[comp.os.minix] Patches for David Clunie's yacc on MINIX

HELMER%SDNET.BITNET@vm1.nodak.edu (Guy Helmer) (07/31/89)

This posting contains the diffs and modified yasystem.h file that I
have created to port David Clunie's yacc to MINIX.  I have compiled
my port with both TurboC and the MINIX C compiler, and each appears
to work.  I have not included a makefile, and I have not tried using
the makefile that David posted.

Warnings:
     1)  This version does not use unique names for the files it
         stores in /tmp, so don't run more than one copy at one
         time (I'll fix this shortly).

     2)  This version uses _lots_ of temporary disk space.  Running
         yacc on the included csyntax.y file required more than the
         155K I had available on /dev/ram; mounting a floppy as /tmp
         fixed allowed 'yacc csyntax.y' to run to completion.

     3)  This program is _not_ speedy.

I compiled yacc by executing 'cc -T. -F -S -c ya*.c' and then
'cc -T. -i -o yacc *.s'.  'yacc' will abort with errors if it
doesn't have enough stack, so I used 'chmem =64000 /usr/bin/yacc'
on the executable I compiled with TurboC.  Make sure that the
file 'yaccpar' gets put in '/usr/lib' with proper permissions.

File 'yalr0.c' had a broken line when it arrived in my mailbox
on BITNET;  a corrected line is included as part of the fixes, so
if patch doesn't like one hunk of the fix to that file you'll
know why.

Enjoy!

-- Guy Helmer                                       BITNET: HELMER@SDNET
   Dakota State University Computing Services       AT&T: (605) 256-5315
   Madison, SD

