C file that contains common code between the lexers (i.e. the actions).
[gedcom-parse.git] / gedcom_lohi.lex
index 3b315839ed5db01cf46b2536ebdb23300d94b70c..9b76ac9f19c94e6f618f6867275e67e904ab597f 100644 (file)
@@ -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$ */
 
@@ -90,6 +99,7 @@ if (level_diff < 1) {
 }
 else if (level_diff == 1) {
   level_diff++;
+  gedcom_lval.number = current_level;
   return OPEN;
 }
 else {
@@ -126,6 +136,7 @@ else {
                    }
                    else if (level_diff == 1) {
                      level_diff++;
+                     gedcom_lval.number = current_level;
                      return OPEN;
                    }
                    else {
@@ -343,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;