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 $ */
39 static char flex_version[] = FLEX_VERSION;
42 /* declare functions that have forward references */
44 void flexinit PROTO((int, char**));
45 void readin PROTO((void));
46 void set_up_initial_allocations PROTO((void));
48 #ifdef NEED_ARGV_FIXUP
49 extern void argv_fixup PROTO((int *, char ***));
53 /* these globals are all defined and commented in flexdef.h */
54 int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;
55 int interactive, caseins, lex_compat, do_yylineno, useecs, fulltbl, usemecs;
56 int fullspd, gen_line_dirs, performance_report, backing_up_report;
57 int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap, csize;
58 int yymore_used, reject, real_reject, continued_action, in_rule;
59 int yymore_really_used, reject_really_used;
60 int datapos, dataline, linenum, out_linenum;
61 FILE *skelfile = NULL;
64 int action_size, defs1_offset, prolog_offset, action_offset, action_index;
65 char *infilename = NULL, *outfilename = NULL;
67 char *prefix, *yyclass;
68 int do_stdinit, use_stdout;
69 int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
70 int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
71 int current_mns, current_max_rules;
72 int num_rules, num_eof_rules, default_rule, lastnfa;
73 int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
74 int *accptnum, *assoc_rule, *state_type;
75 int *rule_type, *rule_linenum, *rule_useful;
76 int current_state_type;
77 int variable_trailing_context_rules;
78 int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
79 int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
80 int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs, tecfwd[CSIZE + 1];
81 int tecbck[CSIZE + 1];
82 int lastsc, *scset, *scbol, *scxclu, *sceof;
85 int current_max_dfa_size, current_max_xpairs;
86 int current_max_template_xpairs, current_max_dfas;
87 int lastdfa, *nxt, *chk, *tnxt;
88 int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
89 union dfaacc_union *dfaacc;
90 int *accsiz, *dhash, numas;
91 int numsnpairs, jambase, jamstate;
92 int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
93 int current_maxccls, current_max_ccl_tbl_size;
96 int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
97 int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
98 int num_backing_up, bol_needed;
99 FILE *backing_up_file;
100 int end_of_buffer_state;
104 /* Make sure program_name is initialized so we don't crash if writing
105 * out an error message before getting the program name from argv[0].
107 char *program_name = "flex";
109 #ifndef SHORT_FILE_NAMES
110 static char *outfile_template = "lex.%s.%s";
111 static char *backing_name = "lex.backup";
113 static char *outfile_template = "lex%s.%s";
114 static char *backing_name = "lex.bck";
117 static char outfile_path[MAXLINE];
118 static int outfile_created = 0;
119 static char *skelname = NULL;
122 int main(int argc, char **argv)
126 #ifdef NEED_ARGV_FIXUP
127 argv_fixup( &argc, &argv );
130 flexinit( argc, argv );
136 for ( i = 1; i <= num_rules; ++i )
137 if ( ! rule_useful[i] && i != default_rule )
138 line_warning( _( "rule cannot be matched" ),
141 if ( spprdflt && ! reject && rule_useful[default_rule] )
143 _( "-s option given but default rule can be matched" ),
144 rule_linenum[default_rule] );
146 /* Generate the C state transition tables from the DFA. */
149 /* Note, flexend does not return. It exits with its argument
154 return 0; /* keep compilers/lint happy */
158 /* check_options - check user-specified options */
160 void check_options(void)
167 flexerror( _( "Can't use -+ with -l option" ) );
169 if ( fulltbl || fullspd )
170 flexerror( _( "Can't use -f or -F with -l option" ) );
172 /* Don't rely on detecting use of yymore() and REJECT,
173 * just assume they'll be used.
175 yymore_really_used = reject_really_used = true;
177 yytext_is_array = true;
183 /* This should really be "maintain_backup_tables = true" */
184 reject_really_used = true;
186 if ( csize == unspecified )
188 if ( (fulltbl || fullspd) && ! useecs )
189 csize = DEFAULT_CSIZE;
194 if ( interactive == unspecified )
196 if ( fulltbl || fullspd )
202 if ( fulltbl || fullspd )
206 _( "-Cf/-CF and -Cm don't make sense together" ) );
209 flexerror( _( "-Cf/-CF and -I are incompatible" ) );
213 _( "-Cf/-CF are incompatible with lex-compatibility mode" ) );
217 _( "-Cf/-CF and %option yylineno are incompatible" ) );
219 if ( fulltbl && fullspd )
220 flexerror( _( "-Cf and -CF are mutually exclusive" ) );
223 if ( C_plus_plus && fullspd )
224 flexerror( _( "Can't use -+ with -CF option" ) );
226 if ( C_plus_plus && yytext_is_array )
228 warn( _( "%array incompatible with -+ option" ) );
229 yytext_is_array = false;
233 { /* Set up doubly-linked equivalence classes. */
235 /* We loop all the way up to csize, since ecgroup[csize] is
236 * the position used for NUL characters.
240 for ( i = 2; i <= csize; ++i )
246 nextecm[csize] = NIL;
251 /* Put everything in its own equivalence class. */
252 for ( i = 1; i <= csize; ++i )
255 nextecm[i] = BAD_SUBSCRIPT; /* to catch errors */
263 if ( ! did_outfilename )
272 sprintf( outfile_path, outfile_template,
275 outfilename = outfile_path;
278 prev_stdout = freopen( outfilename, "w", stdout );
280 if ( prev_stdout == NULL )
281 lerrsf( _( "could not create %s" ), outfilename );
286 if ( skelname && (skelfile = fopen( skelname, "r" )) == NULL )
287 lerrsf( _( "can't open skeleton file %s" ), skelname );
289 if ( strcmp( prefix, "yy" ) )
291 #define GEN_PREFIX(name) out_str3( "#define yy%s %s%s\n", name, prefix, name )
293 GEN_PREFIX( "FlexLexer" );
296 GEN_PREFIX( "_create_buffer" );
297 GEN_PREFIX( "_delete_buffer" );
298 GEN_PREFIX( "_scan_buffer" );
299 GEN_PREFIX( "_scan_string" );
300 GEN_PREFIX( "_scan_bytes" );
301 GEN_PREFIX( "_flex_debug" );
302 GEN_PREFIX( "_init_buffer" );
303 GEN_PREFIX( "_flush_buffer" );
304 GEN_PREFIX( "_load_buffer_state" );
305 GEN_PREFIX( "_switch_to_buffer" );
307 GEN_PREFIX( "leng" );
310 GEN_PREFIX( "restart" );
311 GEN_PREFIX( "text" );
314 GEN_PREFIX( "lineno" );
318 GEN_PREFIX( "wrap" );
323 if ( did_outfilename )
324 line_directive_out( stdout, 0 );
330 /* flexend - terminate flex
333 * This routine does not return.
336 void flexend(int exit_status)
341 if ( skelfile != NULL )
343 if ( ferror( skelfile ) )
344 lerrsf( _( "input error reading skeleton file %s" ),
347 else if ( fclose( skelfile ) )
348 lerrsf( _( "error closing skeleton file %s" ),
352 if ( exit_status != 0 && outfile_created )
354 if ( ferror( stdout ) )
355 lerrsf( _( "error writing output file %s" ),
358 else if ( fclose( stdout ) )
359 lerrsf( _( "error closing output file %s" ),
362 else if ( unlink( outfilename ) )
363 lerrsf( _( "error deleting output file %s" ),
367 if ( backing_up_report && backing_up_file )
369 if ( num_backing_up == 0 )
370 fprintf( backing_up_file, _( "No backing up.\n" ) );
371 else if ( fullspd || fulltbl )
372 fprintf( backing_up_file,
373 _( "%d backing up (non-accepting) states.\n" ),
376 fprintf( backing_up_file,
377 _( "Compressed tables always back up.\n" ) );
379 if ( ferror( backing_up_file ) )
380 lerrsf( _( "error writing backup file %s" ),
383 else if ( fclose( backing_up_file ) )
384 lerrsf( _( "error closing backup file %s" ),
390 fprintf( stderr, _( "%s version %s usage statistics:\n" ),
391 program_name, flex_version );
393 fprintf( stderr, _( " scanner options: -" ) );
397 if ( backing_up_report )
405 if ( performance_report > 0 )
407 if ( performance_report > 1 )
414 putc( 'v', stderr ); /* always true! */
417 if ( interactive == false )
419 if ( interactive == true )
421 if ( ! gen_line_dirs )
426 if ( csize == unspecified )
427 /* We encountered an error fairly early on, so csize
428 * never got specified. Define it now, to prevent
429 * bogus table sizes being written out below.
438 fprintf( stderr, " -C" );
453 if ( did_outfilename )
454 fprintf( stderr, " -o%s", outfilename );
457 fprintf( stderr, " -S%s", skelname );
459 if ( strcmp( prefix, "yy" ) )
460 fprintf( stderr, " -P%s", prefix );
462 putc( '\n', stderr );
464 fprintf( stderr, _( " %d/%d NFA states\n" ),
465 lastnfa, current_mns );
466 fprintf( stderr, _( " %d/%d DFA states (%d words)\n" ),
467 lastdfa, current_max_dfas, totnst );
468 fprintf( stderr, _( " %d rules\n" ),
469 num_rules + num_eof_rules - 1 /* - 1 for def. rule */ );
471 if ( num_backing_up == 0 )
472 fprintf( stderr, _( " No backing up\n" ) );
473 else if ( fullspd || fulltbl )
475 _( " %d backing-up (non-accepting) states\n" ),
479 _( " Compressed tables always back-up\n" ) );
483 _( " Beginning-of-line patterns used\n" ) );
485 fprintf( stderr, _( " %d/%d start conditions\n" ), lastsc,
488 _( " %d epsilon states, %d double epsilon states\n" ),
492 fprintf( stderr, _( " no character classes\n" ) );
495 _( " %d/%d character classes needed %d/%d words of storage, %d reused\n" ),
496 lastccl, current_maxccls,
497 cclmap[lastccl] + ccllen[lastccl],
498 current_max_ccl_tbl_size, cclreuse );
500 fprintf( stderr, _( " %d state/nextstate pairs created\n" ),
502 fprintf( stderr, _( " %d/%d unique/duplicate transitions\n" ),
507 tblsiz = lastdfa * numecs;
508 fprintf( stderr, _( " %d table entries\n" ), tblsiz );
513 tblsiz = 2 * (lastdfa + numtemps) + 2 * tblend;
516 _( " %d/%d base-def entries created\n" ),
517 lastdfa + numtemps, current_max_dfas );
519 _( " %d/%d (peak %d) nxt-chk entries created\n" ),
520 tblend, current_max_xpairs, peakpairs );
522 _( " %d/%d (peak %d) template nxt-chk entries created\n" ),
524 current_max_template_xpairs,
526 fprintf( stderr, _( " %d empty table entries\n" ),
528 fprintf( stderr, _( " %d protos created\n" ),
531 _( " %d templates created, %d uses\n" ),
537 tblsiz = tblsiz + csize;
539 _( " %d/%d equivalence classes created\n" ),
545 tblsiz = tblsiz + numecs;
547 _( " %d/%d meta-equivalence classes created\n" ),
552 _( " %d (%d saved) hash collisions, %d DFAs equal\n" ),
553 hshcol, hshsave, dfaeql );
554 fprintf( stderr, _( " %d sets of reallocations needed\n" ),
556 fprintf( stderr, _( " %d total table entries needed\n" ),
564 /* flexinit - initialize flex */
566 void flexinit(int argc, char **argv)
571 printstats = syntaxerror = trace = spprdflt = caseins = false;
572 lex_compat = C_plus_plus = backing_up_report = ddebug = fulltbl = false;
573 fullspd = long_align = nowarn = yymore_used = continued_action = false;
574 do_yylineno = yytext_is_array = in_rule = reject = do_stdinit = false;
575 yymore_really_used = reject_really_used = unspecified;
576 interactive = csize = unspecified;
577 do_yywrap = gen_line_dirs = usemecs = useecs = true;
578 performance_report = 0;
582 use_read = use_stdout = false;
586 /* Initialize dynamic array for holding the rule actions. */
587 action_size = 2048; /* default size of action array in bytes */
588 action_array = allocate_character_array( action_size );
589 defs1_offset = prolog_offset = action_offset = action_index = 0;
590 action_array[0] = '\0';
592 program_name = argv[0];
594 if ( program_name[0] != '\0' &&
595 program_name[strlen( program_name ) - 1] == '+' )
599 for ( --argc, ++argv; argc ; --argc, ++argv )
603 if ( arg[0] != '-' || arg[1] == '\0' )
608 if ( ! strcmp( arg, "--help" ) )
611 else if ( ! strcmp( arg, "--version" ) )
614 else if ( ! strcmp( arg, "--" ) )
615 { /* end of options */
622 for ( i = 1; arg[i] != '\0'; ++i )
634 backing_up_report = true;
643 _( "-C flag must be given separately" ) );
653 for ( ++i; arg[i] != '\0'; ++i )
683 _( "unknown -C option '%c'" ),
695 useecs = usemecs = false;
696 use_read = fulltbl = true;
700 useecs = usemecs = false;
701 use_read = fullspd = true;
722 gen_line_dirs = false;
726 /* Stupid do-nothing deprecated
734 _( "-o flag must be given separately" ) );
736 outfilename = arg + i + 1;
743 _( "-P flag must be given separately" ) );
745 prefix = arg + i + 1;
749 ++performance_report;
755 _( "-S flag must be given separately" ) );
757 skelname = arg + i + 1;
777 printf( _( "%s version %s\n" ),
778 program_name, flex_version );
795 _( "%s: unknown flag '%c'. For usage, try\n\t%s --help\n" ),
796 program_name, (int) arg[i],
801 /* Used by -C, -S, -o, and -P flags in lieu of a "continue 2"
807 num_input_files = argc;
809 set_input_file( num_input_files > 0 ? input_files[0] : NULL );
811 lastccl = lastsc = lastdfa = lastnfa = 0;
812 num_rules = num_eof_rules = default_rule = 0;
813 numas = numsnpairs = tmpuses = 0;
814 numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst = 0;
815 numuniq = numdup = hshsave = eofseen = datapos = dataline = 0;
816 num_backing_up = onesp = numprots = 0;
817 variable_trailing_context_rules = bol_needed = false;
819 out_linenum = linenum = sectnum = 1;
822 /* Used in mkprot() so that the first proto goes in slot 1
823 * of the proto queue.
827 set_up_initial_allocations();
831 /* readin - read in the rules section of the input file(s) */
835 static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;";
836 static char yy_nostdinit[] =
837 "FILE *yyin = NULL, *yyout = NULL;";
839 line_directive_out( NULL, 1 );
843 pinpoint_message( _( "fatal parse error" ) );
850 if ( backing_up_report )
852 backing_up_file = fopen( backing_name, "w" );
853 if ( backing_up_file == NULL )
855 _( "could not create backing-up info file %s" ),
860 backing_up_file = NULL;
862 if ( yymore_really_used == true )
864 else if ( yymore_really_used == false )
867 if ( reject_really_used == true )
869 else if ( reject_really_used == false )
872 if ( performance_report > 0 )
877 _( "-l AT&T lex compatibility option entails a large performance penalty\n" ) );
879 _( " and may be the actual source of other reported performance penalties\n" ) );
882 else if ( do_yylineno )
885 _( "%%option yylineno entails a large performance penalty\n" ) );
888 if ( performance_report > 1 )
892 _( "-I (interactive) entails a minor performance penalty\n" ) );
896 _( "yymore() entails a minor performance penalty\n" ) );
901 _( "REJECT entails a large performance penalty\n" ) );
903 if ( variable_trailing_context_rules )
905 _( "Variable trailing context rules entail a large performance penalty\n" ) );
911 if ( variable_trailing_context_rules )
914 if ( (fulltbl || fullspd) && reject )
918 _( "REJECT cannot be used with -f or -F" ) );
919 else if ( do_yylineno )
921 _( "%option yylineno cannot be used with -f or -F" ) );
924 _( "variable trailing context rules cannot be used with -f or -F" ) );
928 outn( "\n#define YY_USES_REJECT" );
932 outn( "\n#define yywrap() 1" );
933 outn( "#define YY_SKIP_YYWRAP" );
937 outn( "\n#define FLEX_DEBUG" );
940 outn( "typedef unsigned char YY_CHAR;" );
942 outn( "typedef char YY_CHAR;" );
946 outn( "#define yytext_ptr yytext" );
949 outn( "#define YY_INTERACTIVE" );
960 outn( yy_nostdinit );
964 outn( "typedef yyconst struct yy_trans_info *yy_state_type;" );
965 else if ( ! C_plus_plus )
966 outn( "typedef int yy_state_type;" );
969 outn( "\n#define FLEX_DEBUG" );
972 outn( "#define YY_FLEX_LEX_COMPAT" );
974 if ( do_yylineno && ! C_plus_plus )
976 outn( "extern int yylineno;" );
977 outn( "int yylineno = 1;" );
982 outn( "\n#include <FlexLexer.h>" );
986 outn( "int yyFlexLexer::yylex()" );
989 "\tLexerError( \"yyFlexLexer::yylex invoked but %option yyclass used\" );" );
990 outn( "\treturn 0;" );
993 out_str( "\n#define YY_DECL int %s::yylex()\n",
1000 if ( yytext_is_array )
1001 outn( "extern char yytext[];\n" );
1005 outn( "extern char *yytext;" );
1006 outn( "#define yytext_ptr yytext" );
1011 _( "%option yyclass only meaningful for C++ scanners" ) );
1015 numecs = cre8ecs( nextecm, ecgroup, csize );
1019 /* Now map the equivalence class for NUL to its expected place. */
1020 ecgroup[0] = ecgroup[csize];
1021 NUL_ec = ABS( ecgroup[0] );
1028 /* set_up_initial_allocations - allocate memory for internal tables */
1030 void set_up_initial_allocations(void)
1032 current_mns = INITIAL_MNS;
1033 firstst = allocate_integer_array( current_mns );
1034 lastst = allocate_integer_array( current_mns );
1035 finalst = allocate_integer_array( current_mns );
1036 transchar = allocate_integer_array( current_mns );
1037 trans1 = allocate_integer_array( current_mns );
1038 trans2 = allocate_integer_array( current_mns );
1039 accptnum = allocate_integer_array( current_mns );
1040 assoc_rule = allocate_integer_array( current_mns );
1041 state_type = allocate_integer_array( current_mns );
1043 current_max_rules = INITIAL_MAX_RULES;
1044 rule_type = allocate_integer_array( current_max_rules );
1045 rule_linenum = allocate_integer_array( current_max_rules );
1046 rule_useful = allocate_integer_array( current_max_rules );
1048 current_max_scs = INITIAL_MAX_SCS;
1049 scset = allocate_integer_array( current_max_scs );
1050 scbol = allocate_integer_array( current_max_scs );
1051 scxclu = allocate_integer_array( current_max_scs );
1052 sceof = allocate_integer_array( current_max_scs );
1053 scname = allocate_char_ptr_array( current_max_scs );
1055 current_maxccls = INITIAL_MAX_CCLS;
1056 cclmap = allocate_integer_array( current_maxccls );
1057 ccllen = allocate_integer_array( current_maxccls );
1058 cclng = allocate_integer_array( current_maxccls );
1060 current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE;
1061 ccltbl = allocate_Character_array( current_max_ccl_tbl_size );
1063 current_max_dfa_size = INITIAL_MAX_DFA_SIZE;
1065 current_max_xpairs = INITIAL_MAX_XPAIRS;
1066 nxt = allocate_integer_array( current_max_xpairs );
1067 chk = allocate_integer_array( current_max_xpairs );
1069 current_max_template_xpairs = INITIAL_MAX_TEMPLATE_XPAIRS;
1070 tnxt = allocate_integer_array( current_max_template_xpairs );
1072 current_max_dfas = INITIAL_MAX_DFAS;
1073 base = allocate_integer_array( current_max_dfas );
1074 def = allocate_integer_array( current_max_dfas );
1075 dfasiz = allocate_integer_array( current_max_dfas );
1076 accsiz = allocate_integer_array( current_max_dfas );
1077 dhash = allocate_integer_array( current_max_dfas );
1078 dss = allocate_int_ptr_array( current_max_dfas );
1079 dfaacc = allocate_dfaacc_union( current_max_dfas );
1090 _( "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" ),
1092 fprintf( f, _( "\t[--help --version] [file ...]\n" ) );
1094 fprintf( f, _( "\t-b generate backing-up information to %s\n" ),
1096 fprintf( f, _( "\t-c do-nothing POSIX option\n" ) );
1097 fprintf( f, _( "\t-d turn on debug mode in generated scanner\n" ) );
1098 fprintf( f, _( "\t-f generate fast, large scanner\n" ) );
1099 fprintf( f, _( "\t-h produce this help message\n" ) );
1100 fprintf( f, _( "\t-i generate case-insensitive scanner\n" ) );
1101 fprintf( f, _( "\t-l maximal compatibility with original lex\n" ) );
1102 fprintf( f, _( "\t-n do-nothing POSIX option\n" ) );
1103 fprintf( f, _( "\t-p generate performance report to stderr\n" ) );
1105 _( "\t-s suppress default rule to ECHO unmatched text\n" ) );
1107 if ( ! did_outfilename )
1109 sprintf( outfile_path, outfile_template,
1110 prefix, C_plus_plus ? "cc" : "c" );
1111 outfilename = outfile_path;
1115 _( "\t-t write generated scanner on stdout instead of %s\n" ),
1119 _( "\t-v write summary of scanner statistics to f\n" ) );
1120 fprintf( f, _( "\t-w do not generate warnings\n" ) );
1121 fprintf( f, _( "\t-B generate batch scanner (opposite of -I)\n" ) );
1123 _( "\t-F use alternative fast scanner representation\n" ) );
1125 _( "\t-I generate interactive scanner (opposite of -B)\n" ) );
1126 fprintf( f, _( "\t-L suppress #line directives in scanner\n" ) );
1127 fprintf( f, _( "\t-T %s should run in trace mode\n" ), program_name );
1128 fprintf( f, _( "\t-V report %s version\n" ), program_name );
1129 fprintf( f, _( "\t-7 generate 7-bit scanner\n" ) );
1130 fprintf( f, _( "\t-8 generate 8-bit scanner\n" ) );
1131 fprintf( f, _( "\t-+ generate C++ scanner class\n" ) );
1132 fprintf( f, _( "\t-? produce this help message\n" ) );
1134 _( "\t-C specify degree of table compression (default is -Cem):\n" ) );
1136 _( "\t\t-Ca trade off larger tables for better memory alignment\n" ) );
1137 fprintf( f, _( "\t\t-Ce construct equivalence classes\n" ) );
1139 _( "\t\t-Cf do not compress scanner tables; use -f representation\n" ) );
1141 _( "\t\t-CF do not compress scanner tables; use -F representation\n" ) );
1142 fprintf( f, _( "\t\t-Cm construct meta-equivalence classes\n" ) );
1144 _( "\t\t-Cr use read() instead of stdio for scanner input\n" ) );
1145 fprintf( f, _( "\t-o specify output filename\n" ) );
1146 fprintf( f, _( "\t-P specify scanner prefix other than \"yy\"\n" ) );
1147 fprintf( f, _( "\t-S specify skeleton file\n" ) );
1148 fprintf( f, _( "\t--help produce this help message\n" ) );
1149 fprintf( f, _( "\t--version report %s version\n" ), program_name );