X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gedcom_lohi.lex;h=9b76ac9f19c94e6f618f6867275e67e904ab597f;hb=0c341b31ca4de86b12b8b98f724b4f746e98a5d2;hp=6d88b435ed979f3daa309bc10e96417fd0cf354a;hpb=a2f7d56476e81f8689d56e6a5641469f6497c487;p=gedcom-parse.git diff --git a/gedcom_lohi.lex b/gedcom_lohi.lex index 6d88b43..9b76ac9 100644 --- a/gedcom_lohi.lex +++ b/gedcom_lohi.lex @@ -1,3 +1,12 @@ +/* This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + + (C) 2001 by The Genes Development Team + Original author: Peter Verthez (Peter.Verthez@advalvas.be) +*/ + /* $Id$ */ /* $Name$ */ @@ -9,6 +18,8 @@ #include "gedcom.h" #include "multilex.h" #include "encoding.h" + +#define YY_NO_UNPUT %} %s NORMAL @@ -88,6 +99,7 @@ if (level_diff < 1) { } else if (level_diff == 1) { level_diff++; + gedcom_lval.number = current_level; return OPEN; } else { @@ -124,6 +136,7 @@ else { } else if (level_diff == 1) { level_diff++; + gedcom_lval.number = current_level; return OPEN; } else { @@ -328,8 +341,10 @@ int yywrap() int main() { - int tok; - int res = open_conv_to_internal("UTF16LE"); + int tok, res; + init_encodings(); + set_encoding_width(TWO_BYTE_LOHI); + res = open_conv_to_internal("UNICODE"); if (!res) { gedcom_error("Unable to open conversion context: %s", strerror(errno)); @@ -339,7 +354,7 @@ int main() while (tok) { switch(tok) { case BADTOKEN: printf("BADTOKEN "); break; - case OPEN: printf("OPEN "); break; + case OPEN: printf("OPEN(%d) ", gedcom_lval.number); break; case CLOSE: printf("CLOSE "); break; case ESCAPE: printf("ESCAPE(%s) ", gedcom_lval.string); break; case DELIM: printf("DELIM "); break;