Byacc

DOC 0460-00


Table of Contents


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

[email protected]

Include a small example if possible. Please include the banner string from `skeleton.c' with the bug report. Do not expect rapid responses.

Summary of bYacc Command Line Options

byacc [ -dlrtv ]  [ -b prefix ]  [ -Qy ]  filename

bYacc reads the grammar specification in the file 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 `y.tab.c'.

The following options are available:

-b prefix
Change the prefix used for the output file names to prefix. The default prefix is the character `y'.
-d
Write the header file `y.tab.h'.
-l
Do not emit `#line' directives. If you do not specify the `-l' option, bYacc inserts #line directives in the generated code. The #line directives let the C compiler relate errors in the generated code to your original code. Any #line directives you specify explicitly are retained.
-Qy
Label the output file with the bYacc version, using an #ident statement of the form
#ident "byacc: Berkeley Yacc (Cygnus)"
-Qn
Explicitly specify that no #ident statement should be included; this is the default.
-r
Produce separate files for code and tables. The code file is named `y.code.c', and the table file is named `y.tab.c'.
-t
Change the preprocessor directives generated by bYacc so that debugging statements will be incorporated in the compiled code.
-V
Display version information for byacc on standard error.
-v
Write a human-readable description of the generated parser to the file `y.output'.

The Files that bYacc Writes

bYacc can produce these output files (shown with the default prefix `y', which you can change with the `-b' option):

y.tab.c
By default, this is the output file containing both the code and the tables generated by bYacc. If you use the `-r' option, however, it contains only the tables.
y.code.c
A file of code generated by bYacc. This is one of the output files when you use the `-r' option.
y.tab.h
A header file: produced when you use the `-d' option.
y.output
A human-readable description of the generated parser, produced when you use the `-v' option.

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

/tmp/yacc.axxxxxx
/tmp/yacc.txxxxxx
/tmp/yacc.uXXXXXX

Messages from bYacc

bYacc writes two sorts of diagnostic messages to standard error:


This document was generated on 7 September 2001 using texi2html 1.56k.