+line_item : anychar { int i;
+ CLEAR_BUFFER(string_buf);
+ string_buf_ptr = string_buf;
+ /* The following also takes care of '@@' */
+ if (!strncmp($1, "@@", 3))
+ *string_buf_ptr++ = '@';
+ else
+ for (i=0; i < strlen($1); i++)
+ *string_buf_ptr++ = $1[i];
+ $$ = string_buf;
+ }
+ | ESCAPE { CLEAR_BUFFER(string_buf);
+ string_buf_ptr = string_buf;
+ /* For now, ignore escapes */
+ $$ = string_buf;
+ }
+ | line_item anychar
+ { if (strlen(string_buf) >= MAXGEDCLINELEN) {
+ gedcom_error("Line too long");
+ YYERROR;
+ }
+ else {
+ int i;
+ /* The following also takes care of '@@' */
+ if (!strncmp($2, "@@", 3))
+ *string_buf_ptr++ = '@';
+ else
+ for (i=0; i < strlen($2); i++)
+ *string_buf_ptr++ = $2[i];
+ $$ = string_buf;
+ }
+ }
+ | line_item ESCAPE
+ { /* For now, ignore escapes */
+ $$ = string_buf;
+ }