Init functions for the lexers.
[gedcom-parse.git] / gedcom / gedcom_1byte.lex
index be4496552302ca447157f51714b8b6541df48951..6fa1d6b0293089b3f4573f8482d7ecd1e1d6eb4e 100644 (file)
@@ -37,6 +37,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
 
@@ -209,12 +210,18 @@ ACTION_BEFORE_REGEXPS
 
 <<EOF>>                   ACTION_EOF
 
+{normal_at}               ACTION_NORMAL_AT
+
 .                         ACTION_UNEXPECTED
 
 %%
 
+static int exitfuncregistered = 0;
+
 int yywrap()
 {
+  if (! exitfuncregistered && atexit(yylex_cleanup) == 0)
+    exitfuncregistered = 1;
   return 1;
 }