diff --git a/.gitignore b/.gitignore index daf0ef99..71b32a7d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ flex-*/ libtool m4/ stamp-* +.vscode \ No newline at end of file diff --git a/src/Makefile.am b/src/Makefile.am index b9ead074..1dde5b58 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -64,6 +64,10 @@ endif COMMON_SOURCES = \ buf.c \ ccl.c \ + cpp-backend.c \ + cpp-backend.h \ + c99-backend.c \ + c99-backend.h \ dfa.c \ ecs.c \ filter.c \ @@ -82,6 +86,7 @@ COMMON_SOURCES = \ scanopt.c \ scanopt.h \ skeletons.c \ + skeletons.h \ sym.c \ tables.c \ tables.h \ @@ -119,6 +124,16 @@ SKELINCLUDES = \ c99-flex.h \ go-flex.h +# DO NOT REMOVE - Ignore StackOverflow +# This variable is misnamed and misunderstood. It tells Make that the named +# sources are synchronization points for parallel builds (e.g. -j8). +# If you remove or change this variable without testing large parallel builds, +# make will fail randomly. Stop "fixing" this based on StackOverflow threads, please. +# +BUILT_SOURCES = $(SKELINCLUDES) stage1scan.c stage2scan.c +# +# DO NOT REMOVE + cpp-flex.h: cpp-flex.skl mkskel.sh flexint_shared.h tables_shared.h tables_shared.c $(SHELL) $(srcdir)/mkskel.sh cpp $(srcdir) $(m4) $(VERSION) > $@.tmp $(SHELL) $(srcdir)/chkskel.sh $@.tmp diff --git a/src/c99-backend.c b/src/c99-backend.c new file mode 100644 index 00000000..4e48270e --- /dev/null +++ b/src/c99-backend.c @@ -0,0 +1,459 @@ +/* c99-backend.c - C99 backend file for flex */ + +/* Copyright (c) 1990 The Regents of the University of California. */ +/* All rights reserved. */ + +/* This code is derived from software contributed to Berkeley by */ +/* Vern Paxson. */ + +/* The United States Government has rights in this work pursuant */ +/* to contract no. DE-AC03-76SF00098 between the United States */ +/* Department of Energy and the University of California. */ + +/* This file is part of flex. */ + +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions */ +/* are met: */ + +/* 1. Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* 2. Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ + +/* Neither the name of the University nor the names of its contributors */ +/* may be used to endorse or promote products derived from this software */ +/* without specific prior written permission. */ + +/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ +/* PURPOSE. */ + + +#include "flexdef.h" +#include "c99-backend.h" + +const int C99_BACKEND_MAX_INDENT = 256; + +const char *c99_skel[] = { +#include "c99-flex.h" +0 +}; + +/* For C99, emit the typedef names from stdint.h */ +const char * c99_get_int32_type ( const struct flex_backend_t *b ) { + return "int32_t"; +} + +/* For C99, emit the typedef names from stdint.h */ +static const char * c99_get_int16_type ( const struct flex_backend_t *b ) { + return "int16_t"; +} + +/* Emit the name of the datatype used in the NULTRANS table. + The datatype of the table depends on various option settings + and the skeleton in use. + */ +static const char * c99_get_state_type ( const struct flex_backend_t *b ) { + /* cpp-flex.skl defines transition states as pointers to + struct yy_trans_info when the FULLSPD option is enabled. + Otherwise, it just uses the int32 type. + */ + return (ctrl.fullspd) ? "struct yy_trans_info*" : b->get_int32_type(b); +} + +static const char * c99_get_packed_type (const struct flex_backend_t *b, struct packtype_t *p) { + switch(p->width) { + case 32: return b->get_int32_type(b); + case 16: return b->get_int16_type(b); + default: flexerror("unsupported packed data width requested\n"); + break; + } +} + +/* TODO: Indent? */ +static void c99_open_block_comment ( const struct flex_backend_t *b ) { + fputs("/* ", stdout); +} + +/* TODO: Indent? */ +static void c99_close_block_comment ( const struct flex_backend_t *b ) { + fputs(" */", stdout); +} + +static const char * c99_get_comment ( const struct flex_backend_t *b, const char *c ) { + static const char *format = "/* %s */"; + static char directive[MAXLINE*2] = {0}; + + snprintf(directive, sizeof(directive), format, c); + return directive; +} + +static void c99_record_separator ( const struct flex_backend_t *b ) { + /* Expected to ocurr at the end of a line, so I'm not indenting. */ + fputs("},\n", stdout); +} + +static void c99_column_separator ( const struct flex_backend_t *b ){ + /* Expected to ocurr at the end of a line, so don't indent. */ + fputs(", ", stdout); +} + +static void c99_newline ( const struct flex_backend_t *b ) { + /* Expected to ocurr at the end of a line, so don't indent. */ + fputs("\n", stdout); +} + +static void c99_increase_indent ( const struct flex_backend_t *b ) { + if ( b->indent_level < C99_BACKEND_MAX_INDENT ) { + /* ++ will require more parens to clarify */ + ((struct flex_backend_t *)b)->indent_level += 1; + } +} + +static void c99_decrease_indent ( const struct flex_backend_t *b ) { + if (b->indent_level > 0) { + /* -- will require more parens to clarify */ + ((struct flex_backend_t *)b)->indent_level -= 1; + } +} + +static void c99_indent ( const struct flex_backend_t *b ) { + int i = 0; + while ( i < b->indent_level ) { + fputs("\t", stdout); + ++i; + } +} + +/* Return a format string appropriate for the skeleton language. + The format string will perform an equivalent function to the CPP line directive. + That is, it will tell target language compiler what .l source line the target source + corresponds to when the compiler generates warnings and errors. + + This method does not provide the arguments to the format string. It just provides the string. +*/ +static const char * c99_get_trace_line_format ( const struct flex_backend_t *b ) { + return "#line %d \"%s\"\n"; +} + +/* TODO: indent? */ +static void c99_open_table ( const struct flex_backend_t *b ) { + fputs("{", stdout); +} + +static void c99_continue_table ( const struct flex_backend_t *b ) { + /* Expected to ocurr at the end of a line, so don't indent. */ + fputs("},\n", stdout); +} + +/* TODO: indent? */ +static void c99_close_table ( const struct flex_backend_t *b ) { + fputs("};\n", stdout); +} + +/* Format an entry into a data table. */ +static void c99_format_data_table_entry ( const struct flex_backend_t * b, int t ) { + /* Expected to occur in a block format, so don't indent. */ + fprintf(stdout, "%5d", t); +} + +/* Format an entry from the transition table into the state table. */ +static void c99_format_state_table_entry ( const struct flex_backend_t * b, int t ) { + b->indent(b); + fprintf(stdout, "&yy_transition[%d],\n", t); +} + +/* Generate a case for the main state switch (in C/CXX). + Other target languages may use another selection syntax. Basically, each arm matches + the character under examination, treated as a number. +*/ +static const char * c99_get_normal_state_case_arm ( const struct flex_backend_t *b, int c ) { + static const char *format = "case %d: "; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, c); + return directive; +} + +/* Generate the special case arm for EOF. + This lives in the body of yyinput and determines whether/when to switch to the next buffer. +*/ +static const char * c99_get_eof_state_case_arm ( const struct flex_backend_t *b, const char * const c ) { + static const char *format = "case YY_STATE_EOF(%s): "; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, c); + return directive; +} + +/* Generate the special action FALLTHROUGH. + This is just a comment in C/CXX, but a few languages require a keyword for fallthrough logic. +*/ +static void c99_eof_state_case_fallthrough ( const struct flex_backend_t *b ) { + b->indent(b); + b->comment(b, "FALLTHROUGH"); +} + +/* Generate the special action terminate. */ +static void c99_eof_state_case_terminate ( const struct flex_backend_t *b ) { + b->indent(b); + fputs("yyterminate();\n", stdout); +} + +/* Generate the action preamble. */ +static const char * c99_get_take_yytext( const struct flex_backend_t *b ) { + static const char *directive = "YY_DO_BEFORE_ACTION; /* set up yytext */"; + return directive; +} + +/* Generate the action postamble. */ +static const char * c99_get_release_yytext( const struct flex_backend_t *b ) { + static const char *directive = "*yy_cp = YY_G(yy_hold_char); /* undo effects of setting up yytext */"; + return directive; +} + +/* Generate the buffer rewind sub-action. */ +static const char * c99_get_char_rewind( const struct flex_backend_t *b, int c ) { + static const char *format = "YY_G(yy_c_buf_p) = yy_cp -= %d;"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, c); + return directive; +} + +/* Generate the line rewind sub-action. */ +static const char * c99_get_line_rewind( const struct flex_backend_t *b, int l ) { + static const char *format = "YY_LINENO_REWIND_TO(yy_cp - %d);"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, l); + return directive; +} + +/* Generate the buffer skip sub-action. */ +static const char * c99_get_char_forward( const struct flex_backend_t *b, int c ) { + static const char *format = "YY_G(yy_c_buf_p) = yy_cp = yy_bp + %d;"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, c); + return directive; +} + +/* Generate the line skip sub-action. */ +static const char * c99_get_line_forward( const struct flex_backend_t *b, int l ) { + static const char *format = "YY_LINENO_REWIND_TO(yy_bp + %d);"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, l); + return directive; +} + +/* Define a byte-width constant. */ +static void c99_format_byte_const ( const struct flex_backend_t *b, const char *n, const int c ) { + fprintf(stdout, "#define %s %d\n", n, c); +} + +/* Define a state constant. */ +static void c99_format_state_const ( const struct flex_backend_t *b, const char *n, const int s ) { + fprintf(stdout, "#define %s %d\n", n, s); +} + +/* Define a size constant. + TODO: It would be better if s were unsigned, but Flex currently counts in signed ints. +*/ +static void c99_format_size_const ( const struct flex_backend_t *b, const char *n, const int s ) { + fprintf(stdout, "#define %s %d\n", n, s); +} + +/* Define a uint constant. */ +static void c99_format_uint_const ( const struct flex_backend_t *b, const char *n, const unsigned int u ) { + fprintf(stdout, "#define %s %u\n", n, u); +} + +/* Define a boolean constant. */ +static void c99_format_bool_const ( const struct flex_backend_t *b, const char *n, const int t ){ + fprintf(stdout, "#define %s %d\n", n, t); +} + +/* Define a string constant. */ +static const char * c99_get_const ( const struct flex_backend_t *b, const char *n, const char *v ) { + static const char *format = "#define %s %s\n"; + static char directive[MAXLINE*2] = {0}; + + snprintf(directive, sizeof(directive), format, n, v); + return directive; +} + +/* Define a constant used by the skeleton. */ +static void c99_format_offset_type ( const struct flex_backend_t *b, const char *t ) { + b->format_const(b, "YY_OFFSET_TYPE", t); +} + +/* Define a constant used by the skeleton. */ +static void c99_format_yy_decl ( const struct flex_backend_t *b, const char *d ) { + b->format_const(b, "YY_DECL", d); +} + +/* Define a constant used by the skeleton. */ +static void c99_format_userinit ( const struct flex_backend_t *b, const char *d ) { + b->format_const(b, "YY_USER_INIT", d); +} + +/* Generate the rule_setup preamble. */ +static const char * c99_get_rule_setup ( const struct flex_backend_t *b ) { + static const char *directive = "YY_RULE_SETUP"; + return directive; +} + +/* Generate the user_action constant, if needed. */ +static const char * c99_get_user_preaction ( const struct flex_backend_t *b, const char *d ) { + return b->get_const(b, "YY_USER_ACTION", d); +} + +/* End a state case arm, optionally inserting user postactions. + + TODO: Why can't this use YY_STATE_CASE_BREAK from format_user_postaction? +*/ +static const char * c99_get_state_case_break ( const struct flex_backend_t *b ) { + static const char *directive = "/*LINTED*/break;"; + if (!ctrl.postaction) { + return directive; + } + else { + return ctrl.postaction; + } +} + +/* Generate the definition of the STATE_CASE_BREAK end of action. */ +static const char * c99_get_user_postaction ( const struct flex_backend_t *b, const char *d ) { + if (d != NULL) { + return b->get_const(b, "YY_STATE_CASE_BREAK", d); + } + else { + return b->get_const(b, "YY_STATE_CASE_BREAK", "/*LINTED*/break;"); + } +} + +/* Generate the fatal_error action. */ +static const char * c99_get_fatal_error ( const struct flex_backend_t *b, const char *e ) { + static const char *format = "yypanic(%s, yyscanner);"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, e); + return directive; +} + +/* Generate the echo action. */ +static const char * c99_get_echo ( const struct flex_backend_t *b ) { + static const char *directive = "yyecho();"; + + return directive; +} + +/* Generate the definition of the terminate special action. */ +static const char * c99_get_yyterminate ( const struct flex_backend_t *b, const char *d ) { + static const char * format = "%s /* yyterminate */"; + static char directive[MAXLINE*2] = {0}; + + if (d != NULL) { + snprintf(directive, sizeof(directive), format, d); + return b->get_const(b, "yyterminate", directive); + } + else { + return b->get_const(b, "yyterminate", "return NULL /* yyterminate */"); + } +} + +/* Generate the reject special action. */ +static const char * c99_get_yyreject ( const struct flex_backend_t *b ) { + static const char *directive = "yyreject()"; + return directive; +} + +/* Construct the c99_backend method table. + This follows the definition in skeletons.h. + cpp-backends.h provides a handle to this structure with external linkage. + skeletons.c imports that handle to access these methods. + That module makes this implementation available to others as an opaque singleton. + + Note that indentation level is managed indepentently for each backend. +*/ +struct flex_backend_t c99_backend = { + .skel = c99_skel, + .indent_level = 0, + .get_int32_type = c99_get_int32_type, + .get_int16_type = c99_get_int16_type, + .get_state_type = c99_get_state_type, + .get_packed_type = c99_get_packed_type, + .open_block_comment = c99_open_block_comment, + .close_block_comment = c99_close_block_comment, + .get_comment = c99_get_comment, + .comment = _format_comment, + .record_separator = c99_record_separator, + .column_separator = c99_column_separator, + .newline = c99_newline, + .increase_indent = c99_increase_indent, + .decrease_indent = c99_decrease_indent, + .indent = c99_indent, + .get_trace_line_format = c99_get_trace_line_format, + .line_directive_out = _format_line_directive_out, + .open_table = c99_open_table, + .continue_table = c99_continue_table, + .close_table = c99_close_table, + .verbatim = _verbatim, + .format_data_table_entry = c99_format_data_table_entry, + .format_state_table_entry = c99_format_state_table_entry, + .get_normal_state_case_arm = c99_get_normal_state_case_arm, + .format_normal_state_case_arm = _format_normal_state_case_arm, + .get_eof_state_case_arm = c99_get_eof_state_case_arm, + .format_eof_state_case_arm = _format_eof_state_case_arm, + .eof_state_case_fallthrough = c99_eof_state_case_fallthrough, + .eof_state_case_terminate = c99_eof_state_case_terminate, + .get_take_yytext = c99_get_take_yytext, + .format_take_yytext = _format_take_yytext, + .get_release_yytext = c99_get_release_yytext, + .format_release_yytext = _format_release_yytext, + .get_char_rewind = c99_get_char_rewind, + .format_char_rewind = _format_char_rewind, + .get_line_rewind = c99_get_line_rewind, + .format_line_rewind = _format_line_rewind, + .get_char_forward = c99_get_char_forward, + .format_char_forward = _format_char_forward, + .get_line_forward = c99_get_line_forward, + .format_line_forward = _format_line_forward, + .format_byte_const = c99_format_byte_const, + .format_state_const = c99_format_state_const, + .format_size_const = c99_format_size_const, + .format_uint_const = c99_format_uint_const, + .format_bool_const = c99_format_bool_const, + .get_const = c99_get_const, + .format_const = _format_const, + .format_offset_type = c99_format_offset_type, + .format_yy_decl = c99_format_yy_decl, + .format_userinit = c99_format_userinit, + .get_rule_setup = c99_get_rule_setup, + .format_rule_setup = _format_rule_setup, + .get_user_preaction = c99_get_user_preaction, + .format_user_preaction = _format_user_preaction, + .get_state_case_break = c99_get_state_case_break, + .format_state_case_break = _format_state_case_break, + .get_user_postaction = c99_get_user_postaction, + .format_user_postaction = _format_user_postaction, + .get_fatal_error = c99_get_fatal_error, + .format_fatal_error = _format_fatal_error, + .get_echo = c99_get_echo, + .echo = _echo, + .get_yyterminate = c99_get_yyterminate, + .format_yyterminate = _format_yyterminate, + .get_yyreject = c99_get_yyreject, + .format_yyreject = _format_yyreject, + .filter_define_name = _filter_define_name, + .filter_define_close = _filter_define_close, + .filter_define_vars = _filter_define_vars, + .filter_define_vard = _filter_define_vard, + .filter_call_macro = _filter_call_macro +}; + diff --git a/src/c99-backend.h b/src/c99-backend.h new file mode 100644 index 00000000..da524831 --- /dev/null +++ b/src/c99-backend.h @@ -0,0 +1,47 @@ +/* c99-backend.h - C99 backend header file for flex */ + +/* Copyright (c) 1990 The Regents of the University of California. */ +/* All rights reserved. */ + +/* This code is derived from software contributed to Berkeley by */ +/* Vern Paxson. */ + +/* The United States Government has rights in this work pursuant */ +/* to contract no. DE-AC03-76SF00098 between the United States */ +/* Department of Energy and the University of California. */ + +/* This file is part of flex. */ + +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions */ +/* are met: */ + +/* 1. Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* 2. Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ + +/* Neither the name of the University nor the names of its contributors */ +/* may be used to endorse or promote products derived from this software */ +/* without specific prior written permission. */ + +/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ +/* PURPOSE. */ + + +#ifndef FLEX_C99_BACKEND_H +#define FLEX_C99_BACKEND_H 1 + +#include "skeletons.h" + +extern const char *c99_skel[]; + +extern const int C99_BACKEND_MAX_INDENT; + +extern struct flex_backend_t c99_backend; + + +#endif /* FLEX_C99_BACKEND_H */ diff --git a/src/c99-flex.skl b/src/c99-flex.skl index 9efbadad..2e57a859 100644 --- a/src/c99-flex.skl +++ b/src/c99-flex.skl @@ -81,7 +81,7 @@ m4_define([[M4_HOOK_SET_PREACTION]], [[m4_define([[YY_USER_ACTION]], [[$1]])]]) m4_define([[M4_HOOK_STATE_CASE_BREAK]], [[/*LINTED*/break;]]) m4_define([[M4_HOOK_SET_POSTACTION]], [[m4_define([[M4_HOOK_STATE_CASE_BREAK]], [[$1]])]]) m4_define([[M4_HOOK_FATAL_ERROR]], [[yypanic($1, yyscanner);]]) -m4_define([[M4_HOOK_ECHO]], [[yyecho(yyscanner);]]) +m4_define([[M4_HOOK_ECHO]], [[yyecho();]]) m4_define([[yyterminate]], m4_ifdef([[M4_MODE_YYTERMINATE]], [[M4_MODE_YYTERMINATE /* $1 */]], [[return YY_NULL /* $1 */]])) @@ -548,6 +548,17 @@ m4_ifdef( [[]], [[ ]]) }; /* end struct yyguts_t */ +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyscanner->yyin_r +#define yyout yyscanner->yyout_r +#define yyextra yyscanner->yyextra_r +#define yyleng yyscanner->yyleng_r +#define yytext yyscanner->yytext_r +#define yylineno (yy_current_buffer(yyscanner)->bs_yylineno) +#define yycolumn (yy_current_buffer(yyscanner)->bs_yycolumn) +#define yyflexdebug yyscanner->yyflexdebug_r + m4_ifdef( [[M4_YY_BISON_LVAL]], [[ /* This must go here because YYSTYPE and YYLTYPE are included @@ -920,12 +931,16 @@ int yystart(yyscan_t yyscanner) { /* This used to be an fputs(), but since the string might contain NULs, * we now use fwrite(). */ -void yyecho(yyscan_t yyscanner) { +void yyecho_r(yyscan_t yyscanner) { fwrite(yyscanner->yytext_r, (size_t) yyscanner->yyleng_r, 1, yyscanner->yyout_r); } +#define yyecho() yyecho_r(yyscanner) + m4_ifdef( [[M4_YY_NO_YYUNPUT]],, [[ -void yyunput(char c, yyscan_t yyscanner) +#define yyunput(c) yyunput_r(c, yyscanner) + +void yyunput_r(char c, yyscan_t yyscanner) { char *yy_cp; @@ -974,7 +989,7 @@ m4_ifdef( [[M4_MODE_YYLINENO]], %# magic functions, so yy_get_next_buffer() won't need a forward declaration. m4_ifdef([[M4_MODE_YYMORE_USED]], [[ m4_ifdef( [[M4_MODE_YYTEXT_IS_ARRAY]], [[ -void yymore(yyscan_t yyscanner) {yyscanner->yy_more_offset = strlen(yyscanner->yytext_r);} +void yymore_r(yyscan_t yyscanner) {yyscanner->yy_more_offset = strlen(yyscanner->yytext_r);} m4_define([[YY_MORE_ADJ]], [[0]]) m4_define([[YY_RESTORE_YY_MORE_OFFSET]], [[{ yyscanner->yy_more_offset = yyscanner->yy_prev_more_offset; @@ -983,12 +998,14 @@ yyscanner->yyleng_r -= yyscanner->yy_more_offset; ]]) ]]) m4_ifdef( [[M4_MODE_NO_YYTEXT_IS_ARRAY]], [[ -void yymore(yyscan_t yyscanner) {yyscanner->yy_more_flag = true;} +void yymore_r(yyscan_t yyscanner) {yyscanner->yy_more_flag = true;} m4_define([[YY_MORE_ADJ]], [[yyscanner->yy_more_len]]) m4_define([[YY_RESTORE_YY_MORE_OFFSET]], [[]]) ]]) ]]) +#define yymore() yymore_r(yyscanner) + m4_ifdef([[M4_MODE_NO_YYMORE_USED]], [[ m4_define([[YY_MORE_ADJ]], [[0]]) m4_define([[YY_RESTORE_YY_MORE_OFFSET]], [[]]) diff --git a/src/cpp-backend.c b/src/cpp-backend.c new file mode 100644 index 00000000..1ee8c373 --- /dev/null +++ b/src/cpp-backend.c @@ -0,0 +1,462 @@ +/* cpp-backend.c - C++ backend file for flex */ + +/* Copyright (c) 1990 The Regents of the University of California. */ +/* All rights reserved. */ + +/* This code is derived from software contributed to Berkeley by */ +/* Vern Paxson. */ + +/* The United States Government has rights in this work pursuant */ +/* to contract no. DE-AC03-76SF00098 between the United States */ +/* Department of Energy and the University of California. */ + +/* This file is part of flex. */ + +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions */ +/* are met: */ + +/* 1. Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* 2. Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ + +/* Neither the name of the University nor the names of its contributors */ +/* may be used to endorse or promote products derived from this software */ +/* without specific prior written permission. */ + +/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ +/* PURPOSE. */ + + +#include "flexdef.h" +#include "cpp-backend.h" + +const int CPP_BACKEND_MAX_INDENT = 256; + +const char *cpp_skel[] = { +#include "cpp-flex.h" +0 +}; + +/* For C and CXX, emit the typedef names from flexint_shared.h */ +const char * cpp_get_int32_type ( const struct flex_backend_t *b ) { + return "flex_int32_t"; +} + +/* For C and CXX, emit the typedef names from flexint_shared.h */ +static const char * cpp_get_int16_type ( const struct flex_backend_t *b ) { + return "flex_int16_t"; +} + +/* Emit the name of the datatype used in the NULTRANS table. + The datatype of the table depends on various option settings + and the skeleton in use. + */ +static const char * cpp_get_state_type ( const struct flex_backend_t *b ) { + /* cpp-flex.skl defines transition states as pointers to + struct yy_trans_info when the FULLSPD option is enabled. + Otherwise, it just uses the int32 type. + */ + return (ctrl.fullspd) ? "struct yy_trans_info*" : b->get_int32_type(b); +} + +static const char * cpp_get_packed_type (const struct flex_backend_t *b, struct packtype_t *p) { + switch(p->width) { + case 32: return b->get_int32_type(b); + case 16: return b->get_int16_type(b); + default: flexerror("unsupported packed data width requested\n"); + break; + } +} + +/* TODO: Indent? */ +static void cpp_open_block_comment ( const struct flex_backend_t *b ) { + fputs("/* ", stdout); +} + +/* TODO: Indent? */ +static void cpp_close_block_comment ( const struct flex_backend_t *b ) { + fputs(" */", stdout); +} + +static const char * cpp_get_comment ( const struct flex_backend_t *b, const char *c ) { + static const char *format = "/* %s */"; + static char directive[MAXLINE*2] = {0}; + + snprintf(directive, sizeof(directive), format, c); + return directive; +} + +static void cpp_record_separator ( const struct flex_backend_t *b ) { + /* Expected to ocurr at the end of a line, so I'm not indenting. */ + fputs("},\n", stdout); +} + +static void cpp_column_separator ( const struct flex_backend_t *b ){ + /* Expected to ocurr at the end of a line, so don't indent. */ + fputs(", ", stdout); +} + +static void cpp_newline ( const struct flex_backend_t *b ) { + /* Expected to ocurr at the end of a line, so don't indent. */ + fputs("\n", stdout); +} + +static void cpp_increase_indent ( const struct flex_backend_t *b ) { + if ( b->indent_level < CPP_BACKEND_MAX_INDENT ) { + /* ++ will require more parens to clarify */ + ((struct flex_backend_t *)b)->indent_level += 1; + } +} + +static void cpp_decrease_indent ( const struct flex_backend_t *b ) { + if (b->indent_level > 0) { + /* -- will require more parens to clarify */ + ((struct flex_backend_t *)b)->indent_level -= 1; + } +} + +static void cpp_indent ( const struct flex_backend_t *b ) { + int i = 0; + while ( i < b->indent_level ) { + fputs("\t", stdout); + ++i; + } +} + +/* Return a format string appropriate for the skeleton language. + The format string will perform an equivalent function to the CPP line directive. + That is, it will tell target language compiler what .l source line the target source + corresponds to when the compiler generates warnings and errors. + + This method does not provide the arguments to the format string. It just provides the string. +*/ +static const char * cpp_get_trace_line_format ( const struct flex_backend_t *b ) { + return "#line %d \"%s\"\n"; +} + +/* TODO: indent? */ +static void cpp_open_table ( const struct flex_backend_t *b ) { + fputs("{", stdout); +} + +static void cpp_continue_table ( const struct flex_backend_t *b ) { + /* Expected to ocurr at the end of a line, so don't indent. */ + fputs("},\n", stdout); +} + +/* TODO: indent? */ +static void cpp_close_table ( const struct flex_backend_t *b ) { + fputs("};\n", stdout); +} + +/* Format an entry into a data table. */ +static void cpp_format_data_table_entry ( const struct flex_backend_t * b, int t ) { + /* Expected to occur in a block format, so don't indent. */ + fprintf(stdout, "%5d", t); +} + +/* Format an entry from the transition table into the state table. */ +static void cpp_format_state_table_entry ( const struct flex_backend_t * b, int t ) { + b->indent(b); + fprintf(stdout, "&yy_transition[%d],\n", t); +} + +/* Generate a case for the main state switch (in C/CXX). + Other target languages may use another selection syntax. Basically, each arm matches + the character under examination, treated as a number. +*/ +static const char * cpp_get_normal_state_case_arm ( const struct flex_backend_t *b, int c ) { + static const char *format = "case %d: "; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, c); + return directive; +} + +/* Generate the special case arm for EOF. + This lives in the body of yyinput and determines whether/when to switch to the next buffer. +*/ +static const char * cpp_get_eof_state_case_arm ( const struct flex_backend_t *b, const char * const c ) { + static const char *format = "case YY_STATE_EOF(%s): "; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, c); + return directive; +} + +/* Emit the special case arm for EOF. */ +static void cpp_format_eof_state_case_arm ( const struct flex_backend_t *b, const char * const c ) { + b->indent(b); + fputs(b->get_eof_state_case_arm(b, c), stdout); +} + +/* Generate the special action FALLTHROUGH. + This is just a comment in C/CXX, but a few languages require a keyword for fallthrough logic. +*/ +static void cpp_eof_state_case_fallthrough ( const struct flex_backend_t *b ) { + b->indent(b); + b->comment(b, "FALLTHROUGH"); + b->newline(b); +} + +/* Generate the special action terminate. */ +static void cpp_eof_state_case_terminate ( const struct flex_backend_t *b ) { + b->indent(b); + fputs("yyterminate();\n", stdout); +} + +/* Generate the action preamble. */ +static const char * cpp_get_take_yytext( const struct flex_backend_t *b ) { + static const char *directive = "YY_DO_BEFORE_ACTION; /* set up yytext */"; + return directive; +} + +/* Generate the action postamble. */ +static const char * cpp_get_release_yytext( const struct flex_backend_t *b ) { + static const char *directive = "*yy_cp = YY_G(yy_hold_char); /* undo effects of setting up yytext */"; + return directive; +} + +/* Generate the buffer rewind sub-action. */ +static const char * cpp_get_char_rewind( const struct flex_backend_t *b, int c ) { + static const char *format = "YY_G(yy_c_buf_p) = yy_cp -= %d;"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, c); + return directive; +} + +/* Generate the line rewind sub-action. */ +static const char * cpp_get_line_rewind( const struct flex_backend_t *b, int l ) { + static const char *format = "YY_LINENO_REWIND_TO(yy_cp - %d);"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, l); + return directive; +} + +/* Generate the buffer skip sub-action. */ +static const char * cpp_get_char_forward( const struct flex_backend_t *b, int c ) { + static const char *format = "YY_G(yy_c_buf_p) = yy_cp = yy_bp + %d;"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, c); + return directive; +} + +/* Generate the line skip sub-action. */ +static const char * cpp_get_line_forward( const struct flex_backend_t *b, int l ) { + static const char *format = "YY_LINENO_REWIND_TO(yy_bp + %d);"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, l); + return directive; +} + +/* Define a byte-width constant. */ +static void cpp_format_byte_const ( const struct flex_backend_t *b, const char *n, const int c ) { + fprintf(stdout, "#define %s %d\n", n, c); +} + +/* Define a state constant. */ +static void cpp_format_state_const ( const struct flex_backend_t *b, const char *n, const int s ) { + fprintf(stdout, "#define %s %d\n", n, s); +} + +/* Define a size constant. + TODO: It would be better if s were unsigned, but Flex currently counts in signed ints. +*/ +static void cpp_format_size_const ( const struct flex_backend_t *b, const char *n, const int s ) { + fprintf(stdout, "#define %s %d\n", n, s); +} + +/* Define a uint constant. */ +static void cpp_format_uint_const ( const struct flex_backend_t *b, const char *n, const unsigned int u ) { + fprintf(stdout, "#define %s %u\n", n, u); +} + +/* Define a boolean constant. */ +static void cpp_format_bool_const ( const struct flex_backend_t *b, const char *n, const int t ){ + fprintf(stdout, "#define %s %d\n", n, t); +} + +/* Define a string constant. */ +static const char * cpp_get_const ( const struct flex_backend_t *b, const char *n, const char *v ) { + static const char *format = "#define %s %s\n"; + static char directive[MAXLINE*2] = {0}; + + snprintf(directive, sizeof(directive), format, n, v); + return directive; +} + +/* Define a constant used by the skeleton. */ +static void cpp_format_offset_type ( const struct flex_backend_t *b, const char *t ) { + fputs(b->get_const(b, "YY_OFFSET_TYPE", t), stdout); +} + +/* Define a constant used by the skeleton. */ +static void cpp_format_yy_decl ( const struct flex_backend_t *b, const char *d ) { + fputs(b->get_const(b, "YY_DECL", d), stdout); +} + +/* Define a constant used by the skeleton. */ +static void cpp_format_userinit ( const struct flex_backend_t *b, const char *d ) { + fputs(b->get_const(b, "YY_USER_INIT", d), stdout); +} + +/* Generate the rule_setup preamble. */ +static const char * cpp_get_rule_setup ( const struct flex_backend_t *b ) { + static const char *directive = "YY_RULE_SETUP"; + return directive; +} + +/* Generate the user_action constant, if needed. */ +static const char * cpp_get_user_preaction ( const struct flex_backend_t *b, const char *d ) { + return b->get_const(b, "YY_USER_ACTION", d); +} + +/* End a state case arm, optionally inserting user postactions. + + TODO: Why can't this use YY_STATE_CASE_BREAK from format_user_postaction? +*/ +static const char * cpp_get_state_case_break ( const struct flex_backend_t *b ) { + static const char *directive = "/*LINTED*/break;"; + if (!ctrl.postaction) { + return directive; + } + else { + return ctrl.postaction; + } +} + +/* Generate the definition of the STATE_CASE_BREAK end of action. */ +static const char * cpp_get_user_postaction ( const struct flex_backend_t *b, const char *d ) { + if (d != NULL) { + return b->get_const(b, "YY_STATE_CASE_BREAK", d); + } + else { + return b->get_const(b, "YY_STATE_CASE_BREAK", "/*LINTED*/break;"); + } +} + +/* Generate the fatal_error action. */ +static const char * cpp_get_fatal_error ( const struct flex_backend_t *b, const char *e ) { + static const char *format = "yypanic(%s M4_YY_CALL_LAST_ARG);"; + static char directive[MAXLINE*2] = {0}; + + snprintf (directive, sizeof(directive), format, e); + return directive; +} + +/* Generate the echo action. */ +static const char * cpp_get_echo ( const struct flex_backend_t *b ) { + static const char *directive = "yyecho();"; + + return directive; +} + +/* Generate the definition of the terminate special action. */ +static const char * cpp_get_yyterminate ( const struct flex_backend_t *b, const char *d ) { + if (d != NULL) { + return b->get_const(b, "yyterminate", d); + } + else { + return b->get_const(b, "yyterminate", ""); + } +} + +/* Generate the reject special action. */ +static const char * cpp_get_yyreject ( const struct flex_backend_t *b ) { + static const char *directive = "yyreject()"; + return directive; +} + +/* Construct the cpp_backend method table. + This follows the definition in skeletons.h. + cpp-backends.h provides a handle to this structure with external linkage. + skeletons.c imports that handle to access these methods. + That module makes this implementation available to others as an opaque singleton. + + Note that indentation level is managed indepentently for each backend. +*/ +struct flex_backend_t cpp_backend = { + .skel = cpp_skel, + .indent_level = 0, + .get_int32_type = cpp_get_int32_type, + .get_int16_type = cpp_get_int16_type, + .get_state_type = cpp_get_state_type, + .get_packed_type = cpp_get_packed_type, + .open_block_comment = cpp_open_block_comment, + .close_block_comment = cpp_close_block_comment, + .get_comment = cpp_get_comment, + .comment = _format_comment, + .record_separator = cpp_record_separator, + .column_separator = cpp_column_separator, + .newline = cpp_newline, + .increase_indent = cpp_increase_indent, + .decrease_indent = cpp_decrease_indent, + .indent = cpp_indent, + .get_trace_line_format = cpp_get_trace_line_format, + .line_directive_out = _format_line_directive_out, + .open_table = cpp_open_table, + .continue_table = cpp_continue_table, + .close_table = cpp_close_table, + .verbatim = _verbatim, + .format_data_table_entry = cpp_format_data_table_entry, + .format_state_table_entry = cpp_format_state_table_entry, + .get_normal_state_case_arm = cpp_get_normal_state_case_arm, + .format_normal_state_case_arm = _format_normal_state_case_arm, + .get_eof_state_case_arm = cpp_get_eof_state_case_arm, + .format_eof_state_case_arm = _format_eof_state_case_arm, + .eof_state_case_fallthrough = cpp_eof_state_case_fallthrough, + .eof_state_case_terminate = cpp_eof_state_case_terminate, + .get_take_yytext = cpp_get_take_yytext, + .format_take_yytext = _format_take_yytext, + .get_release_yytext = cpp_get_release_yytext, + .format_release_yytext = _format_release_yytext, + .get_char_rewind = cpp_get_char_rewind, + .format_char_rewind = _format_char_rewind, + .get_line_rewind = cpp_get_line_rewind, + .format_line_rewind = _format_line_rewind, + .get_char_forward = cpp_get_char_forward, + .format_char_forward = _format_char_forward, + .get_line_forward = cpp_get_line_forward, + .format_line_forward = _format_line_forward, + .format_byte_const = cpp_format_byte_const, + .format_state_const = cpp_format_state_const, + .format_size_const = cpp_format_size_const, + .format_uint_const = cpp_format_uint_const, + .format_bool_const = cpp_format_bool_const, + .get_const = cpp_get_const, + .format_const = _format_const, + .format_offset_type = cpp_format_offset_type, + .format_yy_decl = cpp_format_yy_decl, + .format_userinit = cpp_format_userinit, + .get_rule_setup = cpp_get_rule_setup, + .format_rule_setup = _format_rule_setup, + .get_user_preaction = cpp_get_user_preaction, + .format_user_preaction = _format_user_preaction, + .get_state_case_break = cpp_get_state_case_break, + .format_state_case_break = _format_state_case_break, + .get_user_postaction = cpp_get_user_postaction, + .format_user_postaction = _format_user_postaction, + .get_fatal_error = cpp_get_fatal_error, + .format_fatal_error = _format_fatal_error, + .get_echo = cpp_get_echo, + .echo = _echo, + .get_yyterminate = cpp_get_yyterminate, + .format_yyterminate = _format_yyterminate, + .get_yyreject = cpp_get_yyreject, + .format_yyreject = _format_yyreject, + .filter_define_name = _filter_define_name, + .filter_define_close = _filter_define_close, + .filter_define_vars = _filter_define_vars, + .filter_define_vard = _filter_define_vard, + .filter_call_macro = _filter_call_macro +}; + diff --git a/src/cpp-backend.h b/src/cpp-backend.h new file mode 100644 index 00000000..2454146e --- /dev/null +++ b/src/cpp-backend.h @@ -0,0 +1,47 @@ +/* cpp-backend.h - C++ backend header file for flex */ + +/* Copyright (c) 1990 The Regents of the University of California. */ +/* All rights reserved. */ + +/* This code is derived from software contributed to Berkeley by */ +/* Vern Paxson. */ + +/* The United States Government has rights in this work pursuant */ +/* to contract no. DE-AC03-76SF00098 between the United States */ +/* Department of Energy and the University of California. */ + +/* This file is part of flex. */ + +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions */ +/* are met: */ + +/* 1. Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* 2. Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ + +/* Neither the name of the University nor the names of its contributors */ +/* may be used to endorse or promote products derived from this software */ +/* without specific prior written permission. */ + +/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ +/* PURPOSE. */ + + +#ifndef FLEX_CPP_BACKEND_H +#define FLEX_CPP_BACKEND_H 1 + +#include "skeletons.h" + +extern const char *cpp_skel[]; + +extern const int CPP_BACKEND_MAX_INDENT; + +extern struct flex_backend_t cpp_backend; + + +#endif /* FLEX_CPP_BACKEND_H */ diff --git a/src/dfa.c b/src/dfa.c index ed1af934..346b6783 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -31,6 +31,7 @@ #include "flexdef.h" #include "tables.h" +#include "skeletons.h" /* declare functions that have forward references */ @@ -383,6 +384,7 @@ size_t ntod (void) int symlist[CSIZE + 1]; int num_start_states; int todo_head, todo_next; + const struct flex_backend_t *backend = get_backend(); struct yytbl_data *yynxt_tbl = 0; flex_int32_t *yynxt_data = 0, yynxt_curr = 0; @@ -505,12 +507,15 @@ size_t ntod (void) struct packtype_t *ptype = optimize_pack(0); /* Note: Used when ctrl.fulltbl is on. Alternately defined elsewhere */ - out_str ("m4_define([[M4_HOOK_NXT_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_NXT_ROWS]], [[%d]])", num_full_table_rows); - outn ("m4_define([[M4_HOOK_NXT_BODY]], [[m4_dnl"); - outn ("M4_HOOK_TABLE_OPENER"); + backend->filter_define_vars(backend, "M4_HOOK_NXT_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_NXT_ROWS", num_full_table_rows); + backend->filter_define_name(backend, "M4_HOOK_NXT_BODY", true); + backend->newline(backend); + backend->open_table(backend); + backend->newline(backend); if (gentables) - outn ("M4_HOOK_TABLE_OPENER"); + backend->open_table(backend); + backend->newline(backend); /* Generate 0 entries for state #0. */ for (i = 0; i < num_full_table_rows; ++i) { @@ -520,7 +525,8 @@ size_t ntod (void) if (gentables) { dataflush (); - outn ("M4_HOOK_TABLE_CONTINUE"); + backend->continue_table(backend); + backend->newline(backend); } } @@ -675,7 +681,8 @@ size_t ntod (void) yynxt_tbl->td_lolen * sizeof (flex_int32_t)); if (gentables) - outn ("M4_HOOK_TABLE_OPENER"); + backend->open_table(backend); + backend->newline(backend); /* Supply array's 0-element. */ if (ds == end_of_buffer_state) { @@ -700,7 +707,8 @@ size_t ntod (void) if (gentables) { dataflush (); - outn ("M4_HOOK_TABLE_CONTINUE"); + backend->continue_table(backend); + backend->newline(backend); } } @@ -733,8 +741,10 @@ size_t ntod (void) } if (ctrl.fulltbl) { - dataend ("M4_HOOK_TABLE_CLOSER"); - outn("/* body */]])"); + dataend (true); + backend->comment(backend, "body"); + backend->filter_define_close(backend, NULL); /* End of NXT_BODY */ + backend->newline(backend); if (tablesext) { yytbl_data_compress (yynxt_tbl); if (yytbl_data_fwrite (&tableswr, yynxt_tbl) < 0) diff --git a/src/flexdef.h b/src/flexdef.h index adf4fd0a..72b38678 100644 --- a/src/flexdef.h +++ b/src/flexdef.h @@ -841,7 +841,7 @@ extern char *xstrdup(const char *); extern int cclcmp(const void *, const void *); /* Finish up a block of data declarations. */ -extern void dataend(const char *); +extern void dataend(const int endit); /* Flush generated data statements. */ extern void dataflush(void); @@ -909,17 +909,6 @@ extern int myctoi(const char *); /* Return character corresponding to escape sequence. */ extern unsigned char myesc(unsigned char[]); -/* Output a (possibly-formatted) string to the generated scanner. */ -extern void out(const char *); -extern void out_dec(const char *, int); -extern void out_dec2(const char *, int, int); -extern void out_hex(const char *, unsigned int); -extern void out_str(const char *, const char *); -extern void out_str_dec(const char *, const char *, int); -extern void outc(int); -extern void outn(const char *); -extern void out_m4_define(const char* def, const char* val); - /* Return a printable version of the given character, which might be * 8-bit. */ @@ -1012,17 +1001,30 @@ extern void set_input_file(char *); /* from file skeletons.c */ +typedef enum flex_backend_id { + FLEX_BACKEND_DEFAULT = 0, + FLEX_BACKEND_CPP = 0, + FLEX_BACKEND_C99, + FLEX_BACKEND_GO, + FLEX_BACKEND_ID_MAX /* Only add new backend names above this line. */ + /* FLEX_BACKEND_ID_MAX sets the size of the backend array */ + /* and backend stack. */ +} flex_backend_id_t; + +/* Initialize backends */ +extern void init_backends( void ); + /* return the correct file suffix for the selected back end */ -const char *suffix (void); +extern const char *suffix (void); -/* Mine a text-valued property out of the skeleton file */ -extern const char *skel_property(const char *); +/* Select a backend by name */ +extern flex_backend_id_t backend_by_name(const char *); /* Is the default back end selected?*/ extern bool is_default_backend(void); -/* Select a backend by name */ -extern void backend_by_name(const char *); +/* Mine a text-valued property out of the skeleton file */ +extern const char *skel_property(const char *); /* Write out one section of the skeleton file. */ extern void skelout(bool); @@ -1097,10 +1099,6 @@ extern struct Buf *buf_prints(struct Buf *buf, const char *fmt, const char* s); extern struct Buf userdef_buf; /* a string buffer for #define's generated by user-options on cmd line. */ extern struct Buf top_buf; /* contains %top code. String buffer. */ -/* For blocking out code from the header file. */ -#define OUT_BEGIN_CODE() outn("m4_ifdef( [[M4_YY_IN_HEADER]],,[[m4_dnl") -#define OUT_END_CODE() outn("]])") - /* For setjmp/longjmp (instead of calling exit(2)). Linkage in main.c */ extern jmp_buf flex_main_jmp_buf; diff --git a/src/gen.c b/src/gen.c index 3522d875..8dd3378e 100644 --- a/src/gen.c +++ b/src/gen.c @@ -33,6 +33,7 @@ #include "flexdef.h" #include "tables.h" +#include "skeletons.h" /* These typedefs are only used for computing footprint sizes, * You need to make sure they match reality in the skeleton file to @@ -92,23 +93,30 @@ static void geneoltbl (void) { int i; struct packtype_t *ptype = optimize_pack(num_rules); + const struct flex_backend_t *backend = get_backend(); - outn ("m4_ifdef( [[M4_MODE_YYLINENO]],[["); - out_str ("m4_define([[M4_HOOK_EOLTABLE_TYPE]], [[%s]])\n", ptype->name); - out_dec ("m4_define([[M4_HOOK_EOLTABLE_SIZE]], [[%d]])", num_rules + 1); - outn ("m4_define([[M4_HOOK_EOLTABLE_BODY]], [[m4_dnl"); + backend->verbatim(backend, "m4_ifdef( [[M4_MODE_YYLINENO]],[["); + backend->newline(backend); + backend->filter_define_vars(backend, "M4_HOOK_EOLTABLE_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_EOLTABLE_SIZE", num_rules + 1); + backend->filter_define_name(backend, "M4_HOOK_EOLTABLE_BODY", true); + backend->newline(backend); if (gentables) { for (i = 1; i <= num_rules; i++) { - out_dec ("%d, ", rule_has_nl[i] ? 1 : 0); + backend->format_data_table_entry(backend, rule_has_nl[i] ? 1 : 0); + backend->column_separator(backend); /* format nicely, 20 numbers per line. */ if ((i % 20) == 19) - out ("\n "); + backend->newline(backend); + backend->indent(backend); } } footprint += num_rules * ptype->width; - outn ("]])"); - outn ("]])"); + backend->filter_define_close(backend, NULL); /* End EOLTABLE_BODY */ + backend->newline(backend); + backend->verbatim(backend, "]])"); /* End m4_ifdef( [[M4_MODE_YYLINENO]]...*/ + backend->newline(backend); } @@ -125,9 +133,10 @@ static struct yytbl_data *mkctbl (void) struct yytbl_data *tbl = 0; flex_int32_t *tdata = 0, curr = 0; int end_of_buffer_action = num_rules + 1; + const struct flex_backend_t *backend = get_backend(); struct packtype_t *ptype = optimize_pack(tblend + 2 + 1); - out_str ("m4_define([[M4_HOOK_MKCTBL_TYPE]], [[%s]])", ptype->name); + backend->filter_define_vars(backend, "M4_HOOK_MKCTBL_TYPE", backend->get_packed_type(backend, ptype)); tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (tbl, YYTD_ID_TRANSITION); @@ -247,10 +256,12 @@ static void genctbl(void) { int i; int end_of_buffer_action = num_rules + 1; + const struct flex_backend_t *backend = get_backend(); /* Table of verify for transition and offset to next state. */ - out_dec ("m4_define([[M4_HOOK_TRANSTABLE_SIZE]], [[%d]])", tblend + 2 + 1); - outn ("m4_define([[M4_HOOK_TRANSTABLE_BODY]], [[m4_dnl"); + backend->filter_define_vard(backend, "M4_HOOK_TRANSTABLE_SIZE", tblend + 2 + 1); + backend->filter_define_name(backend, "M4_HOOK_TRANSTABLE_BODY", true); + backend->newline(backend); /* We want the transition to be represented as the offset to the * next state, not the actual state number, which is what it currently @@ -317,17 +328,20 @@ static void genctbl(void) transition_struct_out (chk[tblend + 1], nxt[tblend + 1]); transition_struct_out (chk[tblend + 2], nxt[tblend + 2]); - outn ("]])"); + backend->filter_define_close(backend, NULL); /* End TRANSTABLE_BODY */ + backend->newline(backend); footprint += sizeof(struct yy_trans_info) * (tblend + 2 + 1); - out_dec ("m4_define([[M4_HOOK_STARTTABLE_SIZE]], [[%d]])", lastsc * 2 + 1); + backend->filter_define_vard(backend, "M4_HOOK_STARTTABLE_SIZE", lastsc * 2 + 1); if (gentables) { - outn ("m4_define([[M4_HOOK_STARTTABLE_BODY]], [[m4_dnl"); + backend->filter_define_name(backend, "M4_HOOK_STARTTABLE_BODY", true); + backend->newline(backend); for (i = 0; i <= lastsc * 2; ++i) - out_dec ("M4_HOOK_STATE_ENTRY_FORMAT(%d)", base[i]); + backend->format_state_table_entry(backend, base[i]); - dataend (NULL); - outn("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End STARTTABLE_BODY */ + backend->newline(backend); footprint += sizeof(struct yy_trans_info *) * (lastsc * 2 + 1); } @@ -367,17 +381,20 @@ static void genecs(void) { int ch, row; int numrows; + const struct flex_backend_t *backend = get_backend(); - out_dec ("m4_define([[M4_HOOK_ECSTABLE_SIZE]], [[%d]])", ctrl.csize); - outn ("m4_define([[M4_HOOK_ECSTABLE_BODY]], [[m4_dnl"); + backend->filter_define_vard(backend, "M4_HOOK_ECSTABLE_SIZE", ctrl.csize); + backend->filter_define_name(backend, "M4_HOOK_ECSTABLE_BODY", true); + backend->newline(backend); for (ch = 1; ch < ctrl.csize; ++ch) { ecgroup[ch] = ABS (ecgroup[ch]); mkdata (ecgroup[ch]); } - dataend (NULL); - outn("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End ECSTABLE_BODY */ + backend->newline(backend); footprint += sizeof(YY_CHAR) * ctrl.csize; if (env.trace) { @@ -442,13 +459,16 @@ static void genftbl(void) int i; int end_of_buffer_action = num_rules + 1; struct packtype_t *ptype = optimize_pack(num_rules + 1); + const struct flex_backend_t *backend = get_backend(); dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action; - outn ("m4_define([[M4_HOOK_NEED_ACCEPT]], 1)"); - out_str ("m4_define([[M4_HOOK_ACCEPT_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_ACCEPT_SIZE]], [[%d]])", lastdfa + 1); - outn ("m4_define([[M4_HOOK_ACCEPT_BODY]], [[m4_dnl"); + backend->filter_define_vard(backend, "M4_HOOK_NEED_ACCEPT", 1); + backend->newline(backend); + backend->filter_define_vars(backend, "M4_HOOK_ACCEPT_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_ACCEPT_SIZE", lastdfa + 1); + backend->filter_define_name(backend, "M4_HOOK_ACCEPT_BODY", true); + backend->newline(backend); for (i = 1; i <= lastdfa; ++i) { int anum = dfaacc[i].dfaacc_state; @@ -460,8 +480,9 @@ static void genftbl(void) i, anum); } - dataend (NULL); - outn("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End ACCEPT_BODY*/ + backend->newline(backend); footprint += (lastdfa + 1) * ptype->width; if (ctrl.useecs) @@ -484,6 +505,7 @@ static void gentabs(void) *yynxt_data = 0, *yychk_data = 0, *yyacclist_data=0; flex_int32_t yybase_curr = 0, yyacclist_curr=0,yyacc_curr=0; struct packtype_t *ptype; + const struct flex_backend_t *backend = get_backend(); acc_array = allocate_integer_array (current_max_dfas); nummt = 0; @@ -513,9 +535,10 @@ static void gentabs(void) sz = MAX (numas, 1) + 1; ptype = optimize_pack(sz); - out_str ("m4_define([[M4_HOOK_ACCLIST_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_ACCLIST_SIZE]], [[%d]])", sz); - outn ("m4_define([[M4_HOOK_ACCLIST_BODY]], [[m4_dnl"); + backend->filter_define_vars(backend, "M4_HOOK_ACCLIST_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_ACCLIST_SIZE", sz); + backend->filter_define_name(backend, "M4_HOOK_ACCLIST_BODY", true); + backend->newline(backend); yyacclist_tbl = calloc(1,sizeof(struct yytbl_data)); yytbl_data_init (yyacclist_tbl, YYTD_ID_ACCLIST); @@ -578,8 +601,9 @@ static void gentabs(void) /* add accepting number for the "jam" state */ acc_array[i] = j; - dataend (NULL); - outn("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End ACCLIST_BODY*/ + backend->newline(backend); footprint += sz * ptype->width; if (tablesext) { yytbl_data_compress (yyacclist_tbl); @@ -623,10 +647,12 @@ static void gentabs(void) /* Note that this table is alternately defined if ctrl.fulltbl */ ptype = optimize_pack(sz); - outn ("m4_define([[M4_HOOK_NEED_ACCEPT]], 1)"); - out_str ("m4_define([[M4_HOOK_ACCEPT_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_ACCEPT_SIZE]], [[%d]])", sz); - outn ("m4_define([[M4_HOOK_ACCEPT_BODY]], [[m4_dnl"); + backend->filter_define_vard(backend, "M4_HOOK_NEED_ACCEPT", 1); + backend->newline(backend); + backend->filter_define_vars(backend, "M4_HOOK_ACCEPT_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_ACCEPT_SIZE", sz); + backend->filter_define_name(backend, "M4_HOOK_ACCEPT_BODY", true); + backend->newline(backend); yyacc_tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (yyacc_tbl, YYTD_ID_ACCEPT); @@ -654,8 +680,9 @@ static void gentabs(void) yyacc_data[yyacc_curr++] = acc_array[i]; } - dataend (NULL); - outn ("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End ACCEPT_BODY*/ + backend->newline(backend); footprint += sz * ptype->width; if (tablesext) { @@ -698,8 +725,9 @@ static void gentabs(void) if (env.trace) fputs (_("\n\nMeta-Equivalence Classes:\n"), stderr); - out_dec ("m4_define([[M4_HOOK_MECSTABLE_SIZE]], [[%d]])", numecs+1); - outn ("m4_define([[M4_HOOK_MECSTABLE_BODY]], [[m4_dnl"); + backend->filter_define_vard(backend, "M4_HOOK_MECSTABLE_SIZE", numecs+1); + backend->filter_define_name(backend, "M4_HOOK_MECSTABLE_BODY", true); + backend->newline(backend); for (i = 1; i <= numecs; ++i) { if (env.trace) @@ -710,8 +738,9 @@ static void gentabs(void) yymecs_data[i] = ABS (tecbck[i]); } - dataend (NULL); - outn ("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End MECSTABLE_BODY */ + backend->newline(backend); footprint += sizeof(YY_CHAR) * (numecs + 1); if (tablesext) { yytbl_data_compress (yymeta_tbl); @@ -728,9 +757,10 @@ static void gentabs(void) /* Begin generating yy_base */ sz = total_states + 1; ptype = optimize_pack(sz); - out_str ("m4_define([[M4_HOOK_BASE_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_BASE_SIZE]], [[%d]])", sz); - outn ("m4_define([[M4_HOOK_BASE_BODY]], [[m4_dnl"); + backend->filter_define_vars(backend, "M4_HOOK_BASE_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_BASE_SIZE", sz); + backend->filter_define_name(backend, "M4_HOOK_BASE_BODY", true); + backend->newline(backend); yybase_tbl = calloc (1, sizeof (struct yytbl_data)); yytbl_data_init (yybase_tbl, YYTD_ID_BASE); @@ -769,8 +799,9 @@ static void gentabs(void) def[i] = jamstate; } - dataend (NULL); - outn ("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End BASE_BODY */ + backend->newline(backend); footprint += sz * ptype->width; if (tablesext) { @@ -785,9 +816,10 @@ static void gentabs(void) /* Begin generating yy_def */ ptype = optimize_pack(total_states + 1); - out_str ("m4_define([[M4_HOOK_DEF_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_DEF_SIZE]], [[%d]])", total_states + 1); - outn ("m4_define([[M4_HOOK_DEF_BODY]], [[m4_dnl"); + backend->filter_define_vars(backend, "M4_HOOK_DEF_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_DEF_SIZE", total_states + 1); + backend->filter_define_name(backend, "M4_HOOK_DEF_BODY", true); + backend->newline(backend); yydef_tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (yydef_tbl, YYTD_ID_DEF); @@ -800,8 +832,9 @@ static void gentabs(void) yydef_data[i] = def[i]; } - dataend (NULL); - outn ("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End DEF_BODY */ + backend->newline(backend); footprint += (total_states + 1) * ptype->width; if (tablesext) { @@ -818,9 +851,10 @@ static void gentabs(void) /* Note: Used when !ctrl.fulltbl && !ctrl.fullspd). * (Alternately defined when ctrl.fullspd) */ - out_str ("m4_define([[M4_HOOK_YYNXT_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_YYNXT_SIZE]], [[%d]])", tblend + 1); - outn ("m4_define([[M4_HOOK_YYNXT_BODY]], [[m4_dnl"); + backend->filter_define_vars(backend, "M4_HOOK_YYNXT_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_YYNXT_SIZE", tblend + 1); + backend->filter_define_name(backend, "M4_HOOK_YYNXT_BODY", true); + backend->newline(backend); yynxt_tbl = calloc (1, sizeof (struct yytbl_data)); yytbl_data_init (yynxt_tbl, YYTD_ID_NXT); @@ -839,8 +873,9 @@ static void gentabs(void) yynxt_data[i] = nxt[i]; } - dataend (NULL); - outn("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End YYNXT_BODY */ + backend->newline(backend); footprint += ptype->width * (tblend + 1); if (tablesext) { @@ -854,9 +889,10 @@ static void gentabs(void) /* Begin generating yy_chk */ ptype = optimize_pack(tblend + 1); - out_str ("m4_define([[M4_HOOK_CHK_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_CHK_SIZE]], [[%d]])", tblend + 1); - outn ("m4_define([[M4_HOOK_CHK_BODY]], [[m4_dnl"); + backend->filter_define_vars(backend, "M4_HOOK_CHK_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_CHK_SIZE", tblend + 1); + backend->filter_define_name(backend, "M4_HOOK_CHK_BODY", true); + backend->newline(backend); yychk_tbl = calloc (1, sizeof (struct yytbl_data)); yytbl_data_init (yychk_tbl, YYTD_ID_CHK); @@ -872,8 +908,9 @@ static void gentabs(void) yychk_data[i] = chk[i]; } - dataend (NULL); - outn ("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End CHK_BODY */ + backend->newline(backend); footprint += ptype->width * (tblend + 1); if (tablesext) { @@ -891,28 +928,33 @@ static void gentabs(void) void visible_define (const char *symname) { - out_m4_define(symname, NULL); - comment(symname); - outc ('\n'); + const struct flex_backend_t *backend = get_backend(); + + backend->filter_define_name(backend, symname, false); + backend->comment(backend, symname); + backend->newline(backend); } void visible_define_str (const char *symname, const char *val) { char buf[128]; - out_m4_define(symname, val); + const struct flex_backend_t *backend = get_backend(); + + backend->filter_define_vars(backend, symname, val); snprintf(buf, sizeof(buf), "%s = %s", symname, val); - comment(buf); - outc ('\n'); + backend->comment(backend, buf); + backend->newline(backend); } void visible_define_int (const char *symname, const int val) { - char nbuf[24], buf[128]; - snprintf(nbuf, sizeof(nbuf), "%d", val); - out_m4_define(symname, nbuf); + char buf[128]; + const struct flex_backend_t *backend = get_backend(); + + backend->filter_define_vard(backend, symname, val); snprintf(buf, sizeof(buf), "%s = %d", symname, val); - comment(buf); - outc ('\n'); + backend->comment(backend, buf); + backend->newline(backend); } /* make_tables - generate transition tables @@ -923,6 +965,7 @@ void make_tables (void) char buf[128]; int i; struct yytbl_data *yynultrans_tbl = NULL; + const struct flex_backend_t *backend = get_backend(); /* This is where we REALLY begin generating the tables. */ @@ -965,7 +1008,7 @@ void make_tables (void) tbl = mkftbl (); yytbl_data_compress (tbl); ptype = optimize_pack(tbl->td_lolen); - out_str ("m4_define([[M4_HOOK_ACCEPT_TYPE]], [[%s]])", ptype->name); + backend->filter_define_vars(backend, "M4_HOOK_ACCEPT_TYPE", backend->get_packed_type(backend, ptype)); if (yytbl_data_fwrite (&tableswr, tbl) < 0) flexerror (_("Could not write ftbl")); yytbl_data_destroy (tbl); @@ -986,22 +1029,28 @@ void make_tables (void) gentabs (); } - snprintf(buf, sizeof(buf), "footprint: %ld bytes\n", footprint); - comment(buf); - snprintf(buf, sizeof(buf), "tblend: %d\n", tblend); - comment(buf); - snprintf(buf, sizeof(buf), "numecs: %d\n", numecs); - comment(buf); - snprintf(buf, sizeof(buf), "num_rules: %d\n", num_rules); - comment(buf); - snprintf(buf, sizeof(buf), "lastdfa: %d\n", lastdfa); - comment(buf); - outc ('\n'); + snprintf(buf, sizeof(buf), "footprint: %ld bytes", footprint); + backend->comment(backend, buf); + backend->newline(backend); + snprintf(buf, sizeof(buf), "tblend: %d", tblend); + backend->comment(backend, buf); + backend->newline(backend); + snprintf(buf, sizeof(buf), "numecs: %d", numecs); + backend->comment(backend, buf); + backend->newline(backend); + snprintf(buf, sizeof(buf), "num_rules: %d", num_rules); + backend->comment(backend, buf); + backend->newline(backend); + snprintf(buf, sizeof(buf), "lastdfa: %d", lastdfa); + backend->comment(backend, buf); + backend->newline(backend); + backend->newline(backend); // Only at this point do we know if the automaton has backups. // Some m4 conditionals require this information. - comment("m4 controls begin\n"); + backend->comment(backend, "m4 controls begin"); + backend->newline(backend); if (num_backing_up > 0) visible_define ( "M4_MODE_HAS_BACKING_UP"); @@ -1012,8 +1061,8 @@ void make_tables (void) if ((num_backing_up > 0 && !reject) && (ctrl.fullspd || ctrl.fulltbl)) visible_define ( "M4_MODE_NULTRANS_WRAP"); - comment("m4 controls end\n"); - out ("\n"); + backend->comment(backend, "m4 controls end"); + backend->newline(backend); if (ctrl.do_yylineno) { @@ -1035,9 +1084,10 @@ void make_tables (void) flex_int32_t *yynultrans_data = 0; /* Begin generating yy_NUL_trans */ - out_str ("m4_define([[M4_HOOK_NULTRANS_TYPE]], [[%s]])", (ctrl.fullspd) ? "struct yy_trans_info*" : "M4_HOOK_INT32"); - out_dec ("m4_define([[M4_HOOK_NULTRANS_SIZE]], [[%d]])", lastdfa + 1); - outn ("m4_define([[M4_HOOK_NULTRANS_BODY]], [[m4_dnl"); + backend->filter_define_vars(backend, "M4_HOOK_NULTRANS_TYPE", backend->get_state_type(backend)); + backend->filter_define_vard(backend, "M4_HOOK_NULTRANS_SIZE", lastdfa + 1); + backend->filter_define_name(backend, "M4_HOOK_NULTRANS_BODY", true); + backend->newline(backend); yynultrans_tbl = calloc(1, sizeof (struct yytbl_data)); yytbl_data_init (yynultrans_tbl, YYTD_ID_NUL_TRANS); @@ -1052,9 +1102,7 @@ void make_tables (void) for (i = 1; i <= lastdfa; ++i) { if ((yynultrans_tbl->td_flags & YYTD_PTRANS) != 0) { - // Only works in very C-like languages - out_dec (" &yy_transition[%d],\n", - base[i]); + backend->format_state_table_entry(backend, base[i]); yynultrans_data[i] = base[i]; } else { @@ -1064,8 +1112,12 @@ void make_tables (void) } } - dataend (NULL); - outn("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End NULTRANS_BODY */ + backend->newline(backend); + /* footprint is only used to print an estimated table size in a user-requested summary. + There's a C assumtption in the calculation here, but it doesn't affect the scanner. + */ footprint += (lastdfa + 1) * (ctrl.fullspd ? sizeof(struct yy_trans_info *) : sizeof(int32_t)); if (tablesext) { yytbl_data_compress (yynultrans_tbl); @@ -1088,13 +1140,15 @@ void make_tables (void) * in the table metering. */ struct packtype_t *ptype = optimize_pack(num_rules); - out_str ("m4_define([[M4_HOOK_DEBUGTABLE_TYPE]], [[%s]])", ptype->name); - out_dec ("m4_define([[M4_HOOK_DEBUGTABLE_SIZE]], [[%d]])", num_rules); - outn ("m4_define([[M4_HOOK_DEBUGTABLE_BODY]], [[m4_dnl"); + backend->filter_define_vars(backend, "M4_HOOK_DEBUGTABLE_TYPE", backend->get_packed_type(backend, ptype)); + backend->filter_define_vard(backend, "M4_HOOK_DEBUGTABLE_SIZE", num_rules); + backend->filter_define_name(backend, "M4_HOOK_DEBUGTABLE_BODY", true); + backend->newline(backend); for (i = 1; i < num_rules; ++i) mkdata (rule_linenum[i]); - dataend (NULL); - outn("]])"); + dataend (false); + backend->filter_define_close(backend, NULL); /* End DEBUGTABLE_BODY */ + backend->newline(backend); } } diff --git a/src/main.c b/src/main.c index 56ca8ae3..58a458b9 100644 --- a/src/main.c +++ b/src/main.c @@ -36,6 +36,7 @@ #include "version.h" #include "options.h" #include "tables.h" +#include "skeletons.h" #include "parse.h" static char flex_version[] = FLEX_VERSION; @@ -135,6 +136,7 @@ int flex_main (int argc, char *argv[]) { int i, exit_status, child_status; int did_eof_rule = false; + const struct flex_backend_t *backend = NULL; /* Set a longjmp target. Yes, I know it's a hack, but it gets worse: The * return value of setjmp, if non-zero, is the desired exit code PLUS ONE. @@ -165,6 +167,9 @@ int flex_main (int argc, char *argv[]) flexinit (argc, argv); readin (); + + backend = get_backend(); + skelout (true); /* %% [1.0] DFA */ footprint += ntod (); @@ -178,7 +183,8 @@ int flex_main (int argc, char *argv[]) ("-s option given but default rule can be matched"), rule_linenum[default_rule]); - comment("START of m4 controls\n"); + backend->comment(backend, "START of m4 controls"); + backend->newline(backend); // mode switches for yy_trans_info specification // nultrans @@ -196,20 +202,20 @@ int flex_main (int argc, char *argv[]) visible_define ( "M4_MODE_NO_NULTRANS_FULLSPD"); } - comment("END of m4 controls\n"); - out ("\n"); - - comment("START of Flex-generated definitions\n"); - out_str_dec ("M4_HOOK_CONST_DEFINE_UINT(%s, %d)", "YY_NUM_RULES", num_rules); - out_str_dec ("M4_HOOK_CONST_DEFINE_STATE(%s, %d)", "YY_END_OF_BUFFER", num_rules + 1); - out_str_dec ("M4_HOOK_CONST_DEFINE_STATE(%s, %d)", "YY_JAMBASE", jambase); - out_str_dec ("M4_HOOK_CONST_DEFINE_STATE(%s, %d)", "YY_JAMSTATE", jamstate); - out_str_dec ("M4_HOOK_CONST_DEFINE_BYTE(%s, %d)", "YY_NUL_EC", NUL_ec); + backend->comment(backend, "END of m4 controls"); + backend->newline(backend); + + backend->comment(backend, "START of Flex-generated definitions"); + backend->format_size_const(backend, "YY_NUM_RULES", num_rules); + backend->format_state_const(backend, "YY_END_OF_BUFFER", num_rules + 1); + backend->format_state_const(backend, "YY_JAMBASE", jambase); + backend->format_state_const(backend, "YY_JAMSTATE", jamstate); + backend->format_byte_const(backend, "YY_NUL_EC", NUL_ec); /* Need to define the transet type as a size large * enough to hold the biggest offset. */ - out_str ("M4_HOOK_SET_OFFSET_TYPE(%s)", optimize_pack(tblend + numecs + 1)->name); - comment("END of Flex-generated definitions\n"); + backend->filter_call_macro(backend, "M4_HOOK_SET_OFFSET_TYPE", backend->get_packed_type(backend, optimize_pack(tblend + numecs + 1))); + backend->comment(backend, "END of Flex-generated definitions"); skelout (true); /* %% [2.0] - tables get dumped here */ @@ -218,36 +224,38 @@ int flex_main (int argc, char *argv[]) skelout (true); /* %% [3.0] - mode-dependent static declarations get dumped here */ - out (&action_array[defs1_offset]); + backend->verbatim(backend, &action_array[defs1_offset]); + backend->newline(backend); line_directive_out (stdout, NULL, linenum); skelout (true); /* %% [4.0] - various random yylex internals get dumped here */ /* Copy prolog to output file. */ - out (&action_array[prolog_offset]); + backend->verbatim(backend, &action_array[prolog_offset]); + backend->newline(backend); line_directive_out (stdout, NULL, linenum); skelout (true); /* %% [5.0] - main loop of matching-engine code gets dumped here */ /* Copy actions to output file. */ - out (&action_array[action_offset]); + backend->verbatim(backend, &action_array[action_offset]); + backend->newline(backend); line_directive_out (stdout, NULL, linenum); /* generate cases for any missing EOF rules */ for (i = 1; i <= lastsc; ++i) if (!sceof[i]) { - out_str ("M4_HOOK_EOF_STATE_CASE_ARM(%s)", scname[i]); - outc('\n'); - out ("M4_HOOK_EOF_STATE_CASE_FALLTHROUGH"); - outc('\n'); + backend->format_eof_state_case_arm(backend, scname[i]); + backend->eof_state_case_fallthrough(backend); + backend->newline(backend); did_eof_rule = true; } if (did_eof_rule) { - out ("M4_HOOK_EOF_STATE_CASE_TERMINATE"); + backend->eof_state_case_terminate(backend); } skelout (true); @@ -257,13 +265,15 @@ int flex_main (int argc, char *argv[]) line_directive_out (stdout, infilename, linenum); if (sectnum == 3) { - OUT_BEGIN_CODE (); + backend->verbatim(backend, "m4_ifdef( [[M4_YY_IN_HEADER]],,[[m4_dnl"); + backend->newline(backend); if (!ctrl.no_section3_escape) fputs("[[", stdout); (void) flexscan (); /* copy remainder of input to output */ if (!ctrl.no_section3_escape) fputs("]]", stdout); - OUT_END_CODE (); + backend->verbatim(backend, "]])"); + backend->newline(backend); } /* Note, flexend does not return. It exits with its argument @@ -722,6 +732,9 @@ void flexinit (int argc, char **argv) buf_init (&userdef_buf, sizeof (char)); /* one long string */ buf_init (&top_buf, sizeof (char)); /* one long string */ + init_backends(); + push_backend(FLEX_BACKEND_CPP); + sf_init (); /* Enable C++ if program name ends with '+'. */ @@ -1193,6 +1206,8 @@ void flexinit (int argc, char **argv) void readin (void) { char buf[256]; + flex_backend_id_t backend_id; + const struct flex_backend_t *backend = NULL; line_directive_out(NULL, infilename, linenum); @@ -1210,10 +1225,15 @@ void readin (void) * when %option emit was evaluated; this catches command-line * optiins and the default case. */ - backend_by_name(ctrl.emit); + backend_id = backend_by_name(ctrl.emit); + if ( backend_id != top_backend() ) + /* only push a new backend if it's not already the top */ + push_backend(backend_id); initialize_output_filters(); + backend = get_backend(); + yyout = stdout; if (tablesext) @@ -1265,39 +1285,42 @@ void readin (void) skelout(false); /* [0.0] Make hook macros available, silently */ - comment("A lexical scanner generated by flex\n"); + backend->comment(backend, "A lexical scanner generated by flex"); + backend->newline(backend); /* Dump the %top code. */ if( top_buf.elts) - outn((char*) top_buf.elts); + backend->verbatim(backend, (char*) top_buf.elts); + backend->newline(backend); /* Place a bogus line directive, it will be fixed in the filter. */ line_directive_out(NULL, NULL, 0); /* User may want to set the scanner prototype */ if (ctrl.yydecl != NULL) { - out_str ("M4_HOOK_SET_YY_DECL(%s)\n", ctrl.yydecl); + backend->filter_call_macro(backend, "M4_HOOK_SET_YY_DECL", ctrl.yydecl); } if (ctrl.userinit != NULL) { - out_str ("M4_HOOK_SET_USERINIT(%s)\n", ctrl.userinit); + backend->filter_call_macro(backend, "M4_HOOK_SET_USERINIT", ctrl.userinit); } if (ctrl.preaction != NULL) { - out_str ("M4_HOOK_SET_PREACTION(%s)\n", ctrl.preaction); + backend->filter_call_macro(backend, "M4_HOOK_SET_PREACTION", ctrl.preaction); } if (ctrl.postaction != NULL) { - out_str ("M4_HOOK_SET_POSTACTION(%s)\n", ctrl.postaction); + backend->filter_call_macro(backend, "M4_HOOK_SET_POSTACTION", ctrl.postaction); } /* This has to be a straight textual substitution rather * than a constant declaration because in C a const is * not const enough to be a static array bound. */ - out_dec ("m4_define([[YYLMAX]], [[%d]])\n", ctrl.yylmax); + backend->filter_define_vard(backend, "YYLMAX", ctrl.yylmax); /* Dump the user defined preproc directives. */ if (userdef_buf.elts) - outn ((char *) (userdef_buf.elts)); + backend->verbatim(backend, (char *) (userdef_buf.elts)); + backend->newline(backend); /* If the user explicitly requested posix compatibility by specifying the * posix-compat option, then we check for conflicting options. However, if @@ -1414,30 +1437,21 @@ void readin (void) // that historically used to be generated by C code in flex // itself; by shoving all this stuff out to the skeleton file // we make it easier to retarget the code generation. - snprintf(buf, sizeof(buf), "Target: %s\n", ctrl.backend_name); - comment(buf); - comment("START of m4 controls\n"); + snprintf(buf, sizeof(buf), "Target: %s", ctrl.backend_name); + backend->comment(backend, buf); + backend->newline(backend); + backend->comment(backend, "START of m4 controls"); + backend->newline(backend); /* Define the start condition macros. */ { - struct Buf tmpbuf; - int i; - buf_init(&tmpbuf, sizeof(char)); + int i = 0; + // FIXME: Not dumped visibly because we plan to do away with the indirection + backend->filter_define_name(backend, "M4_YY_SC_DEFS", true); for (i = 1; i <= lastsc; i++) { - char *str, *fmt = "M4_HOOK_CONST_DEFINE_STATE(%s, %d)"; - size_t strsz; - - strsz = strlen(fmt) + strlen(scname[i]) + (size_t)(1 + ceil (log10(i))) + 2; - str = malloc(strsz); - if (!str) - flexfatal(_("allocation of macro definition failed")); - snprintf(str, strsz, fmt, scname[i], i - 1); - buf_strappend(&tmpbuf, str); - free(str); + backend->format_state_const(backend, scname[i], i-1); } - // FIXME: Not dumped visibly because we plan to do away with the indirection - out_m4_define("M4_YY_SC_DEFS", tmpbuf.elts); - buf_destroy(&tmpbuf); + backend->filter_define_close(backend, NULL); /* End YY_SC_DEFS */ } if (ctrl.bison_bridge_lval) @@ -1557,7 +1571,7 @@ void readin (void) if (ctrl.yyclass != NULL) { visible_define ( "M4_MODE_YYCLASS"); - out_m4_define("M4_YY_CLASS_NAME", ctrl.yyclass); + backend->filter_define_vars(backend, "M4_YY_CLASS_NAME", ctrl.yyclass); } if (ctrl.ddebug) @@ -1673,8 +1687,8 @@ void readin (void) else visible_define ( "M4_MODE_NO_REWRITE"); - comment("END of m4 controls\n"); - out ("\n"); + backend->comment(backend, "END of m4 controls"); + backend->newline(backend); } /* set_up_initial_allocations - allocate memory for internal tables */ diff --git a/src/misc.c b/src/misc.c index 56d2abab..6d1ca677 100644 --- a/src/misc.c +++ b/src/misc.c @@ -32,6 +32,7 @@ /* PURPOSE. */ #include "flexdef.h" #include "tables.h" +#include "skeletons.h" /* Append "new_text" to the running buffer. */ void add_action (const char *new_text) @@ -157,17 +158,20 @@ int cclcmp (const void *a, const void *b) /* dataend - finish up a block of data declarations */ -void dataend (const char *endit) +void dataend (const int endit) { + const struct flex_backend_t *backend = get_backend(); + /* short circuit any output */ if (gentables) { + /* Pretty print the end of the current data line. */ if (datapos > 0) dataflush (); - /* add terminator for initialization; { for vi */ + /* Optionally, close the table. */ if (endit) - outn (endit); + backend->close_table(backend); } dataline = 0; datapos = 0; @@ -178,16 +182,19 @@ void dataend (const char *endit) void dataflush (void) { - assert (gentables); + const struct flex_backend_t *backend = get_backend(); + if (!gentables) + return; + if (datapos > 0) - outc ('\n'); + backend->newline(backend); if (++dataline >= NUMDATALINES) { /* Put out a blank line so that the table is grouped into * large blocks that enable the user to find elements easily. */ - outc ('\n'); + backend->newline(backend); dataline = 0; } @@ -246,45 +253,9 @@ void lerr_fatal (const char *msg, ...) /* line_directive_out - spit out a "#line" statement or equivalent */ void line_directive_out (FILE *output_file, char *path, int linenum) { - char *trace_fmt = "m4_ifdef([[M4_HOOK_TRACE_LINE_FORMAT]], [[M4_HOOK_TRACE_LINE_FORMAT([[%d]], [[%s]])]])"; - char directive[MAXLINE*2], filename[MAXLINE]; - char *s1, *s2, *s3; - - if (!ctrl.gen_line_dirs) - return; - - s1 = (path != NULL) ? path : "M4_YY_OUTFILE_NAME"; - - if ((path != NULL) && !s1) - s1 = ""; - - s2 = filename; - s3 = &filename[sizeof (filename) - 2]; - - while (s2 < s3 && *s1) { - if (*s1 == '\\' || *s1 == '"') - /* Escape the '\' or '"' */ - *s2++ = '\\'; - - *s2++ = *s1++; - } - - *s2 = '\0'; - - if (path != NULL) - snprintf (directive, sizeof(directive), trace_fmt, linenum, filename); - else { - snprintf (directive, sizeof(directive), trace_fmt, 0, filename); - } + const struct flex_backend_t *backend = get_backend(); - /* If output_file is nil then we should put the directive in - * the accumulated actions. - */ - if (output_file) { - fputs (directive, output_file); - } - else - add_action (directive); + backend->line_directive_out(backend, output_file, path, linenum); } @@ -318,25 +289,25 @@ void mark_prolog (void) */ void mk2data (int value) { + const struct flex_backend_t *backend = get_backend(); + /* short circuit any output */ if (!gentables) return; if (datapos >= NUMDATAITEMS) { - outc (','); + backend->column_separator(backend); dataflush (); } if (datapos == 0) - /* Indent. */ - out (" "); - + backend->indent(backend); else - outc (','); + backend->column_separator(backend); ++datapos; - out_dec ("%5d", value); + backend->format_data_table_entry(backend, value); } @@ -347,23 +318,25 @@ void mk2data (int value) */ void mkdata (int value) { + const struct flex_backend_t *backend = get_backend(); + /* short circuit any output */ if (!gentables) return; if (datapos >= NUMDATAITEMS) { - outc (','); + backend->column_separator(backend); dataflush (); } if (datapos == 0) - /* Indent. */ - out (" "); + backend->indent(backend); else - outc (','); + backend->column_separator(backend); + ++datapos; - out_dec ("%5d", value); + backend->format_data_table_entry(backend, value); } @@ -454,62 +427,6 @@ unsigned char myesc (unsigned char array[]) } -/* out - various flavors of outputting a (possibly formatted) string for the - * generated scanner, keeping track of the line count. - */ - -void out (const char *str) -{ - fputs (str, stdout); -} - -void out_dec (const char *fmt, int n) -{ - fprintf (stdout, fmt, n); -} - -void out_dec2 (const char *fmt, int n1, int n2) -{ - fprintf (stdout, fmt, n1, n2); -} - -void out_hex (const char *fmt, unsigned int x) -{ - fprintf (stdout, fmt, x); -} - -void out_str (const char *fmt, const char str[]) -{ - fprintf (stdout,fmt, str); -} - -void out_str_dec (const char *fmt, const char str[], int n) -{ - fprintf (stdout,fmt, str, n); -} - -void outc (int c) -{ - fputc (c, stdout); -} - -void outn (const char *str) -{ - fputs (str,stdout); - fputc('\n',stdout); -} - -/** Print "m4_define( [[def]], [[val]])m4_dnl\n". - * @param def The m4 symbol to define. - * @param val The definition; may be NULL. - */ -void out_m4_define (const char* def, const char* val) -{ - const char * fmt = "m4_define( [[%s]], [[%s]])m4_dnl\n"; - fprintf(stdout, fmt, def, val?val:""); -} - - /* readable_form - return the the human-readable form of a character * * The returned string is in static storage. @@ -599,21 +516,26 @@ void *reallocate_array (void *array, int size, size_t element_size) void transition_struct_out (int element_v, int element_n) { + const struct flex_backend_t *backend = get_backend(); /* short circuit any output */ if (!gentables) return; - out_dec2 ("M4_HOOK_TABLE_OPENER[[%4d]],[[%4d]]M4_HOOK_TABLE_CONTINUE", element_v, element_n); - outc ('\n'); + backend->open_table(backend); + backend->format_data_table_entry(backend, element_v); + backend->column_separator(backend); + backend->format_data_table_entry(backend, element_n); + backend->continue_table(backend); + backend->newline(backend); datapos += TRANS_STRUCT_PRINT_LENGTH; if (datapos >= 79 - TRANS_STRUCT_PRINT_LENGTH) { - outc ('\n'); + backend->newline(backend); if (++dataline % 10 == 0) - outc ('\n'); + backend->newline(backend); datapos = 0; } @@ -659,19 +581,4 @@ char *chomp (char *str) return str; } -void comment(const char *txt) -{ - char buf[MAXLINE]; - bool eol; - - strncpy(buf, txt, MAXLINE-1); - eol = buf[strlen(buf)-1] == '\n'; - - if (eol) - buf[strlen(buf)-1] = '\0'; - out_str("M4_HOOK_COMMENT_OPEN [[%s]] M4_HOOK_COMMENT_CLOSE", buf); - if (eol) - outc ('\n'); -} - diff --git a/src/parse.y b/src/parse.y index 80e7f097..82172b30 100644 --- a/src/parse.y +++ b/src/parse.y @@ -66,6 +66,7 @@ #include "flexdef.h" #include "tables.h" +#include "skeletons.h" int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen; static int currccl; @@ -79,6 +80,9 @@ static int madeany = false; /* whether we've made the '.' character class */ static int ccldot, cclany; int previous_continued_action; /* whether the previous rule's action was '|' */ +static flex_backend_id_t backend_id; +static const struct flex_backend_t *backend = NULL; + #define format_warn3(fmt, a1, a2) \ do{ \ char fw3_msg[MAXLINE];\ @@ -117,6 +121,10 @@ int previous_continued_action; /* whether the previous rule's action was '|' */ %} +%initial-action { + backend = get_backend(); +}; + %% goal : initlex sect1 sect1end sect2 initforrule { /* add default rule */ @@ -140,13 +148,14 @@ goal : initlex sect1 sect1end sect2 initforrule add_action("]]"); if ( ctrl.spprdflt ) - add_action( - "M4_HOOK_FATAL_ERROR(\"flex scanner jammed\")"); + add_action( backend->get_fatal_error(backend, "\"flex scanner jammed\"") ); else { - add_action("M4_HOOK_ECHO"); + add_action( backend->get_echo(backend) ); } - add_action( "\n\tM4_HOOK_STATE_CASE_BREAK\n" ); + add_action( "\n\t" ); + add_action( backend->get_state_case_break(backend) ); + add_action( "\n" ); } ; @@ -223,7 +232,14 @@ option : TOK_OUTFILE '=' NAME | TOK_BUFSIZE '=' TOK_NUMERIC { ctrl.bufsize = nmval; } | TOK_EMIT '=' NAME - { ctrl.emit = xstrdup(nmstr); backend_by_name(ctrl.emit); } + { ctrl.emit = xstrdup(nmstr); + backend_id = backend_by_name(ctrl.emit); + if ( backend_id != top_backend() ) { + /* only push a new backend if it's not already the top */ + push_backend(backend_id); + backend = get_backend(); + } + } | TOK_USERINIT '=' NAME { ctrl.userinit = xstrdup(nmstr); } | TOK_YYTERMINATE '=' NAME @@ -978,7 +994,6 @@ string : string CHAR void build_eof_action(void) { int i; - char action_text[MAXLINE]; for ( i = 1; i <= scon_stk_ptr; ++i ) { @@ -991,12 +1006,13 @@ void build_eof_action(void) { sceof[scon_stk[i]] = true; - if (previous_continued_action /* && previous action was regular */) - add_action("YY_RULE_SETUP\n"); + if (previous_continued_action /* && previous action was regular */) { + add_action( backend->get_rule_setup(backend) ); + add_action( "\n" ); + } - snprintf( action_text, sizeof(action_text), "M4_HOOK_EOF_STATE_CASE_ARM(%s)\n", - scname[scon_stk[i]] ); - add_action( action_text ); + add_action( backend->get_eof_state_case_arm(backend, scname[scon_stk[i]]) ); + add_action( "\n" ); } } diff --git a/src/skeletons.c b/src/skeletons.c index 84e3a4fd..59488c33 100644 --- a/src/skeletons.c +++ b/src/skeletons.c @@ -34,57 +34,124 @@ #include "flexdef.h" #include "tables.h" +#include "skeletons.h" + /* START digested skeletons */ -const char *cpp_skel[] = { -#include "cpp-flex.h" - 0, -}; +#include "cpp-backend.h" -const char *c99_skel[] = { -#include "c99-flex.h" - 0, -}; +#include "c99-backend.h" const char *go_skel[] = { +/* FIXME: Refactor like cpp-backend when Go backend is ready. #include "go-flex.h" +*/ 0, }; /* END digested skeletons */ -/* Method table describing a language-specific back end. - * Even if this never gets a member other than the skel - * array, it prevents us from getting lost in a maze of - * twisty array reference levels, all different. + +/* backends is an array of skeleton code-emitting backend structs. +/* It uses the flex_backend_t enum so we don't have to care what order it's in. */ -struct flex_backend_t { - const char **skel; // Digested skeleton file -}; +static struct flex_backend_t backends[FLEX_BACKEND_ID_MAX]; + +/* backend_stack is an array-based stack of flex_backend_ids. +/* It lets us keep track of which skeleton and emitter are in use and allows +/* us to switch to another backend during runtime, for example to dump an +/* auxiliary table. +/* The need to switch backends should be uncommon, the stack is only as deep +/* as the number of available backends. +/* backen_stack_head is declared static so it must be manipulated through +/* the stack functions defined in this module. + */ +flex_backend_id_t backend_stack[FLEX_BACKEND_ID_MAX+1]; +static unsigned int backend_stack_head = 0; -static struct flex_backend_t backends[] = { - {.skel=cpp_skel}, - {.skel=c99_skel}, - {.skel=go_skel}, - {NULL} -}; +/* Push a flex_backend_id onto the backend stack. +/* Returns false when the stack is full, and true otherwise. + */ +bool push_backend(flex_backend_id_t bid){ + ++backend_stack_head; + if( backend_stack_head >= FLEX_BACKEND_ID_MAX ){ + --backend_stack_head; + flexerror(_("backend stack depth exceeded")); + return false; + } + else { + backend_stack[backend_stack_head-1] = bid; + } + return true; +} + +/* Pop a flex_backend_id off of the backend stack. +/* Returns the FLEX_BACKEND_ID_MAX when the stack is empty, and the +/* popped backend id otherwise. */ +flex_backend_id_t pop_backend(void) { + flex_backend_id_t ret = FLEX_BACKEND_ID_MAX; + if( backend_stack_head > 0 ) { + ret = backend_stack[backend_stack_head-1]; + --backend_stack_head; + return ret; + } + else { + flexerror(_("attempt to pop empty backend stack")); + return ret; + } +} + +/* Return the flex_backend_id on top of the backend stack. +/* Returns the FLEX_BACKEND_ID_MAX when the stack is empty, and the +/* top backend id otherwise. */ +flex_backend_id_t top_backend(void){ + if( backend_stack_head > 0 ) { + return backend_stack[backend_stack_head-1]; + } + else { + flexerror(_("attempt to read the top of empty backend stack")); + return FLEX_BACKEND_ID_MAX; + } +} -static struct flex_backend_t *backend = &backends[0]; + + + +const struct flex_backend_t *get_backend(void) { + return &backends[top_backend()]; +} + +/* Initialize backends */ +void init_backends( void ) { + backends[FLEX_BACKEND_CPP] = cpp_backend; + backends[FLEX_BACKEND_C99] = c99_backend; + backends[FLEX_BACKEND_GO].skel=go_skel; + backends[FLEX_BACKEND_ID_MAX] = (struct flex_backend_t){NULL}; +} /* Functions for querying skeleton properties. */ +const char *_skel_property(const flex_backend_id_t backend_id, const char *propname); +static bool _boneseeker(const flex_backend_id_t backend_id, const char *bone); +/* TODO: What does this mean now? */ bool is_default_backend(void) { - return backend == &backends[0]; + return top_backend() == FLEX_BACKEND_DEFAULT; } /* Search for a string in the skeleton prolog, where macros are defined. */ -static bool boneseeker(const char *bone) +static bool boneseeker(const char *bone) { + return _boneseeker(top_backend(), bone); +} + +static bool _boneseeker(const flex_backend_id_t backend_id, const char *bone) { int i; + const struct flex_backend_t *backend = &backends[backend_id]; + for (i = 0; backend->skel[i] != NULL; i++) { const char *line = backend->skel[i]; if (strstr(line, bone) != NULL) @@ -95,36 +162,42 @@ static bool boneseeker(const char *bone) return false; } -void backend_by_name(const char *name) +flex_backend_id_t backend_by_name(const char *name) { const char *prefix_property; + flex_backend_id_t backend_id = FLEX_BACKEND_DEFAULT, i = FLEX_BACKEND_DEFAULT; + if (name != NULL) { if (strcmp(name, "nr") == 0) { - backend = &backends[0]; + backend_id = FLEX_BACKEND_CPP; ctrl.reentrant = false; goto backend_ok; } if (strcmp(name, "r") == 0) { - backend = &backends[0]; + backend_id = FLEX_BACKEND_CPP; ctrl.reentrant = true; goto backend_ok; } - for (backend = &backends[0]; backend->skel != NULL; backend++) { - if (strcasecmp(skel_property("M4_PROPERTY_BACKEND_NAME"), name) == 0) + for (i = 0; backends[i].skel != NULL && i < FLEX_BACKEND_ID_MAX; ++i) { + if (strcasecmp(_skel_property(i, "M4_PROPERTY_BACKEND_NAME"), name) == 0) { + backend_id = i; goto backend_ok; + } } flexerror(_("no such back end")); + return FLEX_BACKEND_ID_MAX; } backend_ok: ctrl.rewrite = !is_default_backend(); - ctrl.backend_name = xstrdup(skel_property("M4_PROPERTY_BACKEND_NAME")); - ctrl.traceline_re = xstrdup(skel_property("M4_PROPERTY_TRACE_LINE_REGEXP")); - ctrl.traceline_template = xstrdup(skel_property("M4_PROPERTY_TRACE_LINE_TEMPLATE")); - ctrl.have_state_entry_format = boneseeker("m4_define([[M4_HOOK_STATE_ENTRY_FORMAT]]"); - prefix_property = skel_property("M4_PROPERTY_PREFIX"); + ctrl.backend_name = xstrdup(_skel_property(backend_id, "M4_PROPERTY_BACKEND_NAME")); + ctrl.traceline_re = xstrdup(_skel_property(backend_id, "M4_PROPERTY_TRACE_LINE_REGEXP")); + ctrl.traceline_template = xstrdup(_skel_property(backend_id, "M4_PROPERTY_TRACE_LINE_TEMPLATE")); + ctrl.have_state_entry_format = _boneseeker(backend_id, "m4_define([[M4_HOOK_STATE_ENTRY_FORMAT]]"); + prefix_property = _skel_property(backend_id, "M4_PROPERTY_PREFIX"); if (prefix_property != NULL) ctrl.prefix = xstrdup(prefix_property); flex_init_regex(ctrl.traceline_re); + return backend_id; } const char *suffix (void) @@ -147,11 +220,16 @@ const char *suffix (void) * definition must be single-line. Don't call this a second time before * stashing away the previous return, we cheat with static buffers. */ -const char *skel_property(const char *propname) +const char *skel_property(const char *propname){ + return _skel_property(top_backend(), propname); +} + +const char *_skel_property(const flex_backend_id_t backend_id, const char *propname) { int i; static char name[256], value[256], *np, *vp;; const char *cp; + const struct flex_backend_t *backend = &backends[backend_id]; for (i = 0; backend->skel[i] != NULL; i++) { const char *line = backend->skel[i]; @@ -212,6 +290,7 @@ void skelout (bool announce) char buf_storage[MAXLINE]; char *buf = buf_storage; bool do_copy = true; + const struct flex_backend_t *backend = get_backend(); /* Loop pulling lines either from the skelfile, if we're using * one, or from the selected back end's skel[] array. @@ -227,8 +306,8 @@ void skelout (bool announce) if (buf[0] == '%') { /* control line */ /* print the control line as a comment. */ if (ctrl.ddebug && buf[1] != '#') { - comment(buf); - outc ('\n'); + backend->comment(backend, buf); + backend->newline(backend); } if (buf[1] == '#') { /* %# indicates comment line to be ignored */ @@ -236,8 +315,8 @@ void skelout (bool announce) else if (buf[1] == '%') { /* %% is a break point for skelout() */ if (announce) { - comment(buf); - outc ('\n'); + backend->comment(backend, buf); + backend->newline(backend); } return; } @@ -246,10 +325,255 @@ void skelout (bool announce) } } - else if (do_copy) - outn (buf); + else if (do_copy) { + backend->verbatim(backend, buf); + backend->newline(backend); + } } /* end while */ } +/* Combine the format string from *_get_trace_line_format with its arguments. */ +void _format_line_directive_out ( const struct flex_backend_t *b, FILE *output_file, char *path, int linenum ) { + char directive[MAXLINE*2], filename[MAXLINE]; + char *s1, *s2, *s3; + + if (!ctrl.gen_line_dirs) { + return; + } + + /* char *infilename is in the global namespace */ + s1 = (path != NULL) ? path : infilename; + + if ((path != NULL) && !s1) { + s1 = ""; + } + + s2 = filename; + s3 = &filename[sizeof (filename) - 2]; + + while (s2 < s3 && *s1) { + if (*s1 == '\\' || *s1 == '"') { + /* Escape the '\' or '"' */ + *s2++ = '\\'; + } + + *s2++ = *s1++; + } + + *s2 = '\0'; + + if (path != NULL) { + snprintf (directive, sizeof(directive), b->get_trace_line_format(b), linenum, filename); + } else { + snprintf (directive, sizeof(directive), b->get_trace_line_format(b), 0, filename); + } + + /* If output_file is nil then we should put the directive in + * the accumulated actions. + */ + if (output_file) { + fputs (directive, output_file); + } + else { + add_action (directive); + } +} + +void _format_comment ( const struct flex_backend_t *b, const char *const c ) { + b->indent(b); + fputs(b->get_comment(b, c), stdout); +} + +/* +void _format_open_table ( const struct flex_backend_t *b ); + +void _format_continue_table ( const struct flex_backend_t *b ); + +void _format_close_table ( const struct flex_backend_t *b ); +*/ + +/* Intended to emit a macro call in C/CXX. + Can also emit a bare string. + */ +void _verbatim ( const struct flex_backend_t *b, const char *s ) { + if (s) + fputs(s, stdout); + + return; +} + +/* Emit a case for the main state switch. +*/ +void _format_normal_state_case_arm ( const struct flex_backend_t *b, int c ) { + b->indent(b); + fputs(b->get_normal_state_case_arm(b, c), stdout); +} + +/* Emit the special case arm for EOF. */ +void _format_eof_state_case_arm ( const struct flex_backend_t *b, const char *const c ) { + b->indent(b); + fputs(b->get_eof_state_case_arm(b, c), stdout); +} + +/* +void _format_eof_state_case_fallthrough ( const struct flex_backend_t *b ); + +void _format_eof_state_case_terminate ( const struct flex_backend_t *b ); +*/ + +/* Emit the action preamble. */ +void _format_take_yytext ( const struct flex_backend_t *b ) { + b->indent(b); + fputs(b->get_take_yytext(b), stdout); +} + +/* Emit the action postamble. */ +void _format_release_yytext ( const struct flex_backend_t *b ) { + b->indent(b); + fputs( b->get_release_yytext(b), stdout); +} + +/* Emit the buffer rewind sub-action. */ +void _format_char_rewind ( const struct flex_backend_t *b, int c ) { + b->indent(b); + fputs(b->get_char_rewind(b, c), stdout); +} + +/* Emit the line rewind sub-action. */ +void _format_line_rewind ( const struct flex_backend_t *b, int l ) { + b->indent(b); + fputs(b->get_line_rewind(b,l), stdout); +} + +/* Emit the buffer skip sub-action. */ +void _format_char_forward ( const struct flex_backend_t *b, int c ) { + b->indent(b); + fputs(b->get_char_forward(b, c), stdout); +} + +/* Emit the line skip sub-action. */ +void _format_line_forward ( const struct flex_backend_t *b, int l ) { + b->indent(b); + fputs(b->get_line_forward(b,l), stdout); +} + +/* +void _format_yy_decl ( const struct flex_backend_t *b, const char *d ); + +void _format_userinit ( const struct flex_backend_t *b, const char *d ); +*/ + +/* Define a string constant. */ +void _format_const ( const struct flex_backend_t *b, const char *n, const char *v ) { + fputs(b->get_const(b, n, v), stdout); +} + + +/* Inject the rule_setup macro call where needed. */ +void _format_rule_setup ( const struct flex_backend_t *b ) { + fputs(b->get_rule_setup(b), stdout); + b->newline(b); +} + + +/* Emit the user_action constant, if needed. */ +void _format_user_preaction ( const struct flex_backend_t *b, const char *d ) { + fputs(b->get_user_preaction(b, d), stdout); +} + +/* End a state case arm, optionally inserting user postactions. */ +void _format_state_case_break ( const struct flex_backend_t *b ) { + b->indent(b); + b->get_state_case_break(b); +} + +/* Generate the definition of the STATE_CASE_BREAK end of action. */ +void _format_user_postaction ( const struct flex_backend_t *b, const char *d ) { + fputs(b->get_user_postaction(b, d), stdout); +} + +/* Emit the fatal_error action. */ +void _format_fatal_error ( const struct flex_backend_t *b, const char *e ) { + b->indent(b); + fputs(b->get_fatal_error(b, e), stdout); +} + + +/* Emit the echo action. */ +void _echo ( const struct flex_backend_t *b ) { + b->indent(b); + fputs(b->get_echo(b), stdout); +} + +void _format_yyterminate ( const struct flex_backend_t *b, const char *d ) { + fputs(b->get_yyterminate(b, d), stdout); +} + +/* Emit the reject special action. */ +void _format_yyreject ( const struct flex_backend_t *b ) { + b->indent(b); + fputs(b->get_yyreject(b), stdout); +} + +/* Define a symbol used by the output filter system. + Optionally, leave the definition open to encompass a block of verbatim output. +*/ +void _filter_define_name ( const struct flex_backend_t *b, const char *n, const int leave_open ) { + b->verbatim(b, "m4_define([["); + b->verbatim(b, n); + b->verbatim(b, "]], [["); + if (leave_open) + b->verbatim(b, "m4_dnl"); + else + b->verbatim(b, "]])m4_dnl"); + b->newline(b); +} + +/* Close a filter symbol definition that was left open by a call to filter_define_name. + Optionally, provide a final string of verbatim output to emit before closing the definition block. +*/ +void _filter_define_close (const struct flex_backend_t *b, const char *v) { + b->verbatim(b, v); + b->verbatim(b, "]])m4_dnl"); + b->newline(b); +} + +/* Define a variable used by the output filter system. + Provide a string value the filter will substitue for the variable when it is encountered + later in the output. +*/ +void _filter_define_vars ( const struct flex_backend_t *b, const char *n, const char *v ) { + b->filter_define_name(b, n, true); + b->filter_define_close(b, v); +} + +/* Define a variable used by the output filter system. + Provide a numeric value the filter will substitue for the variable when it is encountered + later in the output. +*/ +void _filter_define_vard ( const struct flex_backend_t *b, const char *n, const int v ) { + b->filter_define_name(b, n, true); + fprintf(stdout, "%d", v); + b->filter_define_close(b, NULL); +} + +/* Format a macro replacement through the output filter system. + Filter macros are defined like variables. The syntax for defining a filter macro depends on the + filter chain in use. + + This example assumes the M4 filter chain where: every variable is a macro; the tokens following + the name are substituted for the macro name; if the first token following the name is an OPAREN, + it is followed by a comma-delimited list of positional parameters that are themselves substituded + into the text after the next CPAREN in place of the tokens '$1', '$2', etc. + + Flex's own filter macros only use one positional argument, currently. +*/ +void _filter_call_macro ( const struct flex_backend_t *b, const char *n, const char *v ) { + b->verbatim(b, n); + b->verbatim(b, "( "); + b->verbatim(b, v); + b->verbatim(b, " )"); + b->newline(b); +} /* end */ diff --git a/src/skeletons.h b/src/skeletons.h new file mode 100644 index 00000000..d6bc5efa --- /dev/null +++ b/src/skeletons.h @@ -0,0 +1,175 @@ + +/* skeletons.h - skeletons file for flex */ + +/* Copyright (c) 1990 The Regents of the University of California. */ +/* All rights reserved. */ + +/* This code is derived from software contributed to Berkeley by */ +/* Vern Paxson. */ + +/* The United States Government has rights in this work pursuant */ +/* to contract no. DE-AC03-76SF00098 between the United States */ +/* Department of Energy and the University of California. */ + +/* This file is part of flex. */ + +/* Redistribution and use in source and binary forms, with or without */ +/* modification, are permitted provided that the following conditions */ +/* are met: */ + +/* 1. Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* 2. Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in the */ +/* documentation and/or other materials provided with the distribution. */ + +/* Neither the name of the University nor the names of its contributors */ +/* may be used to endorse or promote products derived from this software */ +/* without specific prior written permission. */ + +/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ +/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ +/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ +/* PURPOSE. */ + + +#ifndef FLEX_SKELETONS_H +#define FLEX_SKELETONS_H 1 + +#include "flexdef.h" + +bool push_backend(flex_backend_id_t); +flex_backend_id_t pop_backend(void); +flex_backend_id_t top_backend(void); + +/* Method table describing a language-specific back end. + * Even if this never gets a member other than the skel + * array, it prevents us from getting lost in a maze of + * twisty array reference levels, all different. + */ +struct flex_backend_t { + const char **skel; // Digested skeleton file + unsigned int indent_level; + const char * (*get_int32_type) ( const struct flex_backend_t *b ); + const char * (*get_int16_type) ( const struct flex_backend_t *b ); + const char * (*get_state_type) ( const struct flex_backend_t *b ); + const char * (*get_packed_type) (const struct flex_backend_t *b, struct packtype_t *p); + void (*open_block_comment) ( const struct flex_backend_t *b ); + void (*close_block_comment) ( const struct flex_backend_t *b ); + const char * (*get_comment) ( const struct flex_backend_t *b, const char *c ); + void (*comment) ( const struct flex_backend_t *b, const char *c ); + void (*record_separator) ( const struct flex_backend_t *b ); + void (*column_separator) ( const struct flex_backend_t *b ); + void (*newline) ( const struct flex_backend_t *b ); + void (*increase_indent) ( const struct flex_backend_t *b ); + void (*decrease_indent) ( const struct flex_backend_t *b ); + void (*indent) ( const struct flex_backend_t *b ); + const char * (*get_trace_line_format) ( const struct flex_backend_t *b ); + void (*line_directive_out) ( const struct flex_backend_t *b, FILE *output_file, char *path, int linenum ); + void (*open_table) ( const struct flex_backend_t *b ); + void (*continue_table) ( const struct flex_backend_t *b ); + void (*close_table) ( const struct flex_backend_t *b ); + void (*verbatim) ( const struct flex_backend_t *b, const char *s ); + void (*format_data_table_entry) ( const struct flex_backend_t *b, int t ); + void (*format_state_table_entry) ( const struct flex_backend_t *b, int t ); + const char * (*get_normal_state_case_arm) ( const struct flex_backend_t *b, int c ); + void (*format_normal_state_case_arm) ( const struct flex_backend_t *b, int c ); + const char * (*get_eof_state_case_arm) ( const struct flex_backend_t *b, const char *const c ); + void (*format_eof_state_case_arm) ( const struct flex_backend_t *b, const char *const c ); + void (*eof_state_case_fallthrough) ( const struct flex_backend_t *b ); + void (*eof_state_case_terminate) ( const struct flex_backend_t *b ); + const char * (*get_take_yytext) ( const struct flex_backend_t *b ); + void (*format_take_yytext) ( const struct flex_backend_t *b ); + const char * (*get_release_yytext) ( const struct flex_backend_t *b ); + void (*format_release_yytext) ( const struct flex_backend_t *b ); + const char * (*get_char_rewind) ( const struct flex_backend_t *b, int c ); + void (*format_char_rewind) ( const struct flex_backend_t *b, int c ); + const char * (*get_line_rewind) ( const struct flex_backend_t *b, int l ); + void (*format_line_rewind) ( const struct flex_backend_t *b, int l ); + const char * (*get_char_forward) ( const struct flex_backend_t *b, int c ); + void (*format_char_forward) ( const struct flex_backend_t *b, int c ); + const char * (*get_line_forward) ( const struct flex_backend_t *b, int l ); + void (*format_line_forward) ( const struct flex_backend_t *b, int l ); + void (*format_byte_const) ( const struct flex_backend_t *b, const char *n, const int c ); + void (*format_state_const) ( const struct flex_backend_t *b, const char *n, const int s ); + void (*format_size_const) ( const struct flex_backend_t *b, const char *n, const int s ); + void (*format_uint_const) ( const struct flex_backend_t *b, const char *n, const unsigned int u ); + void (*format_bool_const) ( const struct flex_backend_t *b, const char *n, const int t ); + const char * (*get_const) ( const struct flex_backend_t *b, const char *n, const char *v ); + void (*format_const) ( const struct flex_backend_t *b, const char *n, const char *v ); + void (*format_offset_type) ( const struct flex_backend_t *b, const char *t ); + void (*format_yy_decl) ( const struct flex_backend_t *b, const char *d ); + void (*format_userinit) ( const struct flex_backend_t *b, const char *d ); + const char * (*get_rule_setup) ( const struct flex_backend_t *b ); + void (*format_rule_setup) ( const struct flex_backend_t *b ); + const char * (*get_user_preaction) ( const struct flex_backend_t *b, const char *d ); + void (*format_user_preaction) ( const struct flex_backend_t *b, const char *d ); + const char * (*get_state_case_break) ( const struct flex_backend_t *b ); + void (*format_state_case_break) ( const struct flex_backend_t *b ); + const char * (*get_user_postaction) ( const struct flex_backend_t *b, const char *d ); + void (*format_user_postaction) ( const struct flex_backend_t *b, const char *d ); + const char * (*get_fatal_error) ( const struct flex_backend_t *b, const char *e ); + void (*format_fatal_error) ( const struct flex_backend_t *b, const char *e ); + const char * (*get_echo) ( const struct flex_backend_t *b ); + void (*echo) ( const struct flex_backend_t *b ); + const char * (*get_yyterminate) ( const struct flex_backend_t *b, const char *d ); + void (*format_yyterminate) ( const struct flex_backend_t *b, const char *d ); + const char * (*get_yyreject) ( const struct flex_backend_t *b ); + void (*format_yyreject) ( const struct flex_backend_t *b ); + void (*filter_define_name) ( const struct flex_backend_t *b, const char *n, const int leave_open ); + void (*filter_define_close) (const struct flex_backend_t *b, const char *v); + void (*filter_define_vars) ( const struct flex_backend_t *b, const char *n, const char *v ); + void (*filter_define_vard) ( const struct flex_backend_t *b, const char *n, const int v ); + void (*filter_call_macro) ( const struct flex_backend_t *b, const char *n, const char *v ); +}; + +const struct flex_backend_t *get_backend(void); + +/* Default implementations for emitter functions */ +void _format_line_directive_out ( const struct flex_backend_t *b, FILE *output_file, char *path, int linenum ); +void _format_comment (const struct flex_backend_t *b, const char *const c); +void _format_open_table ( const struct flex_backend_t *b ); +void _format_continue_table ( const struct flex_backend_t *b ); +void _format_close_table ( const struct flex_backend_t *b ); +void _verbatim ( const struct flex_backend_t *b, const char *s ); +void _format_normal_state_case_arm ( const struct flex_backend_t *b, int c ); +void _format_eof_state_case_arm ( const struct flex_backend_t *b, const char *const c ); +void _format_eof_state_case_fallthrough ( const struct flex_backend_t *b ); +void _format_eof_state_case_terminate ( const struct flex_backend_t *b ); +void _format_take_yytext ( const struct flex_backend_t *b ); +void _format_release_yytext ( const struct flex_backend_t *b ); +void _format_char_rewind ( const struct flex_backend_t *b, int c ); +void _format_line_rewind ( const struct flex_backend_t *b, int l ); +void _format_char_forward ( const struct flex_backend_t *b, int c ); +void _format_line_forward ( const struct flex_backend_t *b, int l ); +/* +void _format_yy_decl ( const struct flex_backend_t *b, const char *d ); +void _format_userinit ( const struct flex_backend_t *b, const char *d ); +*/ +void _format_const ( const struct flex_backend_t *b, const char *n, const char *v ); +void _format_rule_setup ( const struct flex_backend_t *b ); +void _format_user_preaction ( const struct flex_backend_t *b, const char *d ); +void _format_state_case_break ( const struct flex_backend_t *b ); +void _format_user_postaction ( const struct flex_backend_t *b, const char *d ); +void _format_fatal_error ( const struct flex_backend_t *b, const char *e ); +void _echo ( const struct flex_backend_t *b ); +void _format_yyterminate ( const struct flex_backend_t *b, const char *d ); +void _format_yyreject ( const struct flex_backend_t *b ); +/* +void (*format_byte_const) ( const struct flex_backend_t *b, const char *n, const int c ); +void (*format_state_const) ( const struct flex_backend_t *b, const char *n, const int s ); +void (*format_size_const) ( const struct flex_backend_t *b, const char *n, const int s ); +void (*format_uint_const) ( const struct flex_backend_t *b, const char *n, const unsigned int u ); +void (*format_bool_const) ( const struct flex_backend_t *b, const char *n, const int t ); +void (*format_const) ( const struct flex_backend_t *b, const char *n, const char *v ); +void (*format_offset_type) ( const struct flex_backend_t *b, const char *t ); +*/ + +/* Default implementations of filter emitter fuctions */ +void _filter_define_name ( const struct flex_backend_t *b, const char *n, const int leave_open ); +void _filter_define_close (const struct flex_backend_t *b, const char *v); +void _filter_define_vars ( const struct flex_backend_t *b, const char *n, const char *v ); +void _filter_define_vard ( const struct flex_backend_t *b, const char *n, const int v ); +void _filter_call_macro ( const struct flex_backend_t *b, const char *n, const char *v ); + +#endif /* FLEX_SKELETONS_H */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 91ca5690..2ded7eeb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -61,7 +61,7 @@ AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src check_PROGRAMS = $(RULESET_TESTS) $(SPORADIC_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS) SPORADIC_TESTS = \ - alloc_extra_nr \ + alloc_extra_r \ alloc_extra_c99 \ bison_nr \ bison_yylloc \ @@ -107,7 +107,7 @@ I3_TESTS = \ PTHREAD_TESTS = \ pthread.pthread -alloc_extra_nr_SOURCES = alloc_extra_nr.l +alloc_extra_r_SOURCES = alloc_extra_r.l alloc_extra_c99_SOURCES = alloc_extra_c99.l if HAVE_BISON bison_nr_SOURCES = bison_nr_scanner.l bison_nr_parser.y bison_nr_main.c @@ -172,7 +172,7 @@ state_buf_multiple_direct_SOURCES = state_buf_multiple.direct.lll # it. CLEANFILES = \ - alloc_extra_nr.c \ + alloc_extra_r.c \ alloc_extra_c99.c \ bison_nr_parser.c \ bison_nr_parser.h \ @@ -399,13 +399,13 @@ top.h: top.c # Build rules for non-C back ends -.l.go: - $(AM_V_LEX)$(FLEX) $(TESTOPTS) -o $@ $< +#.l.go: +# $(AM_V_LEX)$(FLEX) $(TESTOPTS) -o $@ $< # This is a temporary fake rule for use while the Go back end still # actually generates C. -.go: - $(CC) $< -o $*_go +#.go: +# $(CC) $< -o $*_go # Most test productions can be autogenerated from ruleset files, but # automake has no way to specify such things with a loop in a variable @@ -437,8 +437,12 @@ RULESETS = \ $(srcdir)/yymorearraybol.rules \ $(srcdir)/yyunput.rules +#$(srcdir)/ruleset.am: $(srcdir)/ruleset.sh $(RULESETS) +# ( cd $(srcdir) && $(SHELL) ruleset.sh nr r c99 go >ruleset.am ) + $(srcdir)/ruleset.am: $(srcdir)/ruleset.sh $(RULESETS) - ( cd $(srcdir) && $(SHELL) ruleset.sh nr r c99 go >ruleset.am ) + ( cd $(srcdir) && $(SHELL) ruleset.sh nr r c99 >ruleset.am ) + include $(srcdir)/ruleset.am diff --git a/tests/alloc_extra_nr.l b/tests/alloc_extra_r.l similarity index 100% rename from tests/alloc_extra_nr.l rename to tests/alloc_extra_r.l diff --git a/tests/ruleset.am b/tests/ruleset.am index 35ea9447..c159f7d1 100644 --- a/tests/ruleset.am +++ b/tests/ruleset.am @@ -645,218 +645,6 @@ tableopts_ver_c99_Caem_ver_SOURCES = tableopts_ver_c99-Caem.ver.l tableopts_ver_c99-Caem.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ -array_go_SOURCES = array_go.l -array_go.l: $(srcdir)/array.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -basic_go_SOURCES = basic_go.l -basic_go.l: $(srcdir)/basic.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -bol_go_SOURCES = bol_go.l -bol_go.l: $(srcdir)/bol.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -ccl_go_SOURCES = ccl_go.l -ccl_go.l: $(srcdir)/ccl.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -debug_go_SOURCES = debug_go.l -debug_go.l: $(srcdir)/debug.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -extended_go_SOURCES = extended_go.l -extended_go.l: $(srcdir)/extended.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -fixedtrailing_go_SOURCES = fixedtrailing_go.l -fixedtrailing_go.l: $(srcdir)/fixedtrailing.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -flexname_go_SOURCES = flexname_go.l -flexname_go.l: $(srcdir)/flexname.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -lineno_go_SOURCES = lineno_go.l -lineno_go.l: $(srcdir)/lineno.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -posix_go_SOURCES = posix_go.l -posix_go.l: $(srcdir)/posix.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -preposix_go_SOURCES = preposix_go.l -preposix_go.l: $(srcdir)/preposix.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -quoteincomment_go_SOURCES = quoteincomment_go.l -quoteincomment_go.l: $(srcdir)/quoteincomment.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -reject_go_SOURCES = reject_go.l -reject_go.l: $(srcdir)/reject.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_go_SOURCES = tableopts_go.l -tableopts_go.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -vartrailing_go_SOURCES = vartrailing_go.l -vartrailing_go.l: $(srcdir)/vartrailing.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -yyless_go_SOURCES = yyless_go.l -yyless_go.l: $(srcdir)/yyless.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -yymore_go_SOURCES = yymore_go.l -yymore_go.l: $(srcdir)/yymore.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -yymorearray_go_SOURCES = yymorearray_go.l -yymorearray_go.l: $(srcdir)/yymorearray.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -yymorearraybol_go_SOURCES = yymorearraybol_go.l -yymorearraybol_go.l: $(srcdir)/yymorearraybol.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -yyunput_go_SOURCES = yyunput_go.l -yyunput_go.l: $(srcdir)/yyunput.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Ca_opt_SOURCES = tableopts_opt_go-Ca.opt.l -tableopts_opt_go-Ca.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Ce_opt_SOURCES = tableopts_opt_go-Ce.opt.l -tableopts_opt_go-Ce.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Cf_opt_SOURCES = tableopts_opt_go-Cf.opt.l -tableopts_opt_go-Cf.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_CxF_opt_SOURCES = tableopts_opt_go-CxF.opt.l -tableopts_opt_go-CxF.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Cm_opt_SOURCES = tableopts_opt_go-Cm.opt.l -tableopts_opt_go-Cm.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Cem_opt_SOURCES = tableopts_opt_go-Cem.opt.l -tableopts_opt_go-Cem.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Cae_opt_SOURCES = tableopts_opt_go-Cae.opt.l -tableopts_opt_go-Cae.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Caef_opt_SOURCES = tableopts_opt_go-Caef.opt.l -tableopts_opt_go-Caef.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_CaexF_opt_SOURCES = tableopts_opt_go-CaexF.opt.l -tableopts_opt_go-CaexF.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Cam_opt_SOURCES = tableopts_opt_go-Cam.opt.l -tableopts_opt_go-Cam.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_opt_go_Caem_opt_SOURCES = tableopts_opt_go-Caem.opt.l -tableopts_opt_go-Caem.opt.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Ca_ser_SOURCES = tableopts_ser_go-Ca.ser.l -tableopts_ser_go-Ca.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Ce_ser_SOURCES = tableopts_ser_go-Ce.ser.l -tableopts_ser_go-Ce.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Cf_ser_SOURCES = tableopts_ser_go-Cf.ser.l -tableopts_ser_go-Cf.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_CxF_ser_SOURCES = tableopts_ser_go-CxF.ser.l -tableopts_ser_go-CxF.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Cm_ser_SOURCES = tableopts_ser_go-Cm.ser.l -tableopts_ser_go-Cm.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Cem_ser_SOURCES = tableopts_ser_go-Cem.ser.l -tableopts_ser_go-Cem.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Cae_ser_SOURCES = tableopts_ser_go-Cae.ser.l -tableopts_ser_go-Cae.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Caef_ser_SOURCES = tableopts_ser_go-Caef.ser.l -tableopts_ser_go-Caef.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_CaexF_ser_SOURCES = tableopts_ser_go-CaexF.ser.l -tableopts_ser_go-CaexF.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Cam_ser_SOURCES = tableopts_ser_go-Cam.ser.l -tableopts_ser_go-Cam.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ser_go_Caem_ser_SOURCES = tableopts_ser_go-Caem.ser.l -tableopts_ser_go-Caem.ser.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Ca_ver_SOURCES = tableopts_ver_go-Ca.ver.l -tableopts_ver_go-Ca.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Ce_ver_SOURCES = tableopts_ver_go-Ce.ver.l -tableopts_ver_go-Ce.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Cf_ver_SOURCES = tableopts_ver_go-Cf.ver.l -tableopts_ver_go-Cf.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_CxF_ver_SOURCES = tableopts_ver_go-CxF.ver.l -tableopts_ver_go-CxF.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Cm_ver_SOURCES = tableopts_ver_go-Cm.ver.l -tableopts_ver_go-Cm.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Cem_ver_SOURCES = tableopts_ver_go-Cem.ver.l -tableopts_ver_go-Cem.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Cae_ver_SOURCES = tableopts_ver_go-Cae.ver.l -tableopts_ver_go-Cae.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Caef_ver_SOURCES = tableopts_ver_go-Caef.ver.l -tableopts_ver_go-Caef.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_CaexF_ver_SOURCES = tableopts_ver_go-CaexF.ver.l -tableopts_ver_go-CaexF.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Cam_ver_SOURCES = tableopts_ver_go-Cam.ver.l -tableopts_ver_go-Cam.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - -tableopts_ver_go_Caem_ver_SOURCES = tableopts_ver_go-Caem.ver.l -tableopts_ver_go-Caem.ver.l: $(srcdir)/tableopts.rules $(srcdir)/testmaker.sh $(srcdir)/testmaker.m4 - $(SHELL) $(srcdir)/testmaker.sh -i $(srcdir) $@ - posixlycorrect_nr.c: posixlycorrect_nr.l $(FLEX) $(AM_V_LEX)POSIXLY_CORRECT=1 $(FLEX) $(TESTOPTS) -o $@ $< @@ -881,16 +669,8 @@ test-yydecl-c99.sh$(EXEEXT): $(srcdir)/test-yydecl-gen.sh $(SHELL) $(srcdir)/test-yydecl-gen.sh c99 $(FLEX) >test-yydecl-c99.sh$(EXEEXT) chmod a+x test-yydecl-c99.sh$(EXEEXT) -posixlycorrect_go.go: posixlycorrect_go.l $(FLEX) - $(AM_V_LEX)POSIXLY_CORRECT=1 $(FLEX) $(TESTOPTS) -o $@ $< - -test_yydecl_go_sh_SOURCES = -test-yydecl-go.sh$(EXEEXT): $(srcdir)/test-yydecl-gen.sh - $(SHELL) $(srcdir)/test-yydecl-gen.sh go $(FLEX) >test-yydecl-go.sh$(EXEEXT) - chmod a+x test-yydecl-go.sh$(EXEEXT) - # End generated test rules -RULESET_TESTS = array_nr basic_nr bol_nr ccl_nr debug_nr extended_nr fixedtrailing_nr flexname_nr lexcompat_nr lineno_nr posix_nr posixlycorrect_nr preposix_nr quoteincomment_nr reject_nr tableopts_nr vartrailing_nr yyless_nr yymore_nr yymorearray_nr yymorearraybol_nr yyunput_nr tableopts_opt_nr-Ca.opt tableopts_opt_nr-Ce.opt tableopts_opt_nr-Cf.opt tableopts_opt_nr-CxF.opt tableopts_opt_nr-Cm.opt tableopts_opt_nr-Cem.opt tableopts_opt_nr-Cae.opt tableopts_opt_nr-Caef.opt tableopts_opt_nr-CaexF.opt tableopts_opt_nr-Cam.opt tableopts_opt_nr-Caem.opt tableopts_ser_nr-Ca.ser tableopts_ser_nr-Ce.ser tableopts_ser_nr-Cf.ser tableopts_ser_nr-CxF.ser tableopts_ser_nr-Cm.ser tableopts_ser_nr-Cem.ser tableopts_ser_nr-Cae.ser tableopts_ser_nr-Caef.ser tableopts_ser_nr-CaexF.ser tableopts_ser_nr-Cam.ser tableopts_ser_nr-Caem.ser tableopts_ver_nr-Ca.ver tableopts_ver_nr-Ce.ver tableopts_ver_nr-Cf.ver tableopts_ver_nr-CxF.ver tableopts_ver_nr-Cm.ver tableopts_ver_nr-Cem.ver tableopts_ver_nr-Cae.ver tableopts_ver_nr-Caef.ver tableopts_ver_nr-CaexF.ver tableopts_ver_nr-Cam.ver tableopts_ver_nr-Caem.ver array_r basic_r bol_r ccl_r debug_r extended_r fixedtrailing_r flexname_r lineno_r posix_r preposix_r quoteincomment_r reject_r tableopts_r vartrailing_r yyless_r yymore_r yymorearray_r yymorearraybol_r yyunput_r tableopts_opt_r-Ca.opt tableopts_opt_r-Ce.opt tableopts_opt_r-Cf.opt tableopts_opt_r-CxF.opt tableopts_opt_r-Cm.opt tableopts_opt_r-Cem.opt tableopts_opt_r-Cae.opt tableopts_opt_r-Caef.opt tableopts_opt_r-CaexF.opt tableopts_opt_r-Cam.opt tableopts_opt_r-Caem.opt tableopts_ser_r-Ca.ser tableopts_ser_r-Ce.ser tableopts_ser_r-Cf.ser tableopts_ser_r-CxF.ser tableopts_ser_r-Cm.ser tableopts_ser_r-Cem.ser tableopts_ser_r-Cae.ser tableopts_ser_r-Caef.ser tableopts_ser_r-CaexF.ser tableopts_ser_r-Cam.ser tableopts_ser_r-Caem.ser tableopts_ver_r-Ca.ver tableopts_ver_r-Ce.ver tableopts_ver_r-Cf.ver tableopts_ver_r-CxF.ver tableopts_ver_r-Cm.ver tableopts_ver_r-Cem.ver tableopts_ver_r-Cae.ver tableopts_ver_r-Caef.ver tableopts_ver_r-CaexF.ver tableopts_ver_r-Cam.ver tableopts_ver_r-Caem.ver array_c99 basic_c99 bol_c99 ccl_c99 debug_c99 extended_c99 fixedtrailing_c99 flexname_c99 lineno_c99 posix_c99 preposix_c99 quoteincomment_c99 reject_c99 tableopts_c99 vartrailing_c99 yyless_c99 yymore_c99 yymorearray_c99 yymorearraybol_c99 yyunput_c99 tableopts_opt_c99-Ca.opt tableopts_opt_c99-Ce.opt tableopts_opt_c99-Cf.opt tableopts_opt_c99-CxF.opt tableopts_opt_c99-Cm.opt tableopts_opt_c99-Cem.opt tableopts_opt_c99-Cae.opt tableopts_opt_c99-Caef.opt tableopts_opt_c99-CaexF.opt tableopts_opt_c99-Cam.opt tableopts_opt_c99-Caem.opt tableopts_ser_c99-Ca.ser tableopts_ser_c99-Ce.ser tableopts_ser_c99-Cf.ser tableopts_ser_c99-CxF.ser tableopts_ser_c99-Cm.ser tableopts_ser_c99-Cem.ser tableopts_ser_c99-Cae.ser tableopts_ser_c99-Caef.ser tableopts_ser_c99-CaexF.ser tableopts_ser_c99-Cam.ser tableopts_ser_c99-Caem.ser tableopts_ver_c99-Ca.ver tableopts_ver_c99-Ce.ver tableopts_ver_c99-Cf.ver tableopts_ver_c99-CxF.ver tableopts_ver_c99-Cm.ver tableopts_ver_c99-Cem.ver tableopts_ver_c99-Cae.ver tableopts_ver_c99-Caef.ver tableopts_ver_c99-CaexF.ver tableopts_ver_c99-Cam.ver tableopts_ver_c99-Caem.ver array_go basic_go bol_go ccl_go debug_go extended_go fixedtrailing_go flexname_go lineno_go posix_go preposix_go quoteincomment_go reject_go tableopts_go vartrailing_go yyless_go yymore_go yymorearray_go yymorearraybol_go yyunput_go tableopts_opt_go-Ca.opt tableopts_opt_go-Ce.opt tableopts_opt_go-Cf.opt tableopts_opt_go-CxF.opt tableopts_opt_go-Cm.opt tableopts_opt_go-Cem.opt tableopts_opt_go-Cae.opt tableopts_opt_go-Caef.opt tableopts_opt_go-CaexF.opt tableopts_opt_go-Cam.opt tableopts_opt_go-Caem.opt tableopts_ser_go-Ca.ser tableopts_ser_go-Ce.ser tableopts_ser_go-Cf.ser tableopts_ser_go-CxF.ser tableopts_ser_go-Cm.ser tableopts_ser_go-Cem.ser tableopts_ser_go-Cae.ser tableopts_ser_go-Caef.ser tableopts_ser_go-CaexF.ser tableopts_ser_go-Cam.ser tableopts_ser_go-Caem.ser tableopts_ver_go-Ca.ver tableopts_ver_go-Ce.ver tableopts_ver_go-Cf.ver tableopts_ver_go-CxF.ver tableopts_ver_go-Cm.ver tableopts_ver_go-Cem.ver tableopts_ver_go-Cae.ver tableopts_ver_go-Caef.ver tableopts_ver_go-CaexF.ver tableopts_ver_go-Cam.ver tableopts_ver_go-Caem.ver test-yydecl-nr.sh$(EXEEXT) test-yydecl-r.sh$(EXEEXT) test-yydecl-c99.sh$(EXEEXT) test-yydecl-go.sh$(EXEEXT) -RULESET_REMOVABLES = array_nr array_nr.c array_nr.l basic_nr basic_nr.c basic_nr.l bol_nr bol_nr.c bol_nr.l ccl_nr ccl_nr.c ccl_nr.l debug_nr debug_nr.c debug_nr.l extended_nr extended_nr.c extended_nr.l fixedtrailing_nr fixedtrailing_nr.c fixedtrailing_nr.l flexname_nr flexname_nr.c flexname_nr.l lexcompat_nr lexcompat_nr.c lexcompat_nr.l lineno_nr lineno_nr.c lineno_nr.l posix_nr posix_nr.c posix_nr.l posixlycorrect_nr posixlycorrect_nr.c posixlycorrect_nr.l preposix_nr preposix_nr.c preposix_nr.l quoteincomment_nr quoteincomment_nr.c quoteincomment_nr.l reject_nr reject_nr.c reject_nr.l tableopts_nr tableopts_nr.c tableopts_nr.l vartrailing_nr vartrailing_nr.c vartrailing_nr.l yyless_nr yyless_nr.c yyless_nr.l yymore_nr yymore_nr.c yymore_nr.l yymorearray_nr yymorearray_nr.c yymorearray_nr.l yymorearraybol_nr yymorearraybol_nr.c yymorearraybol_nr.l yyunput_nr yyunput_nr.c yyunput_nr.l tableopts_opt_nr-Ca.opt tableopts_opt_nr-Ca.opt.c tableopts_opt_nr-Ca.opt.l tableopts_opt_nr-Ca.opt.tables tableopts_opt_nr-Ce.opt tableopts_opt_nr-Ce.opt.c tableopts_opt_nr-Ce.opt.l tableopts_opt_nr-Ce.opt.tables tableopts_opt_nr-Cf.opt tableopts_opt_nr-Cf.opt.c tableopts_opt_nr-Cf.opt.l tableopts_opt_nr-Cf.opt.tables tableopts_opt_nr-CxF.opt tableopts_opt_nr-CxF.opt.c tableopts_opt_nr-CxF.opt.l tableopts_opt_nr-CxF.opt.tables tableopts_opt_nr-Cm.opt tableopts_opt_nr-Cm.opt.c tableopts_opt_nr-Cm.opt.l tableopts_opt_nr-Cm.opt.tables tableopts_opt_nr-Cem.opt tableopts_opt_nr-Cem.opt.c tableopts_opt_nr-Cem.opt.l tableopts_opt_nr-Cem.opt.tables tableopts_opt_nr-Cae.opt tableopts_opt_nr-Cae.opt.c tableopts_opt_nr-Cae.opt.l tableopts_opt_nr-Cae.opt.tables tableopts_opt_nr-Caef.opt tableopts_opt_nr-Caef.opt.c tableopts_opt_nr-Caef.opt.l tableopts_opt_nr-Caef.opt.tables tableopts_opt_nr-CaexF.opt tableopts_opt_nr-CaexF.opt.c tableopts_opt_nr-CaexF.opt.l tableopts_opt_nr-CaexF.opt.tables tableopts_opt_nr-Cam.opt tableopts_opt_nr-Cam.opt.c tableopts_opt_nr-Cam.opt.l tableopts_opt_nr-Cam.opt.tables tableopts_opt_nr-Caem.opt tableopts_opt_nr-Caem.opt.c tableopts_opt_nr-Caem.opt.l tableopts_opt_nr-Caem.opt.tables tableopts_ser_nr-Ca.ser tableopts_ser_nr-Ca.ser.c tableopts_ser_nr-Ca.ser.l tableopts_ser_nr-Ca.ser.tables tableopts_ser_nr-Ce.ser tableopts_ser_nr-Ce.ser.c tableopts_ser_nr-Ce.ser.l tableopts_ser_nr-Ce.ser.tables tableopts_ser_nr-Cf.ser tableopts_ser_nr-Cf.ser.c tableopts_ser_nr-Cf.ser.l tableopts_ser_nr-Cf.ser.tables tableopts_ser_nr-CxF.ser tableopts_ser_nr-CxF.ser.c tableopts_ser_nr-CxF.ser.l tableopts_ser_nr-CxF.ser.tables tableopts_ser_nr-Cm.ser tableopts_ser_nr-Cm.ser.c tableopts_ser_nr-Cm.ser.l tableopts_ser_nr-Cm.ser.tables tableopts_ser_nr-Cem.ser tableopts_ser_nr-Cem.ser.c tableopts_ser_nr-Cem.ser.l tableopts_ser_nr-Cem.ser.tables tableopts_ser_nr-Cae.ser tableopts_ser_nr-Cae.ser.c tableopts_ser_nr-Cae.ser.l tableopts_ser_nr-Cae.ser.tables tableopts_ser_nr-Caef.ser tableopts_ser_nr-Caef.ser.c tableopts_ser_nr-Caef.ser.l tableopts_ser_nr-Caef.ser.tables tableopts_ser_nr-CaexF.ser tableopts_ser_nr-CaexF.ser.c tableopts_ser_nr-CaexF.ser.l tableopts_ser_nr-CaexF.ser.tables tableopts_ser_nr-Cam.ser tableopts_ser_nr-Cam.ser.c tableopts_ser_nr-Cam.ser.l tableopts_ser_nr-Cam.ser.tables tableopts_ser_nr-Caem.ser tableopts_ser_nr-Caem.ser.c tableopts_ser_nr-Caem.ser.l tableopts_ser_nr-Caem.ser.tables tableopts_ver_nr-Ca.ver tableopts_ver_nr-Ca.ver.c tableopts_ver_nr-Ca.ver.l tableopts_ver_nr-Ca.ver.tables tableopts_ver_nr-Ce.ver tableopts_ver_nr-Ce.ver.c tableopts_ver_nr-Ce.ver.l tableopts_ver_nr-Ce.ver.tables tableopts_ver_nr-Cf.ver tableopts_ver_nr-Cf.ver.c tableopts_ver_nr-Cf.ver.l tableopts_ver_nr-Cf.ver.tables tableopts_ver_nr-CxF.ver tableopts_ver_nr-CxF.ver.c tableopts_ver_nr-CxF.ver.l tableopts_ver_nr-CxF.ver.tables tableopts_ver_nr-Cm.ver tableopts_ver_nr-Cm.ver.c tableopts_ver_nr-Cm.ver.l tableopts_ver_nr-Cm.ver.tables tableopts_ver_nr-Cem.ver tableopts_ver_nr-Cem.ver.c tableopts_ver_nr-Cem.ver.l tableopts_ver_nr-Cem.ver.tables tableopts_ver_nr-Cae.ver tableopts_ver_nr-Cae.ver.c tableopts_ver_nr-Cae.ver.l tableopts_ver_nr-Cae.ver.tables tableopts_ver_nr-Caef.ver tableopts_ver_nr-Caef.ver.c tableopts_ver_nr-Caef.ver.l tableopts_ver_nr-Caef.ver.tables tableopts_ver_nr-CaexF.ver tableopts_ver_nr-CaexF.ver.c tableopts_ver_nr-CaexF.ver.l tableopts_ver_nr-CaexF.ver.tables tableopts_ver_nr-Cam.ver tableopts_ver_nr-Cam.ver.c tableopts_ver_nr-Cam.ver.l tableopts_ver_nr-Cam.ver.tables tableopts_ver_nr-Caem.ver tableopts_ver_nr-Caem.ver.c tableopts_ver_nr-Caem.ver.l tableopts_ver_nr-Caem.ver.tables array_r array_r.c array_r.l basic_r basic_r.c basic_r.l bol_r bol_r.c bol_r.l ccl_r ccl_r.c ccl_r.l debug_r debug_r.c debug_r.l extended_r extended_r.c extended_r.l fixedtrailing_r fixedtrailing_r.c fixedtrailing_r.l flexname_r flexname_r.c flexname_r.l lineno_r lineno_r.c lineno_r.l posix_r posix_r.c posix_r.l preposix_r preposix_r.c preposix_r.l quoteincomment_r quoteincomment_r.c quoteincomment_r.l reject_r reject_r.c reject_r.l tableopts_r tableopts_r.c tableopts_r.l vartrailing_r vartrailing_r.c vartrailing_r.l yyless_r yyless_r.c yyless_r.l yymore_r yymore_r.c yymore_r.l yymorearray_r yymorearray_r.c yymorearray_r.l yymorearraybol_r yymorearraybol_r.c yymorearraybol_r.l yyunput_r yyunput_r.c yyunput_r.l tableopts_opt_r-Ca.opt tableopts_opt_r-Ca.opt.c tableopts_opt_r-Ca.opt.l tableopts_opt_r-Ca.opt.tables tableopts_opt_r-Ce.opt tableopts_opt_r-Ce.opt.c tableopts_opt_r-Ce.opt.l tableopts_opt_r-Ce.opt.tables tableopts_opt_r-Cf.opt tableopts_opt_r-Cf.opt.c tableopts_opt_r-Cf.opt.l tableopts_opt_r-Cf.opt.tables tableopts_opt_r-CxF.opt tableopts_opt_r-CxF.opt.c tableopts_opt_r-CxF.opt.l tableopts_opt_r-CxF.opt.tables tableopts_opt_r-Cm.opt tableopts_opt_r-Cm.opt.c tableopts_opt_r-Cm.opt.l tableopts_opt_r-Cm.opt.tables tableopts_opt_r-Cem.opt tableopts_opt_r-Cem.opt.c tableopts_opt_r-Cem.opt.l tableopts_opt_r-Cem.opt.tables tableopts_opt_r-Cae.opt tableopts_opt_r-Cae.opt.c tableopts_opt_r-Cae.opt.l tableopts_opt_r-Cae.opt.tables tableopts_opt_r-Caef.opt tableopts_opt_r-Caef.opt.c tableopts_opt_r-Caef.opt.l tableopts_opt_r-Caef.opt.tables tableopts_opt_r-CaexF.opt tableopts_opt_r-CaexF.opt.c tableopts_opt_r-CaexF.opt.l tableopts_opt_r-CaexF.opt.tables tableopts_opt_r-Cam.opt tableopts_opt_r-Cam.opt.c tableopts_opt_r-Cam.opt.l tableopts_opt_r-Cam.opt.tables tableopts_opt_r-Caem.opt tableopts_opt_r-Caem.opt.c tableopts_opt_r-Caem.opt.l tableopts_opt_r-Caem.opt.tables tableopts_ser_r-Ca.ser tableopts_ser_r-Ca.ser.c tableopts_ser_r-Ca.ser.l tableopts_ser_r-Ca.ser.tables tableopts_ser_r-Ce.ser tableopts_ser_r-Ce.ser.c tableopts_ser_r-Ce.ser.l tableopts_ser_r-Ce.ser.tables tableopts_ser_r-Cf.ser tableopts_ser_r-Cf.ser.c tableopts_ser_r-Cf.ser.l tableopts_ser_r-Cf.ser.tables tableopts_ser_r-CxF.ser tableopts_ser_r-CxF.ser.c tableopts_ser_r-CxF.ser.l tableopts_ser_r-CxF.ser.tables tableopts_ser_r-Cm.ser tableopts_ser_r-Cm.ser.c tableopts_ser_r-Cm.ser.l tableopts_ser_r-Cm.ser.tables tableopts_ser_r-Cem.ser tableopts_ser_r-Cem.ser.c tableopts_ser_r-Cem.ser.l tableopts_ser_r-Cem.ser.tables tableopts_ser_r-Cae.ser tableopts_ser_r-Cae.ser.c tableopts_ser_r-Cae.ser.l tableopts_ser_r-Cae.ser.tables tableopts_ser_r-Caef.ser tableopts_ser_r-Caef.ser.c tableopts_ser_r-Caef.ser.l tableopts_ser_r-Caef.ser.tables tableopts_ser_r-CaexF.ser tableopts_ser_r-CaexF.ser.c tableopts_ser_r-CaexF.ser.l tableopts_ser_r-CaexF.ser.tables tableopts_ser_r-Cam.ser tableopts_ser_r-Cam.ser.c tableopts_ser_r-Cam.ser.l tableopts_ser_r-Cam.ser.tables tableopts_ser_r-Caem.ser tableopts_ser_r-Caem.ser.c tableopts_ser_r-Caem.ser.l tableopts_ser_r-Caem.ser.tables tableopts_ver_r-Ca.ver tableopts_ver_r-Ca.ver.c tableopts_ver_r-Ca.ver.l tableopts_ver_r-Ca.ver.tables tableopts_ver_r-Ce.ver tableopts_ver_r-Ce.ver.c tableopts_ver_r-Ce.ver.l tableopts_ver_r-Ce.ver.tables tableopts_ver_r-Cf.ver tableopts_ver_r-Cf.ver.c tableopts_ver_r-Cf.ver.l tableopts_ver_r-Cf.ver.tables tableopts_ver_r-CxF.ver tableopts_ver_r-CxF.ver.c tableopts_ver_r-CxF.ver.l tableopts_ver_r-CxF.ver.tables tableopts_ver_r-Cm.ver tableopts_ver_r-Cm.ver.c tableopts_ver_r-Cm.ver.l tableopts_ver_r-Cm.ver.tables tableopts_ver_r-Cem.ver tableopts_ver_r-Cem.ver.c tableopts_ver_r-Cem.ver.l tableopts_ver_r-Cem.ver.tables tableopts_ver_r-Cae.ver tableopts_ver_r-Cae.ver.c tableopts_ver_r-Cae.ver.l tableopts_ver_r-Cae.ver.tables tableopts_ver_r-Caef.ver tableopts_ver_r-Caef.ver.c tableopts_ver_r-Caef.ver.l tableopts_ver_r-Caef.ver.tables tableopts_ver_r-CaexF.ver tableopts_ver_r-CaexF.ver.c tableopts_ver_r-CaexF.ver.l tableopts_ver_r-CaexF.ver.tables tableopts_ver_r-Cam.ver tableopts_ver_r-Cam.ver.c tableopts_ver_r-Cam.ver.l tableopts_ver_r-Cam.ver.tables tableopts_ver_r-Caem.ver tableopts_ver_r-Caem.ver.c tableopts_ver_r-Caem.ver.l tableopts_ver_r-Caem.ver.tables array_c99 array_c99.c array_c99.l basic_c99 basic_c99.c basic_c99.l bol_c99 bol_c99.c bol_c99.l ccl_c99 ccl_c99.c ccl_c99.l debug_c99 debug_c99.c debug_c99.l extended_c99 extended_c99.c extended_c99.l fixedtrailing_c99 fixedtrailing_c99.c fixedtrailing_c99.l flexname_c99 flexname_c99.c flexname_c99.l lineno_c99 lineno_c99.c lineno_c99.l posix_c99 posix_c99.c posix_c99.l preposix_c99 preposix_c99.c preposix_c99.l quoteincomment_c99 quoteincomment_c99.c quoteincomment_c99.l reject_c99 reject_c99.c reject_c99.l tableopts_c99 tableopts_c99.c tableopts_c99.l vartrailing_c99 vartrailing_c99.c vartrailing_c99.l yyless_c99 yyless_c99.c yyless_c99.l yymore_c99 yymore_c99.c yymore_c99.l yymorearray_c99 yymorearray_c99.c yymorearray_c99.l yymorearraybol_c99 yymorearraybol_c99.c yymorearraybol_c99.l yyunput_c99 yyunput_c99.c yyunput_c99.l tableopts_opt_c99-Ca.opt tableopts_opt_c99-Ca.opt.c tableopts_opt_c99-Ca.opt.l tableopts_opt_c99-Ca.opt.tables tableopts_opt_c99-Ce.opt tableopts_opt_c99-Ce.opt.c tableopts_opt_c99-Ce.opt.l tableopts_opt_c99-Ce.opt.tables tableopts_opt_c99-Cf.opt tableopts_opt_c99-Cf.opt.c tableopts_opt_c99-Cf.opt.l tableopts_opt_c99-Cf.opt.tables tableopts_opt_c99-CxF.opt tableopts_opt_c99-CxF.opt.c tableopts_opt_c99-CxF.opt.l tableopts_opt_c99-CxF.opt.tables tableopts_opt_c99-Cm.opt tableopts_opt_c99-Cm.opt.c tableopts_opt_c99-Cm.opt.l tableopts_opt_c99-Cm.opt.tables tableopts_opt_c99-Cem.opt tableopts_opt_c99-Cem.opt.c tableopts_opt_c99-Cem.opt.l tableopts_opt_c99-Cem.opt.tables tableopts_opt_c99-Cae.opt tableopts_opt_c99-Cae.opt.c tableopts_opt_c99-Cae.opt.l tableopts_opt_c99-Cae.opt.tables tableopts_opt_c99-Caef.opt tableopts_opt_c99-Caef.opt.c tableopts_opt_c99-Caef.opt.l tableopts_opt_c99-Caef.opt.tables tableopts_opt_c99-CaexF.opt tableopts_opt_c99-CaexF.opt.c tableopts_opt_c99-CaexF.opt.l tableopts_opt_c99-CaexF.opt.tables tableopts_opt_c99-Cam.opt tableopts_opt_c99-Cam.opt.c tableopts_opt_c99-Cam.opt.l tableopts_opt_c99-Cam.opt.tables tableopts_opt_c99-Caem.opt tableopts_opt_c99-Caem.opt.c tableopts_opt_c99-Caem.opt.l tableopts_opt_c99-Caem.opt.tables tableopts_ser_c99-Ca.ser tableopts_ser_c99-Ca.ser.c tableopts_ser_c99-Ca.ser.l tableopts_ser_c99-Ca.ser.tables tableopts_ser_c99-Ce.ser tableopts_ser_c99-Ce.ser.c tableopts_ser_c99-Ce.ser.l tableopts_ser_c99-Ce.ser.tables tableopts_ser_c99-Cf.ser tableopts_ser_c99-Cf.ser.c tableopts_ser_c99-Cf.ser.l tableopts_ser_c99-Cf.ser.tables tableopts_ser_c99-CxF.ser tableopts_ser_c99-CxF.ser.c tableopts_ser_c99-CxF.ser.l tableopts_ser_c99-CxF.ser.tables tableopts_ser_c99-Cm.ser tableopts_ser_c99-Cm.ser.c tableopts_ser_c99-Cm.ser.l tableopts_ser_c99-Cm.ser.tables tableopts_ser_c99-Cem.ser tableopts_ser_c99-Cem.ser.c tableopts_ser_c99-Cem.ser.l tableopts_ser_c99-Cem.ser.tables tableopts_ser_c99-Cae.ser tableopts_ser_c99-Cae.ser.c tableopts_ser_c99-Cae.ser.l tableopts_ser_c99-Cae.ser.tables tableopts_ser_c99-Caef.ser tableopts_ser_c99-Caef.ser.c tableopts_ser_c99-Caef.ser.l tableopts_ser_c99-Caef.ser.tables tableopts_ser_c99-CaexF.ser tableopts_ser_c99-CaexF.ser.c tableopts_ser_c99-CaexF.ser.l tableopts_ser_c99-CaexF.ser.tables tableopts_ser_c99-Cam.ser tableopts_ser_c99-Cam.ser.c tableopts_ser_c99-Cam.ser.l tableopts_ser_c99-Cam.ser.tables tableopts_ser_c99-Caem.ser tableopts_ser_c99-Caem.ser.c tableopts_ser_c99-Caem.ser.l tableopts_ser_c99-Caem.ser.tables tableopts_ver_c99-Ca.ver tableopts_ver_c99-Ca.ver.c tableopts_ver_c99-Ca.ver.l tableopts_ver_c99-Ca.ver.tables tableopts_ver_c99-Ce.ver tableopts_ver_c99-Ce.ver.c tableopts_ver_c99-Ce.ver.l tableopts_ver_c99-Ce.ver.tables tableopts_ver_c99-Cf.ver tableopts_ver_c99-Cf.ver.c tableopts_ver_c99-Cf.ver.l tableopts_ver_c99-Cf.ver.tables tableopts_ver_c99-CxF.ver tableopts_ver_c99-CxF.ver.c tableopts_ver_c99-CxF.ver.l tableopts_ver_c99-CxF.ver.tables tableopts_ver_c99-Cm.ver tableopts_ver_c99-Cm.ver.c tableopts_ver_c99-Cm.ver.l tableopts_ver_c99-Cm.ver.tables tableopts_ver_c99-Cem.ver tableopts_ver_c99-Cem.ver.c tableopts_ver_c99-Cem.ver.l tableopts_ver_c99-Cem.ver.tables tableopts_ver_c99-Cae.ver tableopts_ver_c99-Cae.ver.c tableopts_ver_c99-Cae.ver.l tableopts_ver_c99-Cae.ver.tables tableopts_ver_c99-Caef.ver tableopts_ver_c99-Caef.ver.c tableopts_ver_c99-Caef.ver.l tableopts_ver_c99-Caef.ver.tables tableopts_ver_c99-CaexF.ver tableopts_ver_c99-CaexF.ver.c tableopts_ver_c99-CaexF.ver.l tableopts_ver_c99-CaexF.ver.tables tableopts_ver_c99-Cam.ver tableopts_ver_c99-Cam.ver.c tableopts_ver_c99-Cam.ver.l tableopts_ver_c99-Cam.ver.tables tableopts_ver_c99-Caem.ver tableopts_ver_c99-Caem.ver.c tableopts_ver_c99-Caem.ver.l tableopts_ver_c99-Caem.ver.tables array_go array_go.c array_go.l basic_go basic_go.c basic_go.l bol_go bol_go.c bol_go.l ccl_go ccl_go.c ccl_go.l debug_go debug_go.c debug_go.l extended_go extended_go.c extended_go.l fixedtrailing_go fixedtrailing_go.c fixedtrailing_go.l flexname_go flexname_go.c flexname_go.l lineno_go lineno_go.c lineno_go.l posix_go posix_go.c posix_go.l preposix_go preposix_go.c preposix_go.l quoteincomment_go quoteincomment_go.c quoteincomment_go.l reject_go reject_go.c reject_go.l tableopts_go tableopts_go.c tableopts_go.l vartrailing_go vartrailing_go.c vartrailing_go.l yyless_go yyless_go.c yyless_go.l yymore_go yymore_go.c yymore_go.l yymorearray_go yymorearray_go.c yymorearray_go.l yymorearraybol_go yymorearraybol_go.c yymorearraybol_go.l yyunput_go yyunput_go.c yyunput_go.l tableopts_opt_go-Ca.opt tableopts_opt_go-Ca.opt.c tableopts_opt_go-Ca.opt.l tableopts_opt_go-Ca.opt.tables tableopts_opt_go-Ce.opt tableopts_opt_go-Ce.opt.c tableopts_opt_go-Ce.opt.l tableopts_opt_go-Ce.opt.tables tableopts_opt_go-Cf.opt tableopts_opt_go-Cf.opt.c tableopts_opt_go-Cf.opt.l tableopts_opt_go-Cf.opt.tables tableopts_opt_go-CxF.opt tableopts_opt_go-CxF.opt.c tableopts_opt_go-CxF.opt.l tableopts_opt_go-CxF.opt.tables tableopts_opt_go-Cm.opt tableopts_opt_go-Cm.opt.c tableopts_opt_go-Cm.opt.l tableopts_opt_go-Cm.opt.tables tableopts_opt_go-Cem.opt tableopts_opt_go-Cem.opt.c tableopts_opt_go-Cem.opt.l tableopts_opt_go-Cem.opt.tables tableopts_opt_go-Cae.opt tableopts_opt_go-Cae.opt.c tableopts_opt_go-Cae.opt.l tableopts_opt_go-Cae.opt.tables tableopts_opt_go-Caef.opt tableopts_opt_go-Caef.opt.c tableopts_opt_go-Caef.opt.l tableopts_opt_go-Caef.opt.tables tableopts_opt_go-CaexF.opt tableopts_opt_go-CaexF.opt.c tableopts_opt_go-CaexF.opt.l tableopts_opt_go-CaexF.opt.tables tableopts_opt_go-Cam.opt tableopts_opt_go-Cam.opt.c tableopts_opt_go-Cam.opt.l tableopts_opt_go-Cam.opt.tables tableopts_opt_go-Caem.opt tableopts_opt_go-Caem.opt.c tableopts_opt_go-Caem.opt.l tableopts_opt_go-Caem.opt.tables tableopts_ser_go-Ca.ser tableopts_ser_go-Ca.ser.c tableopts_ser_go-Ca.ser.l tableopts_ser_go-Ca.ser.tables tableopts_ser_go-Ce.ser tableopts_ser_go-Ce.ser.c tableopts_ser_go-Ce.ser.l tableopts_ser_go-Ce.ser.tables tableopts_ser_go-Cf.ser tableopts_ser_go-Cf.ser.c tableopts_ser_go-Cf.ser.l tableopts_ser_go-Cf.ser.tables tableopts_ser_go-CxF.ser tableopts_ser_go-CxF.ser.c tableopts_ser_go-CxF.ser.l tableopts_ser_go-CxF.ser.tables tableopts_ser_go-Cm.ser tableopts_ser_go-Cm.ser.c tableopts_ser_go-Cm.ser.l tableopts_ser_go-Cm.ser.tables tableopts_ser_go-Cem.ser tableopts_ser_go-Cem.ser.c tableopts_ser_go-Cem.ser.l tableopts_ser_go-Cem.ser.tables tableopts_ser_go-Cae.ser tableopts_ser_go-Cae.ser.c tableopts_ser_go-Cae.ser.l tableopts_ser_go-Cae.ser.tables tableopts_ser_go-Caef.ser tableopts_ser_go-Caef.ser.c tableopts_ser_go-Caef.ser.l tableopts_ser_go-Caef.ser.tables tableopts_ser_go-CaexF.ser tableopts_ser_go-CaexF.ser.c tableopts_ser_go-CaexF.ser.l tableopts_ser_go-CaexF.ser.tables tableopts_ser_go-Cam.ser tableopts_ser_go-Cam.ser.c tableopts_ser_go-Cam.ser.l tableopts_ser_go-Cam.ser.tables tableopts_ser_go-Caem.ser tableopts_ser_go-Caem.ser.c tableopts_ser_go-Caem.ser.l tableopts_ser_go-Caem.ser.tables tableopts_ver_go-Ca.ver tableopts_ver_go-Ca.ver.c tableopts_ver_go-Ca.ver.l tableopts_ver_go-Ca.ver.tables tableopts_ver_go-Ce.ver tableopts_ver_go-Ce.ver.c tableopts_ver_go-Ce.ver.l tableopts_ver_go-Ce.ver.tables tableopts_ver_go-Cf.ver tableopts_ver_go-Cf.ver.c tableopts_ver_go-Cf.ver.l tableopts_ver_go-Cf.ver.tables tableopts_ver_go-CxF.ver tableopts_ver_go-CxF.ver.c tableopts_ver_go-CxF.ver.l tableopts_ver_go-CxF.ver.tables tableopts_ver_go-Cm.ver tableopts_ver_go-Cm.ver.c tableopts_ver_go-Cm.ver.l tableopts_ver_go-Cm.ver.tables tableopts_ver_go-Cem.ver tableopts_ver_go-Cem.ver.c tableopts_ver_go-Cem.ver.l tableopts_ver_go-Cem.ver.tables tableopts_ver_go-Cae.ver tableopts_ver_go-Cae.ver.c tableopts_ver_go-Cae.ver.l tableopts_ver_go-Cae.ver.tables tableopts_ver_go-Caef.ver tableopts_ver_go-Caef.ver.c tableopts_ver_go-Caef.ver.l tableopts_ver_go-Caef.ver.tables tableopts_ver_go-CaexF.ver tableopts_ver_go-CaexF.ver.c tableopts_ver_go-CaexF.ver.l tableopts_ver_go-CaexF.ver.tables tableopts_ver_go-Cam.ver tableopts_ver_go-Cam.ver.c tableopts_ver_go-Cam.ver.l tableopts_ver_go-Cam.ver.tables tableopts_ver_go-Caem.ver tableopts_ver_go-Caem.ver.c tableopts_ver_go-Caem.ver.l tableopts_ver_go-Caem.ver.tables test-yydecl-nr.sh$(EXEEXT) test-yydecl-r.sh$(EXEEXT) test-yydecl-c99.sh$(EXEEXT) test-yydecl-go.sh$(EXEEXT) +RULESET_TESTS = array_nr basic_nr bol_nr ccl_nr debug_nr extended_nr fixedtrailing_nr flexname_nr lexcompat_nr lineno_nr posix_nr posixlycorrect_nr preposix_nr quoteincomment_nr reject_nr tableopts_nr vartrailing_nr yyless_nr yymore_nr yymorearray_nr yymorearraybol_nr yyunput_nr tableopts_opt_nr-Ca.opt tableopts_opt_nr-Ce.opt tableopts_opt_nr-Cf.opt tableopts_opt_nr-CxF.opt tableopts_opt_nr-Cm.opt tableopts_opt_nr-Cem.opt tableopts_opt_nr-Cae.opt tableopts_opt_nr-Caef.opt tableopts_opt_nr-CaexF.opt tableopts_opt_nr-Cam.opt tableopts_opt_nr-Caem.opt tableopts_ser_nr-Ca.ser tableopts_ser_nr-Ce.ser tableopts_ser_nr-Cf.ser tableopts_ser_nr-CxF.ser tableopts_ser_nr-Cm.ser tableopts_ser_nr-Cem.ser tableopts_ser_nr-Cae.ser tableopts_ser_nr-Caef.ser tableopts_ser_nr-CaexF.ser tableopts_ser_nr-Cam.ser tableopts_ser_nr-Caem.ser tableopts_ver_nr-Ca.ver tableopts_ver_nr-Ce.ver tableopts_ver_nr-Cf.ver tableopts_ver_nr-CxF.ver tableopts_ver_nr-Cm.ver tableopts_ver_nr-Cem.ver tableopts_ver_nr-Cae.ver tableopts_ver_nr-Caef.ver tableopts_ver_nr-CaexF.ver tableopts_ver_nr-Cam.ver tableopts_ver_nr-Caem.ver array_r basic_r bol_r ccl_r debug_r extended_r fixedtrailing_r flexname_r lineno_r posix_r preposix_r quoteincomment_r reject_r tableopts_r vartrailing_r yyless_r yymore_r yymorearray_r yymorearraybol_r yyunput_r tableopts_opt_r-Ca.opt tableopts_opt_r-Ce.opt tableopts_opt_r-Cf.opt tableopts_opt_r-CxF.opt tableopts_opt_r-Cm.opt tableopts_opt_r-Cem.opt tableopts_opt_r-Cae.opt tableopts_opt_r-Caef.opt tableopts_opt_r-CaexF.opt tableopts_opt_r-Cam.opt tableopts_opt_r-Caem.opt tableopts_ser_r-Ca.ser tableopts_ser_r-Ce.ser tableopts_ser_r-Cf.ser tableopts_ser_r-CxF.ser tableopts_ser_r-Cm.ser tableopts_ser_r-Cem.ser tableopts_ser_r-Cae.ser tableopts_ser_r-Caef.ser tableopts_ser_r-CaexF.ser tableopts_ser_r-Cam.ser tableopts_ser_r-Caem.ser tableopts_ver_r-Ca.ver tableopts_ver_r-Ce.ver tableopts_ver_r-Cf.ver tableopts_ver_r-CxF.ver tableopts_ver_r-Cm.ver tableopts_ver_r-Cem.ver tableopts_ver_r-Cae.ver tableopts_ver_r-Caef.ver tableopts_ver_r-CaexF.ver tableopts_ver_r-Cam.ver tableopts_ver_r-Caem.ver array_c99 basic_c99 bol_c99 ccl_c99 debug_c99 extended_c99 fixedtrailing_c99 flexname_c99 lineno_c99 posix_c99 preposix_c99 quoteincomment_c99 reject_c99 tableopts_c99 vartrailing_c99 yyless_c99 yymore_c99 yymorearray_c99 yymorearraybol_c99 yyunput_c99 tableopts_opt_c99-Ca.opt tableopts_opt_c99-Ce.opt tableopts_opt_c99-Cf.opt tableopts_opt_c99-CxF.opt tableopts_opt_c99-Cm.opt tableopts_opt_c99-Cem.opt tableopts_opt_c99-Cae.opt tableopts_opt_c99-Caef.opt tableopts_opt_c99-CaexF.opt tableopts_opt_c99-Cam.opt tableopts_opt_c99-Caem.opt tableopts_ser_c99-Ca.ser tableopts_ser_c99-Ce.ser tableopts_ser_c99-Cf.ser tableopts_ser_c99-CxF.ser tableopts_ser_c99-Cm.ser tableopts_ser_c99-Cem.ser tableopts_ser_c99-Cae.ser tableopts_ser_c99-Caef.ser tableopts_ser_c99-CaexF.ser tableopts_ser_c99-Cam.ser tableopts_ser_c99-Caem.ser tableopts_ver_c99-Ca.ver tableopts_ver_c99-Ce.ver tableopts_ver_c99-Cf.ver tableopts_ver_c99-CxF.ver tableopts_ver_c99-Cm.ver tableopts_ver_c99-Cem.ver tableopts_ver_c99-Cae.ver tableopts_ver_c99-Caef.ver tableopts_ver_c99-CaexF.ver tableopts_ver_c99-Cam.ver tableopts_ver_c99-Caem.ver test-yydecl-nr.sh$(EXEEXT) test-yydecl-r.sh$(EXEEXT) test-yydecl-c99.sh$(EXEEXT) +RULESET_REMOVABLES = array_nr array_nr.c array_nr.l basic_nr basic_nr.c basic_nr.l bol_nr bol_nr.c bol_nr.l ccl_nr ccl_nr.c ccl_nr.l debug_nr debug_nr.c debug_nr.l extended_nr extended_nr.c extended_nr.l fixedtrailing_nr fixedtrailing_nr.c fixedtrailing_nr.l flexname_nr flexname_nr.c flexname_nr.l lexcompat_nr lexcompat_nr.c lexcompat_nr.l lineno_nr lineno_nr.c lineno_nr.l posix_nr posix_nr.c posix_nr.l posixlycorrect_nr posixlycorrect_nr.c posixlycorrect_nr.l preposix_nr preposix_nr.c preposix_nr.l quoteincomment_nr quoteincomment_nr.c quoteincomment_nr.l reject_nr reject_nr.c reject_nr.l tableopts_nr tableopts_nr.c tableopts_nr.l vartrailing_nr vartrailing_nr.c vartrailing_nr.l yyless_nr yyless_nr.c yyless_nr.l yymore_nr yymore_nr.c yymore_nr.l yymorearray_nr yymorearray_nr.c yymorearray_nr.l yymorearraybol_nr yymorearraybol_nr.c yymorearraybol_nr.l yyunput_nr yyunput_nr.c yyunput_nr.l tableopts_opt_nr-Ca.opt tableopts_opt_nr-Ca.opt.c tableopts_opt_nr-Ca.opt.l tableopts_opt_nr-Ca.opt.tables tableopts_opt_nr-Ce.opt tableopts_opt_nr-Ce.opt.c tableopts_opt_nr-Ce.opt.l tableopts_opt_nr-Ce.opt.tables tableopts_opt_nr-Cf.opt tableopts_opt_nr-Cf.opt.c tableopts_opt_nr-Cf.opt.l tableopts_opt_nr-Cf.opt.tables tableopts_opt_nr-CxF.opt tableopts_opt_nr-CxF.opt.c tableopts_opt_nr-CxF.opt.l tableopts_opt_nr-CxF.opt.tables tableopts_opt_nr-Cm.opt tableopts_opt_nr-Cm.opt.c tableopts_opt_nr-Cm.opt.l tableopts_opt_nr-Cm.opt.tables tableopts_opt_nr-Cem.opt tableopts_opt_nr-Cem.opt.c tableopts_opt_nr-Cem.opt.l tableopts_opt_nr-Cem.opt.tables tableopts_opt_nr-Cae.opt tableopts_opt_nr-Cae.opt.c tableopts_opt_nr-Cae.opt.l tableopts_opt_nr-Cae.opt.tables tableopts_opt_nr-Caef.opt tableopts_opt_nr-Caef.opt.c tableopts_opt_nr-Caef.opt.l tableopts_opt_nr-Caef.opt.tables tableopts_opt_nr-CaexF.opt tableopts_opt_nr-CaexF.opt.c tableopts_opt_nr-CaexF.opt.l tableopts_opt_nr-CaexF.opt.tables tableopts_opt_nr-Cam.opt tableopts_opt_nr-Cam.opt.c tableopts_opt_nr-Cam.opt.l tableopts_opt_nr-Cam.opt.tables tableopts_opt_nr-Caem.opt tableopts_opt_nr-Caem.opt.c tableopts_opt_nr-Caem.opt.l tableopts_opt_nr-Caem.opt.tables tableopts_ser_nr-Ca.ser tableopts_ser_nr-Ca.ser.c tableopts_ser_nr-Ca.ser.l tableopts_ser_nr-Ca.ser.tables tableopts_ser_nr-Ce.ser tableopts_ser_nr-Ce.ser.c tableopts_ser_nr-Ce.ser.l tableopts_ser_nr-Ce.ser.tables tableopts_ser_nr-Cf.ser tableopts_ser_nr-Cf.ser.c tableopts_ser_nr-Cf.ser.l tableopts_ser_nr-Cf.ser.tables tableopts_ser_nr-CxF.ser tableopts_ser_nr-CxF.ser.c tableopts_ser_nr-CxF.ser.l tableopts_ser_nr-CxF.ser.tables tableopts_ser_nr-Cm.ser tableopts_ser_nr-Cm.ser.c tableopts_ser_nr-Cm.ser.l tableopts_ser_nr-Cm.ser.tables tableopts_ser_nr-Cem.ser tableopts_ser_nr-Cem.ser.c tableopts_ser_nr-Cem.ser.l tableopts_ser_nr-Cem.ser.tables tableopts_ser_nr-Cae.ser tableopts_ser_nr-Cae.ser.c tableopts_ser_nr-Cae.ser.l tableopts_ser_nr-Cae.ser.tables tableopts_ser_nr-Caef.ser tableopts_ser_nr-Caef.ser.c tableopts_ser_nr-Caef.ser.l tableopts_ser_nr-Caef.ser.tables tableopts_ser_nr-CaexF.ser tableopts_ser_nr-CaexF.ser.c tableopts_ser_nr-CaexF.ser.l tableopts_ser_nr-CaexF.ser.tables tableopts_ser_nr-Cam.ser tableopts_ser_nr-Cam.ser.c tableopts_ser_nr-Cam.ser.l tableopts_ser_nr-Cam.ser.tables tableopts_ser_nr-Caem.ser tableopts_ser_nr-Caem.ser.c tableopts_ser_nr-Caem.ser.l tableopts_ser_nr-Caem.ser.tables tableopts_ver_nr-Ca.ver tableopts_ver_nr-Ca.ver.c tableopts_ver_nr-Ca.ver.l tableopts_ver_nr-Ca.ver.tables tableopts_ver_nr-Ce.ver tableopts_ver_nr-Ce.ver.c tableopts_ver_nr-Ce.ver.l tableopts_ver_nr-Ce.ver.tables tableopts_ver_nr-Cf.ver tableopts_ver_nr-Cf.ver.c tableopts_ver_nr-Cf.ver.l tableopts_ver_nr-Cf.ver.tables tableopts_ver_nr-CxF.ver tableopts_ver_nr-CxF.ver.c tableopts_ver_nr-CxF.ver.l tableopts_ver_nr-CxF.ver.tables tableopts_ver_nr-Cm.ver tableopts_ver_nr-Cm.ver.c tableopts_ver_nr-Cm.ver.l tableopts_ver_nr-Cm.ver.tables tableopts_ver_nr-Cem.ver tableopts_ver_nr-Cem.ver.c tableopts_ver_nr-Cem.ver.l tableopts_ver_nr-Cem.ver.tables tableopts_ver_nr-Cae.ver tableopts_ver_nr-Cae.ver.c tableopts_ver_nr-Cae.ver.l tableopts_ver_nr-Cae.ver.tables tableopts_ver_nr-Caef.ver tableopts_ver_nr-Caef.ver.c tableopts_ver_nr-Caef.ver.l tableopts_ver_nr-Caef.ver.tables tableopts_ver_nr-CaexF.ver tableopts_ver_nr-CaexF.ver.c tableopts_ver_nr-CaexF.ver.l tableopts_ver_nr-CaexF.ver.tables tableopts_ver_nr-Cam.ver tableopts_ver_nr-Cam.ver.c tableopts_ver_nr-Cam.ver.l tableopts_ver_nr-Cam.ver.tables tableopts_ver_nr-Caem.ver tableopts_ver_nr-Caem.ver.c tableopts_ver_nr-Caem.ver.l tableopts_ver_nr-Caem.ver.tables array_r array_r.c array_r.l basic_r basic_r.c basic_r.l bol_r bol_r.c bol_r.l ccl_r ccl_r.c ccl_r.l debug_r debug_r.c debug_r.l extended_r extended_r.c extended_r.l fixedtrailing_r fixedtrailing_r.c fixedtrailing_r.l flexname_r flexname_r.c flexname_r.l lineno_r lineno_r.c lineno_r.l posix_r posix_r.c posix_r.l preposix_r preposix_r.c preposix_r.l quoteincomment_r quoteincomment_r.c quoteincomment_r.l reject_r reject_r.c reject_r.l tableopts_r tableopts_r.c tableopts_r.l vartrailing_r vartrailing_r.c vartrailing_r.l yyless_r yyless_r.c yyless_r.l yymore_r yymore_r.c yymore_r.l yymorearray_r yymorearray_r.c yymorearray_r.l yymorearraybol_r yymorearraybol_r.c yymorearraybol_r.l yyunput_r yyunput_r.c yyunput_r.l tableopts_opt_r-Ca.opt tableopts_opt_r-Ca.opt.c tableopts_opt_r-Ca.opt.l tableopts_opt_r-Ca.opt.tables tableopts_opt_r-Ce.opt tableopts_opt_r-Ce.opt.c tableopts_opt_r-Ce.opt.l tableopts_opt_r-Ce.opt.tables tableopts_opt_r-Cf.opt tableopts_opt_r-Cf.opt.c tableopts_opt_r-Cf.opt.l tableopts_opt_r-Cf.opt.tables tableopts_opt_r-CxF.opt tableopts_opt_r-CxF.opt.c tableopts_opt_r-CxF.opt.l tableopts_opt_r-CxF.opt.tables tableopts_opt_r-Cm.opt tableopts_opt_r-Cm.opt.c tableopts_opt_r-Cm.opt.l tableopts_opt_r-Cm.opt.tables tableopts_opt_r-Cem.opt tableopts_opt_r-Cem.opt.c tableopts_opt_r-Cem.opt.l tableopts_opt_r-Cem.opt.tables tableopts_opt_r-Cae.opt tableopts_opt_r-Cae.opt.c tableopts_opt_r-Cae.opt.l tableopts_opt_r-Cae.opt.tables tableopts_opt_r-Caef.opt tableopts_opt_r-Caef.opt.c tableopts_opt_r-Caef.opt.l tableopts_opt_r-Caef.opt.tables tableopts_opt_r-CaexF.opt tableopts_opt_r-CaexF.opt.c tableopts_opt_r-CaexF.opt.l tableopts_opt_r-CaexF.opt.tables tableopts_opt_r-Cam.opt tableopts_opt_r-Cam.opt.c tableopts_opt_r-Cam.opt.l tableopts_opt_r-Cam.opt.tables tableopts_opt_r-Caem.opt tableopts_opt_r-Caem.opt.c tableopts_opt_r-Caem.opt.l tableopts_opt_r-Caem.opt.tables tableopts_ser_r-Ca.ser tableopts_ser_r-Ca.ser.c tableopts_ser_r-Ca.ser.l tableopts_ser_r-Ca.ser.tables tableopts_ser_r-Ce.ser tableopts_ser_r-Ce.ser.c tableopts_ser_r-Ce.ser.l tableopts_ser_r-Ce.ser.tables tableopts_ser_r-Cf.ser tableopts_ser_r-Cf.ser.c tableopts_ser_r-Cf.ser.l tableopts_ser_r-Cf.ser.tables tableopts_ser_r-CxF.ser tableopts_ser_r-CxF.ser.c tableopts_ser_r-CxF.ser.l tableopts_ser_r-CxF.ser.tables tableopts_ser_r-Cm.ser tableopts_ser_r-Cm.ser.c tableopts_ser_r-Cm.ser.l tableopts_ser_r-Cm.ser.tables tableopts_ser_r-Cem.ser tableopts_ser_r-Cem.ser.c tableopts_ser_r-Cem.ser.l tableopts_ser_r-Cem.ser.tables tableopts_ser_r-Cae.ser tableopts_ser_r-Cae.ser.c tableopts_ser_r-Cae.ser.l tableopts_ser_r-Cae.ser.tables tableopts_ser_r-Caef.ser tableopts_ser_r-Caef.ser.c tableopts_ser_r-Caef.ser.l tableopts_ser_r-Caef.ser.tables tableopts_ser_r-CaexF.ser tableopts_ser_r-CaexF.ser.c tableopts_ser_r-CaexF.ser.l tableopts_ser_r-CaexF.ser.tables tableopts_ser_r-Cam.ser tableopts_ser_r-Cam.ser.c tableopts_ser_r-Cam.ser.l tableopts_ser_r-Cam.ser.tables tableopts_ser_r-Caem.ser tableopts_ser_r-Caem.ser.c tableopts_ser_r-Caem.ser.l tableopts_ser_r-Caem.ser.tables tableopts_ver_r-Ca.ver tableopts_ver_r-Ca.ver.c tableopts_ver_r-Ca.ver.l tableopts_ver_r-Ca.ver.tables tableopts_ver_r-Ce.ver tableopts_ver_r-Ce.ver.c tableopts_ver_r-Ce.ver.l tableopts_ver_r-Ce.ver.tables tableopts_ver_r-Cf.ver tableopts_ver_r-Cf.ver.c tableopts_ver_r-Cf.ver.l tableopts_ver_r-Cf.ver.tables tableopts_ver_r-CxF.ver tableopts_ver_r-CxF.ver.c tableopts_ver_r-CxF.ver.l tableopts_ver_r-CxF.ver.tables tableopts_ver_r-Cm.ver tableopts_ver_r-Cm.ver.c tableopts_ver_r-Cm.ver.l tableopts_ver_r-Cm.ver.tables tableopts_ver_r-Cem.ver tableopts_ver_r-Cem.ver.c tableopts_ver_r-Cem.ver.l tableopts_ver_r-Cem.ver.tables tableopts_ver_r-Cae.ver tableopts_ver_r-Cae.ver.c tableopts_ver_r-Cae.ver.l tableopts_ver_r-Cae.ver.tables tableopts_ver_r-Caef.ver tableopts_ver_r-Caef.ver.c tableopts_ver_r-Caef.ver.l tableopts_ver_r-Caef.ver.tables tableopts_ver_r-CaexF.ver tableopts_ver_r-CaexF.ver.c tableopts_ver_r-CaexF.ver.l tableopts_ver_r-CaexF.ver.tables tableopts_ver_r-Cam.ver tableopts_ver_r-Cam.ver.c tableopts_ver_r-Cam.ver.l tableopts_ver_r-Cam.ver.tables tableopts_ver_r-Caem.ver tableopts_ver_r-Caem.ver.c tableopts_ver_r-Caem.ver.l tableopts_ver_r-Caem.ver.tables array_c99 array_c99.c array_c99.l basic_c99 basic_c99.c basic_c99.l bol_c99 bol_c99.c bol_c99.l ccl_c99 ccl_c99.c ccl_c99.l debug_c99 debug_c99.c debug_c99.l extended_c99 extended_c99.c extended_c99.l fixedtrailing_c99 fixedtrailing_c99.c fixedtrailing_c99.l flexname_c99 flexname_c99.c flexname_c99.l lineno_c99 lineno_c99.c lineno_c99.l posix_c99 posix_c99.c posix_c99.l preposix_c99 preposix_c99.c preposix_c99.l quoteincomment_c99 quoteincomment_c99.c quoteincomment_c99.l reject_c99 reject_c99.c reject_c99.l tableopts_c99 tableopts_c99.c tableopts_c99.l vartrailing_c99 vartrailing_c99.c vartrailing_c99.l yyless_c99 yyless_c99.c yyless_c99.l yymore_c99 yymore_c99.c yymore_c99.l yymorearray_c99 yymorearray_c99.c yymorearray_c99.l yymorearraybol_c99 yymorearraybol_c99.c yymorearraybol_c99.l yyunput_c99 yyunput_c99.c yyunput_c99.l tableopts_opt_c99-Ca.opt tableopts_opt_c99-Ca.opt.c tableopts_opt_c99-Ca.opt.l tableopts_opt_c99-Ca.opt.tables tableopts_opt_c99-Ce.opt tableopts_opt_c99-Ce.opt.c tableopts_opt_c99-Ce.opt.l tableopts_opt_c99-Ce.opt.tables tableopts_opt_c99-Cf.opt tableopts_opt_c99-Cf.opt.c tableopts_opt_c99-Cf.opt.l tableopts_opt_c99-Cf.opt.tables tableopts_opt_c99-CxF.opt tableopts_opt_c99-CxF.opt.c tableopts_opt_c99-CxF.opt.l tableopts_opt_c99-CxF.opt.tables tableopts_opt_c99-Cm.opt tableopts_opt_c99-Cm.opt.c tableopts_opt_c99-Cm.opt.l tableopts_opt_c99-Cm.opt.tables tableopts_opt_c99-Cem.opt tableopts_opt_c99-Cem.opt.c tableopts_opt_c99-Cem.opt.l tableopts_opt_c99-Cem.opt.tables tableopts_opt_c99-Cae.opt tableopts_opt_c99-Cae.opt.c tableopts_opt_c99-Cae.opt.l tableopts_opt_c99-Cae.opt.tables tableopts_opt_c99-Caef.opt tableopts_opt_c99-Caef.opt.c tableopts_opt_c99-Caef.opt.l tableopts_opt_c99-Caef.opt.tables tableopts_opt_c99-CaexF.opt tableopts_opt_c99-CaexF.opt.c tableopts_opt_c99-CaexF.opt.l tableopts_opt_c99-CaexF.opt.tables tableopts_opt_c99-Cam.opt tableopts_opt_c99-Cam.opt.c tableopts_opt_c99-Cam.opt.l tableopts_opt_c99-Cam.opt.tables tableopts_opt_c99-Caem.opt tableopts_opt_c99-Caem.opt.c tableopts_opt_c99-Caem.opt.l tableopts_opt_c99-Caem.opt.tables tableopts_ser_c99-Ca.ser tableopts_ser_c99-Ca.ser.c tableopts_ser_c99-Ca.ser.l tableopts_ser_c99-Ca.ser.tables tableopts_ser_c99-Ce.ser tableopts_ser_c99-Ce.ser.c tableopts_ser_c99-Ce.ser.l tableopts_ser_c99-Ce.ser.tables tableopts_ser_c99-Cf.ser tableopts_ser_c99-Cf.ser.c tableopts_ser_c99-Cf.ser.l tableopts_ser_c99-Cf.ser.tables tableopts_ser_c99-CxF.ser tableopts_ser_c99-CxF.ser.c tableopts_ser_c99-CxF.ser.l tableopts_ser_c99-CxF.ser.tables tableopts_ser_c99-Cm.ser tableopts_ser_c99-Cm.ser.c tableopts_ser_c99-Cm.ser.l tableopts_ser_c99-Cm.ser.tables tableopts_ser_c99-Cem.ser tableopts_ser_c99-Cem.ser.c tableopts_ser_c99-Cem.ser.l tableopts_ser_c99-Cem.ser.tables tableopts_ser_c99-Cae.ser tableopts_ser_c99-Cae.ser.c tableopts_ser_c99-Cae.ser.l tableopts_ser_c99-Cae.ser.tables tableopts_ser_c99-Caef.ser tableopts_ser_c99-Caef.ser.c tableopts_ser_c99-Caef.ser.l tableopts_ser_c99-Caef.ser.tables tableopts_ser_c99-CaexF.ser tableopts_ser_c99-CaexF.ser.c tableopts_ser_c99-CaexF.ser.l tableopts_ser_c99-CaexF.ser.tables tableopts_ser_c99-Cam.ser tableopts_ser_c99-Cam.ser.c tableopts_ser_c99-Cam.ser.l tableopts_ser_c99-Cam.ser.tables tableopts_ser_c99-Caem.ser tableopts_ser_c99-Caem.ser.c tableopts_ser_c99-Caem.ser.l tableopts_ser_c99-Caem.ser.tables tableopts_ver_c99-Ca.ver tableopts_ver_c99-Ca.ver.c tableopts_ver_c99-Ca.ver.l tableopts_ver_c99-Ca.ver.tables tableopts_ver_c99-Ce.ver tableopts_ver_c99-Ce.ver.c tableopts_ver_c99-Ce.ver.l tableopts_ver_c99-Ce.ver.tables tableopts_ver_c99-Cf.ver tableopts_ver_c99-Cf.ver.c tableopts_ver_c99-Cf.ver.l tableopts_ver_c99-Cf.ver.tables tableopts_ver_c99-CxF.ver tableopts_ver_c99-CxF.ver.c tableopts_ver_c99-CxF.ver.l tableopts_ver_c99-CxF.ver.tables tableopts_ver_c99-Cm.ver tableopts_ver_c99-Cm.ver.c tableopts_ver_c99-Cm.ver.l tableopts_ver_c99-Cm.ver.tables tableopts_ver_c99-Cem.ver tableopts_ver_c99-Cem.ver.c tableopts_ver_c99-Cem.ver.l tableopts_ver_c99-Cem.ver.tables tableopts_ver_c99-Cae.ver tableopts_ver_c99-Cae.ver.c tableopts_ver_c99-Cae.ver.l tableopts_ver_c99-Cae.ver.tables tableopts_ver_c99-Caef.ver tableopts_ver_c99-Caef.ver.c tableopts_ver_c99-Caef.ver.l tableopts_ver_c99-Caef.ver.tables tableopts_ver_c99-CaexF.ver tableopts_ver_c99-CaexF.ver.c tableopts_ver_c99-CaexF.ver.l tableopts_ver_c99-CaexF.ver.tables tableopts_ver_c99-Cam.ver tableopts_ver_c99-Cam.ver.c tableopts_ver_c99-Cam.ver.l tableopts_ver_c99-Cam.ver.tables tableopts_ver_c99-Caem.ver tableopts_ver_c99-Caem.ver.c tableopts_ver_c99-Caem.ver.l tableopts_ver_c99-Caem.ver.tables test-yydecl-nr.sh$(EXEEXT) test-yydecl-r.sh$(EXEEXT) test-yydecl-c99.sh$(EXEEXT) diff --git a/tests/yywrap_r.i3 b/tests/yywrap_r.i3 new file mode 100755 index 00000000..3a6eef56 Binary files /dev/null and b/tests/yywrap_r.i3 differ