Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!murtoa.cs.mu.oz.au!munnari.oz.au!otc!metro!extro!glenn From: glenn@extro.ucc.su.oz (G. Geers [ext 3241]) Newsgroups: comp.os.minix Subject: yacc for minix (4 of 4) Message-ID: <490@extro.ucc.su.oz> Date: 28 Jun 89 10:42:03 GMT Reply-To: glenn@extro.ucc.su.oz (G. Geers [ext 3241]) Organization: University Computing Service, Uni. of Sydney, Australia. Lines: 445 --- cut here --- cut here --- cut here --- cut here --- cut here --- #!/bin/sh # This is a shell archive. Remove anything before the /bin/sh line # then unpack it by saving it in a file and typing "sh file" # (Files unpacked will be owned by you and have default permissions). # Don't worry about trailing garbage - the archive ends with exit # This archive contains the following files: # ./HEADER # ./Makefile # ./Makefile.msc # ./README # ./README.MINIX # ./cytab.h # if `test ! -s ./HEADER` then echo "writing ./HEADER" cat > ./HEADER << '\EOF\' @From mark@ems.UUCP@munnari.oz Sun Feb 1 18:27:23 1987 Path: ipso!metro!otc!munnari!seismo!rutgers!dayton!ems!mark @From: mark@ems.UUCP (Mark H. Colburn) Newsgroups: net.sources Subject: Public Domain YACC (part 1 of 2) Keywords: UNIX MS-DOS IBM-PC YACC Finally Message-ID: <135@ems.UUCP> Date: 1 Feb 87 07:27:23 GMT Sender: news@ems.UUCP Reply-To: mark@ems.UUCP (Mark H. Colburn) Distribution: world Organization: EMS/McGraw-Hill, Eden Prairie Lines: 2363 Here is a copy of the Public Domain YACC that I promised earlier. For those of you who sent me mail, if you still need me to email you a copy, please let me know, otherwise I will assume that you have pulled it off of the net. This version runs on System V and MS-DOS. I have not been able to get access to a BSD machine to test it there. Please send any bug reports, fixes, enhancements, comments or suggestions to me so that they can be included in any later releases or patches. Have fun. Mark H. Colburn mark@ems.uucp EMS/McGraw-Hill {rutgers|amdahl|ihnp4}!meccts!ems!mark 9855 West 78th Street Eden Prairie, MN 55344 (612) 829-8200 x235 # # The following files will be created: # ysetup.c # dtxtrn.h # yypars.c # ygttok.c # ycpact.c # yclsur.c # yclopt.c # y1imp.c # y2.h # ystagn.c # ycemty.c # ystate.c # Makefile # y1.h # yywrap.c # Lines: 2555 # The following files will be created: # youtpt.c # y2imp.c # ydefin.c # ywract.c # yapack.c # yothrs.c # ywstat.c # ystin.c # system.h # ysumry.c # README # yg2gen.c # y4.h # ycpfir.c # yg2out.c # ycpres.c # y3.h # ygin.c # ymain.c # yprcft.c # ycpuni.c # ydfout.c # ywritm.c # yflset.c # yhdprd.c # yptitm.c # ycpycd.c # ygtnm.c # yskpcm.c # yosmry.c # y4imp.c # ynxti.c # ychfnd.c # yyless.c # yarout.c # yerror.c # ywarry.c # yfdtyp.c # yprlok.c # ystuni.c # yaoput.c # y3imp.c # ycstsh.c # ysmnam.c # yaryfl.c # ychcpy.c # yfnact.c # \EOF\ else echo "will not over write ./HEADER" fi if `test ! -s ./Makefile` then echo "writing ./Makefile" cat > ./Makefile << '\EOF\' # Makefile for MINIX # BIN = /usr/bin LIB = /usr/lib CFLAGS = -O LDFLAGS = -i OBJECTS = y1imp.s y2imp.s y3imp.s y4imp.s yaryfl.s ycemty.s ychcpy.s\ yclsur.s ycpfir.s ycpres.s yerror.s yflset.s ymain.s yothrs.s\ yprlok.s yptitm.s ysmnam.s ystagn.s ystate.s ystuni.s ysumry.s\ ywritm.s ychfnd.s ycpact.s ycpuni.s ycpycd.s ycstsh.s ydefin.s\ ydfout.s yfdtyp.s yfnact.s ygttok.s ysetup.s yskpcm.s yapack.s\ yg2gen.s yg2out.s yhdprd.s youtpt.s yprcft.s ywarry.s ywract.s\ ywstat.s yaoput.s yclopt.s ygin.s ygtnm.s ynxti.s yosmry.s\ ystin.s yarout.s PROGRAMS = yacc all: ${PROGRAMS} clean: rm -f ${PROGRAMS} rm -f ${OBJECTS} rm -f a.out core yacc: ${OBJECTS} cc ${LDFLAGS} ${OBJECTS} -o yacc test: parse.y yacc ./yacc -hi parse.y install: yacc yypars cp yacc $(BIN)/yacc cp yypars $(LIB)/yypars dtxtrn.h: /usr/include/stdio.h system.h y1.h: dtxtrn.h y1imp.s: dtxtrn.h y2.h: dtxtrn.h y2imp.s: dtxtrn.h y3.h: dtxtrn.h y3imp.s: dtxtrn.h y4.h: dtxtrn.h y4imp.s: dtxtrn.h yaoput.s: y4.h yapack.s: y3.h yarout.s: y4.h yaryfl.s: y1.h ycemty.s: y1.h ychcpy.s: y1.h ychfnd.s: y2.h yclopt.s: y4.h yclsur.s: y1.h ycpact.s: /usr/include/stdio.h /usr/include/ctype.h y2.h ycpfir.s: y1.h ycpres.s: y1.h ycpuni.s: y2.h ycpycd.s: y2.h ycstsh.s: y2.h ydefin.s: y2.h ydfout.s: /usr/include/ctype.h y2.h yerror.s: y1.h yfdtyp.s: y2.h yflset.s: y1.h yfnact.s: y2.h yg2gen.s: y3.h yg2out.s: y3.h ygin.s: y4.h ygtnm.s: /usr/include/ctype.h y4.h ygttok.s: /usr/include/ctype.h y2.h yhdprd.s: y3.h ymain.s: y1.h ynxti.s: y4.h yosmry.s: y4.h yothrs.s: y1.h youtpt.s: y3.h yprcft.s: y3.h yprlok.s: y1.h yptitm.s: y1.h ysetup.s: y2.h yskpcm.s: y2.h ysmnam.s: y1.h ystagn.s: y1.h ystate.s: y1.h ystin.s: y4.h ystuni.s: y1.h ysumry.s: y1.h ywarry.s: y3.h ywract.s: y3.h ywritm.s: y1.h ywstat.s: y3.h \EOF\ else echo "will not over write ./Makefile" fi if `test ! -s ./Makefile.msc` then echo "writing ./Makefile.msc" cat > ./Makefile.msc << '\EOF\' CFLAGS = -OX -FPi LDFLAGS = OBJECTS = y1imp.o y2imp.o y3imp.o y4imp.o yaryfl.o ycemty.o ychcpy.o\ yclsur.o ycpfir.o ycpres.o yerror.o yflset.o ymain.o yothrs.o\ yprlok.o yptitm.o ysmnam.o ystagn.o ystate.o ystuni.o ysumry.o\ ywritm.o ychfnd.o ycpact.o ycpuni.o ycpycd.o ycstsh.o ydefin.o\ ydfout.o yfdtyp.o yfnact.o ygttok.o ysetup.o yskpcm.o yapack.o\ yg2gen.o yg2out.o yhdprd.o youtpt.o yprcft.o ywarry.o ywract.o\ ywstat.o yaoput.o yclopt.o ygin.o ygtnm.o ynxti.o yosmry.o\ ystin.o yarout.o PROGRAMS = yacc yacc: cl $LDFLAGS $OBJECTS -o yacc dtxtrn.h: stdio.h system.h y1.h: dtxtrn.h y1imp.o: dtxtrn.h y2.h: dtxtrn.h y2imp.o: dtxtrn.h y3.h: dtxtrn.h y3imp.o: dtxtrn.h y4.h: dtxtrn.h y4imp.o: dtxtrn.h yaoput.o: y4.h yapack.o: y3.h yarout.o: y4.h yaryfl.o: y1.h ycemty.o: y1.h ychcpy.o: y1.h ychfnd.o: y2.h yclopt.o: y4.h yclsur.o: y1.h ycpact.o: stdio.h ctype.h y2.h ycpfir.o: y1.h ycpres.o: y1.h ycpuni.o: y2.h ycpycd.o: y2.h ycstsh.o: y2.h ydefin.o: y2.h ydfout.o: ctype.h y2.h yerror.o: y1.h yfdtyp.o: y2.h yflset.o: y1.h yfnact.o: y2.h yg2gen.o: y3.h yg2out.o: y3.h ygin.o: y4.h ygtnm.o: ctype.h y4.h ygttok.o: ctype.h y2.h yhdprd.o: y3.h ymain.o: y1.h ynxti.o: y4.h yosmry.o: y4.h yothrs.o: y1.h youtpt.o: y3.h yprcft.o: y3.h yprlok.o: y1.h yptitm.o: y1.h ysetup.o: y2.h yskpcm.o: y2.h ysmnam.o: y1.h ystagn.o: y1.h ystate.o: y1.h ystin.o: y4.h ystuni.o: y1.h ysumry.o: y1.h ywarry.o: y3.h ywract.o: y3.h ywritm.o: y1.h ywstat.o: y3.h \EOF\ else echo "will not over write ./Makefile.msc" fi if `test ! -s ./README` then echo "writing ./README" cat > ./README << '\EOF\' UNIX/MS-DOS YACC Here is a copy of a public domain version of YACC. This version is a derivative of the DECUS yacc (at lease some where along the it come from there anyways). When I got it it had been modified to run under MS-DOS on IBM-PC's. I have modified it to, (once again) run under UNIX, as well as PC-DOS. It runs fine under System V.2 on an Arete 1200, as well as PC-DOS 3.1. I do not have access to a Berkley machine, so I have not been able to test it in that environment. I will post updates and patches to this version of YACC as I work with it more, and as I get comments from other people who use it. If you have any enhancements, portability problems or comments, please let me know and I will put them in. For those of you who have been wanting YACC on a PC, here it is. In order to install the package, look at the #defines in system.h and dtxtrn.h and modify them to match you machine configuration and needs/desires. Then type make. Mark H. Colburn mark@ems.uucp EMS/McGraw-Hill {rutgers|amdahl|ihnp4}!meccts!ems!mark 9855 West 78th Street Eden Prairie, MN 55344 (612) 829-8200 x235 \EOF\ else echo "will not over write ./README" fi if `test ! -s ./README.MINIX` then echo "writing ./README.MINIX" cat > ./README.MINIX << '\EOF\' The following program is a public domain implementation of yacc. There were no modifications required to any of the files (except the Makefile, of course). In the current state a MEDIUM sized version of yacc is made. This is the largest version possible under PC-MINIX. ST-MINIX users should edit the file system.h and #define HUGE, HUGETAB and probably WORD32 if they are using gcc. This will give a gigantic version of yacc capable of handling grammars of almost any size. The program will also compile on almost all versions of UNIX (I've tried Xenix/286, Ultrix, SysV.3 and UMIPS) and under DOS. Please read the files HEADER and README for the original info. The file parse.y used for testing yacc is taken from the flex distribution. I also noticed a nice irony here: the author works for Mc.Graw-Hill ! Share and Enjoy, Glenn Glenn Geers Department of Theoretical Physics, University of Sydney, Sydney, N.S.W., 2006 phone: +61 2 692-3241 email: glenn@extro.ucc.su.oz \EOF\ else echo "will not over write ./README.MINIX" fi if `test ! -s ./cytab.h` then echo "writing ./cytab.h" cat > ./cytab.h << '\EOF\' # define IDENTIFIER 257 # define CONSTANT 258 # define STRING_LITERAL 259 # define SIZEOF 260 # define PTR_OP 261 # define INC_OP 262 # define DEC_OP 263 # define LEFT_OP 264 # define RIGHT_OP 265 # define LE_OP 266 # define GE_OP 267 # define EQ_OP 268 # define NE_OP 269 # define AND_OP 270 # define OR_OP 271 # define MUL_ASSIGN 272 # define DIV_ASSIGN 273 # define MOD_ASSIGN 274 # define ADD_ASSIGN 275 # define SUB_ASSIGN 276 # define LEFT_ASSIGN 277 # define RIGHT_ASSIGN 278 # define AND_ASSIGN 279 # define XOR_ASSIGN 280 # define OR_ASSIGN 281 # define TYPE_NAME 282 # define TYPEDEF 283 # define EXTERN 284 # define STATIC 285 # define AUTO 286 # define REGISTER 287 # define CHAR 288 # define SHORT 289 # define INT 290 # define LONG 291 # define SIGNED 292 # define UNSIGNED 293 # define FLOAT 294 # define DOUBLE 295 # define CONST 296 # define VOLATILE 297 # define VOID 298 # define STRUCT 299 # define UNION 300 # define ENUM 301 # define ELIPSIS 302 # define RANGE 303 # define CASE 304 # define DEFAULT 305 # define IF 306 # define ELSE 307 # define SWITCH 308 # define WHILE 309 # define DO 310 # define FOR 311 # define GOTO 312 # define CONTINUE 313 # define BREAK 314 # define RETURN 315 \EOF\ else echo "will not over write ./cytab.h" fi echo "Finished archive 4 of 4" # if you want to concatenate archives, remove anything after this line exit 0