home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / FLEX / FLEX-2.4 / FLEX-2 / flex-2.4.7 / MISC / VMS / VMS.more-stuff / vmscmdln.c < prev   
Encoding:
C/C++ Source or Header  |  1990-11-26  |  3.2 KB  |  88 lines

  1. /*
  2.  *    This code is included by main.c when the macro VMSCMDLN is 
  3.  *    defined to request a VMS-style command line interface.
  4.  */
  5. {
  6.     int n;
  7.     char *p, *s, c;
  8.     static char outfnbuf[256];
  9.     static char skelfnbuf[256];
  10.     static char btfnbuf[256];
  11.     static char infnbuf[256];
  12.     static char **infnptr = NULL;
  13.     static int maxn = 0;
  14.     Char clower();
  15.  
  16.     program_name    =  "flex";
  17. /*
  18.  *  Default values for the various command line parameters and
  19.  *  qualifiers should be set in the .CLD file using the DEFAULT
  20.  *  and VALUE=(DEFAULT,...) keywords, not here.   This allows
  21.  *  them to be changed without recompiling any code.
  22.  */
  23.     ddebug         =  cli_qualifier( "DEBUG", 0 );
  24.     trace        =  cli_qualifier( "TRACE", 0 );
  25.     interactive     =  cli_qualifier( "INTERACTIVE", 0 );
  26.     caseins         = !cli_qualifier( "CASE_SENSITIVE", 0 );
  27.     gen_line_dirs     =  cli_qualifier( "LINE", 0);
  28.     performance_report     =  cli_qualifier( "STATISTICS.PERFORMANCE", 0 )
  29. ;
  30.     backtrack_report    =  cli_qualifier( "BACKTRACK_REPORT", 0 );
  31.     spprdflt         = !cli_qualifier( "ECHO", 0 );
  32.     printstats         =  cli_qualifier( "STATISTICS.SUMMARY", 0 );
  33.     fulltbl        =  cli_qualifier( "TABLES.FAST", 0 );
  34.     fullspd        =  cli_qualifier( "TABLES.FULL", 0 );
  35.     useecs          =  cli_qualifier( "TABLES.EQUIVALENCE", 0 );
  36.     usemecs        =  cli_qualifier( "TABLES.META_EQUIVALENCE", 0 );
  37.     if ( cli_qualifier( "EIGHTBIT", 0 ) ) csize = CSIZE;
  38. /*
  39.  *  In the code below, filenames are converted to lower case.  This is
  40.  *  most important for the input filenames so that the .c files generated
  41.  *  by this version of flex will be identical (including the input file-
  42.  *  names that end up in the #line directives) with the .c files generated
  43.  *  by the unix version.  For the other filenames it's just a matter of
  44.  *  consistency of apperance in messages.
  45.  */
  46. /*
  47.  *  Get the names of all the input files, allocating space for them as
  48.  *  needed.  Pointers to them are kept in an array 'infnptr' that is
  49.  *  expanded as needed (though I doubt anybody will have more than 50
  50.  *  input files on a command line!).
  51.  */
  52.     for ( n=0; cli_value( "FILENAME", infnbuf, sizeof( infnbuf ) ); n++ ) {
  53.     if (n >= maxn) 
  54.         infnptr = (char **)realloc( infnptr,
  55.                     sizeof( *infnptr ) * ( maxn+=50 ) );
  56.     s = (char *)malloc( strlen( infnbuf ) + 1 );
  57.     infnptr[n] = s;
  58.     for ( p=infnbuf; c=(*p); p++ )
  59.         *s++ = clower( c ); 
  60.     }
  61.     num_input_files = n;
  62.     input_files = infnptr;
  63. /*
  64.  *  Get the output file name.  This may always have a value
  65.  *  if the .CLD file defines it with a default value.
  66.  */
  67.     if ( cli_value( "OUTPUT", outfnbuf, sizeof( outfnbuf ) ) ) {
  68.     for ( p=outfnbuf; c=(*p); p++ ) *p = clower( c );  
  69.     outfile = outfnbuf;
  70.     }
  71. /*
  72.  *  Get the skeleton file name.  This may always have a 
  73.  *  value if the .CLD file defines it with a default value.
  74.  */
  75.     if ( cli_value( "SKELETON", skelfnbuf, sizeof( skelfnbuf ) ) ) {
  76.     for ( p=skelfnbuf; c=(*p); p++ ) *p = clower( c ); 
  77.     skelname = skelfnbuf;
  78.     }
  79. /*
  80.  *  Get the backtracking info file name.  This may always have a 
  81.  *  value if the .CLD file defines it with a default value.
  82.  */
  83.     if ( cli_value( "BACKTRACK_REPORT", btfnbuf, sizeof( btfnbuf ) ) ) {
  84.     for ( p=btfnbuf; c=(*p); p++ ) *p = clower( c ); 
  85.     backtrack_fn = btfnbuf;
  86.     }
  87.    }
  88.