Pristine Ack-5.5
[Ack-5.5.git] / util / byacc / manpage
1 .\"     %W%     %R% (Berkeley) %E%
2 .\"
3 .TH YACC 1 "July\ 15,\ 1990"
4 .UC 6
5 .SH NAME
6 Yacc \- an LALR(1) parser generator
7 .SH SYNOPSIS
8 .B yacc [ -dlrtv ] [ -b
9 .I prefix
10 .B ]
11 .I filename
12 .SH DESCRIPTION
13 .I Yacc
14 reads the grammar specification in the file
15 .I filename
16 and generates an LR(1) parser for it.
17 The parsers consist of a set of LALR(1) parsing tables and a driver routine
18 written in the C programming language.
19 .I Yacc
20 normally writes the parse tables and the driver routine to the file
21 .IR y.tab.c.
22 .PP
23 The following options are available:
24 .RS
25 .TP
26 \fB-b \fIprefix\fR
27 The
28 .B -b
29 option changes the prefix prepended to the output file names to
30 the string denoted by
31 .IR prefix.
32 The default prefix is the character
33 .IR y.
34 .TP
35 .B -d
36 The \fB-d\fR option causes the header file
37 .IR y.tab.h
38 to be written.
39 .TP
40 .B -l
41 If the
42 .B -l
43 option is not specified,
44 .I yacc
45 will insert \#line directives in the generated code.
46 The \#line directives let the C compiler relate errors in the
47 generated code to the user's original code.
48 If the \fB-l\fR option is specified,
49 .I yacc
50 will not insert the \#line directives.
51 \&\#line directives specified by the user will be retained.
52 .TP
53 .B -r
54 The
55 .B -r
56 option causes
57 .I yacc
58 to produce separate files for code and tables.  The code file
59 is named
60 .IR y.code.c,
61 and the tables file is named
62 .IR y.tab.c.
63 .TP
64 .B -t
65 The
66 .B -t
67 option changes the preprocessor directives generated by
68 .I yacc
69 so that debugging statements will be incorporated in the compiled code.
70 .TP
71 .B -v
72 The
73 .B -v
74 option causes a human-readable description of the generated parser to
75 be written to the file
76 .IR y.output.
77 .RE
78 .PP
79 If the environment variable TMPDIR is set, the string denoted by
80 TMPDIR will be used as the name of the directory where the temporary
81 files are created.
82 .SH FILES
83 .IR y.code.c
84 .br
85 .IR y.tab.c
86 .br
87 .IR y.tab.h
88 .br
89 .IR y.output
90 .br
91 .IR /tmp/yacc.aXXXXXX
92 .br
93 .IR /tmp/yacc.tXXXXXX
94 .br
95 .IR /tmp/yacc.uXXXXXX
96 .SH DIAGNOSTICS
97 If there are rules that are never reduced, the number of such rules is
98 reported on standard error.
99 If there are any LALR(1) conflicts, the number of conflicts is reported
100 on standard error.