Linking two yacc (y.tab.o) files

Gregory N. Bond gnb at bby.oz.au
Mon Feb 26 10:31:45 AEST 1990


Here is a script I use for making yacc output files static, so you can
link n of them in one binary.  I use it on the output of getdate.y to
make a general gate-parsing library.  Tried only on SunOs 3.5 and 4.0.3.
(It assumes the .y file contains a global routine that calls the
yyparse routine).

Usage: sed -f yaccstaticize.sed < y.tab.c > file.c

Greg.
-- 
Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Internet: gnb at melba.bby.oz.au    non-MX: gnb%melba.bby.oz at uunet.uu.net
Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  yaccstaticize.sed
# Wrapped by gnb at baby on Mon Feb 26 10:29:39 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'yaccstaticize.sed' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'yaccstaticize.sed'\"
else
echo shar: Extracting \"'yaccstaticize.sed'\" \(93 characters\)
sed "s/^X//" >'yaccstaticize.sed' <<'END_OF_FILE'
Xs/^short yy/static &/
Xs/^int[ 	]*yy/static &/
Xs/^YY[LS]TYPE/static &/
Xs/^yyparse()/static &/
END_OF_FILE
if test 93 -ne `wc -c <'yaccstaticize.sed'`; then
    echo shar: \"'yaccstaticize.sed'\" unpacked with wrong size!
fi
# end of 'yaccstaticize.sed'
fi
echo shar: End of shell archive.
exit 0
--
Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Internet: gnb at melba.bby.oz.au    non-MX: gnb%melba.bby.oz at uunet.uu.net
Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb
-- 
Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Internet: gnb at melba.bby.oz.au    non-MX: gnb%melba.bby.oz at uunet.uu.net
Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb



More information about the Comp.unix.wizards mailing list