.TH YACC 1 .CT 1 prog_other .SH NAME yacc, eyacc \- yet another compiler-compiler .SH SYNOPSIS .B yacc [ .I option ... ] .I grammar .PP .B eyacc [ .B -v ] [ .I grammar ] .SH DESCRIPTION .I Yacc converts a context-free grammar and translation code into a set of tables for an LR(1) parser and translator. The grammar may be ambiguous; specified precedence rules are used to break ambiguities. .PP The output file, .FR y.tab.c , must be compiled by the C compiler to produce a program .LR yyparse . This program must be loaded with a lexical analyzer function, .IR yylex () (often generated by .IR lex (1)), with a .IR main () program, and with an error handling routine, .IR yyerror (). Simple default versions of the last two are loaded by option .B \%-ly of .IR ld (1). .PP The options are .TP .BI -o " output Direct output to the specified file instead of .FR y.tab.c. .TP .B -D Create file .FR y.debug , containing diagnostic messages. To incorporate them in the parser, compile it with preprocessor symbol .B YYDEBUG defined. The amount of diagnostic output from the parser is regulated by values of an external variable .LR yydebug : .RS .TP 0 Report errors. .TP 1 Also report reductions. .TP 2 Also report the name of each token returned by .LR yylex . .RE .TP .B -v Create file .FR y.output , containing a description of the parsing tables and of conflicts arising from ambiguities in the grammar. .TP .B -d Create file .FR y.tab.h , containing .B #define statements that associate .IR yacc -assigned `token codes' with user-declared `token names'. Include it in source files other than .F y.tab.c to give access to the token codes. .TP .BI -s " stem Change the prefix .L y of the file names .FR y.tab.c , .FR y.tab.h , .FR y.debug , and .F y.output to .I stem. .PP .I Eyacc is a special version of .I yacc, with systematic error recovery. It is used to compile .IR pascal (A). .SH FILES .TF /usr/lib/yaccpar .TP .F y.output .TP .F y.tab.c .TP .F y.tab.h .TP .F y.debug .TP .F y.tmp.* temporary file .TP .F y.acts.* temporary file .TP .F /usr/lib/yaccpar parser prototype for C programs .TP .F /usr/lib/liby.a library .B -ly .SH "SEE ALSO" .IR lex (1) .br S. C. Johnson and R. Sethi, this manual, Volume 2 .SH BUGS The parser may not have full information when it writes to .F y.debug so that the names of the tokens returned by .L yylex may be missing.