Use lexer sections.
/* $Name$ */
%{
-#undef IN_LEX /* include only a specific part of the following file */
+#define LEX_SECTION 1 /* include only a specific part of the following file */
+#define yymyinit gedcom_1byte_myinit
#include "gedcom_lex_common.c"
static size_t encoding_width = 1;
%%
%{
-#define IN_LEX /* include only a specific part of the following file */
+#undef LEX_SECTION
+#define LEX_SECTION 2 /* include only a specific part of the following file */
#include "gedcom_lex_common.c"
ACTION_BEFORE_REGEXPS
. ACTION_UNEXPECTED
%%
-
-static int exitfuncregistered = 0;
-
-int yywrap()
-{
- if (! exitfuncregistered && atexit(yylex_cleanup) == 0)
- exitfuncregistered = 1;
- return 1;
-}
+#undef LEX_SECTION
+#define LEX_SECTION 3 /* include only a specific part of the following file */
+#include "gedcom_lex_common.c"
#ifdef LEXER_TEST
int gedcom_lex()
/* i.e. this is utf-16-be */
%{
-#undef IN_LEX /* include only a specific part of the following file */
+#define LEX_SECTION 1 /* include only a specific part of the following file */
+#define yymyinit gedcom_hilo_myinit
#include "gedcom_lex_common.c"
static size_t encoding_width = 2;
%%
%{
-#define IN_LEX /* include only a specific part of the following file */
+#undef LEX_SECTION
+#define LEX_SECTION 2 /* include only a specific part of the following file */
#include "gedcom_lex_common.c"
ACTION_BEFORE_REGEXPS
. ACTION_UNEXPECTED
%%
-
-static int exitfuncregistered = 0;
-
-int yywrap()
-{
- if (! exitfuncregistered && atexit(yylex_cleanup) == 0)
- atexit(yylex_cleanup);
- return 1;
-}
+#undef LEX_SECTION
+#define LEX_SECTION 3 /* include only a specific part of the following file */
+#include "gedcom_lex_common.c"
#ifdef LEXER_TEST
int gedcom_lex()
/* i.e. this is utf-16-le */
%{
-#undef IN_LEX /* include only a specific part of the following file */
+#define LEX_SECTION 1 /* include only a specific part of the following file */
+#define yymyinit gedcom_lohi_myinit
#include "gedcom_lex_common.c"
static size_t encoding_width = 2;
%%
%{
-#define IN_LEX /* include only a specific part of the following file */
+#undef LEX_SECTION
+#define LEX_SECTION 2 /* include only a specific part of the following file */
#include "gedcom_lex_common.c"
ACTION_BEFORE_REGEXPS
. ACTION_UNEXPECTED
%%
-
-static int exitfuncregistered = 0;
-
-int yywrap()
-{
- if (! exitfuncregistered && atexit(yylex_cleanup) == 0)
- atexit(yylex_cleanup);
- return 1;
-}
+#undef LEX_SECTION
+#define LEX_SECTION 3 /* include only a specific part of the following file */
+#include "gedcom_lex_common.c"
#ifdef LEXER_TEST
int gedcom_lex()