Define init function for the lexer.
[gedcom-parse.git] / gedcom / gedcom_1byte.lex
index be4496552302ca447157f51714b8b6541df48951..938a97c476ed63b396be602ae07d56a03ec298e0 100644 (file)
@@ -22,7 +22,8 @@
 /* $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;
@@ -37,6 +38,7 @@ delim        " "
 tab          [\t]
 hash         #
 literal_at   @@
+normal_at    @
 otherchar    [\x21-\x22\x24-\x2F\x3A-\x3F\x5B-\x5E\x60\x7B-\x7E\x80-\xFE]
 terminator   \x0D|\x0A|\x0D\x0A|\x0A\x0D
 
@@ -52,7 +54,8 @@ pointer      @{alphanum}{non_at}+@
 %%
 
 %{
-#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
@@ -209,14 +212,14 @@ ACTION_BEFORE_REGEXPS
 
 <<EOF>>                   ACTION_EOF
 
+{normal_at}               ACTION_NORMAL_AT
+
 .                         ACTION_UNEXPECTED
 
 %%
-
-int yywrap()
-{
-  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()