[TUHS] Yacc binary on 4th edition tape
Jonathan Gray via TUHS
tuhs at tuhs.org
Mon Jan 19 18:38:56 AEST 2026
On Tue, Jan 13, 2026 at 12:21:25PM +1100, Jonathan Gray via TUHS wrote:
> On Sun, Jan 11, 2026 at 11:21:39PM +0100, Paul Ruizendaal via TUHS wrote:
> > Jonathan Gray very kindly found two sources for “yopti” in the TUHS archives.
> >
> > The first is in the UNSW 110 archive (https://www.tuhs.org/Archive/Distributions/UNSW/110/). The archive is from 1981, but it appears to be the 1975 yacc of 6th edition.
> >
> > This yacc has the source for the optimizer ("yopti.c”). It reads the the y.tab.c file that plain 6th edition yacc generates, does some processing and writes out a new y.tab.c. It also comes with a new yyparse routine and this routine is essentially identical to the yyparse of 7th edition (which I think is more or less the final version of classic yacc).
> >
> > The other is in the PWB1 distribution (https://www.tuhs.org/cgi-bin/utree.pl?file=PWB1/sys/source/s2/yacc.d), from 1977. The optimizer is now in the source file "y5.c” and largely, but not fully the same. It has a new way to compress the “yyact” table. The y5.c file can build both as a separate program and as a subroutine of the yacc core, reusing table space from the earlier phases. The new way to compress is also used in 7th edition, but the optimizer has been fully integrated in the core yacc codebase.
>
> Also appears (without source) in a listing of files.
>
> Documentation/TechReports/USG_Library/
> 1046_UNIX_Support_Classifications_for_PG_1C300_Issue_2.pdf
>
> UNIX Support Classifications for PG-1C300-1 Issue 2
> January 30, 1976
>
> opar.c yacc optimization parser
> yopti.c yacc optimizer postpass
>
> > All in all, my hypothesis on the timeline would now be:
> >
> > - 1971: first version of yacc created in B
"yacc was written in 1972"
Stephen C. Johnson interview in
The C Journal, Vol 3, No 2, Fall 1987, p 58
https://archive.org/details/the-c-journal-v-3-n-2-1987-fall/page/n63/mode/1up
> > - 1972: improvements to make it more practical
> > - 1973: yacc introduced to Waterloo (relevant for Eh)
>
> Unix Programmer's Manual, Third Edition, February 1973
> YACC (VI) 1/20/73
> mentions /crp/scj/bpar.b, output tables in actn.b
>
> "If your grammar is too big for yacc, you may try /crp/scj/bigyacc"
>
> > - 1973: conversion from B to C
>
> Unix Programmer's Manual, Fourth Edition, November 1973
> YACC (VI) 6/6/73
> no longer mentions b files
>
> > - 1974: improvements on speeding up table generation
>
> Unix Programmer's Manual, Sixth Edition, May 1975
> YACC (I) 11/25/74
>
> /usr/yacc/opar.c parser for optimized tables
> /usr/yacc/yopti optimizer postpass
>
> > - 1975: improvements on speeding up yyparse execution
> > - 1976: improvement on reducing optimized table size
> > - 1977/78: cleaning up code base, portability, tracking C changes
> > - 1979: more or less final version of classic yacc
> >
> > The above matches with interviews with Johnson and Aho, where both say that yacc was improved over a number of years and with about a dozen rewrites in that period.
More information about the TUHS
mailing list