|
|
1.1 root 1: .TH YACC 1
2: .CT 1 prog_other
3: .SH NAME
4: yacc, eyacc \- yet another compiler-compiler
5: .SH SYNOPSIS
6: .B yacc
7: [
8: .I option ...
9: ]
10: .I grammar
11: .PP
12: .B eyacc
13: [
14: .B -v
15: ]
16: [
17: .I grammar
18: ]
19: .SH DESCRIPTION
20: .I Yacc
21: converts a context-free grammar and translation code
22: into a set of
23: tables for an LR(1) parser and translator.
24: The grammar may be ambiguous;
25: specified precedence rules are used to break ambiguities.
26: .PP
27: The output file,
28: .FR y.tab.c ,
29: must be compiled by the C compiler
30: to produce a program
31: .LR yyparse .
32: This program must be loaded with a lexical analyzer function,
33: .IR yylex ()
34: (often generated by
35: .IR lex (1)),
36: with a
37: .IR main ()
38: program, and with an error handling routine,
39: .IR yyerror ().
40: Simple default versions of the last two are loaded by option
41: .B \%-ly
42: of
43: .IR ld (1).
44: .PP
45: The options are
46: .TP
47: .BI -o " output
48: Direct output to the specified file instead of
49: .FR y.tab.c.
50: .TP
51: .B -D
52: Create file
53: .FR y.debug ,
54: containing diagnostic messages.
55: To incorporate
56: them in the parser, compile it with preprocessor symbol
57: .B YYDEBUG
58: defined.
59: The amount of
60: diagnostic output from the parser is regulated by
61: values of an external variable
62: .LR yydebug :
63: .RS
64: .TP
65: 0
66: Report errors.
67: .TP
68: 1
69: Also report reductions.
70: .TP
71: 2
72: Also report the name of each token returned by
73: .LR yylex .
74: .RE
75: .TP
76: .B -v
77: Create file
78: .FR y.output ,
79: containing a description of the parsing tables and of
80: conflicts arising from ambiguities in the grammar.
81: .TP
82: .B -d
83: Create file
84: .FR y.tab.h ,
85: containing
86: .B #define
87: statements that associate
88: .IR yacc -assigned
89: `token codes' with user-declared `token names'.
90: Include it in source files other than
91: .F y.tab.c
92: to give access to the token codes.
93: .TP
94: .BI -s " stem
95: Change the prefix
96: .L y
97: of the file names
98: .FR y.tab.c ,
99: .FR y.tab.h ,
100: .FR y.debug ,
101: and
102: .F y.output
103: to
104: .I stem.
105: .PP
106: .I Eyacc
107: is a special version of
108: .I yacc,
109: with systematic error recovery.
110: It is used to compile
111: .IR pascal (A).
112: .SH FILES
113: .TF /usr/lib/yaccpar
114: .TP
115: .F y.output
116: .TP
117: .F y.tab.c
118: .TP
119: .F y.tab.h
120: .TP
121: .F y.debug
122: .TP
123: .F y.tmp.*
124: temporary file
125: .TP
126: .F y.acts.*
127: temporary file
128: .TP
129: .F /usr/lib/yaccpar
130: parser prototype for C programs
131: .TP
132: .F /usr/lib/liby.a
133: library
134: .B -ly
135: .SH "SEE ALSO"
136: .IR lex (1)
137: .br
138: S. C. Johnson and R. Sethi,
139: this manual, Volume 2
140: .SH BUGS
141: The parser may not have full information when it writes to
142: .F y.debug
143: so that the names of the tokens returned by
144: .L yylex
145: may be missing.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.