home *** CD-ROM | disk | FTP | other *** search
- /*
- * This code is included by main.c when the macro VMSCMDLN is
- * defined to request a VMS-style command line interface.
- */
- {
- int n;
- char *p, *s, c;
- static char outfnbuf[256];
- static char skelfnbuf[256];
- static char btfnbuf[256];
- static char infnbuf[256];
- static char **infnptr = NULL;
- static int maxn = 0;
- Char clower();
-
- program_name = "flex";
- /*
- * Default values for the various command line parameters and
- * qualifiers should be set in the .CLD file using the DEFAULT
- * and VALUE=(DEFAULT,...) keywords, not here. This allows
- * them to be changed without recompiling any code.
- */
- ddebug = cli_qualifier( "DEBUG", 0 );
- trace = cli_qualifier( "TRACE", 0 );
- interactive = cli_qualifier( "INTERACTIVE", 0 );
- caseins = !cli_qualifier( "CASE_SENSITIVE", 0 );
- gen_line_dirs = cli_qualifier( "LINE", 0);
- performance_report = cli_qualifier( "STATISTICS.PERFORMANCE", 0 )
- ;
- backtrack_report = cli_qualifier( "BACKTRACK_REPORT", 0 );
- spprdflt = !cli_qualifier( "ECHO", 0 );
- printstats = cli_qualifier( "STATISTICS.SUMMARY", 0 );
- fulltbl = cli_qualifier( "TABLES.FAST", 0 );
- fullspd = cli_qualifier( "TABLES.FULL", 0 );
- useecs = cli_qualifier( "TABLES.EQUIVALENCE", 0 );
- usemecs = cli_qualifier( "TABLES.META_EQUIVALENCE", 0 );
- if ( cli_qualifier( "EIGHTBIT", 0 ) ) csize = CSIZE;
- /*
- * In the code below, filenames are converted to lower case. This is
- * most important for the input filenames so that the .c files generated
- * by this version of flex will be identical (including the input file-
- * names that end up in the #line directives) with the .c files generated
- * by the unix version. For the other filenames it's just a matter of
- * consistency of apperance in messages.
- */
- /*
- * Get the names of all the input files, allocating space for them as
- * needed. Pointers to them are kept in an array 'infnptr' that is
- * expanded as needed (though I doubt anybody will have more than 50
- * input files on a command line!).
- */
- for ( n=0; cli_value( "FILENAME", infnbuf, sizeof( infnbuf ) ); n++ ) {
- if (n >= maxn)
- infnptr = (char **)realloc( infnptr,
- sizeof( *infnptr ) * ( maxn+=50 ) );
- s = (char *)malloc( strlen( infnbuf ) + 1 );
- infnptr[n] = s;
- for ( p=infnbuf; c=(*p); p++ )
- *s++ = clower( c );
- }
- num_input_files = n;
- input_files = infnptr;
- /*
- * Get the output file name. This may always have a value
- * if the .CLD file defines it with a default value.
- */
- if ( cli_value( "OUTPUT", outfnbuf, sizeof( outfnbuf ) ) ) {
- for ( p=outfnbuf; c=(*p); p++ ) *p = clower( c );
- outfile = outfnbuf;
- }
- /*
- * Get the skeleton file name. This may always have a
- * value if the .CLD file defines it with a default value.
- */
- if ( cli_value( "SKELETON", skelfnbuf, sizeof( skelfnbuf ) ) ) {
- for ( p=skelfnbuf; c=(*p); p++ ) *p = clower( c );
- skelname = skelfnbuf;
- }
- /*
- * Get the backtracking info file name. This may always have a
- * value if the .CLD file defines it with a default value.
- */
- if ( cli_value( "BACKTRACK_REPORT", btfnbuf, sizeof( btfnbuf ) ) ) {
- for ( p=btfnbuf; c=(*p); p++ ) *p = clower( c );
- backtrack_fn = btfnbuf;
- }
- }
-