home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / fish / misc_utils / yacc_419 / diffs < prev    next >
Text File  |  1990-12-18  |  27KB  |  1,274 lines

  1. [ These diffs apply to the berkeley_yacc postings from comp.sources.unix,
  2.   volume 21, to produce the amiga sources.  ...tad ]
  3.  
  4.  
  5.  
  6. diff -c -r unix/ACKNOWLEDGEMENTS amiga/ACKNOWLEDGEMENTS
  7. *** unix/ACKNOWLEDGEMENTS    Sun Aug 19 16:20:36 1990
  8. --- amiga/ACKNOWLEDGEMENTS    Sat Jul 14 14:56:12 1990
  9. ***************
  10. *** 11,16 ****
  11. --- 11,17 ----
  12.   
  13.         Benson I. Margulies
  14.         Dave Gentzel
  15. +       Antoine Verheijen
  16.         Peter S. Housel
  17.         Dale Smith
  18.         Ozan Yigit
  19. diff -c -r unix/Makefile amiga/Makefile
  20. *** unix/Makefile    Sun Aug 19 16:20:37 1990
  21. --- amiga/Makefile    Sat Jul 14 17:58:33 1990
  22. ***************
  23. *** 2,14 ****
  24.   
  25.   HDRS          = defs.h
  26.   
  27. ! CFLAGS          = -O
  28.   
  29.   LDFLAGS          =
  30.   
  31. ! LIBS          =
  32.   
  33. ! LINKER          = cc
  34.   
  35.   MAKEFILE      = Makefile
  36.   
  37. --- 2,14 ----
  38.   
  39.   HDRS          = defs.h
  40.   
  41. ! CFLAGS          =  -cwus
  42.   
  43.   LDFLAGS          =
  44.   
  45. ! LIBS          = lib:lc.lib lib:amiga.lib
  46.   
  47. ! LINKER          = blink
  48.   
  49.   MAKEFILE      = Makefile
  50.   
  51. ***************
  52. *** 45,86 ****
  53.   all:        $(PROGRAM)
  54.   
  55.   $(PROGRAM):     $(OBJS) $(LIBS)
  56. !         @echo -n "Loading $(PROGRAM) ... "
  57. !         @$(LINKER) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
  58.           @echo "done"
  59.   
  60. ! clean:;        @rm -f $(OBJS)
  61.   
  62. ! depend:;    @mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)
  63.   
  64. ! index:;        @ctags -wx $(HDRS) $(SRCS)
  65.   
  66.   install:    $(PROGRAM)
  67.           @echo Installing $(PROGRAM) in $(DEST)
  68.           @install -s $(PROGRAM) $(DEST)
  69.   
  70. ! listing:;    @$(PRINT) Makefile $(HDRS) $(SRCS) | lpr
  71.   
  72. ! lint:;        @lint $(SRCS)
  73.   
  74.   program:        $(PROGRAM)
  75.   
  76.   tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
  77.   
  78. - update:        $(DEST)/$(PROGRAM)
  79. - $(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS)
  80. -         @make -f $(MAKEFILE) DEST=$(DEST) install
  81.   ###
  82. ! closure.o: defs.h
  83. ! error.o: defs.h
  84. ! lalr.o: defs.h
  85. ! lr0.c: defs.h
  86. ! main.o: defs.h
  87. ! mkpar.o: defs.h
  88. ! output.o: defs.h
  89. ! reader.o: defs.h
  90. ! skeleton.o: defs.h
  91. ! symtab.o: defs.h
  92. ! verbose.o: defs.h
  93. ! warshall.o: defs.h
  94. --- 45,90 ----
  95.   all:        $(PROGRAM)
  96.   
  97.   $(PROGRAM):     $(OBJS) $(LIBS)
  98. !         @echo "Loading $(PROGRAM) ... "
  99. !         @$(LINKER) to $(PROGRAM) from lib:c.o $(OBJS) lib $(LIBS) $(LDFLAGS)
  100.           @echo "done"
  101.   
  102. ! clean:
  103. !         @rm -f $(OBJS)
  104.   
  105. ! clobber:
  106. !         @rm -f $(OBJS) $(PROGRAM)
  107.   
  108. ! depend:
  109. !         @mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)
  110.   
  111. + index:
  112. +         @ctags -wx $(HDRS) $(SRCS)
  113.   install:    $(PROGRAM)
  114.           @echo Installing $(PROGRAM) in $(DEST)
  115.           @install -s $(PROGRAM) $(DEST)
  116.   
  117. ! listing:
  118. !         @$(PRINT) Makefile $(HDRS) $(SRCS) | lpr
  119.   
  120. ! lint:
  121. !         @lint $(SRCS)
  122.   
  123.   program:        $(PROGRAM)
  124.   
  125.   tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
  126.   
  127.   ###
  128. ! closure.o: closure.c defs.h
  129. ! error.o: error.c defs.h
  130. ! lalr.o: lalr.c defs.h
  131. ! lr0.o: lr0.c defs.h
  132. ! main.o: main.c defs.h
  133. ! mkpar.o: mkpar.c defs.h
  134. ! output.o: output.c defs.h
  135. ! reader.o: reader.c defs.h
  136. ! skeleton.o: skeleton.c defs.h
  137. ! symtab.o: symtab.c defs.h
  138. ! verbose.o: verbose.c defs.h
  139. ! warshall.o: warshall.c defs.h
  140. diff -c -r unix/defs.h amiga/defs.h
  141. *** unix/defs.h    Sun Aug 19 16:20:40 1990
  142. --- amiga/defs.h    Sat Jul 14 17:41:52 1990
  143. ***************
  144. *** 7,13 ****
  145.   /*  the following definitions are for the VAX        */
  146.   /*  they might have to be changed for other machines    */
  147.   
  148. ! /*  MAXCHAR is the largest character value        */
  149.   /*  MAXSHORT is the largest value of a C short        */
  150.   /*  MINSHORT is the most negative value of a C short    */
  151.   /*  MAXTABLE is the maximum table size            */
  152. --- 7,13 ----
  153.   /*  the following definitions are for the VAX        */
  154.   /*  they might have to be changed for other machines    */
  155.   
  156. ! /*  MAXCHAR is the largest unsigned character value    */
  157.   /*  MAXSHORT is the largest value of a C short        */
  158.   /*  MINSHORT is the most negative value of a C short    */
  159.   /*  MAXTABLE is the maximum table size            */
  160. ***************
  161. *** 24,31 ****
  162.   #define MAXTABLE    32500
  163.   #define BITS_PER_WORD    32
  164.   #define    WORDSIZE(n)    (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
  165. ! #define    BIT(r, n)    ((((r)[(n) >> 5]) >> ((n) & 31)) & 1)
  166. ! #define    SETBIT(r, n)    ((r)[(n) >> 5] |= (1 << ((n) & 31)))
  167.   
  168.   
  169.   /*  character names  */
  170. --- 24,31 ----
  171.   #define MAXTABLE    32500
  172.   #define BITS_PER_WORD    32
  173.   #define    WORDSIZE(n)    (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
  174. ! #define    BIT(r, n)    ((((r)[(n)>>5])>>((n)&31))&1)
  175. ! #define    SETBIT(r, n)    ((r)[(n)>>5]|=((unsigned)1<<((n)&31)))
  176.   
  177.   
  178.   /*  character names  */
  179. ***************
  180. *** 98,103 ****
  181. --- 98,104 ----
  182.   
  183.   /*  storage allocation macros  */
  184.   
  185. + #define CALLOC(k,n)    (calloc((unsigned)(k),(unsigned)(n)))
  186.   #define    FREE(x)        (free((char*)(x)))
  187.   #define MALLOC(n)    (malloc((unsigned)(n)))
  188.   #define    NEW(t)        ((t*)allocate(sizeof(t)))
  189. ***************
  190. *** 278,283 ****
  191. --- 279,289 ----
  192.   
  193.   extern void free();
  194.   extern char *calloc();
  195. + #ifdef AMIGA
  196. + extern void *malloc();
  197. + extern void *realloc();
  198. + #else
  199.   extern char *malloc();
  200.   extern char *realloc();
  201. + #endif
  202.   extern char *strcpy();
  203. diff -c -r unix/lr0.c amiga/lr0.c
  204. *** unix/lr0.c    Sun Aug 19 16:20:47 1990
  205. --- amiga/lr0.c    Sat Jul 14 14:56:44 1990
  206. ***************
  207. *** 12,17 ****
  208. --- 12,18 ----
  209.   int get_state();
  210.   core *new_state();
  211.   
  212. + static core **state_set;
  213.   static core *this_state;
  214.   static core *last_state;
  215.   static shifts *last_shift;
  216. ***************
  217. *** 27,35 ****
  218.   static short **kernel_end;
  219.   static short *kernel_items;
  220.   
  221. - static core **state_table;
  222.   
  223.   allocate_itemsets()
  224.   {
  225.     register short *itemp;
  226. --- 28,34 ----
  227. ***************
  228. *** 79,85 ****
  229.   
  230.     shiftset = NEW2(nsyms, short);
  231.     redset = NEW2(nrules + 1, short);
  232. !   state_table = NEW2(nitems, core *);
  233.   }
  234.   
  235.   
  236. --- 78,84 ----
  237.   
  238.     shiftset = NEW2(nsyms, short);
  239.     redset = NEW2(nrules + 1, short);
  240. !   state_set = NEW2(nitems, core *);
  241.   }
  242.   
  243.   
  244. ***************
  245. *** 122,128 ****
  246.     FREE(kernel_base);
  247.     FREE(kernel_end);
  248.     FREE(kernel_items);
  249. !   FREE(state_table);
  250.   }
  251.   
  252.   
  253. --- 121,127 ----
  254.     FREE(kernel_base);
  255.     FREE(kernel_end);
  256.     FREE(kernel_items);
  257. !   FREE(state_set);
  258.   }
  259.   
  260.   
  261. ***************
  262. *** 177,183 ****
  263.   
  264.     key = *isp1;
  265.     assert(0 <= key && key < nitems);
  266. !   sp = state_table[key];
  267.     if (sp)
  268.       {
  269.         found = 0;
  270. --- 176,182 ----
  271.   
  272.     key = *isp1;
  273.     assert(0 <= key && key < nitems);
  274. !   sp = state_set[key];
  275.     if (sp)
  276.       {
  277.         found = 0;
  278. ***************
  279. *** 212,218 ****
  280.       }
  281.     else
  282.       {
  283. !       state_table[key] = sp = new_state(symbol);
  284.       }
  285.   
  286.     return (sp->number);
  287. --- 211,217 ----
  288.       }
  289.     else
  290.       {
  291. !       state_set[key] = sp = new_state(symbol);
  292.       }
  293.   
  294.     return (sp->number);
  295. diff -c -r unix/main.c amiga/main.c
  296. *** unix/main.c    Sun Aug 19 16:20:41 1990
  297. --- amiga/main.c    Sat Jul 14 17:35:01 1990
  298. ***************
  299. *** 3,14 ****
  300.   
  301.   char dflag;
  302.   char lflag;
  303.   char tflag;
  304.   char vflag;
  305.   
  306. ! char *prefix = "y";
  307.   char *myname = "yacc";
  308.   char *temp_form = "yacc.XXXXXXX";
  309.   
  310.   int lineno;
  311.   int outline;
  312. --- 3,19 ----
  313.   
  314.   char dflag;
  315.   char lflag;
  316. + char rflag;
  317.   char tflag;
  318.   char vflag;
  319.   
  320. ! char *file_prefix = "y";
  321.   char *myname = "yacc";
  322. + #ifndef AMIGA
  323.   char *temp_form = "yacc.XXXXXXX";
  324. + #else
  325. + char *temp_form = "t:yacc";
  326. + #endif
  327.   
  328.   int lineno;
  329.   int outline;
  330. ***************
  331. *** 92,98 ****
  332.   
  333.   usage()
  334.   {
  335. !     fprintf(stderr, "usage: %s [-dltv] [-b prefix] filename\n", myname);
  336.       exit(1);
  337.   }
  338.   
  339. --- 97,103 ----
  340.   
  341.   usage()
  342.   {
  343. !     fprintf(stderr, "usage: %s [-dlrtv] [-b file_prefix] filename\n", myname);
  344.       exit(1);
  345.   }
  346.   
  347. ***************
  348. *** 116,128 ****
  349.           if (i + 1 < argc) usage();
  350.           return;
  351.   
  352. !     case '_':
  353.           ++i;
  354.           goto no_more_options;
  355.   
  356.       case 'b':
  357. !         if (*++s || ++i >= argc) usage();
  358. !         prefix = argv[i];
  359.           continue;
  360.   
  361.       case 'd':
  362. --- 121,137 ----
  363.           if (i + 1 < argc) usage();
  364.           return;
  365.   
  366. !     case '-':
  367.           ++i;
  368.           goto no_more_options;
  369.   
  370.       case 'b':
  371. !         if (*++s)
  372. !          file_prefix = s;
  373. !         else if (++i < argc)
  374. !         file_prefix = argv[i];
  375. !         else
  376. !         usage();
  377.           continue;
  378.   
  379.       case 'd':
  380. ***************
  381. *** 133,138 ****
  382. --- 142,151 ----
  383.           lflag = 1;
  384.           break;
  385.   
  386. +     case 'r':
  387. +         rflag = 1;
  388. +         break;
  389.       case 't':
  390.           tflag = 1;
  391.           break;
  392. ***************
  393. *** 160,165 ****
  394. --- 173,182 ----
  395.           lflag = 1;
  396.           break;
  397.   
  398. +         case 'r':
  399. +         rflag = 1;
  400. +         break;
  401.           case 't':
  402.           tflag = 1;
  403.           break;
  404. ***************
  405. *** 187,197 ****
  406.   {
  407.       register char *p;
  408.   
  409. !     p = calloc((unsigned) 1, n);
  410. !     if (!p) no_space();
  411.       return (p);
  412.   }
  413.   
  414.   
  415.   create_file_names()
  416.   {
  417. --- 204,230 ----
  418.   {
  419.       register char *p;
  420.   
  421. !     p = NULL;
  422. !     if (n)
  423. !     {
  424. !     p = CALLOC(1, n);
  425. !     if (!p) no_space();
  426. !     }
  427.       return (p);
  428.   }
  429.   
  430. + #ifdef AMIGA
  431. + char *                                                                        
  432. + TmpFileName(template)                                                         
  433. + char *template;                                                               
  434. + {                                                                             
  435. +     static char Template[256];                                                
  436. +     static unsigned short Idx;                                                
  437. +                                                                               
  438. +     sprintf(Template, "%s%08lx.TMP", template, (long)FindTask(NULL) + Idx++);
  439. +     return(Template);                                                         
  440. + }
  441. + #endif
  442.   
  443.   create_file_names()
  444.   {
  445. ***************
  446. *** 198,210 ****
  447. --- 231,250 ----
  448.       int i, len;
  449.       char *tmpdir;
  450.   
  451. + #ifndef AMIGA
  452.       tmpdir = getenv("TMPDIR");
  453.       if (tmpdir == 0) tmpdir = "/tmp";
  454. + #else
  455. +     if (tmpdir == 0) tmpdir = "t:";
  456. + #endif
  457.   
  458.       len = strlen(tmpdir);
  459.       i = len + 13;
  460. + #ifndef AMIGA
  461.       if (len && tmpdir[len-1] != '/')
  462.       ++i;
  463. + #endif
  464.   
  465.       action_file_name = MALLOC(i);
  466.       if (action_file_name == 0) no_space();
  467. ***************
  468. *** 217,222 ****
  469. --- 257,263 ----
  470.       strcpy(text_file_name, tmpdir);
  471.       strcpy(union_file_name, tmpdir);
  472.   
  473. + #ifndef AMIGA
  474.       if (len && tmpdir[len - 1] != '/')
  475.       {
  476.       action_file_name[len] = '/';
  477. ***************
  478. *** 224,229 ****
  479. --- 265,271 ----
  480.       union_file_name[len] = '/';
  481.       ++len;
  482.       }
  483. + #endif
  484.   
  485.       strcpy(action_file_name + len, temp_form);
  486.       strcpy(text_file_name + len, temp_form);
  487. ***************
  488. *** 233,243 ****
  489.       text_file_name[len + 5] = 't';
  490.       union_file_name[len + 5] = 'u';
  491.   
  492.       mktemp(action_file_name);
  493.       mktemp(text_file_name);
  494.       mktemp(union_file_name);
  495.   
  496. !     len = strlen(prefix);
  497.       if (dflag)
  498.       {
  499.       /*  the number 7 below is the size of ".tab.h"; sizeof is not used  */
  500. --- 275,291 ----
  501.       text_file_name[len + 5] = 't';
  502.       union_file_name[len + 5] = 'u';
  503.   
  504. + #ifndef AMIGA
  505.       mktemp(action_file_name);
  506.       mktemp(text_file_name);
  507.       mktemp(union_file_name);
  508. + #else
  509. +     strcpy(action_file_name, TmpFileName(action_file_name));
  510. +     strcpy(text_file_name, TmpFileName(text_file_name));
  511. +     strcpy(union_file_name, TmpFileName(union_file_name));
  512. + #endif
  513.   
  514. !     len = strlen(file_prefix);
  515.       if (dflag)
  516.       {
  517.       /*  the number 7 below is the size of ".tab.h"; sizeof is not used  */
  518. ***************
  519. *** 244,256 ****
  520.       /*  because of a C compiler that thinks sizeof(".tab.h") == 6        */
  521.       defines_file_name = MALLOC(len + 7);
  522.       if (defines_file_name == 0) no_space();
  523. !     strcpy(defines_file_name, prefix);
  524.       strcpy(defines_file_name + len, DEFINES_SUFFIX);
  525.       }
  526.   
  527.       output_file_name = MALLOC(len + 7);
  528.       if (output_file_name == 0) no_space();
  529. !     strcpy(output_file_name, prefix);
  530.       strcpy(output_file_name + len, OUTPUT_SUFFIX);
  531.   
  532.       if (vflag)
  533. --- 292,304 ----
  534.       /*  because of a C compiler that thinks sizeof(".tab.h") == 6        */
  535.       defines_file_name = MALLOC(len + 7);
  536.       if (defines_file_name == 0) no_space();
  537. !     strcpy(defines_file_name, file_prefix);
  538.       strcpy(defines_file_name + len, DEFINES_SUFFIX);
  539.       }
  540.   
  541.       output_file_name = MALLOC(len + 7);
  542.       if (output_file_name == 0) no_space();
  543. !     strcpy(output_file_name, file_prefix);
  544.       strcpy(output_file_name + len, OUTPUT_SUFFIX);
  545.   
  546.       if (vflag)
  547. ***************
  548. *** 257,263 ****
  549.       {
  550.       verbose_file_name = MALLOC(len + 8);
  551.       if (verbose_file_name == 0) no_space();
  552. !     strcpy(verbose_file_name, prefix);
  553.       strcpy(verbose_file_name + len, VERBOSE_SUFFIX);
  554.       }
  555.   }
  556. --- 305,311 ----
  557.       {
  558.       verbose_file_name = MALLOC(len + 8);
  559.       if (verbose_file_name == 0) no_space();
  560. !     strcpy(verbose_file_name, file_prefix);
  561.       strcpy(verbose_file_name + len, VERBOSE_SUFFIX);
  562.       }
  563.   }
  564. diff -c -r unix/manpage amiga/manpage
  565. *** unix/manpage    Sun Aug 19 16:20:42 1990
  566. --- amiga/manpage    Sat Jul 14 14:56:37 1990
  567. ***************
  568. *** 1,11 ****
  569.   .\"    %W%    %R% (Berkeley) %E%
  570.   .\"
  571. ! .TH YACC 1 "December 10, 1989"
  572.   .UC 6
  573.   .SH NAME
  574.   Yacc \- an LALR(1) parser generator
  575.   .SH SYNOPSIS
  576. ! .B yacc [ -dltv ] [ -b
  577.   .I prefix
  578.   .B ]
  579.   .I filename
  580. --- 1,11 ----
  581.   .\"    %W%    %R% (Berkeley) %E%
  582.   .\"
  583. ! .TH YACC 1 "June 3, 1990"
  584.   .UC 6
  585.   .SH NAME
  586.   Yacc \- an LALR(1) parser generator
  587.   .SH SYNOPSIS
  588. ! .B yacc [ -dlrtv ] [ -b
  589.   .I prefix
  590.   .B ]
  591.   .I filename
  592. ***************
  593. *** 50,59 ****
  594.   will not insert the \#line directives.
  595.   \&\#line directives specified by the user will be retained.
  596.   .TP
  597.   .B -t
  598.   The
  599.   .B -t
  600. ! option will change the preprocessor directives generated by
  601.   .I yacc
  602.   so that debugging statements will be incorporated in the compiled code.
  603.   .TP
  604. --- 50,74 ----
  605.   will not insert the \#line directives.
  606.   \&\#line directives specified by the user will be retained.
  607.   .TP
  608. + .B -r
  609. + The
  610. + .B -r
  611. + option causes
  612. + .I yacc
  613. + to produce separate files for code and tables.  The code file
  614. + is named
  615. + .IR
  616. + y.code.c,
  617. + and the tables file is named
  618. + .IR y.tab.c.
  619. + (The
  620. + .B -r
  621. + option has not yet been implemented.)
  622. + .TP
  623.   .B -t
  624.   The
  625.   .B -t
  626. ! option changes the preprocessor directives generated by
  627.   .I yacc
  628.   so that debugging statements will be incorporated in the compiled code.
  629.   .TP
  630. diff -c -r unix/output.c amiga/output.c
  631. *** unix/output.c    Sun Aug 19 16:20:49 1990
  632. --- amiga/output.c    Sat Jul 14 14:56:17 1990
  633. ***************
  634. *** 511,519 ****
  635.   
  636.           newmax = maxtable;
  637.           do { newmax += 200; } while (newmax <= loc);
  638. !         table = (short *) realloc(table, newmax*sizeof(short));
  639.           if (table == 0) no_space();
  640. !         check = (short *) realloc(check, newmax*sizeof(short));
  641.           if (check == 0) no_space();
  642.           for (l  = maxtable; l < newmax; ++l)
  643.           {
  644. --- 511,519 ----
  645.   
  646.           newmax = maxtable;
  647.           do { newmax += 200; } while (newmax <= loc);
  648. !         table = (short *) REALLOC(table, newmax*sizeof(short));
  649.           if (table == 0) no_space();
  650. !         check = (short *) REALLOC(check, newmax*sizeof(short));
  651.           if (check == 0) no_space();
  652.           for (l  = maxtable; l < newmax; ++l)
  653.           {
  654. ***************
  655. *** 807,812 ****
  656. --- 807,815 ----
  657.   
  658.       symnam = (char **) MALLOC((max+1)*sizeof(char *));
  659.       if (symnam == 0) no_space();
  660. +     /* Note that it is  not necessary to initialize the element        */
  661. +     /* symnam[max].                            */
  662.       for (i = 0; i < max; ++i)
  663.       symnam[i] = 0;
  664.       for (i = ntokens - 1; i >= 2; --i)
  665. ***************
  666. *** 825,840 ****
  667.           k = 7;
  668.           while (*++s != '"')
  669.           {
  670.               if (*s == '\\')
  671.               {
  672.               k += 2;
  673.               if (*++s == '\\')
  674. -                 k += 2;
  675. -             else
  676.                   ++k;
  677.               }
  678. -             else
  679. -             ++k;
  680.           }
  681.           j += k;
  682.           if (j > 80)
  683. --- 828,840 ----
  684.           k = 7;
  685.           while (*++s != '"')
  686.           {
  687. +             ++k;
  688.               if (*s == '\\')
  689.               {
  690.               k += 2;
  691.               if (*++s == '\\')
  692.                   ++k;
  693.               }
  694.           }
  695.           j += k;
  696.           if (j > 80)
  697. ***************
  698. *** 862,867 ****
  699. --- 862,868 ----
  700.           }
  701.           else if (s[0] == '\'')
  702.           {
  703. + fprintf(stderr, "s[0] = %c, s[1] = %c, s[2] = %c\n", s[0], s[1], s[2]);
  704.           if (s[1] == '"')
  705.           {
  706.               j += 7;
  707. ***************
  708. *** 878,894 ****
  709.               k = 5;
  710.               while (*++s != '\'')
  711.               {
  712.               if (*s == '\\')
  713.               {
  714.                   k += 2;
  715. -                 ++s;
  716.                   if (*++s == '\\')
  717. -                 k += 2;
  718. -                 else
  719.                   ++k;
  720.               }
  721. !             else
  722. !                 ++k;
  723.               }
  724.               j += k;
  725.               if (j > 80)
  726. --- 879,893 ----
  727.               k = 5;
  728.               while (*++s != '\'')
  729.               {
  730. + fprintf(stderr, "k = %d, *s = %c\n", k, *s);
  731. +             ++k;
  732.               if (*s == '\\')
  733.               {
  734.                   k += 2;
  735.                   if (*++s == '\\')
  736.                   ++k;
  737.               }
  738. ! fprintf(stderr, "k = %d, *s = %c\n", k, *s);
  739.               }
  740.               j += k;
  741.               if (j > 80)
  742. diff -c -r unix/reader.c amiga/reader.c
  743. *** unix/reader.c    Sun Aug 19 16:20:52 1990
  744. --- amiga/reader.c    Sat Jul 14 14:56:22 1990
  745. ***************
  746. *** 406,412 ****
  747.           }
  748.           }
  749.       }
  750. -     putc('/', f);
  751.       need_newline = 1;
  752.       goto loop;
  753.   
  754. --- 406,411 ----
  755. ***************
  756. *** 1105,1111 ****
  757.       if (!last_was_action && plhs[nrules]->tag)
  758.       {
  759.       for (i = nitems - 1; pitem[i]; --i) continue;
  760. !     if (pitem[i+1]->tag != plhs[nrules]->tag)
  761.           default_action_warning();
  762.       }
  763.   
  764. --- 1104,1110 ----
  765.       if (!last_was_action && plhs[nrules]->tag)
  766.       {
  767.       for (i = nitems - 1; pitem[i]; --i) continue;
  768. !     if (pitem[i+1] == 0 || pitem[i+1]->tag != plhs[nrules]->tag)
  769.           default_action_warning();
  770.       }
  771.   
  772. ***************
  773. *** 1217,1223 ****
  774.           c = *cptr;
  775.           if (c == '$')
  776.           {
  777. !         fprintf(f, "yyval.%s ", tag);
  778.           ++cptr;
  779.           FREE(d_line);
  780.           goto loop;
  781. --- 1216,1222 ----
  782.           c = *cptr;
  783.           if (c == '$')
  784.           {
  785. !         fprintf(f, "yyval.%s", tag);
  786.           ++cptr;
  787.           FREE(d_line);
  788.           goto loop;
  789. ***************
  790. *** 1226,1232 ****
  791.           {
  792.           i = get_number();
  793.           if (i > n) dollar_warning(d_lineno, i);
  794. !         fprintf(f, "yyvsp[%d].%s ", i - n, tag);
  795.           FREE(d_line);
  796.           goto loop;
  797.           }
  798. --- 1225,1231 ----
  799.           {
  800.           i = get_number();
  801.           if (i > n) dollar_warning(d_lineno, i);
  802. !         fprintf(f, "yyvsp[%d].%s", i - n, tag);
  803.           FREE(d_line);
  804.           goto loop;
  805.           }
  806. ***************
  807. *** 1234,1240 ****
  808.           {
  809.           ++cptr;
  810.           i = -get_number() - n;
  811. !         fprintf(f, "yyvsp[%d].%s ", i, tag);
  812.           FREE(d_line);
  813.           goto loop;
  814.           }
  815. --- 1233,1239 ----
  816.           {
  817.           ++cptr;
  818.           i = -get_number() - n;
  819. !         fprintf(f, "yyvsp[%d].%s", i, tag);
  820.           FREE(d_line);
  821.           goto loop;
  822.           }
  823. ***************
  824. *** 1247,1256 ****
  825.           {
  826.           tag = plhs[nrules]->tag;
  827.           if (tag == 0) untyped_lhs();
  828. !         fprintf(f, "yyval.%s ", tag);
  829.           }
  830.           else
  831. !         fprintf(f, "yyval ");
  832.           cptr += 2;
  833.           goto loop;
  834.       }
  835. --- 1246,1255 ----
  836.           {
  837.           tag = plhs[nrules]->tag;
  838.           if (tag == 0) untyped_lhs();
  839. !         fprintf(f, "yyval.%s", tag);
  840.           }
  841.           else
  842. !         fprintf(f, "yyval");
  843.           cptr += 2;
  844.           goto loop;
  845.       }
  846. ***************
  847. *** 1264,1270 ****
  848.               unknown_rhs(i);
  849.           tag = pitem[nitems + i - n - 1]->tag;
  850.           if (tag == 0) untyped_rhs(i, pitem[nitems + i - n - 1]->name);
  851. !         fprintf(f, "yyvsp[%d].%s ", i - n, tag);
  852.           }
  853.           else
  854.           {
  855. --- 1263,1269 ----
  856.               unknown_rhs(i);
  857.           tag = pitem[nitems + i - n - 1]->tag;
  858.           if (tag == 0) untyped_rhs(i, pitem[nitems + i - n - 1]->name);
  859. !         fprintf(f, "yyvsp[%d].%s", i - n, tag);
  860.           }
  861.           else
  862.           {
  863. diff -c -r unix/skeleton.c amiga/skeleton.c
  864. *** unix/skeleton.c    Sun Aug 19 16:20:48 1990
  865. --- amiga/skeleton.c    Sat Jul 14 14:56:05 1990
  866. ***************
  867. *** 10,16 ****
  868.   char *banner[] =
  869.   {
  870.       "#ifndef lint",
  871. !     "char yysccsid[] = \"@(#)yaccpar    1.4 (Berkeley) 02/25/90\";",
  872.       "#endif",
  873.       0
  874.   };
  875. --- 10,16 ----
  876.   char *banner[] =
  877.   {
  878.       "#ifndef lint",
  879. !     "char yysccsid[] = \"@(#)yaccpar    1.5 (Berkeley) 06/03/90\";",
  880.       "#endif",
  881.       0
  882.   };
  883. ***************
  884. *** 198,204 ****
  885.       "    yym = yylhs[yyn];",
  886.       "    if (yystate == 0 && yym == 0)",
  887.       "    {",
  888. !     "#ifdef YYDEBUG",
  889.       "        if (yydebug)",
  890.       "            printf(\"yydebug: after reduction, shifting from state 0 to\\",
  891.       " state %d\\n\", YYFINAL);",
  892. --- 198,204 ----
  893.       "    yym = yylhs[yyn];",
  894.       "    if (yystate == 0 && yym == 0)",
  895.       "    {",
  896. !     "#if YYDEBUG",
  897.       "        if (yydebug)",
  898.       "            printf(\"yydebug: after reduction, shifting from state 0 to\\",
  899.       " state %d\\n\", YYFINAL);",
  900. ***************
  901. *** 228,234 ****
  902.       "        yystate = yytable[yyn];",
  903.       "    else",
  904.       "        yystate = yydgoto[yym];",
  905. !     "#ifdef YYDEBUG",
  906.       "    if (yydebug)",
  907.       "        printf(\"yydebug: after reduction, shifting from state %d \\",
  908.       "to state %d\\n\", *yyssp, yystate);",
  909. --- 228,234 ----
  910.       "        yystate = yytable[yyn];",
  911.       "    else",
  912.       "        yystate = yydgoto[yym];",
  913. !     "#if YYDEBUG",
  914.       "    if (yydebug)",
  915.       "        printf(\"yydebug: after reduction, shifting from state %d \\",
  916.       "to state %d\\n\", *yyssp, yystate);",
  917. diff -c -r unix/test/error.tab.c amiga/test/error.tab.c
  918. *** unix/test/error.tab.c    Sun Aug 19 16:20:43 1990
  919. --- amiga/test/error.tab.c    Mon Jun  4 00:42:01 1990
  920. ***************
  921. *** 1,5 ****
  922.   #ifndef lint
  923. ! char yysccsid[] = "@(#)yaccpar    1.4 (Berkeley) 02/25/90";
  924.   #endif
  925.   #define YYERRCODE 256
  926.   short yylhs[] = {                                        -1,
  927. --- 1,5 ----
  928.   #ifndef lint
  929. ! char yysccsid[] = "@(#)yaccpar    1.5 (Berkeley) 06/03/90";
  930.   #endif
  931.   #define YYERRCODE 256
  932.   short yylhs[] = {                                        -1,
  933. ***************
  934. *** 214,220 ****
  935.       yym = yylhs[yyn];
  936.       if (yystate == 0 && yym == 0)
  937.       {
  938. ! #ifdef YYDEBUG
  939.           if (yydebug)
  940.               printf("yydebug: after reduction, shifting from state 0 to\
  941.    state %d\n", YYFINAL);
  942. --- 214,220 ----
  943.       yym = yylhs[yyn];
  944.       if (yystate == 0 && yym == 0)
  945.       {
  946. ! #if YYDEBUG
  947.           if (yydebug)
  948.               printf("yydebug: after reduction, shifting from state 0 to\
  949.    state %d\n", YYFINAL);
  950. ***************
  951. *** 244,250 ****
  952.           yystate = yytable[yyn];
  953.       else
  954.           yystate = yydgoto[yym];
  955. ! #ifdef YYDEBUG
  956.       if (yydebug)
  957.           printf("yydebug: after reduction, shifting from state %d \
  958.   to state %d\n", *yyssp, yystate);
  959. --- 244,250 ----
  960.           yystate = yytable[yyn];
  961.       else
  962.           yystate = yydgoto[yym];
  963. ! #if YYDEBUG
  964.       if (yydebug)
  965.           printf("yydebug: after reduction, shifting from state %d \
  966.   to state %d\n", *yyssp, yystate);
  967. diff -c -r unix/test/ftp.tab.c amiga/test/ftp.tab.c
  968. *** unix/test/ftp.tab.c    Sun Aug 19 16:20:55 1990
  969. --- amiga/test/ftp.tab.c    Mon Jun  4 00:42:30 1990
  970. ***************
  971. *** 1,5 ****
  972.   #ifndef lint
  973. ! char yysccsid[] = "@(#)yaccpar    1.4 (Berkeley) 02/25/90";
  974.   #endif
  975.   #line 26 "ftp.y"
  976.   
  977. --- 1,5 ----
  978.   #ifndef lint
  979. ! char yysccsid[] = "@(#)yaccpar    1.5 (Berkeley) 06/03/90";
  980.   #endif
  981.   #line 26 "ftp.y"
  982.   
  983. ***************
  984. *** 7,18 ****
  985.   static char sccsid[] = "@(#)ftpcmd.y    5.20.1.1 (Berkeley) 3/2/89";
  986.   #endif /* not lint */
  987.   
  988. ! #include <sys//param.h>
  989. ! #include <sys//socket.h>
  990.   
  991. ! #include <netinet//in.h>
  992.   
  993. ! #include <arpa//ftp.h>
  994.   
  995.   #include <stdio.h>
  996.   #include <signal.h>
  997. --- 7,18 ----
  998.   static char sccsid[] = "@(#)ftpcmd.y    5.20.1.1 (Berkeley) 3/2/89";
  999.   #endif /* not lint */
  1000.   
  1001. ! #include <sys/param.h>
  1002. ! #include <sys/socket.h>
  1003.   
  1004. ! #include <netinet/in.h>
  1005.   
  1006. ! #include <arpa/ftp.h>
  1007.   
  1008.   #include <stdio.h>
  1009.   #include <signal.h>
  1010. ***************
  1011. *** 20,26 ****
  1012.   #include <pwd.h>
  1013.   #include <setjmp.h>
  1014.   #include <syslog.h>
  1015. ! #include <sys//stat.h>
  1016.   #include <time.h>
  1017.   
  1018.   extern    struct sockaddr_in data_dest;
  1019. --- 20,26 ----
  1020.   #include <pwd.h>
  1021.   #include <setjmp.h>
  1022.   #include <syslog.h>
  1023. ! #include <sys/stat.h>
  1024.   #include <time.h>
  1025.   
  1026.   extern    struct sockaddr_in data_dest;
  1027. ***************
  1028. *** 1495,1501 ****
  1029.   case 49:
  1030.   #line 493 "ftp.y"
  1031.    {
  1032. !             *(char **)&(yyval ) = "";
  1033.           }
  1034.   break;
  1035.   case 52:
  1036. --- 1495,1501 ----
  1037.   case 49:
  1038.   #line 493 "ftp.y"
  1039.    {
  1040. !             *(char **)&(yyval) = "";
  1041.           }
  1042.   break;
  1043.   case 52:
  1044. ***************
  1045. *** 1513,1531 ****
  1046.   case 53:
  1047.   #line 516 "ftp.y"
  1048.    {
  1049. !         yyval  = FORM_N;
  1050.       }
  1051.   break;
  1052.   case 54:
  1053.   #line 520 "ftp.y"
  1054.    {
  1055. !         yyval  = FORM_T;
  1056.       }
  1057.   break;
  1058.   case 55:
  1059.   #line 524 "ftp.y"
  1060.    {
  1061. !         yyval  = FORM_C;
  1062.       }
  1063.   break;
  1064.   case 56:
  1065. --- 1513,1531 ----
  1066.   case 53:
  1067.   #line 516 "ftp.y"
  1068.    {
  1069. !         yyval = FORM_N;
  1070.       }
  1071.   break;
  1072.   case 54:
  1073.   #line 520 "ftp.y"
  1074.    {
  1075. !         yyval = FORM_T;
  1076.       }
  1077.   break;
  1078.   case 55:
  1079.   #line 524 "ftp.y"
  1080.    {
  1081. !         yyval = FORM_C;
  1082.       }
  1083.   break;
  1084.   case 56:
  1085. ***************
  1086. *** 1586,1622 ****
  1087.   case 64:
  1088.   #line 572 "ftp.y"
  1089.    {
  1090. !         yyval  = STRU_F;
  1091.       }
  1092.   break;
  1093.   case 65:
  1094.   #line 576 "ftp.y"
  1095.    {
  1096. !         yyval  = STRU_R;
  1097.       }
  1098.   break;
  1099.   case 66:
  1100.   #line 580 "ftp.y"
  1101.    {
  1102. !         yyval  = STRU_P;
  1103.       }
  1104.   break;
  1105.   case 67:
  1106.   #line 586 "ftp.y"
  1107.    {
  1108. !         yyval  = MODE_S;
  1109.       }
  1110.   break;
  1111.   case 68:
  1112.   #line 590 "ftp.y"
  1113.    {
  1114. !         yyval  = MODE_B;
  1115.       }
  1116.   break;
  1117.   case 69:
  1118.   #line 594 "ftp.y"
  1119.    {
  1120. !         yyval  = MODE_C;
  1121.       }
  1122.   break;
  1123.   case 70:
  1124. --- 1586,1622 ----
  1125.   case 64:
  1126.   #line 572 "ftp.y"
  1127.    {
  1128. !         yyval = STRU_F;
  1129.       }
  1130.   break;
  1131.   case 65:
  1132.   #line 576 "ftp.y"
  1133.    {
  1134. !         yyval = STRU_R;
  1135.       }
  1136.   break;
  1137.   case 66:
  1138.   #line 580 "ftp.y"
  1139.    {
  1140. !         yyval = STRU_P;
  1141.       }
  1142.   break;
  1143.   case 67:
  1144.   #line 586 "ftp.y"
  1145.    {
  1146. !         yyval = MODE_S;
  1147.       }
  1148.   break;
  1149.   case 68:
  1150.   #line 590 "ftp.y"
  1151.    {
  1152. !         yyval = MODE_B;
  1153.       }
  1154.   break;
  1155.   case 69:
  1156.   #line 594 "ftp.y"
  1157.    {
  1158. !         yyval = MODE_C;
  1159.       }
  1160.   break;
  1161.   case 70:
  1162. ***************
  1163. *** 1628,1641 ****
  1164.            * This is a valid reply in some cases but not in others.
  1165.            */
  1166.           if (logged_in && yyvsp[0] && strncmp((char *) yyvsp[0], "~", 1) == 0) {
  1167. !             *(char **)&(yyval ) = *glob((char *) yyvsp[0]);
  1168.               if (globerr != NULL) {
  1169.                   reply(550, globerr);
  1170. !                 yyval  = NULL;
  1171.               }
  1172.               free((char *) yyvsp[0]);
  1173.           } else
  1174. !             yyval  = yyvsp[0];
  1175.       }
  1176.   break;
  1177.   case 72:
  1178. --- 1628,1641 ----
  1179.            * This is a valid reply in some cases but not in others.
  1180.            */
  1181.           if (logged_in && yyvsp[0] && strncmp((char *) yyvsp[0], "~", 1) == 0) {
  1182. !             *(char **)&(yyval) = *glob((char *) yyvsp[0]);
  1183.               if (globerr != NULL) {
  1184.                   reply(550, globerr);
  1185. !                 yyval = NULL;
  1186.               }
  1187.               free((char *) yyvsp[0]);
  1188.           } else
  1189. !             yyval = yyvsp[0];
  1190.       }
  1191.   break;
  1192.   case 72:
  1193. ***************
  1194. *** 1660,1666 ****
  1195.               multby *= 8;
  1196.               dec /= 10;
  1197.           }
  1198. !         yyval  = ret;
  1199.       }
  1200.   break;
  1201.   case 73:
  1202. --- 1660,1666 ----
  1203.               multby *= 8;
  1204.               dec /= 10;
  1205.           }
  1206. !         yyval = ret;
  1207.       }
  1208.   break;
  1209.   case 73:
  1210. ***************
  1211. *** 1667,1676 ****
  1212.   #line 647 "ftp.y"
  1213.    {
  1214.           if (logged_in)
  1215. !             yyval  = 1;
  1216.           else {
  1217.               reply(530, "Please login with USER and PASS.");
  1218. !             yyval  = 0;
  1219.           }
  1220.       }
  1221.   break;
  1222. --- 1667,1676 ----
  1223.   #line 647 "ftp.y"
  1224.    {
  1225.           if (logged_in)
  1226. !             yyval = 1;
  1227.           else {
  1228.               reply(530, "Please login with USER and PASS.");
  1229. !             yyval = 0;
  1230.           }
  1231.       }
  1232.   break;
  1233. ***************
  1234. *** 1682,1688 ****
  1235.       yym = yylhs[yyn];
  1236.       if (yystate == 0 && yym == 0)
  1237.       {
  1238. ! #ifdef YYDEBUG
  1239.           if (yydebug)
  1240.               printf("yydebug: after reduction, shifting from state 0 to\
  1241.    state %d\n", YYFINAL);
  1242. --- 1682,1688 ----
  1243.       yym = yylhs[yyn];
  1244.       if (yystate == 0 && yym == 0)
  1245.       {
  1246. ! #if YYDEBUG
  1247.           if (yydebug)
  1248.               printf("yydebug: after reduction, shifting from state 0 to\
  1249.    state %d\n", YYFINAL);
  1250. ***************
  1251. *** 1712,1718 ****
  1252.           yystate = yytable[yyn];
  1253.       else
  1254.           yystate = yydgoto[yym];
  1255. ! #ifdef YYDEBUG
  1256.       if (yydebug)
  1257.           printf("yydebug: after reduction, shifting from state %d \
  1258.   to state %d\n", *yyssp, yystate);
  1259. --- 1712,1718 ----
  1260.           yystate = yytable[yyn];
  1261.       else
  1262.           yystate = yydgoto[yym];
  1263. ! #if YYDEBUG
  1264.       if (yydebug)
  1265.           printf("yydebug: after reduction, shifting from state %d \
  1266.   to state %d\n", *yyssp, yystate);
  1267.