Copied from old documentation. Removed all Gedcom_val details.
[gedcom-parse.git] / gedcom / gedcom_lohi.lex
index 13f45152138656cf26b1f81670b6e88895f88e3a..21f84eb95129ca29aa7ab670d7218bacac85785e 100644 (file)
@@ -25,7 +25,8 @@
 /* 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;
@@ -40,6 +41,7 @@ delim        \x20\x00
 tab          [\t]\x00
 hash         #\x00
 literal_at   @\x00@\x00
+normal_at    @\x00
 otherchar    [\x21-\x22\x24-\x2F\x3A-\x3F\x5B-\x5E\x60\x7B-\x7E\x80-\xFF]\x00|[\x00-\xFF][\x01-\xFF]
 terminator   \x0D\x00|\x0A\x00|\x0D\x00\x0A\x00|\x0A\x00\x0D\x00
 
@@ -50,12 +52,13 @@ alphanum     {alpha}|{digit}
 gen_delim    {delim}|{tab}
 
 escape       @\x00#\x00{any_char}+@\x00
-pointer      @\x00{alphanum}{non_at}+@\x00
+pointer      @\x00{alphanum}{non_at}*@\x00
 
 %%
 
 %{
-#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
@@ -212,14 +215,16 @@ ACTION_BEFORE_REGEXPS
 
 <<EOF>>                  ACTION_EOF
 
+{normal_at}              ACTION_NORMAL_AT
+
+{tab}                    ACTION_TAB
+
 .                        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()