home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / unix / flex.fix < prev    next >
Encoding:
Text File  |  1989-02-23  |  6.5 KB  |  286 lines

  1. #!/bin/sh
  2. # this is a Bourne shell script that shows the mods I did to go from flex
  3. # MSC5/DOS -scott garfinkle
  4. mv fastskeldef.h  fastskel.h
  5. mv flex.fastskel  fastskel.flx
  6. mv flex.skel  skel.flx
  7. mv flexskelcom.h  fskelcom.h
  8. mv flexskeldef.h  flexskel.h
  9. mv scan.c.dist  scan-c.dst
  10. patch2 << 'DONE-WITH-PATCHES'
  11. *** fastskel.flx    Fri Nov 18 13:21:13 1988
  12. --- pc/fastskel.flx    Sat Dec 31 09:49:17 1988
  13. ***************
  14. *** 2,8 ****
  15.   
  16.   #define FLEX_FAST_SKEL
  17.   
  18. ! #include "fastskeldef.h"
  19.   
  20.   %% section 1 code and the definition of YY_TRANS_OFFSET_TYPE, if needed, go here
  21.   
  22. --- 2,8 ----
  23.   
  24.   #define FLEX_FAST_SKEL
  25.   
  26. ! #include "fastskel.h"
  27.   
  28.   %% section 1 code and the definition of YY_TRANS_OFFSET_TYPE, if needed, go here
  29.   
  30. *** fastskel.h    Fri Nov 18 13:21:03 1988
  31. --- pc/fastskel.h    Sat Dec 31 09:49:18 1988
  32. ***************
  33. *** 1,6 ****
  34.   /*  macro definitions for fast/full-table  C/FTL programs generated by flex */
  35.   
  36. ! #include "flexskelcom.h"
  37.   
  38.   #define YY_END_OF_BUFFER_CHAR 0
  39.   
  40. --- 1,6 ----
  41.   /*  macro definitions for fast/full-table  C/FTL programs generated by flex */
  42.   
  43. ! #include "fskelcom.h"
  44.   
  45.   #define YY_END_OF_BUFFER_CHAR 0
  46.   
  47. *** flex.1    Fri Nov 18 13:21:09 1988
  48. --- pc/flex.1    Sat Dec 31 09:49:19 1988
  49. ***************
  50. *** 427,445 ****
  51.   without requiring a separate library to link to.
  52.   .SH FILES
  53.   .TP
  54. ! .I flex.skel
  55.   skeleton scanner
  56.   .TP
  57. ! .I flex.fastskel
  58.   skeleton scanner for -f and -F
  59.   .TP
  60. ! .I flexskelcom.h
  61.   common definitions for skeleton files
  62.   .TP
  63. ! .I flexskeldef.h
  64.   definitions for compressed skeleton file
  65.   .TP
  66. ! .I fastskeldef.h
  67.   definitions for -f, -F skeleton file
  68.   .SH "SEE ALSO"
  69.   .LP
  70. --- 427,445 ----
  71.   without requiring a separate library to link to.
  72.   .SH FILES
  73.   .TP
  74. ! .I flexskel.flx
  75.   skeleton scanner
  76.   .TP
  77. ! .I fastskel.flx
  78.   skeleton scanner for -f and -F
  79.   .TP
  80. ! .I fskelcom.h
  81.   common definitions for skeleton files
  82.   .TP
  83. ! .I flexskel.h
  84.   definitions for compressed skeleton file
  85.   .TP
  86. ! .I fastskel.h
  87.   definitions for -f, -F skeleton file
  88.   .SH "SEE ALSO"
  89.   .LP
  90. *** flexdef.h    Fri Nov 18 13:21:23 1988
  91. --- pc/flexdef.h    Sat Dec 31 09:49:24 1988
  92. ***************
  93. *** 21,34 ****
  94.   
  95.   #include <stdio.h>
  96.   
  97.   #ifdef SV
  98.   #include <string.h>
  99.   #define bzero(s, n) memset((char *)(s), '\000', (unsigned)(n))
  100.   #else
  101.   #include <strings.h>
  102.   #endif
  103.   
  104. - char *sprintf(); /* keep lint happy */
  105.   
  106.   
  107.   /* maximum line length we'll have to deal with */
  108. --- 21,38 ----
  109.   
  110.   #include <stdio.h>
  111.   
  112. + #ifdef MSC5
  113. + # define SV
  114. + #endif
  115.   #ifdef SV
  116.   #include <string.h>
  117.   #define bzero(s, n) memset((char *)(s), '\000', (unsigned)(n))
  118.   #else
  119.   #include <strings.h>
  120. + char *sprintf(); /* keep lint happy */
  121.   #endif
  122.   
  123.   
  124.   
  125.   /* maximum line length we'll have to deal with */
  126. ***************
  127. *** 44,55 ****
  128.   #define false 0
  129.   
  130.   
  131. ! #ifndef DEFAULT_SKELETON_FILE
  132. ! #define DEFAULT_SKELETON_FILE "flex.skel"
  133.   #endif
  134.   
  135. ! #ifndef FAST_SKELETON_FILE
  136. ! #define FAST_SKELETON_FILE "flex.fastskel"
  137.   #endif
  138.   
  139.   /* special nxt[] action number for the "at the end of the input buffer" state */
  140. --- 48,63 ----
  141.   #define false 0
  142.   
  143.   
  144. ! #ifndef FLEXFILE
  145. ! #define FLEXFILE "lex.yy.c"
  146.   #endif
  147.   
  148. ! #ifndef DEFAULT_SKEL
  149. ! #define DEFAULT_SKEL "flex.skel"
  150. ! #endif
  151. ! #ifndef FAST_SKEL
  152. ! #define FAST_SKEL "flex.fastskel"
  153.   #endif
  154.   
  155.   /* special nxt[] action number for the "at the end of the input buffer" state */
  156. *** flexskel.h    Fri Nov 18 13:21:28 1988
  157. --- pc/flexskel.h    Sat Dec 31 09:49:25 1988
  158. ***************
  159. *** 1,6 ****
  160.   /* macro definitions for compressed-table C/FTL programs generated by flex */
  161.   
  162. ! #include "flexskelcom.h"
  163.   
  164.   /* reinitializes everything except the current start condition.  The last
  165.    * input character is set to a newline so an initial beginning-of-line
  166. --- 1,6 ----
  167.   /* macro definitions for compressed-table C/FTL programs generated by flex */
  168.   
  169. ! #include "fskelcom.h"
  170.   
  171.   /* reinitializes everything except the current start condition.  The last
  172.    * input character is set to a newline so an initial beginning-of-line
  173. *** main.c    Fri Nov 18 13:21:33 1988
  174. --- pc/main.c    Sat Dec 31 09:49:26 1988
  175. ***************
  176. *** 347,363 ****
  177.       skelname = skeleton_name_storage;
  178.   
  179.       if ( fullspd || fulltbl )
  180. !         (void) strcpy( skelname, FAST_SKELETON_FILE );
  181.       else
  182. !         (void) strcpy( skelname, DEFAULT_SKELETON_FILE );
  183.       }
  184.   
  185.       if ( ! use_stdout )
  186.       {
  187. !     FILE *prev_stdout = freopen( "lex.yy.c", "w", stdout );
  188.   
  189.       if ( prev_stdout == NULL )
  190. !         flexerror( "could not create lex.yy.c" );
  191.       }
  192.   
  193.       if ( argc )
  194. --- 347,363 ----
  195.       skelname = skeleton_name_storage;
  196.   
  197.       if ( fullspd || fulltbl )
  198. !         (void) strcpy( skelname, FAST_SKEL );
  199.       else
  200. !         (void) strcpy( skelname, DEFAULT_SKEL );
  201.       }
  202.   
  203.       if ( ! use_stdout )
  204.       {
  205. !     FILE *prev_stdout = freopen( FLEXFILE, "w", stdout );
  206.   
  207.       if ( prev_stdout == NULL )
  208. !         flexerror( "could not create " FLEXFILE );
  209.       }
  210.   
  211.       if ( argc )
  212. ***************
  213. *** 380,386 ****
  214.       /* initialize the statistics */
  215.       starttime = gettime();
  216.   
  217. !     if ( (skelfile = fopen( skelname, "r" )) == NULL )
  218.       lerrsf( "can't open skeleton file %s", skelname );
  219.   
  220.       (void) mktemp( action_file_name );
  221. --- 380,401 ----
  222.       /* initialize the statistics */
  223.       starttime = gettime();
  224.   
  225. !     if ( (skelfile = fopen( skelname, "r" )) == NULL ) {
  226. !         char *getenv(), *ptr;
  227. !     if((ptr = getenv("FLEXPATH")) || (ptr = getenv("INIT"))) {
  228. !         char *malloc();
  229. !         char *newname = malloc(strlen(ptr)+strlen(skelname)+2);
  230. !         strcpy(newname,ptr);
  231. !         ptr = newname+strlen(ptr);
  232. !         *ptr++ = '/';    /* works even in DOS */
  233. !         strcpy(ptr,skelname);
  234. !         skelfile = fopen( newname, "r" );
  235. !         free(newname);
  236. !         }
  237. !     }
  238. !     if(!skelfile)
  239.       lerrsf( "can't open skeleton file %s", skelname );
  240.   
  241.       (void) mktemp( action_file_name );
  242. *** scan-c.dst    Fri Nov 18 13:25:22 1988
  243. --- pc/scan-c.dst    Sat Dec 31 09:49:34 1988
  244. ***************
  245. *** 3,9 ****
  246.   #define FLEX_USE_MECS
  247.   /* A lexical scanner generated by flex */
  248.   
  249. ! #include "flexskeldef.h"
  250.   
  251.   # line 1 "scan.l"
  252.   #define INITIAL 0
  253. --- 3,9 ----
  254.   #define FLEX_USE_MECS
  255.   /* A lexical scanner generated by flex */
  256.   
  257. ! #include "fskeldef.h"
  258.   
  259.   # line 1 "scan.l"
  260.   #define INITIAL 0
  261. *** skel.flx    Fri Nov 18 13:21:17 1988
  262. --- pc/skel.flx    Sat Dec 31 09:49:38 1988
  263. ***************
  264. *** 1,6 ****
  265.   /* A lexical scanner generated by flex */
  266.   
  267. ! #include "flexskeldef.h"
  268.   
  269.   %% section 1 code and data tables for DFA go here
  270.   
  271. --- 1,6 ----
  272.   /* A lexical scanner generated by flex */
  273.   
  274. ! #include "flexskel.h"
  275.   
  276.   %% section 1 code and data tables for DFA go here
  277.   
  278. DONE-WITH-PATCHES'
  279. END--cut here--cut here
  280.  
  281.  
  282.