----------------------------- cut here ---------------------------------
echo x - yacc.cdif
sed '/^X/s///' > yacc.cdif << '/'
X*** ../yacc/yaaug.c	Sun Jul 30 16:10:56 1989
X--- yaaug.c	Sun Jul 30 17:05:36 1989
X***************
X*** 27,35 ****
X      /* Augment grammar with	$accept : start $end ; */
X
X      rule=addrule();
X!     settok(send=chksym(ENDNAME),ENDTOKEN);
X!     addlist(rule,sstart);
X!     addlist(rule,send);
X      setnont(sstart=chksym(ACCEPTNAME));
X      sstart->rule=rule;
X      rule->sym=sstart;	/* not filled by addrule() */
X--- 27,35 ----
X      /* Augment grammar with	$accept : start $end ; */
X
X      rule=addrule();
X!     settok(mx_send=chksym(ENDNAME),ENDTOKEN);
X!     addlist(rule,sstart);
X!     addlist(rule,mx_send);
X      setnont(sstart=chksym(ACCEPTNAME));
X      sstart->rule=rule;
X      rule->sym=sstart;	/* not filled by addrule() */
X*** ../yacc/yacc.c	Sun Jul 30 16:11:08 1989
X--- yacc.c	Sun Jul 30 16:02:26 1989
X***************
X*** 38,44 ****
X      int yyparse();
X      void rdstr(),rdsym(),rdrule();
X  #ifdef TRACE
X!     dumpglbl();
X  #endif
X      void mkfirst(),frfirst();
X      void lr0();
X--- 38,44 ----
X      int yyparse();
X      void rdstr(),rdsym(),rdrule();
X  #ifdef TRACE
X!     void dumpglbl();
X  #endif
X      void mkfirst(),frfirst();
X      void lr0();
X***************
X*** 49,60 ****
X      void txsort(),shsort();
X      void rdprec(),frprec(),conf(),pack();
X      void oppars();
X!     clock_t t,f;
X!
X!     init1(argc,argv);		/* Phase 1 */
X      if (o_debug) {
X  	t=clock();
X      }
X      if (yyparse()  cnfatal) {
X  	exit(1);
X      }
X--- 49,64 ----
X      void txsort(),shsort();
X      void rdprec(),frprec(),conf(),pack();
X      void oppars();
X! #ifndef MINIX
X!     clock_t t,f;
X! #endif
X!
X!     init1(argc,argv);		/* Phase 1 */
X! #ifndef MINIX
X      if (o_debug) {
X  	t=clock();
X      }
X+ #endif
X      if (yyparse()  cnfatal) {
X  	exit(1);
X      }
X***************
X*** 115,126 ****
X--- 119,132 ----
X      unlink(ngoto);
X      oppars();			/* Phase 3 */
X      unlink(naction);
X+ #ifndef MINIX
X      if (o_debug) {
X  	f=100/CLK_TCK;	/* make sure we have 1/100ths of a second */
X  	t=(clock()-t)*f;
X  	printf("Elapsed time %lu.%02lu seconds \n",
X  	    (long)(t/100),(long)(t%100));
X      }
X+ #endif
X      exit(0);
X  }
X
X*** ../yacc/yaconf.c	Sun Jul 30 16:11:34 1989
X--- yaconf.c	Sun Jul 30 16:02:31 1989
X***************
X*** 62,69 ****
X
X      message("conf:");
X
X!     ftrans=xopen(ntrans,"rb");
X!     fshift=xopen(nshift,"wb");
X      if (o_verbose) {
X  	foutput=xopen(noutput,"w");
X  	fconflict=foutput;		/* Conflicts go with description */
X--- 62,69 ----
X
X      message("conf:");
X
X!     ftrans=xopen(ntrans,READ_BINARY);
X!     fshift=xopen(nshift,WRITE_BINARY);
X      if (o_verbose) {
X  	foutput=xopen(noutput,"w");
X  	fconflict=foutput;		/* Conflicts go with description */
X***************
X*** 71,77 ****
X      else {
X  	fconflict=stderr;		/* Conflicts go to stderr */
X      }
X!     fitem=xopen(nitem,"rb");
X
X      yxdef=(int *)xalloc(cnstate*sizeof(int));
X
X--- 71,77 ----
X      else {
X  	fconflict=stderr;		/* Conflicts go to stderr */
X      }
X!     fitem=xopen(nitem,READ_BINARY);
X
X      yxdef=(int *)xalloc(cnstate*sizeof(int));
X
X*** ../yacc/yadefs.h	Sun Jul 30 16:11:57 1989
X--- yadefs.h	Sun Jul 30 17:06:19 1989
X***************
X*** 305,311 ****
X
X  /* 		****** Storage declaration/definition ******		*/
X
X! DEFMAC SYMBOL *send;			/* Define end marker */
X  DEFMAC SYMBOL *sstart;			/* Define start symbol */
X  DEFMAC SYMBOL *shead;			/* Head of thread thru symbols */
X
X--- 305,311 ----
X
X  /* 		****** Storage declaration/definition ******		*/
X
X! DEFMAC SYMBOL *mx_send;			/* Define end marker */
X  DEFMAC SYMBOL *sstart;			/* Define start symbol */
X  DEFMAC SYMBOL *shead;			/* Head of thread thru symbols */
X
X*** ../yacc/yagoto.c	Sun Jul 30 16:12:34 1989
X--- yagoto.c	Sun Jul 30 16:02:52 1989
X***************
X*** 28,34 ****
X
X      message("mkgoto:");
X
X!     fgoto=xopen(ngoto,"wb");
X
X      trace(("mkgoto: cnntx=%d sizeof(NTXTAB)=%d *=%d\n",
X  	cnntx,sizeof(NTXTAB),cnntx*sizeof(NTXTAB) ));
X--- 28,34 ----
X
X      message("mkgoto:");
X
X!     fgoto=xopen(ngoto,WRITE_BINARY);
X
X      trace(("mkgoto: cnntx=%d sizeof(NTXTAB)=%d *=%d\n",
X  	cnntx,sizeof(NTXTAB),cnntx*sizeof(NTXTAB) ));
X*** ../yacc/yaincon.c	Sun Jul 30 16:12:40 1989
X--- yaincon.c	Sun Jul 30 16:02:55 1989
X***************
X*** 29,35 ****
X  	cnincon,sizeof(int),cnincon*sizeof(int)));
X      ist=(int *)xalloc(cnincon*sizeof(int));
X
X!     fitem=xopen(nitem,"rb");
X
X      n=basest=ibase=i=0;		/* fitem file sorted by state number */
X      for (;;) {
X--- 29,35 ----
X  	cnincon,sizeof(int),cnincon*sizeof(int)));
X      ist=(int *)xalloc(cnincon*sizeof(int));
X
X!     fitem=xopen(nitem,READ_BINARY);
X
X      n=basest=ibase=i=0;		/* fitem file sorted by state number */
X      for (;;) {
X*** ../yacc/yainit1.c	Sun Jul 30 16:12:52 1989
X--- yainit1.c	Sun Jul 30 16:02:59 1989
X***************
X*** 22,27 ****
X--- 22,31 ----
X
X  #include "yadefs.h"
X
X+ #ifdef MINIX
X+ #include <ctype.h>
X+ #endif
X+
X  void
X  init1(argc,argv)
X  int argc;
X*** ../yacc/yalr0.c	Sun Jul 30 16:13:53 1989
X--- yalr0.c	Sun Jul 30 16:03:13 1989
X***************
X*** 53,59 ****
X
X      cnstate=0;
X      cnrtx=cnntx=cnttx=0;
X!     ftrans=xopen(ntrans,"wb");
X
X      stlast=NULL;				/* None added yet */
X
X--- 53,59 ----
X
X      cnstate=0;
X      cnrtx=cnntx=cnttx=0;
X!     ftrans=xopen(ntrans,WRITE_BINARY);
X
X      stlast=NULL;				/* None added yet */
X
X***************
X*** 125,132 ****
X      TRANS *tr;
X      int itemcmp();
X
X!     trace2(("mrgtrans: entering atrlist=%08lx
X!  trlist=%08lx\n",atrlist,*atrlist));
X
X      while (tr= *atrlist) {		/* "= *" avoids old assignment op */
X  	trace2(("mrgtrans: transition on %s from state number %d\n",
X--- 125,131 ----
X      TRANS *tr;
X      int itemcmp();
X
X!     trace2(("mrgtrans: entering atrlist=%08lx trlist=%08lx\n",
X         atrlist,*atrlist));
X
X      while (tr= *atrlist) {		/* "= *" avoids old assignment op */
X  	trace2(("mrgtrans: transition on %s from state number %d\n",
X***************
X*** 386,392 ****
X      void opstate();
X      STATE *st;
X
X!     fitem=xopen(nitem,"wb");
X      cnincon=0;		/* Count of complete items in inconsistent states */
X      cncxst=0;		/* Count of complex states */
X      cncxit=0;		/* Count of complete items in complex states */
X--- 385,391 ----
X      void opstate();
X      STATE *st;
X
X!     fitem=xopen(nitem,WRITE_BINARY);
X      cnincon=0;		/* Count of complete items in inconsistent states */
X      cncxst=0;		/* Count of complex states */
X      cncxit=0;		/* Count of complete items in complex states */
X***************
X*** 463,467 ****
X      printf("\n");
X  }
X
X! #endif
X!
X--- 462,488 ----
X      printf("\n");
X  }
X
X! #else
X! #ifdef TRACE
X!
X! static void
X! dpitem(it)
X! ITEM *it;
X! {
X!     int i,end,dposn;
X!
X!     end=lngrule(it->rule)+1;
X!     dposn=it->dposn ? it->dposn : end;
X!     printf("\t%s\t: ",namesym(rulesymit->rule|));
X!     for (i=1; i<dposn; ++i) {
X! 	printf("%s ",namesym(rhssym(it,i)));
X!     }
X!     printf("_ ");
X!     for (i=dposn; i<end; ++i) {
X! 	printf("%s ",namesym(rhssym(it,i)));
X!     }
X!     printf("\n");
X! }
X!
X! #endif
X! #endif
X*** ../yacc/yaoppars.c	Sun Jul 30 16:14:02 1989
X--- yaoppars.c	Sun Jul 30 16:03:18 1989
X***************
X*** 28,34 ****
X      for (;;) {
X  	if ((c=getc(fyaccpar)) == '$') {
X  	    if ((c=getc(fyaccpar)) == 'A') {
X! 		faction=xopen(naction,"rb");
X  		for (;;) {
X  		    c=getc(faction);
X  		    if (iseofchar(c)) break;
X--- 28,34 ----
X      for (;;) {
X  	if ((c=getc(fyaccpar)) == '$') {
X  	    if ((c=getc(fyaccpar)) == 'A') {
X! 		faction=xopen(naction,READ_BINARY);
X  		for (;;) {
X  		    c=getc(faction);
X  		    if (iseofchar(c)) break;
X*** ../yacc/yaopsym.c	Sun Jul 30 16:14:16 1989
X--- yaopsym.c	Sun Jul 30 16:03:21 1989
X***************
X*** 72,79 ****
X  	}
X      } while (swap);
X
X!     fsymbol=xopen(nsymbol,"wb");
X!     fstring=xopen(nstring,"wb");
X
X      stroff=0;
X
X--- 72,79 ----
X  	}
X      } while (swap);
X
X!     fsymbol=xopen(nsymbol,WRITE_BINARY);
X!     fstring=xopen(nstring,WRITE_BINARY);
X
X      stroff=0;
X
X***************
X*** 218,225 ****
X  		nonterminals having sequence from cntok onwards
X      */
X
X!     frule=xopen(nrule,"wb");
X!     frhs=xopen(nrhs,"wb");
X      ruleoff=0;
X      rhsoff=0;
X
X--- 218,225 ----
X  		nonterminals having sequence from cntok onwards
X      */
X
X!     frule=xopen(nrule,WRITE_BINARY);
X!     frhs=xopen(nrhs,WRITE_BINARY);
X      ruleoff=0;
X      rhsoff=0;
X
X*** ../yacc/yapack.c	Sun Jul 30 16:14:43 1989
X--- yapack.c	Sun Jul 30 16:03:27 1989
X***************
X*** 117,123 ****
X  					/* space to avoid old assign op */
X      head=NULL;				/* No groups to start with */
X
X!     fshift=xopen(nshift,"rb");
X      vhead=NULL;				/* No value list yet */
X      getshift();				/* Lookahead */
X      nont=0;				/* isbase() doesn't check gotos yet */
X--- 117,123 ----
X  					/* space to avoid old assign op */
X      head=NULL;				/* No groups to start with */
X
X!     fshift=xopen(nshift,READ_BINARY);
X      vhead=NULL;				/* No value list yet */
X      getshift();				/* Lookahead */
X      nont=0;				/* isbase() doesn't check gotos yet */
X***************
X*** 127,133 ****
X      }
X      xclose(fshift,nshift);
X
X!     fgoto=xopen(ngoto,"rb");
X      clearv(&vhead);
X      getgoto();
X      st=cnstate;				/* Make isbase() check all states */
X--- 127,133 ----
X      }
X      xclose(fshift,nshift);
X
X!     fgoto=xopen(ngoto,READ_BINARY);
X      clearv(&vhead);
X      getgoto();
X      st=cnstate;				/* Make isbase() check all states */
X*** ../yacc/yaparse.c	Sun Jul 30 16:15:10 1989
X--- yaparse.c	Sun Jul 30 16:03:33 1989
X***************
X*** 261,267 ****
X  #endif
X
X  #if YYFULLERR
X! static void yyterror();
X  #endif
X
X  #if YYUNION
X--- 261,268 ----
X  #endif
X
X  #if YYFULLERR
X! /*static void yyterror();*/
X! extern void yyterror();
X  #endif
X
X  #if YYUNION
X***************
X*** 451,457 ****
X
X  #line 62
X
X! 			    faction=xopen(naction,"wb");
X
X  			    section=RULES;
X  			    nextrule=1;
X--- 452,458 ----
X
X  #line 62
X
X! 			    faction=xopen(naction,WRITE_BINARY);
X
X  			    section=RULES;
X  			    nextrule=1;
X***************
X*** 654,660 ****
X  			    SYMBOL *sym;
X  			    static char name13| = "$$";
X
X! 			    itoa(nextrule,&name2|,10);	/* Use seq number */
X  			    sym=chksym(name);
X  			    setnont(sym);		/* As dummy nont */
X  			    sym->rule=r=addrule(sym);
X--- 655,665 ----
X  			    SYMBOL *sym;
X  			    static char name13| = "$$";
X
X! #ifdef MINIX
X! 				 strcpy(&name2|, itoa(nextrule));	/* Use seq number */
X! #else
X! 				 itoa(nextrule,&name2|,10);	/* Use seq number */
X! #endif
X  			    sym=chksym(name);
X  			    setnont(sym);		/* As dummy nont */
X  			    sym->rule=r=addrule(sym);
X*** ../yacc/yardprec.c	Sun Jul 30 16:15:37 1989
X--- yardprec.c	Sun Jul 30 16:03:36 1989
X***************
X*** 22,28 ****
X
X      message("rdprec:");
X
X!     fsymbol=xopen(nsymbol,"rb");	/* Read symbols */
X
X      (void)getw(fsymbol);
X      (void)getw(fsymbol);
X--- 22,28 ----
X
X      message("rdprec:");
X
X!     fsymbol=xopen(nsymbol,READ_BINARY);	/* Read symbols */
X
X      (void)getw(fsymbol);
X      (void)getw(fsymbol);
X***************
X*** 42,48 ****
X
X      xclose(fsymbol,nsymbol);
X
X!     frule=xopen(nrule,"rb");		/* Read rules */
X
X      (void)getw(frule);
X      (void)getw(frule);
X--- 42,48 ----
X
X      xclose(fsymbol,nsymbol);
X
X!     frule=xopen(nrule,READ_BINARY);		/* Read rules */
X
X      (void)getw(frule);
X      (void)getw(frule);
X*** ../yacc/yardtx.c	Sun Jul 30 16:15:44 1989
X--- yardtx.c	Sun Jul 30 16:03:39 1989
X***************
X*** 27,33 ****
X
X      message("rdtx:");
X
X!     ftrans=xopen(ntrans,"rb");
X
X      trace(("rdtx: allocating ntxtab size cnntx %u * size %u = %u\n",
X  	cnntx,sizeof(NTXTAB),cnntx*sizeof(NTXTAB)));
X--- 27,33 ----
X
X      message("rdtx:");
X
X!     ftrans=xopen(ntrans,READ_BINARY);
X
X      trace(("rdtx: allocating ntxtab size cnntx %u * size %u = %u\n",
X  	cnntx,sizeof(NTXTAB),cnntx*sizeof(NTXTAB)));
X*** ../yacc/yaread.c	Sun Jul 30 16:15:53 1989
X--- yaread.c	Sun Jul 30 16:03:42 1989
X***************
X*** 34,40 ****
X
X      message("rdstr:");
X
X!     fstring=xopen(nstring,"rb");	/* Read string file */
X      cnstr=getw(fstring);
X      p=strarea=xalloc(cnstr);
X      for (i=0; i<cnstr; ++i) {
X--- 34,40 ----
X
X      message("rdstr:");
X
X!     fstring=xopen(nstring,READ_BINARY);	/* Read string file */
X      cnstr=getw(fstring);
X      p=strarea=xalloc(cnstr);
X      for (i=0; i<cnstr; ++i) {
X***************
X*** 50,56 ****
X
X      message("rdsym:");
X
X!     fsymbol=xopen(nsymbol,"rb");	/* Read symbols */
X
X      cntok=getw(fsymbol);
X      cnnont=getw(fsymbol);
X--- 50,56 ----
X
X      message("rdsym:");
X
X!     fsymbol=xopen(nsymbol,READ_BINARY);	/* Read symbols */
X
X      cntok=getw(fsymbol);
X      cnnont=getw(fsymbol);
X***************
X*** 109,115 ****
X
X      message("rdrule:");
X
X!     frule=xopen(nrule,"rb");		/* Read rules */
X
X      cnrule=getw(frule);
X      cntok=getw(frule);			/* cntok gives offset for nont seq */
X--- 109,115 ----
X
X      message("rdrule:");
X
X!     frule=xopen(nrule,READ_BINARY);		/* Read rules */
X
X      cnrule=getw(frule);
X      cntok=getw(frule);			/* cntok gives offset for nont seq */
X***************
X*** 138,144 ****
X      }
X      xclose(frule,nrule);
X
X!     frhs=xopen(nrhs,"rb");
X      cnrhs=getw(frhs);
X      rulerhscnrule|=cnrhs;			/* Note dummy entry */
X      rhs=(int *)xalloc(cnrhs*sizeof(int));
X--- 138,144 ----
X      }
X      xclose(frule,nrule);
X
X!     frhs=xopen(nrhs,READ_BINARY);
X      cnrhs=getw(frhs);
X      rulerhscnrule|=cnrhs;			/* Note dummy entry */
X      rhs=(int *)xalloc(cnrhs*sizeof(int));
X*** ../yacc/yareln.c	Sun Jul 30 16:16:06 1989
X--- yareln.c	Sun Jul 30 16:03:46 1989
X***************
X*** 76,82 ****
X  	}
X      }
X
X!     ftr2=xopen(ntr2,"rb");
X
X      lastrule=-1;			/* For first time through */
X  					/* Don't finish off rule -1 ! */
X--- 76,82 ----
X  	}
X      }
X
X!     ftr2=xopen(ntr2,READ_BINARY);
X
X      lastrule=-1;			/* For first time through */
X  					/* Don't finish off rule -1 ! */
X*** ../yacc/yasort.c	Sun Jul 30 16:16:18 1989
X--- yasort.c	Sun Jul 30 16:03:50 1989
X***************
X*** 102,108 ****
X
X      gname(high);
X      unlink(outname);
X!     rename(name,outname);
X      return 0;
X  }
X
X--- 102,115 ----
X
X      gname(high);
X      unlink(outname);
X! #ifdef MINIX
X!     if (link(name,outname))
X! 	 	perror("sort() : error returned from link");
X! 	 if (unlink(name))
X! 	 	perror("sort() : error returned from unlink");
X! #else
X!     rename(name,outname);
X! #endif
X      return 0;
X  }
X
X***************
X*** 138,144 ****
X
X      strcpy(name,namepath);
X      strcat(name,prefix);
X!     (void)itoa(n,name+strlen(name),10);
X      strcat(name,suffix);
X      trace(("gname: <%s>\n",name));
X  }
X--- 145,155 ----
X
X      strcpy(name,namepath);
X      strcat(name,prefix);
X! #ifdef MINIX
X! 	 strcat(name,itoa(n));		/* #$%@!   MINIX itoa() is screwy! */
X! #else
X!     (void)itoa(n,name+strlen(name),10);
X! #endif
X      strcat(name,suffix);
X      trace(("gname: <%s>\n",name));
X  }
X*** ../yacc/yasym.c	Sun Jul 30 16:16:24 1989
X--- yasym.c	Sun Jul 30 16:05:30 1989
X***************
X*** 93,99 ****
X
X      i=0;
X      while (*s) {
X! 	i+=*s++ & HASHMASK;
X  	if (*s) i+=(*s++ & HASHMASK)<<HASHIFT;
X      }
X      return i%HASHSIZE;
X--- 93,99 ----
X
X      i=0;
X      while (*s) {
X! 	i += (*s++) & HASHMASK;
X  	if (*s) i+=(*s++ & HASHMASK)<<HASHIFT;
X      }
X      return i%HASHSIZE;
X*** ../yacc/yatxsort.c	Sun Jul 30 16:16:40 1989
X--- yatxsort.c	Sun Jul 30 16:03:59 1989
X***************
X*** 53,66 ****
X  rtxrop(name)
X  char *name;
X  {
X!     return xopen(name,"rb");
X  }
X
X  static FILE *
X  rtxwop(name)
X  char *name;
X  {
X!     return xopen(name,"wb");
X  }
X
X  static void
X--- 53,66 ----
X  rtxrop(name)
X  char *name;
X  {
X!     return xopen(name,READ_BINARY);
X  }
X
X  static FILE *
X  rtxwop(name)
X  char *name;
X  {
X!     return xopen(name,WRITE_BINARY);
X  }
X
X  static void
/
echo x - yasystem.h
sed '/^X/s///' > yasystem.h << '/'
X/* yapcdos.h 08-Jul-89 Implementation dependent things for IBM PC DOS */
X
X/* Copyright 1987,1988,1989 David A. Clunie. All rights reserved.
X   PO Box 811, Parkville 3052 AUSTRALIA.
X   This program may be freely distributed for non-commercial use. */
X
X#define MINIX
X/* defined for debugging */
X/* #define TRACE */
X
X#ifdef __ZTC__
X#define SYSTEM	 "PC-DOS ZTC (file)"
X#else
X#ifdef MINIX
X#define SYSTEM   "MINIX"
X#else
X#define SYSTEM	 "PC-DOS (file)"
X#endif
X#endif
X
X/* #define PCDOS */
X
X#ifdef __ZTC__
X
X#define STDLIBHEAD	<stdlib.h>	/* define if stdlib.h needed */
X#define	STRINGHEAD	<string.h>	/* define if string.h needed */
X#define	TIMEHEAD	<time.h>	/* define if time.h needed */
X
X#else	/* assume Aztec C */
X
Xchar *malloc();
Xchar *realloc();
X
Xtypedef long clock_t;
X#define	clock()		(0l)
X
X#endif
X
X#ifdef __ZTC__
X#define TTYHEAD	<io.h>		/* define only if isatty() needs io.h */
X#else	/* assume Aztec C */
X#define TTYHEAD	<sgtty.h>	/* define only if isatty() needs sgtty.h */
X#endif
X
X#ifdef MINIX
X#define iseofchar(c)    ( (c) == EOF  (c) == 0x04 )	/* ctrl-D? */
X#else
X#define	iseofchar(c)	( c == EOF  c == 0x1a )	/* ctrl-Z */
X#endif
X
X#define BITSTR	unsigned int	/* Type of word used for bit strings */
X
X#define SORTTABLE	3000	/* size of pointer table in txsort() */
X				/* larger -> longer runs */
X#ifdef __ZTC__
X#define	NEEDGETW		/* include x...w() in yautil.c */
X#define	getw(f)		xgetw(f)
X#define	putw(u,f)	xputw(u,f)
X#define	rdstrch(f)	xgetw(f)
X#define	wrstrch(u,f)	xputw(u,f)
X#else	/* assume Aztec C */
X#ifdef MINIX
X#define	NEEDGETW		/* include x...w() in yautil.c */
X#define	getw(f)		xgetw(f)
X#define	putw(u,f)	xputw(u,f)
X#define	rdstrch(f)	xgetw(f)
X#define	wrstrch(u,f)	xputw(u,f)
X#else
X#define	rdstrch(f)	getc(f)
X#define	wrstrch(u,f)	putc(u,f)
X#endif
X#endif
X
X/* set PATHSEPARATOR to null string "" if paths not implemented */
X#ifndef PATHSEPARATOR
X#ifdef MINIX
X#define PATHSEPARATOR	"/"
X#else
X#define	PATHSEPARATOR	"\\"
X#endif
X#endif
X
X/* leave TMPENVPATH undefined if compiler can't access environment */
X#ifndef TMPENVPATH			/* if not defined on compile line */
X#define	TMPENVPATH	"TMP"		/* where to find path for temp files */
X#endif
X/* set TMPDEFPATH to null string "" (current directory) if no paths */
X#ifndef TMPDEFPATH			/* if not defined on compile line */
X#ifdef MINIX
X#define TMPDEFPATH	"/tmp"
X#else
X#define TMPDEFPATH	""		/* path to use if not in environment */
X#endif
X#endif
X
X/* leave SKELENVPATH undefined if compiler can't access environment */
X#ifndef SKELENVPATH			/* if not defined on compile line */
X#define	SKELENVPATH	"YYSKELETON"	/* where to find path for skeleton */
X#endif
X/* set SKELDEFPATH to null string "" (current directory) if no paths */
X#ifndef SKELDEFPATH			/* if not defined on compile line */
X#ifdef MINIX
X#define SKELDEFPATH	"/usr/lib"
X#else
X#define SKELDEFPATH	"c:\\util"	/* path to use if not in environment */
X#endif
X#endif
X#ifndef SKELDEFNAME			/* if not defined on compile line */
X#define SKELDEFNAME	"yaccpar"	/* path to use if not in environment */
X#endif
X
X#ifndef YTABHDEFNAME			/* if not defined on compile line */
X#define	YTABHDEFNAME	"ytab.h"
X#endif
X#ifndef YTABCDEFNAME			/* if not defined on compile line */
X#define	YTABCDEFNAME	"ytab.c"
X#endif
X#ifndef YOUTDEFNAME			/* if not defined on compile line */
X#define	YOUTDEFNAME	"youtput"
X#endif
X
X#ifdef MINIX
X#define READ_BINARY	"r"
X#define WRITE_BINARY	"w"
X#else
X#define READ_BINARY	"rb"
X#define WRITE_BINARY	"wb"
X#endif
X
/
exit 0