outn
outn (" {");
outn (" },\n");
outn (" {");
outn (" },\n");
#define OUT_BEGIN_CODE() outn("m4_ifdef( [[M4_YY_IN_HEADER]],,[[")
#define OUT_END_CODE() outn("]])")
extern void outn PROTO ((const char *));
outn("m4_ifdef( [[M4_YY_USES_REJECT]],\n[[");
outn("]])");
outn("m4_ifdef( [[M4_YY_USE_LINENO]],[[");
outn("/* Table of booleans, true if rule could match eol. */");
outn("");
outn(str);
outn("]])");
outn("m4_ifdef( [[M4_YY_USES_REJECT]],\n[[");
outn("static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;");
outn("static char *yy_full_match;");
outn("static int yy_lp;");
outn("static int yy_looking_for_trail_begin = 0;");
outn("static int yy_full_lp;");
outn("static int *yy_full_state;");
outn("#define REJECT \\");
outn("{ \\");
outn("*yy_cp = YY_G(yy_hold_char); /* undo effects of setting up yytext */ \\");
outn("yy_cp = YY_G(yy_full_match); /* restore poss. backed-over text */ \\");
outn("YY_G(yy_lp) = YY_G(yy_full_lp); /* restore orig. accepting pos. */ \\");
outn("YY_G(yy_state_ptr) = YY_G(yy_full_state); /* restore orig. state */ \\");
outn("yy_current_state = *YY_G(yy_state_ptr); /* restore curr. state */ \\");
outn("++YY_G(yy_lp); \\");
outn("goto find_rule; \\");
outn("}");
outn("]])\n");
outn("/* The intent behind this definition is that it'll catch");
outn(" * any uses of REJECT which flex missed.");
outn(" */");
outn("#define REJECT reject_used_but_not_detected");
outn("#ifndef YYLMAX");
outn("#define YYLMAX 8192");
outn("#endif\n");
outn("char yytext[YYLMAX];");
outn("char *yytext_ptr;");
outn("char *yytext;");
outn("\terrno=0; \\");
outn("\twhile ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \\");
outn("\t{ \\");
outn("\t\tif( errno != EINTR) \\");
outn("\t\t{ \\");
outn("\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\");
outn("\t\t\tbreak; \\");
outn("\t\t} \\");
outn("\t\terrno=0; \\");
outn("\t\tclearerr(yyin); \\");
outn("\t}\\");
outn("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
outn("\t\t{ \\");
outn("\t\tint c = '*'; \\");
outn("\t\tsize_t n; \\");
outn("\t\tfor ( n = 0; n < max_size && \\");
outn("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
outn("\t\t\tbuf[n] = (char) c; \\");
outn("\t\tif ( c == '\\n' ) \\");
outn("\t\t\tbuf[n++] = (char) c; \\");
outn("\t\tif ( c == EOF && ferror( yyin ) ) \\");
outn("\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\");
outn("\t\tresult = n; \\");
outn("\t\t} \\");
outn("\telse \\");
outn("\t\t{ \\");
outn("\t\terrno=0; \\");
outn("\t\twhile ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\");
outn("\t\t\t{ \\");
outn("\t\t\tif( errno != EINTR) \\");
outn("\t\t\t\t{ \\");
outn("\t\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\");
outn("\t\t\t\tbreak; \\");
outn("\t\t\t\t} \\");
outn("\t\t\terrno=0; \\");
outn("\t\t\tclearerr(yyin); \\");
outn("\t\t\t} \\");
outn("\t\t}\\");
outn("yy_match:");
outn("m4_ifdef( [[M4_YY_USE_LINENO]],[[");
outn("]])");
outn("else");
outn("static yyconst struct yy_trans_info *yy_transition = 0;");
outn(" };\n");
outn("static yyconst struct yy_trans_info **yy_start_state_list =0;");
outn(" {");
outn("find_rule: /* we branch to this label when backing up */");
outn("\n#define yywrap(yyscanner) 1");
outn("\n#define yywrap() 1");
outn("#define YY_SKIP_YYWRAP");
outn("\n#define FLEX_DEBUG");
outn("typedef unsigned char YY_CHAR;");
outn("typedef char YY_CHAR;");
outn("#define yytext_ptr yytext");
outn("#define YY_INTERACTIVE");
outn("#define YY_STDINIT");
outn(yy_stdinit);
outn(yy_nostdinit);
outn("typedef yyconst struct yy_trans_info *yy_state_type;");
outn("typedef int yy_state_type;");
outn("#define YY_FLEX_LEX_COMPAT");
outn("extern int yylineno;");
outn("int yylineno = 1;");
outn("\n#include <FlexLexer.h>");
outn("\nint yyFlexLexer::yywrap() { return 1; }");
outn("int yyFlexLexer::yylex()");
outn("\t{");
outn("\tLexerError( \"yyFlexLexer::yylex invoked but %option yyclass used\" );");
outn("\treturn 0;");
outn("\t}");
outn("extern char yytext[];\n");
outn("#define yytext_ptr yytext_r");
outn("extern char *yytext;");
outn("#define yytext_ptr yytext");
outn((char *) top_buf.elts);
outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n");
outn((char *) (userdef_buf.elts));
outn(" } ;\n");
outn((char *) (yydmap_buf.elts));
outn(buf);