%union {
char *string;
+ int number;
}
%token_table
%expect 300
%token <string> BADTOKEN
-%token <string> OPEN
+%token <number> OPEN
%token <string> CLOSE
%token <string> ESCAPE
%token <string> DELIM
}
else if (level_diff == 1) {
level_diff++;
+ gedcom_lval.number = current_level;
return OPEN;
}
else {
}
else if (level_diff == 1) {
level_diff++;
+ gedcom_lval.number = current_level;
return OPEN;
}
else {
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;
}
else if (level_diff == 1) {
level_diff++;
+ gedcom_lval.number = current_level;
return OPEN;
}
else {
}
else if (level_diff == 1) {
level_diff++;
+ gedcom_lval.number = current_level;
return OPEN;
}
else {
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;
}
else if (level_diff == 1) {
level_diff++;
+ gedcom_lval.number = current_level;
return OPEN;
}
else {
}
else if (level_diff == 1) {
level_diff++;
+ gedcom_lval.number = current_level;
return OPEN;
}
else {
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;