Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ yacc(I) — UNIX 6th Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

YACC(I)  −  PWB/UNIX 11/25/74

NAME

yacc − yet another compiler-compiler

SYNOPSIS

yacc [ −vor ] [ 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; specified precedence rules are used to break ambiguities.  The output is y.tab.c, which must be compiled by the C compiler and loaded with any other routines required (perhaps a lexical analyzer) and the Yacc library: cc y.tab.c other.o −ly If the −v flag is given, the file y.output is prepared, which contains a description of the parsing tables and a report on conflicts generated by ambiguities in the grammar.  The −o flag calls an optimizer for the tables; the optimized tables, with parser included, appear on file y.tab.c The −r flag causes Yacc to accept grammars with Ratfor actions, and produce Ratfor output on y.tab.r; −r implies the −o flag.  Typical usage is then rc y.tab.r other.o

SEE ALSO

“LR Parsing”, by A. V. Aho and S. C. Johnson, Computing Surveys, June, 1974.  “The YACC Compiler-compiler”, internal memorandum. 

AUTHOR

S. C. Johnson

FILES

y.output
y.tab.c
y.tab.rwhen ratfor output is obtained
yacc.tmpwhen optimizer is called
/lib/liby.aruntime library for compiler
/usr/yacc/fpar.rratfor parser
/usr/yacc/opar.cparser for optimized tables
/usr/yacc/yoptioptimizer postpass

DIAGNOSTICS

The number of reduce-reduce and shift-reduce conflicts is reported on the standard output; a more detailed report is found in the y.output file. 

BUGS

Because file names are fixed, at most one Yacc process can be active in a given directory at a time. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026