#include "multilex.h"
#include "encoding.h"
#include "interface.h"
+#include "date.h"
int count_level = 0;
int fail = 0;
int gedcom_high_level_debug = 0;
int compatibility = 0;
Gedcom_err_mech error_mechanism = IMMED_FAIL;
+Gedcom_val_struct val;
char line_item_buf[MAXGEDCLINELEN * UTF_FACTOR + 1];
char *line_item_buf_ptr;
head_sour_sect : OPEN DELIM TAG_SOUR mand_line_item
{ set_compatibility($4);
$<ctxt>$ = start_element(ELT_HEAD_SOUR, PARENT,
- $1, $3, $4, $4);
+ $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(SOUR, $<ctxt>$)
}
head_sour_subs
head_sour_vers_sect : OPEN DELIM TAG_VERS mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_SOUR_VERS, PARENT,
- $1, $3, $4, $4);
+ $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(VERS, $<ctxt>$)
}
no_std_subs
;
head_sour_name_sect : OPEN DELIM TAG_NAME mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_SOUR_NAME, PARENT,
- $1, $3, $4, $4);
+ $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(NAME, $<ctxt>$)
}
no_std_subs
;
head_sour_corp_sect : OPEN DELIM TAG_CORP mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_SOUR_CORP, PARENT,
- $1, $3, $4, $4);
+ $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(CORP, $<ctxt>$)
}
head_sour_corp_subs
head_sour_data_sect : OPEN DELIM TAG_DATA mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_SOUR_DATA, PARENT,
- $1, $3, $4, $4);
+ $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(DATA, $<ctxt>$)
}
head_sour_data_subs
;
head_sour_data_date_sect : OPEN DELIM TAG_DATE mand_line_item
- { $<ctxt>$ = start_element(ELT_HEAD_SOUR_DATA_DATE,
- PARENT, $1, $3, $4, $4);
+ { struct date_value dv = gedcom_parse_date($4);
+ $<ctxt>$ = start_element(ELT_HEAD_SOUR_DATA_DATE,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_DATE(dv));
START(DATE, $<ctxt>$)
}
no_std_subs
;
head_sour_data_copr_sect : OPEN DELIM TAG_COPR mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_SOUR_DATA_COPR,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(COPR, $<ctxt>$)
}
no_std_subs
/* HEAD.DEST */
head_dest_sect : OPEN DELIM TAG_DEST mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_DEST,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(DEST, $<ctxt>$)
}
no_std_subs
/* HEAD.DATE */
head_date_sect : OPEN DELIM TAG_DATE mand_line_item
- { $<ctxt>$ = start_element(ELT_HEAD_DATE,
- PARENT, $1, $3, $4, $4);
+ { struct date_value dv = gedcom_parse_date($4);
+ $<ctxt>$ = start_element(ELT_HEAD_DATE,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_DATE(dv));
START(DATE, $<ctxt>$)
}
head_date_subs
head_date_time_sect : OPEN DELIM TAG_TIME mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_DATE_TIME,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(TIME, $<ctxt>$)
}
no_std_subs
/* HEAD.SUBM */
head_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
{ $<ctxt>$ = start_element(ELT_HEAD_SUBM,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(SUBM, $<ctxt>$)
}
no_std_subs
/* HEAD.SUBN */
head_subn_sect : OPEN DELIM TAG_SUBN mand_pointer
{ $<ctxt>$ = start_element(ELT_HEAD_SUBN,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(SUBN, $<ctxt>$)
}
no_std_subs
/* HEAD.FILE */
head_file_sect : OPEN DELIM TAG_FILE mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_FILE,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(FILE, $<ctxt>$)
}
no_std_subs
/* HEAD.COPR */
head_copr_sect : OPEN DELIM TAG_COPR mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_COPR,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(COPR, $<ctxt>$)
}
no_std_subs
;
head_gedc_vers_sect : OPEN DELIM TAG_VERS mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_GEDC_VERS,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(VERS, $<ctxt>$)
}
no_std_subs
;
head_gedc_form_sect : OPEN DELIM TAG_FORM mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_GEDC_FORM,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(FORM, $<ctxt>$)
}
no_std_subs
head_char_sect : OPEN DELIM TAG_CHAR mand_line_item
{ if (open_conv_to_internal($4) == 0) YYERROR;
$<ctxt>$ = start_element(ELT_HEAD_CHAR,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(CHAR, $<ctxt>$)
}
head_char_subs
;
head_char_vers_sect : OPEN DELIM TAG_VERS mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_CHAR_VERS,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(VERS, $<ctxt>$)
}
no_std_subs
/* HEAD.LANG */
head_lang_sect : OPEN DELIM TAG_LANG mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_LANG,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(LANG, $<ctxt>$)
}
no_std_subs
;
head_plac_form_sect : OPEN DELIM TAG_FORM mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_PLAC_FORM,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(FORM, $<ctxt>$)
}
no_std_subs
/* HEAD.NOTE */
head_note_sect : OPEN DELIM TAG_NOTE mand_line_item
{ $<ctxt>$ = start_element(ELT_HEAD_NOTE,
- PARENT, $1, $3, $4, $4);
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
START(NOTE, $<ctxt>$)
}
head_note_subs
/* FAM.HUSB */
fam_husb_sect : OPEN DELIM TAG_HUSB mand_pointer
- { START(HUSB, NULL) } no_std_subs { CHECK0 } CLOSE
- { }
+ { $<ctxt>$ = start_element(ELT_FAM_HUSB,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(HUSB, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_FAM_HUSB, PARENT, $<ctxt>5, NULL);
+ }
;
/* FAM.WIFE */
fam_wife_sect : OPEN DELIM TAG_WIFE mand_pointer
- { START(WIFE, NULL) } no_std_subs { CHECK0 } CLOSE
- { }
+ { $<ctxt>$ = start_element(ELT_FAM_WIFE,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(WIFE, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_FAM_WIFE, PARENT, $<ctxt>5, NULL);
+ }
;
/* FAM.CHIL */
fam_chil_sect : OPEN DELIM TAG_CHIL mand_pointer
- { START(CHIL, NULL) } no_std_subs { CHECK0 } CLOSE
- { }
+ { $<ctxt>$ = start_element(ELT_FAM_CHIL,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(CHIL, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_FAM_CHIL, PARENT, $<ctxt>5, NULL);
+ }
;
/* FAM.NCHI */
fam_nchi_sect : OPEN DELIM TAG_NCHI mand_line_item
- { START(NCHI, NULL) } no_std_subs { CHECK0 } CLOSE
- { }
+ { $<ctxt>$ = start_element(ELT_FAM_NCHI,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(NCHI, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_FAM_NCHI, PARENT, $<ctxt>5, NULL);
+ }
;
/* FAM.SUBM */
fam_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
- { START(SUBM, NULL) } no_std_subs { CHECK0 } CLOSE
- { }
+ { $<ctxt>$ = start_element(ELT_FAM_SUBM,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(SUBM, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_FAM_SUBM, PARENT, $<ctxt>5, NULL);
+ }
;
/*********************************************************************/
/* INDI.RESN */
indi_resn_sect : OPEN DELIM TAG_RESN mand_line_item
- { START(RESN, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_INDI_RESN,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(RESN, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_INDI_RESN, PARENT, $<ctxt>5, NULL);
+ }
;
/* INDI.SEX */
indi_sex_sect : OPEN DELIM TAG_SEX mand_line_item
- { START(SEX, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_INDI_SEX,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(SEX, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_INDI_SEX, PARENT, $<ctxt>5, NULL);
+ }
;
/* INDI.SUBM */
indi_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
- { START(SUBM, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_INDI_SUBM,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(SUBM, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_INDI_SUBM, PARENT, $<ctxt>5, NULL);
+ }
;
/* INDI.ALIA */
indi_alia_sect : OPEN DELIM TAG_ALIA mand_pointer
- { START(ALIA, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_INDI_ALIA,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(ALIA, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_INDI_ALIA, PARENT, $<ctxt>5, NULL);
+ }
;
/* INDI.ANCI */
indi_anci_sect : OPEN DELIM TAG_ANCI mand_pointer
- { START(ANCI, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_INDI_ANCI,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(ANCI, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_INDI_ANCI, PARENT, $<ctxt>5, NULL);
+ }
;
/* INDI.DESI */
indi_desi_sect : OPEN DELIM TAG_DESI mand_pointer
- { START(DESI, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_INDI_DESI,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(DESI, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_INDI_DESI, PARENT, $<ctxt>5, NULL);
+ }
;
/* INDI.RFN */
indi_rfn_sect : OPEN DELIM TAG_RFN mand_line_item
- { START(RFN, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_INDI_RFN,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(RFN, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_INDI_RFN, PARENT, $<ctxt>5, NULL);
+ }
;
/* INDI.AFN */
indi_afn_sect : OPEN DELIM TAG_AFN mand_line_item
- { START(AFN, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_INDI_AFN,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(AFN, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_INDI_AFN, PARENT, $<ctxt>5, NULL);
+ }
;
/* INDI.ADDR (Only for 'ftree' compatibility) */
/* OBJE.FORM */
obje_form_sect : OPEN DELIM TAG_FORM mand_line_item
- { START(FORM, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_OBJE_FORM,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(FORM, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_OBJE_FORM, PARENT, $<ctxt>5, NULL);
+ }
;
/* OBJE.TITL */
obje_titl_sect : OPEN DELIM TAG_TITL mand_line_item
- { START(TITL, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_OBJE_TITL,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(TITL, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_OBJE_TITL, PARENT, $<ctxt>5, NULL);
+ }
;
/* OBJE.BLOB */
obje_blob_sect : OPEN DELIM TAG_BLOB
- { START(BLOB, NULL) }
+ { $<ctxt>$ = start_element(ELT_OBJE_BLOB,
+ PARENT, $1, $3, NULL, NULL);
+ START(BLOB, $<ctxt>$)
+ }
obje_blob_subs
{ CHECK1(CONT) }
- CLOSE { }
+ CLOSE
+ { end_element(ELT_OBJE_BLOB, PARENT, $<ctxt>4, NULL);
+ }
;
obje_blob_subs : /* empty */
;
obje_blob_cont_sect : OPEN DELIM TAG_CONT mand_line_item
- { START(CONT, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_OBJE_BLOB_CONT,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(CONT, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_OBJE_BLOB_CONT, PARENT,
+ $<ctxt>5, NULL);
+ }
;
/* OBJE.OBJE */
obje_obje_sect : OPEN DELIM TAG_OBJE mand_pointer
- { START(OBJE, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_OBJE_OBJE,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(OBJE, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_OBJE_OBJE, PARENT, $<ctxt>5, NULL);
+ }
;
/*********************************************************************/
}
}
| DELIM line_item
- { $$ = $2; }
+ { gedcom_debug_print("==Val: %s==", $2);
+ $$ = $2; }
;
note_subs : /* empty */
/* REPO.NAME */
repo_name_sect : OPEN DELIM TAG_NAME mand_line_item
- { START(NAME, NULL) } no_std_subs { CHECK0 } CLOSE {}
+ { $<ctxt>$ = start_element(ELT_REPO_NAME,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(NAME, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_REPO_NAME, PARENT, $<ctxt>5, NULL);
+ }
;
/*********************************************************************/
/* SOUR.DATA */
sour_data_sect : OPEN DELIM TAG_DATA
- { START(DATA, NULL) }
+ { $<ctxt>$ = start_element(ELT_SOUR_DATA,
+ PARENT, $1, $3, NULL, NULL);
+ START(DATA, $<ctxt>$)
+ }
sour_data_subs
{ CHECK0 }
- CLOSE { }
+ CLOSE
+ { end_element(ELT_SOUR_DATA, PARENT, $<ctxt>4, NULL);
+ }
;
sour_data_subs : /* empty */
;
sour_data_even_sect : OPEN DELIM TAG_EVEN mand_line_item
- { START(EVEN, NULL) }
+ { $<ctxt>$ = start_element(ELT_SOUR_DATA_EVEN,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(EVEN, $<ctxt>$)
+ }
sour_data_even_subs
{ CHECK0 }
- CLOSE { }
+ CLOSE
+ { end_element(ELT_SOUR_DATA_EVEN, PARENT,
+ $<ctxt>5, NULL);
+ }
;
sour_data_even_subs : /* empty */
;
sour_data_even_date_sect : OPEN DELIM TAG_DATE mand_line_item
- { START(DATE, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { struct date_value dv = gedcom_parse_date($4);
+ $<ctxt>$ = start_element(ELT_SOUR_DATA_EVEN_DATE,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_DATE(dv));
+ START(DATE, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SOUR_DATA_EVEN_DATE, PARENT,
+ $<ctxt>5, NULL);
+ }
;
sour_data_even_plac_sect : OPEN DELIM TAG_PLAC mand_line_item
- { START(PLAC, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SOUR_DATA_EVEN_PLAC,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(PLAC, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SOUR_DATA_EVEN_PLAC, PARENT,
+ $<ctxt>5, NULL);
+ }
;
sour_data_agnc_sect : OPEN DELIM TAG_AGNC mand_line_item
- { START(AGNC, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SOUR_DATA_AGNC,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(AGNC, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SOUR_DATA_AGNC, PARENT,
+ $<ctxt>5, NULL);
+ }
;
/* SOUR.AUTH */
sour_auth_sect : OPEN DELIM TAG_AUTH mand_line_item
- { START(AUTH, NULL) }
+ { $<ctxt>$ = start_element(ELT_SOUR_AUTH,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(AUTH, $<ctxt>$)
+ }
sour_auth_subs
{ CHECK0 }
- CLOSE { }
+ CLOSE
+ { end_element(ELT_SOUR_AUTH, PARENT, $<ctxt>5, NULL);
+ }
;
sour_auth_subs : /* empty */
/* SOUR.TITL */
sour_titl_sect : OPEN DELIM TAG_TITL mand_line_item
- { START(TITL, NULL) }
+ { $<ctxt>$ = start_element(ELT_SOUR_TITL,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(TITL, $<ctxt>$)
+ }
sour_titl_subs
{ CHECK0 }
- CLOSE { }
+ CLOSE
+ { end_element(ELT_SOUR_TITL, PARENT, $<ctxt>5, NULL);
+ }
;
sour_titl_subs : /* empty */
/* SOUR.ABBR */
sour_abbr_sect : OPEN DELIM TAG_ABBR mand_line_item
- { START(ABBR, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SOUR_ABBR,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(ABBR, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SOUR_ABBR, PARENT, $<ctxt>5, NULL);
+ }
;
/* SOUR.PUBL */
sour_publ_sect : OPEN DELIM TAG_PUBL mand_line_item
- { START(PUBL, NULL) }
+ { $<ctxt>$ = start_element(ELT_SOUR_PUBL,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(PUBL, $<ctxt>$)
+ }
sour_publ_subs
{ CHECK0 }
- CLOSE { }
+ CLOSE
+ { end_element(ELT_SOUR_PUBL, PARENT, $<ctxt>5, NULL);
+ }
;
sour_publ_subs : /* empty */
/* SOUR.TEXT */
sour_text_sect : OPEN DELIM TAG_TEXT mand_line_item
- { START(TEXT, NULL) }
+ { $<ctxt>$ = start_element(ELT_SOUR_TEXT,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(TEXT, $<ctxt>$)
+ }
sour_text_subs
{ CHECK0 }
- CLOSE { }
+ CLOSE
+ { end_element(ELT_SOUR_TEXT, PARENT, $<ctxt>5, NULL);
+ }
;
sour_text_subs : /* empty */
/* SUBN.SUBM */
subn_subm_sect : OPEN DELIM TAG_SUBM mand_pointer
- { START(SUBM, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBN_SUBM,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(SUBM, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBN_SUBM, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBN.FAMF */
subn_famf_sect : OPEN DELIM TAG_FAMF mand_line_item
- { START(FAMF, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBN_FAMF,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(FAMF, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBN_FAMF, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBN.TEMP */
subn_temp_sect : OPEN DELIM TAG_TEMP mand_line_item
- { START(TEMP, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBN_TEMP,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(TEMP, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBN_TEMP, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBN.ANCE */
subn_ance_sect : OPEN DELIM TAG_ANCE mand_line_item
- { START(ANCE, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBN_ANCE,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(ANCE, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBN_ANCE, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBN.DESC */
subn_desc_sect : OPEN DELIM TAG_DESC mand_line_item
- { START(DESC, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBN_DESC,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(DESC, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBN_DESC, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBN.ORDI */
subn_ordi_sect : OPEN DELIM TAG_ORDI mand_line_item
- { START(ORDI, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBN_ORDI,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(ORDI, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBN_ORDI, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBN.RIN */
subn_rin_sect : OPEN DELIM TAG_RIN mand_line_item
- { START(RIN, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBN_RIN,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(RIN, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBN_RIN, PARENT, $<ctxt>5, NULL);
+ }
;
/*********************************************************************/
/* SUBM.NAME */
subm_name_sect : OPEN DELIM TAG_NAME mand_line_item
- { START(NAME, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBM_NAME,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(NAME, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBM_NAME, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBM.LANG */
subm_lang_sect : OPEN DELIM TAG_LANG mand_line_item
- { START(LANG, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBM_LANG,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(LANG, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBM_LANG, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBM.RFN */
subm_rfn_sect : OPEN DELIM TAG_RFN mand_line_item
- { START(RFN, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBM_RFN,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(RFN, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBM_RFN, PARENT, $<ctxt>5, NULL);
+ }
;
/* SUBM.RIN */
subm_rin_sect : OPEN DELIM TAG_RIN mand_line_item
- { START(RIN, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUBM_RIN,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(RIN, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUBM_RIN, PARENT, $<ctxt>5, NULL);
+ }
;
/*********************************************************************/
;
addr_sect : OPEN DELIM TAG_ADDR mand_line_item
- { START(ADDR, NULL) }
+ { $<ctxt>$ = start_element(ELT_SUB_ADDR,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(ADDR, $<ctxt>$)
+ }
addr_subs
{ CHECK0 }
- CLOSE { }
+ CLOSE
+ { end_element(ELT_SUB_ADDR, PARENT, $<ctxt>5, NULL);
+ }
;
addr_subs : /* empty */
;
addr_cont_sect : OPEN DELIM TAG_CONT mand_line_item
- { START(CONT, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUB_ADDR_CONT,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(CONT, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUB_ADDR_CONT, PARENT, $<ctxt>5, NULL);
+ }
;
addr_adr1_sect : OPEN DELIM TAG_ADR1 mand_line_item
- { START(ADR1, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUB_ADDR_ADR1,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(ADR1, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUB_ADDR_ADR1, PARENT, $<ctxt>5, NULL);
+ }
;
addr_adr2_sect : OPEN DELIM TAG_ADR2 mand_line_item
- { START(ADR2, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUB_ADDR_ADR2,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(ADR2, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUB_ADDR_ADR2, PARENT, $<ctxt>5, NULL);
+ }
;
addr_city_sect : OPEN DELIM TAG_CITY mand_line_item
- { START(CITY, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUB_ADDR_CITY,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(CITY, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUB_ADDR_CITY, PARENT, $<ctxt>5, NULL);
+ }
;
addr_stae_sect : OPEN DELIM TAG_STAE mand_line_item
- { START(STAE, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUB_ADDR_STAE,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(STAE, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUB_ADDR_STAE, PARENT, $<ctxt>5, NULL);
+ }
;
addr_post_sect : OPEN DELIM TAG_POST mand_line_item
- { START(POST, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUB_ADDR_POST,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(POST, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUB_ADDR_POST, PARENT, $<ctxt>5, NULL);
+ }
;
addr_ctry_sect : OPEN DELIM TAG_CTRY mand_line_item
- { START(CTRY, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUB_ADDR_CTRY,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(CTRY, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUB_ADDR_CTRY, PARENT, $<ctxt>5, NULL);
+ }
;
phon_sect : OPEN DELIM TAG_PHON mand_line_item
- { START(PHON, NULL) } no_std_subs { CHECK0 } CLOSE { }
+ { $<ctxt>$ = start_element(ELT_SUB_PHON,
+ PARENT, $1, $3, $4,
+ GEDCOM_MAKE_STRING($4));
+ START(PHON, $<ctxt>$)
+ }
+ no_std_subs
+ { CHECK0 }
+ CLOSE
+ { end_element(ELT_SUB_PHON, PARENT, $<ctxt>5, NULL);
+ }
;
/* ASSOCIATION STRUCTURE */
| no_std_sub
;
+/*********************************************************************/
+/**** Special values ****/
+/*********************************************************************/
+
/*********************************************************************/
/**** General ****/
/*********************************************************************/
}
}
opt_value
- { $<ctxt>$ = start_element(ELT_USER, PARENT, $1, $4, $6, $6);
+ { $<ctxt>$ = start_element(ELT_USER, PARENT, $1, $4, $6,
+ GEDCOM_MAKE_STRING($6));
START($4, $<ctxt>$);
}
user_sects
;
mand_pointer : /* empty */ { gedcom_error(_("Missing pointer")); YYERROR; }
- | DELIM POINTER { $$ = $2; }
+ | DELIM POINTER { gedcom_debug_print("==Ptr: %s==", $2);
+ $$ = $2; }
;
mand_line_item : /* empty */ { gedcom_error(_("Missing value")); YYERROR; }
- | DELIM line_item { $$ = $2; }
+ | DELIM line_item { gedcom_debug_print("==Val: %s==", $2);
+ $$ = $2; }
;
opt_line_item : /* empty */ { }
*line_item_buf_ptr++ = $1[i];
$$ = line_item_buf;
}
- | ESCAPE { CLEAR_BUFFER(line_item_buf);
+ | ESCAPE { size_t i;
+ CLEAR_BUFFER(line_item_buf);
line_item_buf_ptr = line_item_buf;
- /* For now, ignore escapes */
+ for (i=0; i < strlen($1); i++)
+ *line_item_buf_ptr++ = $1[i];
$$ = line_item_buf;
}
| line_item anychar
$$ = line_item_buf;
}
| line_item ESCAPE
- { /* For now, ignore escapes */
+ { size_t i;
+ for (i=0; i < strlen($2); i++)
+ *line_item_buf_ptr++ = $2[i];
$$ = line_item_buf;
}
;
va_start(ap, s);
res = vfprintf(trace_output, s, ap);
va_end(ap);
+ fprintf(trace_output, "\n");
}
return(res);
}