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