aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/yacc/yacc.1
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/yacc/yacc.1')
-rw-r--r--usr.bin/yacc/yacc.1165
1 files changed, 73 insertions, 92 deletions
diff --git a/usr.bin/yacc/yacc.1 b/usr.bin/yacc/yacc.1
index 596d15495bf3..f532779264ff 100644
--- a/usr.bin/yacc/yacc.1
+++ b/usr.bin/yacc/yacc.1
@@ -33,125 +33,106 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)yacc.1 5.8 (Berkeley) 5/24/93
-.\" $Id: yacc.1,v 1.6 1997/02/22 19:58:04 peter Exp $
+.\" $Id: yacc.1,v 1.7 1997/05/14 02:33:08 steve Exp $
.\"
-.TH YACC 1 "May 24, 1993"
-.UC 6
-.SH NAME
-yacc \- an LALR(1) parser generator
-.SH SYNOPSIS
-.B yacc [ -dlrtv ] [ -b
-.I file_prefix
-.B ] [ -o
-.I output_filename
-.B ] [ -p
-.I symbol_prefix
-.B ]
-.I filename
-.SH DESCRIPTION
-.I Yacc
+.Dd May 24, 1993
+.Dt YACC 1
+.Os
+.Sh NAME
+.Nm yacc
+.Nd an LALR(1) parser generator
+.Sh SYNOPSIS
+.Nm
+.Op Fl dlrtv
+.Op Fl b Ar file_prefix
+.Op Fl o Ar output_filename
+.Op Fl p Ar symbol_prefix
+.Ar filename
+.Sh DESCRIPTION
+.Nm Yacc
reads the grammar specification in the file
-.I filename
+.Ar 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.
-.I Yacc
+.Nm Yacc
normally writes the parse tables and the driver routine to the file
-.IR y.tab.c.
-.PP
+.Pa y.tab.c .
+.Pp
The following options are available:
-.RS
-.TP
-\fB-b \fIfile_prefix\fR
-The
-.B -b
-option changes the prefix prepended to the output file names to
+.Bl -tag -width indent
+.It Fl b Ar file_prefix
+Change the prefix prepended to the output file names to
the string denoted by
-.IR file_prefix.
+.Ar file_prefix .
The default prefix is the character
-.IR y.
-.TP
-.B -d
-The \fB-d\fR option causes the header file
-.IR y.tab.h
+.Pa y .
+.It Fl d
+Cause the header file
+.Pa y.tab.h
to be written.
-.TP
-.B -l
+.It Fl l
If the
-.B -l
+.Fl l
option is not specified,
-.I yacc
+.Nm
will insert #line directives in the generated code.
The #line directives let the C compiler relate errors in the
generated code to the user's original code.
-If the \fB-l\fR option is specified,
-.I yacc
+If the
+.Fl l
+option is specified,
+.Nm
will not insert the #line directives.
Any #line directives specified by the user will be retained.
-.TP
-\fB-o \fIoutput_filename\fR
-The
-.B -o
-option causes
-.I yacc
+.It Fl o Ar output_filename
+Cause
+.Nm
to write the generated code to
-.IR output_filename
+.Ar output_filename
instead of the default file,
-.IR y.tab.c .
-.TP
-\fB-p \fIsymbol_prefix\fR
-The
-.B -p
-option changes the prefix prepended to yacc-generated symbols to
+.Pa y.tab.c .
+.It Fl p Ar symbol_prefix
+Change the prefix prepended to yacc-generated symbols to
the string denoted by
-.IR symbol_prefix.
+.Ar symbol_prefix .
The default prefix is the string
-.IR yy.
-.TP
-.B -r
-The
-.B -r
-option causes
-.I yacc
+.Pa yy .
+.It Fl r
+Cause
+.Nm
to produce separate files for code and tables. The code file
is named
-.IR y.code.c,
+.Pa y.code.c ,
and the tables file is named
-.IR y.tab.c.
-.TP
-.B -t
-The
-.B -t
-option changes the preprocessor directives generated by
-.I yacc
+.Pa y.tab.c .
+.It Fl t
+Change the preprocessor directives generated by
+.Nm
so that debugging statements will be incorporated in the compiled code.
-.TP
-.B -v
-The
-.B -v
-option causes a human-readable description of the generated parser to
+.It Fl v
+Cause a human-readable description of the generated parser to
be written to the file
-.IR y.output.
-.RE
-.PP
-If the environment variable TMPDIR is set, the string denoted by
-TMPDIR will be used as the name of the directory where the temporary
+.Pa y.output .
+.El
+.Pp
+If the environment variable
+.Ev TMPDIR
+is set, the string denoted by
+.Ev TMPDIR
+will be used as the name of the directory where the temporary
files are created.
-.SH FILES
-.IR y.code.c
-.br
-.IR y.tab.c
-.br
-.IR y.tab.h
-.br
-.IR y.output
-.br
-.IR /tmp/yacc.aXXXXXX
-.br
-.IR /tmp/yacc.tXXXXXX
-.br
-.IR /tmp/yacc.uXXXXXX
-.SH DIAGNOSTICS
+.Sh FILES
+.Bl -tag -width /tmp/yacc.aXXXXXX -compact
+.It Pa y.code.c
+.It Pa y.tab.c
+.It Pa y.tab.h
+.It Pa y.output
+.It Pa /tmp/yacc.aXXXXXX
+.It Pa /tmp/yacc.tXXXXXX
+.It Pa /tmp/yacc.uXXXXXX
+.El
+.Sh DIAGNOSTICS
If there are rules that are never reduced, the number of such rules is
reported on standard error.
If there are any LALR(1) conflicts, the number of conflicts is reported