Making yacc tables shared in ccom

utzoo!decvax!watmath!dmmartindale utzoo!decvax!watmath!dmmartindale
Tue Feb 23 15:15:20 AEST 1982


The file /usr/src/cmd/pcc/:yyfix is supposed to write a given set of
yacc's tables into the file rodata.c, replacing them with external
declarations in y.tab.c.  In fact, it writes only the last of them
into rodata.c, and reads the rest back into y.tab.c.  Replace :yyfix
with the following, recompile, and about 4Kb of tables become shared.

>rodata.c
for i in $*
do ed - y.tab.c <<!
/^\(.*\)$i[ 	]*\[]/s//extern \1 $i[];\\
\1 $i []/
.-1ka
/}/kb
'ar rodata.c
'a+1,'bw rodata.c
'a+1,'bd
w
q
!
done



More information about the Comp.bugs.4bsd.ucb-fixes mailing list