From: Peter Verthez Date: Tue, 22 Jan 2002 20:20:21 +0000 (+0000) Subject: Some enhancements in the ftree compatibility. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=a9ef3e45e68f855ec594bd5f1fa5e25618a706fd;p=gedcom-parse.git Some enhancements in the ftree compatibility. --- diff --git a/gedcom/gedcom.y b/gedcom/gedcom.y index ed3f303..10486da 100644 --- a/gedcom/gedcom.y +++ b/gedcom/gedcom.y @@ -257,7 +257,7 @@ int compat_mode(int flags); } %token_table -%expect 300 +%expect 303 %token BADTOKEN %token OPEN @@ -1172,23 +1172,37 @@ indi_afn_sect : OPEN DELIM TAG_AFN mand_line_item /* INDI.ADDR (Only for 'ftree' compatibility) */ ftree_addr_sect : OPEN DELIM TAG_ADDR opt_line_item - { Gedcom_ctxt par = compat_generate_resi_start(PARENT); - START(RESI, par); - $$ - = start_element(ELT_SUB_ADDR, - par, $1 + 1, $3, $4, - GEDCOM_MAKE_NULL_OR_STRING(val2, $4)); - START(ADDR, $$) + { if (compat_mode(C_FTREE)) { + Gedcom_ctxt par = compat_generate_resi_start(PARENT); + START(RESI, par); + $$ + = start_element(ELT_SUB_ADDR, + par, $1 + 1, $3, $4, + GEDCOM_MAKE_NULL_OR_STRING(val2, $4)); + START(ADDR, $$); + } + else { START(ADDR, NULL) } } - no_std_subs + ftree_addr_subs { CHECK0 } CLOSE - { Gedcom_ctxt par = PARENT; - end_element(ELT_SUB_ADDR, par, $5, NULL); - CHECK0; - compat_generate_resi_end(PARENT, par); + { if (compat_mode(C_FTREE)) { + Gedcom_ctxt par = PARENT; + end_element(ELT_SUB_ADDR, par, $5, NULL); + CHECK0; + compat_generate_resi_end(PARENT, par); + } } +ftree_addr_subs : /* empty */ + | ftree_addr_subs ftree_addr_sub + ; + +ftree_addr_sub : continuation_sub + | phon_sect + | no_std_sub + ; + /*********************************************************************/ /**** Multimedia record ****/ /*********************************************************************/