YACC(1) — Unix Programmer’s Manual
NAME
yacc − yet another compiler-compiler
SYNOPSIS
yacc [ options ] grammar
DESCRIPTION
Yacc converts a context-free grammar into a set of tables for a simple automaton which executes an LR(1) parsing algorithm. The grammar may be ambiguous. Yacc uses specified precedence rules to break ambiguities.
The output file, y.tab.c , must be compiled by the C compiler to produce a program yyparse. This program must be loaded with the lexical analyzer program, yylex, as well as main and yyerror, an error handling routine. These routines must be supplied by the user. Lex(1) is useful for creating lexical analyzers usable by yacc.
OPTIONS
−d Generates the file y.tab.h with the define statements that associate the yacc -assigned ‘token codes’ with the user-declared ‘token names’. This allows source files other than y.tab.c to access the token codes.
−v Prepares the file y.output, which contains a description of the parsing tables and a report on conflicts generated by ambiguities in the grammar.
FILES
y.output
y.tab.c
y.tab.hdefines for token names
yacc.tmp, yacc.actstemporary files
/usr/lib/yaccparparser prototype for C programs
SEE ALSO
lex(1)
LR Parsing by A. V. Aho and S. C. Johnson, Computing Surveys, June, 1974.
YACC − Yet Another Compiler Compiler by S. C. Johnson.
DIAGNOSTICS
Yacc reports (on the standard output) the number of reduce-reduce and shift-reduce conflicts. The y.output file contains a more detailed report. Yacc also reports rules not reachable from the start symbol.
BUGS
Because filenames are fixed, no more than one yacc process can be active in a given directory at a time.
INTEGRATED SOLUTIONS 4.3 BSD — April 29, 1985