Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!munnari.oz.au!murtoa.cs.mu.oz.au!ditmela!yarra!melba.bby.oz.au!leo!gnb From: gnb@bby.oz.au (Gregory N. Bond) Newsgroups: comp.unix.wizards Subject: Re: Linking two yacc (y.tab.o) files Message-ID: <1990Feb25.233145.4134@melba.bby.oz.au> Date: 25 Feb 90 23:31:45 GMT References: <25E34681.3787@deimos.cis.ksu.edu> <39@mycroft.stanford.edu> <22714@mimsy.umd.edu> Sender: gnb@melba.bby.oz.au (Gregory N. Bond) Organization: Burdett, Buckeridge and Young Ltd. Lines: 49 In-Reply-To: chris@mimsy.umd.edu's message of 23 Feb 90 13:51:49 GMT 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@melba.bby.oz.au non-MX: gnb%melba.bby.oz@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 '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@melba.bby.oz.au non-MX: gnb%melba.bby.oz@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@melba.bby.oz.au non-MX: gnb%melba.bby.oz@uunet.uu.net Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb