1 /* flex - tool to generate fast lexical analyzers */
4 * Copyright (c) 1990 The Regents of the University of California.
7 * This code is derived from software contributed to Berkeley by
10 * The United States Government has rights in this work pursuant
11 * to contract no. DE-AC03-76SF00098 between the United States
12 * Department of Energy and the University of California.
14 * Redistribution and use in source and binary forms are permitted provided
15 * that: (1) source distributions retain this entire copyright notice and
16 * comment, and (2) distributions including binaries display the following
17 * acknowledgement: ``This product includes software developed by the
18 * University of California, Berkeley and its contributors'' in the
19 * documentation or other materials provided with the distribution and in
20 * all advertising materials mentioning features or use of this software.
21 * Neither the name of the University nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28 * @(#) Copyright (c) 1990 The Regents of the University of California. All rights reserved.
29 * $Header: /home/daffy/u0/vern/flex/RCS/main.c,v 2.64 96/05/25 20:42:42 vern Exp $
32 /* $Header: /home/daffy/u0/vern/flex/RCS/main.c,v 2.64 96/05/25 20:42:42 vern Exp $ */
33 /* $FreeBSD: src/usr.bin/lex/main.c,v 1.7 1999/10/27 07:56:45 obrien Exp $ */
34 /* $DragonFly: src/usr.bin/lex/main.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */
40 static char flex_version[] = FLEX_VERSION;
43 /* declare functions that have forward references */
45 void flexinit PROTO((int, char**));
46 void readin PROTO((void));
47 void set_up_initial_allocations PROTO((void));
49 #ifdef NEED_ARGV_FIXUP
50 extern void argv_fixup PROTO((int *, char ***));
54 /* these globals are all defined and commented in flexdef.h */
55 int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;
56 int interactive, caseins, lex_compat, do_yylineno, useecs, fulltbl, usemecs;
57 int fullspd, gen_line_dirs, performance_report, backing_up_report;
58 int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap, csize;
59 int yymore_used, reject, real_reject, continued_action, in_rule;
60 int yymore_really_used, reject_really_used;
61 int datapos, dataline, linenum, out_linenum;
62 FILE *skelfile = NULL;
65 int action_size, defs1_offset, prolog_offset, action_offset, action_index;
66 char *infilename = NULL, *outfilename = NULL;
68 char *prefix, *yyclass;
69 int do_stdinit, use_stdout;
70 int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
71 int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
72 int current_mns, current_max_rules;
73 int num_rules, num_eof_rules, default_rule, lastnfa;
74 int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
75 int *accptnum, *assoc_rule, *state_type;
76 int *rule_type, *rule_linenum, *rule_useful;
77 int current_state_type;
78 int variable_trailing_context_rules;
79 int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
80 int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
81 int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs, tecfwd[CSIZE + 1];
82 int tecbck[CSIZE + 1];
83 int lastsc, *scset, *scbol, *scxclu, *sceof;
86 int current_max_dfa_size, current_max_xpairs;
87 int current_max_template_xpairs, current_max_dfas;
88 int lastdfa, *nxt, *chk, *tnxt;
89 int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
90 union dfaacc_union *dfaacc;
91 int *accsiz, *dhash, numas;
92 int numsnpairs, jambase, jamstate;
93 int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
94 int current_maxccls, current_max_ccl_tbl_size;
97 int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
98 int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
99 int num_backing_up, bol_needed;
100 FILE *backing_up_file;
101 int end_of_buffer_state;
105 /* Make sure program_name is initialized so we don't crash if writing
106 * out an error message before getting the program name from argv[0].
108 char *program_name = "flex";
110 #ifndef SHORT_FILE_NAMES
111 static char *outfile_template = "lex.%s.%s";
112 static char *backing_name = "lex.backup";
114 static char *outfile_template = "lex%s.%s";
115 static char *backing_name = "lex.bck";
123 extern unsigned _stklen = 16384;
126 static char outfile_path[MAXLINE];
127 static int outfile_created = 0;
128 static char *skelname = NULL;
131 int main(int argc, char **argv)
136 argc = ccommand( &argv );
138 #ifdef NEED_ARGV_FIXUP
139 argv_fixup( &argc, &argv );
142 flexinit( argc, argv );
148 for ( i = 1; i <= num_rules; ++i )
149 if ( ! rule_useful[i] && i != default_rule )
150 line_warning( _( "rule cannot be matched" ),
153 if ( spprdflt && ! reject && rule_useful[default_rule] )
155 _( "-s option given but default rule can be matched" ),
156 rule_linenum[default_rule] );
158 /* Generate the C state transition tables from the DFA. */
161 /* Note, flexend does not return. It exits with its argument
166 return 0; /* keep compilers/lint happy */
170 /* check_options - check user-specified options */
172 void check_options(void)
179 flexerror( _( "Can't use -+ with -l option" ) );
181 if ( fulltbl || fullspd )
182 flexerror( _( "Can't use -f or -F with -l option" ) );
184 /* Don't rely on detecting use of yymore() and REJECT,
185 * just assume they'll be used.
187 yymore_really_used = reject_really_used = true;
189 yytext_is_array = true;
195 /* This should really be "maintain_backup_tables = true" */
196 reject_really_used = true;
198 if ( csize == unspecified )
200 if ( (fulltbl || fullspd) && ! useecs )
201 csize = DEFAULT_CSIZE;
206 if ( interactive == unspecified )
208 if ( fulltbl || fullspd )
214 if ( fulltbl || fullspd )
218 _( "-Cf/-CF and -Cm don't make sense together" ) );
221 flexerror( _( "-Cf/-CF and -I are incompatible" ) );
225 _( "-Cf/-CF are incompatible with lex-compatibility mode" ) );
229 _( "-Cf/-CF and %option yylineno are incompatible" ) );
231 if ( fulltbl && fullspd )
232 flexerror( _( "-Cf and -CF are mutually exclusive" ) );
235 if ( C_plus_plus && fullspd )
236 flexerror( _( "Can't use -+ with -CF option" ) );
238 if ( C_plus_plus && yytext_is_array )
240 warn( _( "%array incompatible with -+ option" ) );
241 yytext_is_array = false;
245 { /* Set up doubly-linked equivalence classes. */
247 /* We loop all the way up to csize, since ecgroup[csize] is
248 * the position used for NUL characters.
252 for ( i = 2; i <= csize; ++i )
258 nextecm[csize] = NIL;
263 /* Put everything in its own equivalence class. */
264 for ( i = 1; i <= csize; ++i )
267 nextecm[i] = BAD_SUBSCRIPT; /* to catch errors */
275 if ( ! did_outfilename )
284 sprintf( outfile_path, outfile_template,
287 outfilename = outfile_path;
290 prev_stdout = freopen( outfilename, "w", stdout );
292 if ( prev_stdout == NULL )
293 lerrsf( _( "could not create %s" ), outfilename );
298 if ( skelname && (skelfile = fopen( skelname, "r" )) == NULL )
299 lerrsf( _( "can't open skeleton file %s" ), skelname );
301 if ( strcmp( prefix, "yy" ) )
303 #define GEN_PREFIX(name) out_str3( "#define yy%s %s%s\n", name, prefix, name )
305 GEN_PREFIX( "FlexLexer" );
308 GEN_PREFIX( "_create_buffer" );
309 GEN_PREFIX( "_delete_buffer" );
310 GEN_PREFIX( "_scan_buffer" );
311 GEN_PREFIX( "_scan_string" );
312 GEN_PREFIX( "_scan_bytes" );
313 GEN_PREFIX( "_flex_debug" );
314 GEN_PREFIX( "_init_buffer" );
315 GEN_PREFIX( "_flush_buffer" );
316 GEN_PREFIX( "_load_buffer_state" );
317 GEN_PREFIX( "_switch_to_buffer" );
319 GEN_PREFIX( "leng" );
322 GEN_PREFIX( "restart" );
323 GEN_PREFIX( "text" );
326 GEN_PREFIX( "lineno" );
330 GEN_PREFIX( "wrap" );
335 if ( did_outfilename )
336 line_directive_out( stdout, 0 );
342 /* flexend - terminate flex
345 * This routine does not return.
348 void flexend(int exit_status)
353 if ( skelfile != NULL )
355 if ( ferror( skelfile ) )
356 lerrsf( _( "input error reading skeleton file %s" ),
359 else if ( fclose( skelfile ) )
360 lerrsf( _( "error closing skeleton file %s" ),
364 if ( exit_status != 0 && outfile_created )
366 if ( ferror( stdout ) )
367 lerrsf( _( "error writing output file %s" ),
370 else if ( fclose( stdout ) )
371 lerrsf( _( "error closing output file %s" ),
374 else if ( unlink( outfilename ) )
375 lerrsf( _( "error deleting output file %s" ),
379 if ( backing_up_report && backing_up_file )
381 if ( num_backing_up == 0 )
382 fprintf( backing_up_file, _( "No backing up.\n" ) );
383 else if ( fullspd || fulltbl )
384 fprintf( backing_up_file,
385 _( "%d backing up (non-accepting) states.\n" ),
388 fprintf( backing_up_file,
389 _( "Compressed tables always back up.\n" ) );
391 if ( ferror( backing_up_file ) )
392 lerrsf( _( "error writing backup file %s" ),
395 else if ( fclose( backing_up_file ) )
396 lerrsf( _( "error closing backup file %s" ),
402 fprintf( stderr, _( "%s version %s usage statistics:\n" ),
403 program_name, flex_version );
405 fprintf( stderr, _( " scanner options: -" ) );
409 if ( backing_up_report )
417 if ( performance_report > 0 )
419 if ( performance_report > 1 )
426 putc( 'v', stderr ); /* always true! */
429 if ( interactive == false )
431 if ( interactive == true )
433 if ( ! gen_line_dirs )
438 if ( csize == unspecified )
439 /* We encountered an error fairly early on, so csize
440 * never got specified. Define it now, to prevent
441 * bogus table sizes being written out below.
450 fprintf( stderr, " -C" );
465 if ( did_outfilename )
466 fprintf( stderr, " -o%s", outfilename );
469 fprintf( stderr, " -S%s", skelname );
471 if ( strcmp( prefix, "yy" ) )
472 fprintf( stderr, " -P%s", prefix );
474 putc( '\n', stderr );
476 fprintf( stderr, _( " %d/%d NFA states\n" ),
477 lastnfa, current_mns );
478 fprintf( stderr, _( " %d/%d DFA states (%d words)\n" ),
479 lastdfa, current_max_dfas, totnst );
480 fprintf( stderr, _( " %d rules\n" ),
481 num_rules + num_eof_rules - 1 /* - 1 for def. rule */ );
483 if ( num_backing_up == 0 )
484 fprintf( stderr, _( " No backing up\n" ) );
485 else if ( fullspd || fulltbl )
487 _( " %d backing-up (non-accepting) states\n" ),
491 _( " Compressed tables always back-up\n" ) );
495 _( " Beginning-of-line patterns used\n" ) );
497 fprintf( stderr, _( " %d/%d start conditions\n" ), lastsc,
500 _( " %d epsilon states, %d double epsilon states\n" ),
504 fprintf( stderr, _( " no character classes\n" ) );
507 _( " %d/%d character classes needed %d/%d words of storage, %d reused\n" ),
508 lastccl, current_maxccls,
509 cclmap[lastccl] + ccllen[lastccl],
510 current_max_ccl_tbl_size, cclreuse );
512 fprintf( stderr, _( " %d state/nextstate pairs created\n" ),
514 fprintf( stderr, _( " %d/%d unique/duplicate transitions\n" ),
519 tblsiz = lastdfa * numecs;
520 fprintf( stderr, _( " %d table entries\n" ), tblsiz );
525 tblsiz = 2 * (lastdfa + numtemps) + 2 * tblend;
528 _( " %d/%d base-def entries created\n" ),
529 lastdfa + numtemps, current_max_dfas );
531 _( " %d/%d (peak %d) nxt-chk entries created\n" ),
532 tblend, current_max_xpairs, peakpairs );
534 _( " %d/%d (peak %d) template nxt-chk entries created\n" ),
536 current_max_template_xpairs,
538 fprintf( stderr, _( " %d empty table entries\n" ),
540 fprintf( stderr, _( " %d protos created\n" ),
543 _( " %d templates created, %d uses\n" ),
549 tblsiz = tblsiz + csize;
551 _( " %d/%d equivalence classes created\n" ),
557 tblsiz = tblsiz + numecs;
559 _( " %d/%d meta-equivalence classes created\n" ),
564 _( " %d (%d saved) hash collisions, %d DFAs equal\n" ),
565 hshcol, hshsave, dfaeql );
566 fprintf( stderr, _( " %d sets of reallocations needed\n" ),
568 fprintf( stderr, _( " %d total table entries needed\n" ),
576 /* flexinit - initialize flex */
578 void flexinit(int argc, char **argv)
583 printstats = syntaxerror = trace = spprdflt = caseins = false;
584 lex_compat = C_plus_plus = backing_up_report = ddebug = fulltbl = false;
585 fullspd = long_align = nowarn = yymore_used = continued_action = false;
586 do_yylineno = yytext_is_array = in_rule = reject = do_stdinit = false;
587 yymore_really_used = reject_really_used = unspecified;
588 interactive = csize = unspecified;
589 do_yywrap = gen_line_dirs = usemecs = useecs = true;
590 performance_report = 0;
594 use_read = use_stdout = false;
598 /* Initialize dynamic array for holding the rule actions. */
599 action_size = 2048; /* default size of action array in bytes */
600 action_array = allocate_character_array( action_size );
601 defs1_offset = prolog_offset = action_offset = action_index = 0;
602 action_array[0] = '\0';
604 program_name = argv[0];
606 if ( program_name[0] != '\0' &&
607 program_name[strlen( program_name ) - 1] == '+' )
611 for ( --argc, ++argv; argc ; --argc, ++argv )
615 if ( arg[0] != '-' || arg[1] == '\0' )
620 if ( ! strcmp( arg, "--help" ) )
623 else if ( ! strcmp( arg, "--version" ) )
626 else if ( ! strcmp( arg, "--" ) )
627 { /* end of options */
634 for ( i = 1; arg[i] != '\0'; ++i )
646 backing_up_report = true;
655 _( "-C flag must be given separately" ) );
665 for ( ++i; arg[i] != '\0'; ++i )
695 _( "unknown -C option '%c'" ),
707 useecs = usemecs = false;
708 use_read = fulltbl = true;
712 useecs = usemecs = false;
713 use_read = fullspd = true;
734 gen_line_dirs = false;
738 /* Stupid do-nothing deprecated
746 _( "-o flag must be given separately" ) );
748 outfilename = arg + i + 1;
755 _( "-P flag must be given separately" ) );
757 prefix = arg + i + 1;
761 ++performance_report;
767 _( "-S flag must be given separately" ) );
769 skelname = arg + i + 1;
789 printf( _( "%s version %s\n" ),
790 program_name, flex_version );
807 _( "%s: unknown flag '%c'. For usage, try\n\t%s --help\n" ),
808 program_name, (int) arg[i],
813 /* Used by -C, -S, -o, and -P flags in lieu of a "continue 2"
819 num_input_files = argc;
821 set_input_file( num_input_files > 0 ? input_files[0] : NULL );
823 lastccl = lastsc = lastdfa = lastnfa = 0;
824 num_rules = num_eof_rules = default_rule = 0;
825 numas = numsnpairs = tmpuses = 0;
826 numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst = 0;
827 numuniq = numdup = hshsave = eofseen = datapos = dataline = 0;
828 num_backing_up = onesp = numprots = 0;
829 variable_trailing_context_rules = bol_needed = false;
831 out_linenum = linenum = sectnum = 1;
834 /* Used in mkprot() so that the first proto goes in slot 1
835 * of the proto queue.
839 set_up_initial_allocations();
843 /* readin - read in the rules section of the input file(s) */
847 static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;";
848 static char yy_nostdinit[] =
849 "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;";
851 line_directive_out( (FILE *) 0, 1 );
855 pinpoint_message( _( "fatal parse error" ) );
862 if ( backing_up_report )
864 backing_up_file = fopen( backing_name, "w" );
865 if ( backing_up_file == NULL )
867 _( "could not create backing-up info file %s" ),
872 backing_up_file = NULL;
874 if ( yymore_really_used == true )
876 else if ( yymore_really_used == false )
879 if ( reject_really_used == true )
881 else if ( reject_really_used == false )
884 if ( performance_report > 0 )
889 _( "-l AT&T lex compatibility option entails a large performance penalty\n" ) );
891 _( " and may be the actual source of other reported performance penalties\n" ) );
894 else if ( do_yylineno )
897 _( "%%option yylineno entails a large performance penalty\n" ) );
900 if ( performance_report > 1 )
904 _( "-I (interactive) entails a minor performance penalty\n" ) );
908 _( "yymore() entails a minor performance penalty\n" ) );
913 _( "REJECT entails a large performance penalty\n" ) );
915 if ( variable_trailing_context_rules )
917 _( "Variable trailing context rules entail a large performance penalty\n" ) );
923 if ( variable_trailing_context_rules )
926 if ( (fulltbl || fullspd) && reject )
930 _( "REJECT cannot be used with -f or -F" ) );
931 else if ( do_yylineno )
933 _( "%option yylineno cannot be used with -f or -F" ) );
936 _( "variable trailing context rules cannot be used with -f or -F" ) );
940 outn( "\n#define YY_USES_REJECT" );
944 outn( "\n#define yywrap() 1" );
945 outn( "#define YY_SKIP_YYWRAP" );
949 outn( "\n#define FLEX_DEBUG" );
952 outn( "typedef unsigned char YY_CHAR;" );
954 outn( "typedef char YY_CHAR;" );
958 outn( "#define yytext_ptr yytext" );
961 outn( "#define YY_INTERACTIVE" );
968 outn( "#ifdef VMS" );
969 outn( "#ifndef __VMS_POSIX" );
970 outn( yy_nostdinit );
980 outn( yy_nostdinit );
984 outn( "typedef yyconst struct yy_trans_info *yy_state_type;" );
985 else if ( ! C_plus_plus )
986 outn( "typedef int yy_state_type;" );
989 outn( "\n#define FLEX_DEBUG" );
992 outn( "#define YY_FLEX_LEX_COMPAT" );
994 if ( do_yylineno && ! C_plus_plus )
996 outn( "extern int yylineno;" );
997 outn( "int yylineno = 1;" );
1002 outn( "\n#include <FlexLexer.h>" );
1006 outn( "int yyFlexLexer::yylex()" );
1009 "\tLexerError( \"yyFlexLexer::yylex invoked but %option yyclass used\" );" );
1010 outn( "\treturn 0;" );
1013 out_str( "\n#define YY_DECL int %s::yylex()\n",
1020 if ( yytext_is_array )
1021 outn( "extern char yytext[];\n" );
1025 outn( "extern char *yytext;" );
1026 outn( "#define yytext_ptr yytext" );
1031 _( "%option yyclass only meaningful for C++ scanners" ) );
1035 numecs = cre8ecs( nextecm, ecgroup, csize );
1039 /* Now map the equivalence class for NUL to its expected place. */
1040 ecgroup[0] = ecgroup[csize];
1041 NUL_ec = ABS( ecgroup[0] );
1048 /* set_up_initial_allocations - allocate memory for internal tables */
1050 void set_up_initial_allocations(void)
1052 current_mns = INITIAL_MNS;
1053 firstst = allocate_integer_array( current_mns );
1054 lastst = allocate_integer_array( current_mns );
1055 finalst = allocate_integer_array( current_mns );
1056 transchar = allocate_integer_array( current_mns );
1057 trans1 = allocate_integer_array( current_mns );
1058 trans2 = allocate_integer_array( current_mns );
1059 accptnum = allocate_integer_array( current_mns );
1060 assoc_rule = allocate_integer_array( current_mns );
1061 state_type = allocate_integer_array( current_mns );
1063 current_max_rules = INITIAL_MAX_RULES;
1064 rule_type = allocate_integer_array( current_max_rules );
1065 rule_linenum = allocate_integer_array( current_max_rules );
1066 rule_useful = allocate_integer_array( current_max_rules );
1068 current_max_scs = INITIAL_MAX_SCS;
1069 scset = allocate_integer_array( current_max_scs );
1070 scbol = allocate_integer_array( current_max_scs );
1071 scxclu = allocate_integer_array( current_max_scs );
1072 sceof = allocate_integer_array( current_max_scs );
1073 scname = allocate_char_ptr_array( current_max_scs );
1075 current_maxccls = INITIAL_MAX_CCLS;
1076 cclmap = allocate_integer_array( current_maxccls );
1077 ccllen = allocate_integer_array( current_maxccls );
1078 cclng = allocate_integer_array( current_maxccls );
1080 current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE;
1081 ccltbl = allocate_Character_array( current_max_ccl_tbl_size );
1083 current_max_dfa_size = INITIAL_MAX_DFA_SIZE;
1085 current_max_xpairs = INITIAL_MAX_XPAIRS;
1086 nxt = allocate_integer_array( current_max_xpairs );
1087 chk = allocate_integer_array( current_max_xpairs );
1089 current_max_template_xpairs = INITIAL_MAX_TEMPLATE_XPAIRS;
1090 tnxt = allocate_integer_array( current_max_template_xpairs );
1092 current_max_dfas = INITIAL_MAX_DFAS;
1093 base = allocate_integer_array( current_max_dfas );
1094 def = allocate_integer_array( current_max_dfas );
1095 dfasiz = allocate_integer_array( current_max_dfas );
1096 accsiz = allocate_integer_array( current_max_dfas );
1097 dhash = allocate_integer_array( current_max_dfas );
1098 dss = allocate_int_ptr_array( current_max_dfas );
1099 dfaacc = allocate_dfaacc_union( current_max_dfas );
1101 nultrans = (int *) 0;
1110 _( "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" ),
1112 fprintf( f, _( "\t[--help --version] [file ...]\n" ) );
1114 fprintf( f, _( "\t-b generate backing-up information to %s\n" ),
1116 fprintf( f, _( "\t-c do-nothing POSIX option\n" ) );
1117 fprintf( f, _( "\t-d turn on debug mode in generated scanner\n" ) );
1118 fprintf( f, _( "\t-f generate fast, large scanner\n" ) );
1119 fprintf( f, _( "\t-h produce this help message\n" ) );
1120 fprintf( f, _( "\t-i generate case-insensitive scanner\n" ) );
1121 fprintf( f, _( "\t-l maximal compatibility with original lex\n" ) );
1122 fprintf( f, _( "\t-n do-nothing POSIX option\n" ) );
1123 fprintf( f, _( "\t-p generate performance report to stderr\n" ) );
1125 _( "\t-s suppress default rule to ECHO unmatched text\n" ) );
1127 if ( ! did_outfilename )
1129 sprintf( outfile_path, outfile_template,
1130 prefix, C_plus_plus ? "cc" : "c" );
1131 outfilename = outfile_path;
1135 _( "\t-t write generated scanner on stdout instead of %s\n" ),
1139 _( "\t-v write summary of scanner statistics to f\n" ) );
1140 fprintf( f, _( "\t-w do not generate warnings\n" ) );
1141 fprintf( f, _( "\t-B generate batch scanner (opposite of -I)\n" ) );
1143 _( "\t-F use alternative fast scanner representation\n" ) );
1145 _( "\t-I generate interactive scanner (opposite of -B)\n" ) );
1146 fprintf( f, _( "\t-L suppress #line directives in scanner\n" ) );
1147 fprintf( f, _( "\t-T %s should run in trace mode\n" ), program_name );
1148 fprintf( f, _( "\t-V report %s version\n" ), program_name );
1149 fprintf( f, _( "\t-7 generate 7-bit scanner\n" ) );
1150 fprintf( f, _( "\t-8 generate 8-bit scanner\n" ) );
1151 fprintf( f, _( "\t-+ generate C++ scanner class\n" ) );
1152 fprintf( f, _( "\t-? produce this help message\n" ) );
1154 _( "\t-C specify degree of table compression (default is -Cem):\n" ) );
1156 _( "\t\t-Ca trade off larger tables for better memory alignment\n" ) );
1157 fprintf( f, _( "\t\t-Ce construct equivalence classes\n" ) );
1159 _( "\t\t-Cf do not compress scanner tables; use -f representation\n" ) );
1161 _( "\t\t-CF do not compress scanner tables; use -F representation\n" ) );
1162 fprintf( f, _( "\t\t-Cm construct meta-equivalence classes\n" ) );
1164 _( "\t\t-Cr use read() instead of stdio for scanner input\n" ) );
1165 fprintf( f, _( "\t-o specify output filename\n" ) );
1166 fprintf( f, _( "\t-P specify scanner prefix other than \"yy\"\n" ) );
1167 fprintf( f, _( "\t-S specify skeleton file\n" ) );
1168 fprintf( f, _( "\t--help produce this help message\n" ) );
1169 fprintf( f, _( "\t--version report %s version\n" ), program_name );