doc: minor fixes

* doc/bison.texi: Use consistently $ and @kbd in shell examples.
Prefer sticking to English words: output and file instead of outfile
and infile.
This commit is contained in:
Akim Demaille
2019-04-07 12:38:18 +02:00
parent 0dd97f7c87
commit a745041b7d

View File

@@ -1940,7 +1940,7 @@ With all the source in the grammar file, you use the following command
to convert it into a parser implementation file: to convert it into a parser implementation file:
@example @example
bison @var{file}.y $ @kbd{bison @var{file}.y}
@end example @end example
@noindent @noindent
@@ -10213,38 +10213,37 @@ print_token_value (FILE *file, int type, YYSTYPE value)
The usual way to invoke Bison is as follows: The usual way to invoke Bison is as follows:
@example @example
bison @var{infile} $ @kbd{bison @var{file}}
@end example @end example
Here @var{infile} is the grammar file name, which usually ends in Here @var{file} is the grammar file name, which usually ends in @samp{.y}.
@samp{.y}. The parser implementation file's name is made by replacing The parser implementation file's name is made by replacing the @samp{.y}
the @samp{.y} with @samp{.tab.c} and removing any leading directory. with @samp{.tab.c} and removing any leading directory. Thus, the
Thus, the @samp{bison foo.y} file name yields @file{foo.tab.c}, and @samp{bison foo.y} file name yields @file{foo.tab.c}, and the @samp{bison
the @samp{bison hack/foo.y} file name yields @file{foo.tab.c}. It's hack/foo.y} file name yields @file{foo.tab.c}. It's also possible, in case
also possible, in case you are writing C++ code instead of C in your you are writing C++ code instead of C in your grammar file, to name it
grammar file, to name it @file{foo.ypp} or @file{foo.y++}. Then, the @file{foo.ypp} or @file{foo.y++}. Then, the output files will take an
output files will take an extension like the given one as input extension like the given one as input (respectively @file{foo.tab.cpp} and
(respectively @file{foo.tab.cpp} and @file{foo.tab.c++}). This @file{foo.tab.c++}). This feature takes effect with all options that
feature takes effect with all options that manipulate file names like manipulate file names like @samp{-o} or @samp{-d}.
@samp{-o} or @samp{-d}.
For example : For example:
@example @example
bison -d @var{infile.yxx} $ @kbd{bison -d @var{file.yxx}}
@end example @end example
@noindent @noindent
will produce @file{infile.tab.cxx} and @file{infile.tab.hxx}, and will produce @file{file.tab.cxx} and @file{file.tab.hxx}, and
@example @example
bison -d -o @var{output.c++} @var{infile.y} $ @kbd{bison -d -o @var{output.c++} @var{file.y}}
@end example @end example
@noindent @noindent
will produce @file{output.c++} and @file{outfile.h++}. will produce @file{output.c++} and @file{output.h++}.
For compatibility with POSIX, the standard Bison For compatibility with POSIX, the standard Bison distribution also contains
distribution also contains a shell script called @command{yacc} that a shell script called @command{yacc} that invokes Bison with the @option{-y}
invokes Bison with the @option{-y} option. option.
@menu @menu
* Bison Options:: All the options described in detail, * Bison Options:: All the options described in detail,
@@ -12355,7 +12354,7 @@ The Java parser skeletons are selected using the @code{%language "Java"}
directive or the @option{-L java}/@option{--language=java} option. directive or the @option{-L java}/@option{--language=java} option.
@c FIXME: Documented bug. @c FIXME: Documented bug.
When generating a Java parser, @code{bison @var{basename}.y} will create a When generating a Java parser, @samp{bison @var{basename}.y} will create a
single Java source file named @file{@var{basename}.java} containing the single Java source file named @file{@var{basename}.java} containing the
parser implementation. Using a grammar file without a @file{.y} suffix is parser implementation. Using a grammar file without a @file{.y} suffix is
currently broken. The basename of the parser implementation file can be currently broken. The basename of the parser implementation file can be
@@ -14318,7 +14317,7 @@ resolution. @xref{Unreachable States}.
@node Bibliography @node Bibliography
@unnumbered Bibliography @unnumbered Bibliography
@c Please follow the followint canvas to add more references. @c Please follow the following canvas to add more references.
@table @asis @table @asis
@item [Corbett 1984] @item [Corbett 1984]
@@ -14329,7 +14328,7 @@ Static Semantics in Compiler Error Recovery
@c in @c in
Ph.D. Dissertation, Report No. UCB/CSD 85/251, Ph.D. Dissertation, Report No. UCB/CSD 85/251,
@c where @c where
Departement of Electrical Engineering and Computer Science, Compute Science Department of Electrical Engineering and Computer Science, Compute Science
Division, University of California, Berkeley, California Division, University of California, Berkeley, California
@c when @c when
(June 1985). (June 1985).
@@ -14412,7 +14411,7 @@ London, Department of Computer Science, TR-00-12 (December 2000).
@c LocalWords: Johnstone Shamsa Sadaf Hussain Tomita TR uref YYMAXDEPTH inline @c LocalWords: Johnstone Shamsa Sadaf Hussain Tomita TR uref YYMAXDEPTH inline
@c LocalWords: YYINITDEPTH stmts ref initdcl maybeasm notype Lookahead yyoutput @c LocalWords: YYINITDEPTH stmts ref initdcl maybeasm notype Lookahead yyoutput
@c LocalWords: hexflag STR exdent itemset asis DYYDEBUG YYFPRINTF args Autoconf @c LocalWords: hexflag STR exdent itemset asis DYYDEBUG YYFPRINTF args Autoconf
@c LocalWords: infile ypp yxx outfile itemx tex leaderfill Troubleshouting sqrt @c LocalWords: ypp yxx itemx tex leaderfill Troubleshouting sqrt GraphViz
@c LocalWords: hbox hss hfill tt ly yyin fopen fclose ofirst gcc ll lookahead @c LocalWords: hbox hss hfill tt ly yyin fopen fclose ofirst gcc ll lookahead
@c LocalWords: nbar yytext fst snd osplit ntwo strdup AST Troublereporting th @c LocalWords: nbar yytext fst snd osplit ntwo strdup AST Troublereporting th
@c LocalWords: YYSTACK DVI fdl printindex IELR nondeterministic nonterminals ps @c LocalWords: YYSTACK DVI fdl printindex IELR nondeterministic nonterminals ps
@@ -14446,7 +14445,7 @@ London, Department of Computer Science, TR-00-12 (December 2000).
@c LocalWords: allocators subunit initializations unreferenced untyped dir @c LocalWords: allocators subunit initializations unreferenced untyped dir
@c LocalWords: errorVerbose subtype subtypes Wmidrule midrule's src rvalues @c LocalWords: errorVerbose subtype subtypes Wmidrule midrule's src rvalues
@c LocalWords: automove evolutions Wother Wconflicts PNG lookaheads Acc sep @c LocalWords: automove evolutions Wother Wconflicts PNG lookaheads Acc sep
@c LocalWords: xsltproc XSL xsl xhtml html num Wprecedence Werror fcaret @c LocalWords: xsltproc XSL xsl xhtml html num Wprecedence Werror fcaret gv
@c LocalWords: fdiagnostics setlocale nullptr ast srcdir copyable iff drv @c LocalWords: fdiagnostics setlocale nullptr ast srcdir copyable iff drv
@c LocalWords: deftypefunx pragma Wnull dereference Wdocumentation elif ish @c LocalWords: deftypefunx pragma Wnull dereference Wdocumentation elif ish
@c LocalWords: Wdeprecated Wregister noinput yyloc yypos PODs sstream Wsign @c LocalWords: Wdeprecated Wregister noinput yyloc yypos PODs sstream Wsign
@@ -14454,7 +14453,7 @@ London, Department of Computer Science, TR-00-12 (December 2000).
@c LocalWords: Relocatability exprs fixit Wyacc parseable fixits ffixit @c LocalWords: Relocatability exprs fixit Wyacc parseable fixits ffixit
@c LocalWords: DNDEBUG cstring Wzero workalike POPL workalikes byacc UCB @c LocalWords: DNDEBUG cstring Wzero workalike POPL workalikes byacc UCB
@c LocalWords: Penello's Penello Byson Byson's Corbett's CSD TOPLAS PDP @c LocalWords: Penello's Penello Byson Byson's Corbett's CSD TOPLAS PDP
@c LocalWords: Beazley's goyacc ocamlyacc @c LocalWords: Beazley's goyacc ocamlyacc SIGACT SIGPLAN
@c Local Variables: @c Local Variables:
@c ispell-dictionary: "american" @c ispell-dictionary: "american"