Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lex(1)

YACC(1)

NAME

yacc − yet another compiler-compiler

USAGE

yacc [ −vd ] grammar

DESCRIPTION

Yacc converts a context-free grammar into a set of tables for a simple automaton which executes an LR parsing algorithm.  The grammar may be ambiguous; yacc uses specified precedence rules to eliminate such problems. 

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 you. Lex(1) helps create lexical analyzers usable by yacc. 

OPTIONS

−v Prepare the y.output file, which contains a description of the parsing tables and a report on conflicts generated by ambiguities in the grammar. 

−d Generate the y.tab.h file with the define statements that associate the token codes supplied by yacc with the user-declared token names.  This allows source files other than y.tab.c to access the token codes. 

FILES

y.output
y.tab.c
y.tab.hdefines for token names
yacc.tmp, yacc.actstemporary files
/usr/lib/yaccparparser prototype for C programs

DIAGNOSTICS

Yacc reports, on the standard output, the number of reduce-reduce and shift-reduce conflicts.  It also lets you know if some rules cannot be reached from the start symbol.  The y.output file contains a more detailed report. 

CAUTIONS

Because filenames are fixed, only one yacc process can be active in a given directory at a time. 

RELATED INFORMATION

lex(1). 

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