BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / yacc.0
YACC(1) UNIX Programmer's Manual YACC(1)
N\bNA\bAM\bME\bE
yacc - yet another compiler-compiler
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
y\bya\bac\bcc\bc [ -\b-v\bvd\bd ] grammar
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bY_\ba_\bc_\bc converts a context-free grammar into a set of tables
for a simple automaton which executes an LR(1) parsing algo-
rithm. The grammar may be ambiguous; specified precedence
rules are used to break ambiguities.
The output file, _\by._\bt_\ba_\bb._\bc, must be compiled by the C compiler
to produce a program _\by_\by_\bp_\ba_\br_\bs_\be. This program must be loaded
with the lexical analyzer program, _\by_\by_\bl_\be_\bx, as well as _\bm_\ba_\bi_\bn
and _\by_\by_\be_\br_\br_\bo_\br, an error handling routine. These routines must
be supplied by the user; _\bL_\be_\bx(1) is useful for creating lexi-
cal analyzers usable by _\by_\ba_\bc_\bc.
If the -\b-v\bv flag is given, the file _\by._\bo_\bu_\bt_\bp_\bu_\bt is prepared,
which contains a description of the parsing tables and a
report on conflicts generated by ambiguities in the grammar.
If the -d\bd flag is used, the file _\by._\bt_\ba_\bb._\bh is generated with
the _\bd_\be_\bf_\bi_\bn_\be statements that associate the _\by_\ba_\bc_\bc-assigned
`token codes' with the user-declared `token names'. This
allows source files other than _\by._\bt_\ba_\bb._\bc to access the token
codes.
F\bFI\bIL\bLE\bES\bS
y.output
y.tab.c
y.tab.h defines for token names
yacc.tmp, yacc.acts temporary files
/usr/lib/yaccpar parser prototype for C programs
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
_\bl_\be_\bx(1)
_\bL_\bR _\bP_\ba_\br_\bs_\bi_\bn_\bg by A. V. Aho and S. C. Johnson, Computing Sur-
veys, June, 1974.
_\bY_\bA_\bC_\bC - _\bY_\be_\bt _\bA_\bn_\bo_\bt_\bh_\be_\br _\bC_\bo_\bm_\bp_\bi_\bl_\be_\br _\bC_\bo_\bm_\bp_\bi_\bl_\be_\br by S. C. Johnson.
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
The number of reduce-reduce and shift-reduce conflicts is
reported on the standard output; a more detailed report is
found in the _\by._\bo_\bu_\bt_\bp_\bu_\bt file. Similarly, if some rules are
not reachable from the start symbol, this is also reported.
B\bBU\bUG\bGS\bS
Because file names are fixed, at most one _\by_\ba_\bc_\bc process can
be active in a given directory at a time.
Printed 7/9/88 April 29, 1985 1