Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ yacc(1) — SunOS 4.0.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lex(1)

YACC(1)  —  USER COMMANDS

NAME

yacc − yet another compiler-compiler: parsing program generator

SYNOPSIS

yacc [ −dv ] 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 file, y.tab.c, must be compiled by the C compiler to produce a function named yyparse(). The yyparse() function must be loaded with the lexical analyzer 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-produced parsers. 

OPTIONS

−d Generate the file y.tab.h with the define statements that associate the yacc-assigned “token codes” with the user-declared “token names” so that source files other than y.tab.c can access the token codes. 

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

FILES

.y.output description of parsing tables and conflict report

y.tab.c output parser

y.tab.h defines for token names

yacc.tmp, yacc.acts temporary files

/usr/lib/yaccpar parser prototype for C programs

SEE ALSO

lex(1)

yacc in Programming Utilities and Libraries
LR Parsing by A. V. Aho and S. C. Johnson, Computing Surveys, June, 1974

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.  Similarly, if some rules are not reachable from the start symbol, this is also reported. 

BUGS

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

Sun Release 4.0  —  Last change: 24 September 1987

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