\input texinfo            @c               -*- Texinfo -*-
@c This file is a simpleminded translation of the bYacc README and man
@c page, and as such is in the public domain.
@c
@c The purpose of translating the file to info is simply to make the
@c information available through the info tree, for folks who have
@c formed the laudable habit of checking info rather than man.
@c 
@c This text is intended for formatting via makeinfo.
@c Since this is not a real manual, there is no point in printing this
@c through TeX; ergo the translation does not take TeX formatting into
@c account.  Running this through TeX may or may not work.
@c
@setfilename byacc.info
@settitle Byacc

@ifinfo
@format
START-INFO-DIR-ENTRY
* byacc: (byacc).                bYacc: Sketchy Usage Summary 
END-INFO-DIR-ENTRY
@end format
@end ifinfo

@node Top
@top bYacc

@c from the README:
bYacc, or Berkeley Yacc, is an LALR(1) parser generator.  Berkeley Yacc
has been made as compatible as possible with AT&T Yacc.  Berkeley Yacc
can accept any input specification that conforms to the AT&T Yacc
documentation.  Specifications that take advantage of undocumented
features of AT&T Yacc will probably be rejected.

There is no manual describing bYacc: this file is simply a usage
summary, whose contents were copied from the README and the man page
distributed with bYacc.  This information is duplicated in an Info file
purely for convenience.  If you know how to use Yacc, you also know how
to use bYacc.  If you do not know how to use Yacc, consult your nearest
technical bookstore or library for a book on the subject.

For an excellent manual on the Free Software Foundation's Bison parser
generator, see @cite{BISON: The YACC-compatible Parser Generator}, by
Charles Donnelly and Richard Stallman.  Bison is similar to bYacc, but
is available only for building programs which you intend to make freely
available under the GNU General Public License.

@menu
* Distribution::        A public domain parser generator.
* Invoking Byacc::      Summary of command-line options.
* Files::               Files bYacc writes.
* Diagnostics::         Messages from bYacc.
@end menu

@node Distribution
@chapter A Public Domain Parser Generator

Berkeley Yacc is distributed with no warranty whatever.  The code is
certain to contain errors.  Neither the author nor any contributor takes
responsibility for any consequences of its use.

Berkeley Yacc is in the public domain.  The data structures and
algorithms used in Berkeley Yacc are all either taken from documents
available to the general public or are inventions of the author.  Anyone
may freely distribute source or binary forms of Berkeley Yacc whether
unchanged or modified.  Distributers may charge whatever fees they can
obtain for Berkeley Yacc.  Programs generated by Berkeley Yacc may be
distributed freely.

Please report bugs to

@example
corbett@@berkeley.edu
@end example

Include a small example if possible.  Please include the banner string from
@file{skeleton.c} with the bug report.  Do not expect rapid responses.

@node Invoking Byacc
@chapter Summary of bYacc Command Line Options

@example
byacc @r{[} -dlrtv @r{]}  @r{[} -b @var{prefix} @r{]}  @r{[} -Qy @r{]}  @var{filename}
@end example

bYacc reads the grammar specification in the file @var{filename} and
generates an LR(1) parser for it.  The parsers consist of a set of
LALR(1) parsing tables and a driver routine written in the C programming
language.  bYacc normally writes the parse tables and the driver routine
to the file @file{y.tab.c}.

The following options are available:

@table @code
@item -b @var{prefix}
Change the prefix used for the output file names to @var{prefix}.  The
default prefix is the character @samp{y}.

@item -d
Write the header file @file{y.tab.h}.

@item -l
Do not emit @samp{#line} directives.  If you do not specify the
@samp{-l} option, bYacc inserts @code{#line} directives in the generated
code.  The @code{#line} directives let the C compiler relate errors in
the generated code to your original code.  Any @code{#line} directives
you specify explicitly are retained.

@item -Qy
Label the output file with the bYacc version, using an @code{#ident}
statement of the form

@example
#ident "byacc: Berkeley Yacc (Cygnus)"
@end example

@item -Qn
Explicitly specify that no @code{#ident} statement should be included;
this is the default.

@item -r
Produce separate files for code and tables.  The code file is named
@file{y.code.c}, and the table file is named @file{y.tab.c}.

@item -t
Change the preprocessor directives generated by bYacc so that debugging
statements will be incorporated in the compiled code.

@item -V
Display version information for byacc on standard error.

@item -v
Write a human-readable description of the generated parser to the file
@file{y.output}.
@end table

@node Files
@chapter The Files that bYacc Writes

bYacc can produce these output files (shown with the default prefix
@samp{y}, which you can change with the @samp{-b} option):

@table @code
@item y.tab.c
By default, this is the output file containing @emph{both} the code and
the tables generated by bYacc.  If you use the @samp{-r} option,
however, it contains only the tables.

@item y.code.c
A file of code generated by bYacc.  This is one of the output
files when you use the @samp{-r} option.

@item y.tab.h
A header file: produced when you use the @samp{-d} option.

@item y.output
A human-readable description of the generated parser, produced when you
use the @samp{-v} option.
@end table

If the environment variable @code{TMPDIR} is set, its value is used as
the name of the directory where these temporary files are created (by
default @samp{/tmp}):

@example
/tmp/yacc.a@var{xxxxxx}
/tmp/yacc.t@var{xxxxxx}
/tmp/yacc.u@var{XXXXXX}
@end example

@node Diagnostics
@chapter Messages from bYacc

bYacc writes two sorts of diagnostic messages to standard error:

@itemize @bullet
@item
How many there rules are never reduced, if there are any such.

@item
The number of LALR(1) conflicts, if any.
@end itemize

@bye
