home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume27 / gcom / part06 < prev    next >
Encoding:
Text File  |  1992-01-13  |  48.5 KB  |  1,701 lines

  1. Newsgroups: comp.sources.misc
  2. From: murf@oakhill.sps.mot.com (Steve Murphy)
  3. Subject:  v27i077:  gcom - GEDCOM genealogical database merge utility, v1, Part06/07
  4. Message-ID: <1992Jan13.145700.25679@sparky.imd.sterling.com>
  5. X-Md4-Signature: dc8d6a06252960ad4a90ab5c0e1c049d
  6. Date: Mon, 13 Jan 1992 14:57:00 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: murf@oakhill.sps.mot.com (Steve Murphy)
  10. Posting-number: Volume 27, Issue 77
  11. Archive-name: gcom/part06
  12. Environment: SunOS
  13.  
  14. ---- Cut Here and unpack ----
  15. #!/bin/sh
  16. # This is part 06 of gcom
  17. if touch 2>&1 | fgrep 'amc' > /dev/null
  18.  then TOUCH=touch
  19.  else TOUCH=true
  20. fi
  21. # ============= gedcom.b.tab.c ==============
  22. echo "x - extracting gedcom.b.tab.c (Text)"
  23. sed 's/^X//' << 'SHAR_EOF' > gedcom.b.tab.c &&
  24. X
  25. X/*  A Bison parser, made from gedcom.b  */
  26. X
  27. X#define    DIV    258
  28. X#define    LEV0    259
  29. X#define    LEV1    260
  30. X#define    LEV2    261
  31. X#define    LEV3    262
  32. X#define    ADDR    263
  33. X#define    BAPL    264
  34. X#define    CHAR    265
  35. X#define    COMM    266
  36. X#define    CONT    267
  37. X#define    DATE    268
  38. X#define    DEST    269
  39. X#define    ENDL    270
  40. X#define    FILE9    271
  41. X#define    FLAG    272
  42. X#define    NAME    273
  43. X#define    NOTE    274
  44. X#define    PHON    275
  45. X#define    PLAC    276
  46. X#define    QUAL    277
  47. X#define    REL    278
  48. X#define    SEX    279
  49. X#define    SOUR    280
  50. X#define    TEMP    281
  51. X#define    TITL    282
  52. X#define    REF    283
  53. X#define    BIC    284
  54. X#define    NUMB    285
  55. X#define    REFN    286
  56. X#define    SLGC    287
  57. X#define    SLGS    288
  58. X#define    BIRT    289
  59. X#define    BURI    290
  60. X#define    CHIL    291
  61. X#define    CHR    292
  62. X#define    DEAT    293
  63. X#define    FAM    294
  64. X#define    FAMC    295
  65. X#define    FAMS    296
  66. X#define    HEAD    297
  67. X#define    HUSB    298
  68. X#define    INDI    299
  69. X#define    MARR    300
  70. X#define    STAL    301
  71. X#define    TRLR    302
  72. X#define    WIFE    303
  73. X#define    SUBM    304
  74. X
  75. X#line 1 "gedcom.b"
  76. X
  77. X#ifndef LINT
  78. Xstatic char rcs_gedcom_id[] = "$Id: gedcom.b,v 1.2 1992/01/03 17:49:44 murf Exp $";
  79. X#endif
  80. X/* # Copyright (C) 1992 Steven Michael Murphy
  81. X#
  82. X#
  83. X# This file is part of gcom, the GEDCOM file merging utility for UNIX,
  84. X# 
  85. X# 
  86. X# gcom is free software; you can redistribute it and/or modify
  87. X# it under the terms of the GNU General Public License as published by
  88. X# the Free Software Foundation; either version 2, or (at your option)
  89. X# any later version.
  90. X# 
  91. X# gcom is distributed in the hope that it will be useful,
  92. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  93. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  94. X# GNU General Public License for more details.
  95. X# 
  96. X# You should have received a copy of the GNU General Public License
  97. X# along with gcom; see the file COPYING.  If not, write to
  98. X# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  99. X*/
  100. X
  101. X#include <stdio.h>
  102. X#include "gedcom.h"
  103. Xint lineno;
  104. Xstruct  individ curr_ind;
  105. Xstruct family curr_fam;
  106. Xstruct gedfile *curr_file;
  107. Xstruct submitter curr_submitter;
  108. Xstruct gheader curr_head;
  109. Xstruct submitt{char *submitter; char *rel;};
  110. Xint strcmp();
  111. Xstatic char rcs_stuff[] = "$Id: gedcom.b,v 1.2 1992/01/03 17:49:44 murf Exp $";
  112. X
  113. X#line 40 "gedcom.b"
  114. Xtypedef union
  115. X{     int num;
  116. X    char *str;
  117. X    struct datplace *datplace;
  118. X    struct ordinance *ordinance;
  119. X    struct notelist *notelist;
  120. X    struct individ *individ;
  121. X    struct family *family;
  122. X    struct gheader *header;
  123. X    struct submitt *submit;
  124. X    struct child *child;
  125. X    struct submitt *submitt;
  126. X    struct comment *comment;
  127. X    struct stake *stake;
  128. X    struct address *address;
  129. X} YYSTYPE;
  130. X
  131. X#ifndef YYLTYPE
  132. Xtypedef
  133. X  struct yyltype
  134. X    {
  135. X      int timestamp;
  136. X      int first_line;
  137. X      int first_column;
  138. X      int last_line;
  139. X      int last_column;
  140. X      char *text;
  141. X   }
  142. X  yyltype;
  143. X
  144. X#define YYLTYPE yyltype
  145. X#endif
  146. X
  147. X#include <stdio.h>
  148. X
  149. X#ifndef __STDC__
  150. X#define const
  151. X#endif
  152. X
  153. X
  154. X
  155. X#define    YYFINAL        150
  156. X#define    YYFLAG        -32768
  157. X#define    YYNTBASE    50
  158. X
  159. X#define YYTRANSLATE(x) ((unsigned)(x) <= 304 ? yytranslate[x] : 92)
  160. X
  161. Xstatic const char yytranslate[] = {     0,
  162. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  163. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  164. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  165. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  166. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  167. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  168. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  169. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  170. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  171. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  172. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  173. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  174. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  175. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  176. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  177. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  178. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  179. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  180. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  181. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  182. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  183. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  184. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  185. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  186. X     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  187. X     2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  188. X     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  189. X    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  190. X    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
  191. X    36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
  192. X    46,    47,    48,    49
  193. X};
  194. X
  195. Xstatic const short yyprhs[] = {     0,
  196. X     0,     5,     6,    11,    13,    16,    19,    22,    25,    28,
  197. X    31,    32,    38,    41,    45,    47,    49,    51,    53,    55,
  198. X    58,    60,    63,    67,    70,    72,    74,    78,    82,    88,
  199. X    94,    96,    99,   101,   103,   104,   110,   113,   117,   119,
  200. X   121,   123,   125,   127,   129,   131,   133,   135,   137,   139,
  201. X   141,   144,   147,   149,   151,   153,   156,   159,   162,   167,
  202. X   172,   175,   178,   181,   184,   186,   188,   191,   194,   197,
  203. X   200,   202,   205,   208,   211,   214,   217,   219,   222,   224,
  204. X   226,   229,   232,   237,   239,   242,   243,   249,   252,   256,
  205. X   259,   262,   264,   266,   268,   270,   272,   274,   276,   279,
  206. X   284,   287,   290,   292
  207. X};
  208. X
  209. Xstatic const short yyrhs[] = {    51,
  210. X    55,    63,    91,     0,     0,     4,    42,    52,    53,     0,
  211. X    54,     0,    53,    54,     0,     5,    25,     0,     5,    14,
  212. X     0,     5,    13,     0,     5,    10,     0,     5,    16,     0,
  213. X     0,     4,    28,    56,    49,    57,     0,     5,    58,     0,
  214. X    57,     5,    58,     0,    18,     0,    20,     0,    61,     0,
  215. X    59,     0,    62,     0,     8,    60,     0,     8,     0,     6,
  216. X    12,     0,    60,     6,    12,     0,    11,    60,     0,    11,
  217. X     0,    46,     0,    46,     6,    18,     0,    46,     6,    30,
  218. X     0,    46,     6,    18,     6,    30,     0,    46,     6,    30,
  219. X     6,    18,     0,    64,     0,    63,    64,     0,    65,     0,
  220. X    84,     0,     0,     4,    28,    44,    66,    67,     0,     5,
  221. X    68,     0,    67,     5,    68,     0,    18,     0,    27,     0,
  222. X    24,     0,    31,     0,    69,     0,    71,     0,    72,     0,
  223. X    73,     0,    74,     0,    79,     0,    80,     0,    17,     0,
  224. X    41,    28,     0,    40,    28,     0,    82,     0,    14,     0,
  225. X    83,     0,    34,    70,     0,     6,    13,     0,     6,    21,
  226. X     0,     6,    13,     6,    21,     0,     6,    21,     6,    13,
  227. X     0,    37,    70,     0,    38,    70,     0,    35,    70,     0,
  228. X     9,    75,     0,     9,     0,    76,     0,    75,    76,     0,
  229. X     6,    13,     0,     6,    26,     0,     6,    22,     0,    78,
  230. X     0,    77,    78,     0,     7,    13,     0,     7,    26,     0,
  231. X     7,    22,     0,    15,    75,     0,    15,     0,    32,    75,
  232. X     0,    32,     0,    32,     0,    32,    77,     0,    49,    28,
  233. X     0,    49,    28,     6,    23,     0,    19,     0,    19,    60,
  234. X     0,     0,     4,    28,    85,    39,    86,     0,     5,    87,
  235. X     0,    86,     5,    87,     0,    43,    28,     0,    48,    28,
  236. X     0,    88,     0,    89,     0,    90,     0,     3,     0,    14,
  237. X     0,    17,     0,    82,     0,    36,    28,     0,    36,    28,
  238. X     6,    81,     0,    45,    70,     0,    33,    75,     0,    33,
  239. X     0,     4,    47,     0
  240. X};
  241. X
  242. X#if YYDEBUG != 0
  243. Xstatic const short yyrline[] = { 0,
  244. X   115,   117,   117,   119,   120,   122,   123,   124,   125,   126,
  245. X   128,   128,   131,   132,   134,   135,   136,   137,   138,   140,
  246. X   151,   155,   156,   159,   161,   163,   164,   165,   166,   169,
  247. X   173,   174,   176,   177,   179,   180,   182,   183,   185,   186,
  248. X   187,   190,   191,   192,   193,   194,   195,   196,   197,   198,
  249. X   199,   200,   201,   202,   203,   216,   218,   219,   220,   221,
  250. X   223,   225,   227,   229,   230,   232,   233,   236,   237,   238,
  251. X   240,   241,   244,   245,   246,   248,   249,   251,   252,   254,
  252. X   255,   257,   258,   260,   262,   273,   273,   276,   277,   279,
  253. X   280,   281,   282,   283,   284,   285,   286,   287,   290,   291,
  254. X   293,   295,   296,   298
  255. X};
  256. X
  257. Xstatic const char * const yytname[] = {   "$",
  258. X"error","$illegal.","DIV","LEV0","LEV1","LEV2","LEV3","ADDR","BAPL","CHAR",
  259. X"COMM","CONT","DATE","DEST","ENDL","FILE9","FLAG","NAME","NOTE","PHON",
  260. X"PLAC","QUAL","REL","SEX","SOUR","TEMP","TITL","REF","BIC","NUMB",
  261. X"REFN","SLGC","SLGS","BIRT","BURI","CHIL","CHR","DEAT","FAM","FAMC",
  262. X"FAMS","HEAD","HUSB","INDI","MARR","STAL","TRLR","WIFE","SUBM","file",
  263. X"header","@1","head_rec_list","headrec","submitter","@2","subm_list","submrec","address","ext_list",
  264. X"comment","stake","record_list","record","individual_rec","@3","indiv_stuff_list","indivrec","birth","datplacitem2",
  265. X"christen","death","buried","bap","tempitem","t_item","tempitem3","t_item3","endow","c2pseal",
  266. X"c2pseal3","submitter2","note","fam_rec","@4","fam_stuff_list","famrec","child","marriage","seal2spou",
  267. X"trailer",""
  268. X};
  269. X#endif
  270. X
  271. Xstatic const short yyr1[] = {     0,
  272. X    50,    52,    51,    53,    53,    54,    54,    54,    54,    54,
  273. X    56,    55,    57,    57,    58,    58,    58,    58,    58,    59,
  274. X    59,    60,    60,    61,    61,    62,    62,    62,    62,    62,
  275. X    63,    63,    64,    64,    66,    65,    67,    67,    68,    68,
  276. X    68,    68,    68,    68,    68,    68,    68,    68,    68,    68,
  277. X    68,    68,    68,    68,    68,    69,    70,    70,    70,    70,
  278. X    71,    72,    73,    74,    74,    75,    75,    76,    76,    76,
  279. X    77,    77,    78,    78,    78,    79,    79,    80,    80,    81,
  280. X    81,    82,    82,    83,    83,    85,    84,    86,    86,    87,
  281. X    87,    87,    87,    87,    87,    87,    87,    87,    88,    88,
  282. X    89,    90,    90,    91
  283. X};
  284. X
  285. Xstatic const short yyr2[] = {     0,
  286. X     4,     0,     4,     1,     2,     2,     2,     2,     2,     2,
  287. X     0,     5,     2,     3,     1,     1,     1,     1,     1,     2,
  288. X     1,     2,     3,     2,     1,     1,     3,     3,     5,     5,
  289. X     1,     2,     1,     1,     0,     5,     2,     3,     1,     1,
  290. X     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
  291. X     2,     2,     1,     1,     1,     2,     2,     2,     4,     4,
  292. X     2,     2,     2,     2,     1,     1,     2,     2,     2,     2,
  293. X     1,     2,     2,     2,     2,     2,     1,     2,     1,     1,
  294. X     2,     2,     4,     1,     2,     0,     5,     2,     3,     2,
  295. X     2,     1,     1,     1,     1,     1,     1,     1,     2,     4,
  296. X     2,     2,     1,     2
  297. X};
  298. X
  299. Xstatic const short yydefact[] = {     0,
  300. X     0,     0,     2,     0,     0,     0,    11,     0,     0,    31,
  301. X    33,    34,     0,     3,     4,     0,    86,     0,    32,     1,
  302. X     9,     8,     7,    10,     6,     5,     0,    35,     0,   104,
  303. X     0,    12,     0,     0,    21,    25,    15,    16,    26,    13,
  304. X    18,    17,    19,     0,     0,    36,     0,    87,     0,    20,
  305. X    24,     0,    14,    65,    54,    77,    50,    39,    84,    41,
  306. X    40,    42,    79,     0,     0,     0,     0,     0,     0,     0,
  307. X    37,    43,    44,    45,    46,    47,    48,    49,    53,    55,
  308. X     0,    95,    96,    97,   103,     0,     0,     0,     0,    98,
  309. X    88,    92,    93,    94,     0,    22,     0,    27,    28,     0,
  310. X    64,    66,    76,    85,    78,     0,    56,    63,    61,    62,
  311. X    52,    51,    82,    38,   102,    99,    90,   101,    91,    89,
  312. X    23,     0,     0,    68,    70,    69,    67,    57,    58,     0,
  313. X     0,    29,    30,     0,     0,    83,    80,   100,    59,    60,
  314. X     0,    81,    71,    73,    75,    74,    72,     0,     0,     0
  315. X};
  316. X
  317. Xstatic const short yydefgoto[] = {   148,
  318. X     2,     6,    14,    15,     5,    16,    32,    40,    41,    50,
  319. X    42,    43,     9,    10,    11,    33,    46,    71,    72,   107,
  320. X    73,    74,    75,    76,   101,   102,   142,   143,    77,    78,
  321. X   138,    79,    80,    12,    29,    48,    91,    92,    93,    94,
  322. X    20
  323. X};
  324. X
  325. Xstatic const short yypact[] = {     4,
  326. X   -31,    10,-32768,     2,    20,    33,-32768,    12,    40,-32768,
  327. X-32768,-32768,    47,    33,-32768,    19,    25,   -26,-32768,-32768,
  328. X-32768,-32768,-32768,-32768,-32768,-32768,    49,-32768,    31,-32768,
  329. X     5,    66,    68,    70,    71,    71,-32768,-32768,    73,-32768,
  330. X-32768,-32768,-32768,     5,    18,    75,    -2,    76,    72,    77,
  331. X    77,   -11,-32768,    79,-32768,    79,-32768,-32768,    71,-32768,
  332. X-32768,-32768,    79,    80,    80,    80,    80,    54,    59,    60,
  333. X-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  334. X    18,-32768,-32768,-32768,    79,    61,    62,    80,    63,-32768,
  335. X-32768,-32768,-32768,-32768,    -2,-32768,    81,    86,    88,    -4,
  336. X    79,-32768,    79,    77,    79,     7,-32768,-32768,-32768,-32768,
  337. X-32768,-32768,    89,-32768,    79,    90,-32768,-32768,-32768,-32768,
  338. X-32768,    67,    82,-32768,-32768,-32768,-32768,    92,    93,    78,
  339. X    74,-32768,-32768,    83,    94,-32768,    95,-32768,-32768,-32768,
  340. X    52,    95,-32768,-32768,-32768,-32768,-32768,   103,   105,-32768
  341. X};
  342. X
  343. Xstatic const short yypgoto[] = {-32768,
  344. X-32768,-32768,-32768,    96,-32768,-32768,-32768,    64,-32768,   -30,
  345. X-32768,-32768,-32768,   100,-32768,-32768,-32768,    30,-32768,   -62,
  346. X-32768,-32768,-32768,-32768,   -46,   -39,-32768,   -29,-32768,-32768,
  347. X-32768,   -47,-32768,-32768,-32768,-32768,    17,-32768,-32768,-32768,
  348. X-32768
  349. X};
  350. X
  351. X
  352. X#define    YYLAST        113
  353. X
  354. X
  355. Xstatic const short yytable[] = {    90,
  356. X    82,    17,   108,   109,   110,    51,    98,     1,   124,   103,
  357. X     3,    83,    35,     4,    84,    36,   105,   125,    99,   128,
  358. X    30,   126,    37,     8,    38,   118,    54,   129,   104,     7,
  359. X    85,    55,    56,    86,    57,    58,    59,    13,   115,    17,
  360. X    87,    60,    88,    18,    61,    89,    70,    90,    62,    63,
  361. X    39,    64,    65,    31,    66,    67,    21,    68,    69,    22,
  362. X    23,   127,    24,   127,   144,   127,    70,    27,    28,    34,
  363. X    44,    25,    45,   145,    47,   127,    49,   146,    52,    81,
  364. X    95,   111,    97,    96,   100,   106,   112,   113,   116,   117,
  365. X   119,   122,   121,   123,   130,   131,   132,   134,   135,   133,
  366. X   136,   141,   149,   139,   150,   137,   140,    53,    19,    26,
  367. X   114,   120,   147
  368. X};
  369. X
  370. Xstatic const short yycheck[] = {    47,
  371. X     3,    28,    65,    66,    67,    36,    18,     4,    13,    56,
  372. X    42,    14,     8,     4,    17,    11,    63,    22,    30,    13,
  373. X    47,    26,    18,     4,    20,    88,     9,    21,    59,    28,
  374. X    33,    14,    15,    36,    17,    18,    19,     5,    85,    28,
  375. X    43,    24,    45,     4,    27,    48,    49,    95,    31,    32,
  376. X    46,    34,    35,     5,    37,    38,    10,    40,    41,    13,
  377. X    14,   101,    16,   103,    13,   105,    49,    49,    44,    39,
  378. X     5,    25,     5,    22,     5,   115,     6,    26,     6,     5,
  379. X     5,    28,     6,    12,     6,     6,    28,    28,    28,    28,
  380. X    28,     6,    12,     6,     6,     6,    30,     6,     6,    18,
  381. X    23,     7,     0,    21,     0,    32,    13,    44,     9,    14,
  382. X    81,    95,   142
  383. X};
  384. X/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  385. X#line 3 "bison.simple"
  386. X
  387. X/* Skeleton output parser for bison,
  388. X   Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  389. X
  390. X   This program is free software; you can redistribute it and/or modify
  391. X   it under the terms of the GNU General Public License as published by
  392. X   the Free Software Foundation; either version 1, or (at your option)
  393. X   any later version.
  394. X
  395. X   This program is distributed in the hope that it will be useful,
  396. X   but WITHOUT ANY WARRANTY; without even the implied warranty of
  397. X   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  398. X   GNU General Public License for more details.
  399. X
  400. X   You should have received a copy of the GNU General Public License
  401. X   along with this program; if not, write to the Free Software
  402. X   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  403. X
  404. X
  405. X#ifndef alloca
  406. X#ifdef __GNUC__
  407. X#define alloca __builtin_alloca
  408. X#else /* Not GNU C.  */
  409. X#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
  410. X#include <alloca.h>
  411. X#else /* Not sparc */
  412. X#ifdef MSDOS
  413. X#include <malloc.h>
  414. X#endif /* MSDOS */
  415. X#endif /* Not sparc.  */
  416. X#endif /* Not GNU C.  */
  417. X#endif /* alloca not defined.  */
  418. X
  419. X/* This is the parser code that is written into each bison parser
  420. X  when the %semantic_parser declaration is not specified in the grammar.
  421. X  It was written by Richard Stallman by simplifying the hairy parser
  422. X  used when %semantic_parser is specified.  */
  423. X
  424. X/* Note: there must be only one dollar sign in this file.
  425. X   It is replaced by the list of actions, each action
  426. X   as one case of the switch.  */
  427. X
  428. X#define yyerrok        (yyerrstatus = 0)
  429. X#define yyclearin    (yychar = YYEMPTY)
  430. X#define YYEMPTY        -2
  431. X#define YYEOF        0
  432. X#define YYACCEPT    return(0)
  433. X#define YYABORT     return(1)
  434. X#define YYERROR        goto yyerrlab1
  435. X/* Like YYERROR except do call yyerror.
  436. X   This remains here temporarily to ease the
  437. X   transition to the new meaning of YYERROR, for GCC.
  438. X   Once GCC version 2 has supplanted version 1, this can go.  */
  439. X#define YYFAIL        goto yyerrlab
  440. X#define YYRECOVERING()  (!!yyerrstatus)
  441. X#define YYBACKUP(token, value) \
  442. Xdo                                \
  443. X  if (yychar == YYEMPTY && yylen == 1)                \
  444. X    { yychar = (token), yylval = (value);            \
  445. X      yychar1 = YYTRANSLATE (yychar);                \
  446. X      YYPOPSTACK;                        \
  447. X      goto yybackup;                        \
  448. X    }                                \
  449. X  else                                \
  450. X    { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  451. Xwhile (0)
  452. X
  453. X#define YYTERROR    1
  454. X#define YYERRCODE    256
  455. X
  456. X#ifndef YYPURE
  457. X#define YYLEX        yylex()
  458. X#endif
  459. X
  460. X#ifdef YYPURE
  461. X#ifdef YYLSP_NEEDED
  462. X#define YYLEX        yylex(&yylval, &yylloc)
  463. X#else
  464. X#define YYLEX        yylex(&yylval)
  465. X#endif
  466. X#endif
  467. X
  468. X/* If nonreentrant, generate the variables here */
  469. X
  470. X#ifndef YYPURE
  471. X
  472. Xint    yychar;            /*  the lookahead symbol        */
  473. XYYSTYPE    yylval;            /*  the semantic value of the        */
  474. X                /*  lookahead symbol            */
  475. X
  476. X#ifdef YYLSP_NEEDED
  477. XYYLTYPE yylloc;            /*  location data for the lookahead    */
  478. X                /*  symbol                */
  479. X#endif
  480. X
  481. Xint yynerrs;            /*  number of parse errors so far       */
  482. X#endif  /* not YYPURE */
  483. X
  484. X#if YYDEBUG != 0
  485. Xint yydebug;            /*  nonzero means print parse trace    */
  486. X/* Since this is uninitialized, it does not stop multiple parsers
  487. X   from coexisting.  */
  488. X#endif
  489. X
  490. X/*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  491. X
  492. X#ifndef    YYINITDEPTH
  493. X#define YYINITDEPTH 200
  494. X#endif
  495. X
  496. X/*  YYMAXDEPTH is the maximum size the stacks can grow to
  497. X    (effective only if the built-in stack extension method is used).  */
  498. X
  499. X#if YYMAXDEPTH == 0
  500. X#undef YYMAXDEPTH
  501. X#endif
  502. X
  503. X#ifndef YYMAXDEPTH
  504. X#define YYMAXDEPTH 10000
  505. X#endif
  506. X
  507. X#ifndef __cplusplus
  508. X
  509. X/* This is the most reliable way to avoid incompatibilities
  510. X   in available built-in functions on various systems.  */
  511. Xstatic void
  512. X__yy_bcopy (from, to, count)
  513. X     char *from;
  514. X     char *to;
  515. X     int count;
  516. X{
  517. X  register char *f = from;
  518. X  register char *t = to;
  519. X  register int i = count;
  520. X
  521. X  while (i-- > 0)
  522. X    *t++ = *f++;
  523. X}
  524. X
  525. X#else /* __cplusplus */
  526. X
  527. X/* This is the most reliable way to avoid incompatibilities
  528. X   in available built-in functions on various systems.  */
  529. Xstatic void
  530. X__yy_bcopy (char *from, char *to, int count)
  531. X{
  532. X  register char *f = from;
  533. X  register char *t = to;
  534. X  register int i = count;
  535. X
  536. X  while (i-- > 0)
  537. X    *t++ = *f++;
  538. X}
  539. X
  540. X#endif
  541. X
  542. X#line 160 "bison.simple"
  543. Xint
  544. Xyyparse()
  545. X{
  546. X  register int yystate;
  547. X  register int yyn;
  548. X  register short *yyssp;
  549. X  register YYSTYPE *yyvsp;
  550. X  int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  551. X  int yychar1;        /*  lookahead token as an internal (translated) token number */
  552. X
  553. X  short    yyssa[YYINITDEPTH];    /*  the state stack            */
  554. X  YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  555. X
  556. X  short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  557. X  YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  558. X
  559. X#ifdef YYLSP_NEEDED
  560. X  YYLTYPE *yyls = yylsa;
  561. X  YYLTYPE *yylsp;
  562. X  YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  563. X
  564. X#define YYPOPSTACK   (yyvsp--, yysp--, yylsp--)
  565. X#else
  566. X#define YYPOPSTACK   (yyvsp--, yysp--)
  567. X#endif
  568. X
  569. X  int yystacksize = YYINITDEPTH;
  570. X
  571. X#ifdef YYPURE
  572. X  int yychar;
  573. X  YYSTYPE yylval;
  574. X  int yynerrs;
  575. X#ifdef YYLSP_NEEDED
  576. X  YYLTYPE yylloc;
  577. X#endif
  578. X#endif
  579. X
  580. X  YYSTYPE yyval;        /*  the variable used to return        */
  581. X                /*  semantic values from the action    */
  582. X                /*  routines                */
  583. X
  584. X  int yylen;
  585. X
  586. X#if YYDEBUG != 0
  587. X  if (yydebug)
  588. X    fprintf(stderr, "Starting parse\n");
  589. X#endif
  590. X
  591. X  yystate = 0;
  592. X  yyerrstatus = 0;
  593. X  yynerrs = 0;
  594. X  yychar = YYEMPTY;        /* Cause a token to be read.  */
  595. X
  596. X  /* Initialize stack pointers.
  597. X     Waste one element of value and location stack
  598. X     so that they stay on the same level as the state stack.  */
  599. X
  600. X  yyssp = yyss - 1;
  601. X  yyvsp = yyvs;
  602. X#ifdef YYLSP_NEEDED
  603. X  yylsp = yyls;
  604. X#endif
  605. X
  606. X/* Push a new state, which is found in  yystate  .  */
  607. X/* In all cases, when you get here, the value and location stacks
  608. X   have just been pushed. so pushing a state here evens the stacks.  */
  609. Xyynewstate:
  610. X
  611. X  *++yyssp = yystate;
  612. X
  613. X  if (yyssp >= yyss + yystacksize - 1)
  614. X    {
  615. X      /* Give user a chance to reallocate the stack */
  616. X      /* Use copies of these so that the &'s don't force the real ones into memory. */
  617. X      YYSTYPE *yyvs1 = yyvs;
  618. X      short *yyss1 = yyss;
  619. X#ifdef YYLSP_NEEDED
  620. X      YYLTYPE *yyls1 = yyls;
  621. X#endif
  622. X
  623. X      /* Get the current used size of the three stacks, in elements.  */
  624. X      int size = yyssp - yyss + 1;
  625. X
  626. X#ifdef yyoverflow
  627. X      /* Each stack pointer address is followed by the size of
  628. X     the data in use in that stack, in bytes.  */
  629. X      yyoverflow("parser stack overflow",
  630. X         &yyss1, size * sizeof (*yyssp),
  631. X         &yyvs1, size * sizeof (*yyvsp),
  632. X#ifdef YYLSP_NEEDED
  633. X         &yyls1, size * sizeof (*yylsp),
  634. X#endif
  635. X         &yystacksize);
  636. X
  637. X      yyss = yyss1; yyvs = yyvs1;
  638. X#ifdef YYLSP_NEEDED
  639. X      yyls = yyls1;
  640. X#endif
  641. X#else /* no yyoverflow */
  642. X      /* Extend the stack our own way.  */
  643. X      if (yystacksize >= YYMAXDEPTH)
  644. X    {
  645. X      yyerror("parser stack overflow");
  646. X      return 2;
  647. X    }
  648. X      yystacksize *= 2;
  649. X      if (yystacksize > YYMAXDEPTH)
  650. X    yystacksize = YYMAXDEPTH;
  651. X      yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  652. X      __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  653. X      yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  654. X      __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  655. X#ifdef YYLSP_NEEDED
  656. X      yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  657. X      __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  658. X#endif
  659. X#endif /* no yyoverflow */
  660. X
  661. X      yyssp = yyss + size - 1;
  662. X      yyvsp = yyvs + size - 1;
  663. X#ifdef YYLSP_NEEDED
  664. X      yylsp = yyls + size - 1;
  665. X#endif
  666. X
  667. X#if YYDEBUG != 0
  668. X      if (yydebug)
  669. X    fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  670. X#endif
  671. X
  672. X      if (yyssp >= yyss + yystacksize - 1)
  673. X    YYABORT;
  674. X    }
  675. X
  676. X#if YYDEBUG != 0
  677. X  if (yydebug)
  678. X    fprintf(stderr, "Entering state %d\n", yystate);
  679. X#endif
  680. X
  681. X yybackup:
  682. X
  683. X/* Do appropriate processing given the current state.  */
  684. X/* Read a lookahead token if we need one and don't already have one.  */
  685. X/* yyresume: */
  686. X
  687. X  /* First try to decide what to do without reference to lookahead token.  */
  688. X
  689. X  yyn = yypact[yystate];
  690. X  if (yyn == YYFLAG)
  691. X    goto yydefault;
  692. X
  693. X  /* Not known => get a lookahead token if don't already have one.  */
  694. X
  695. X  /* yychar is either YYEMPTY or YYEOF
  696. X     or a valid token in external form.  */
  697. X
  698. X  if (yychar == YYEMPTY)
  699. X    {
  700. X#if YYDEBUG != 0
  701. X      if (yydebug)
  702. X    fprintf(stderr, "Reading a token: ");
  703. X#endif
  704. X      yychar = YYLEX;
  705. X    }
  706. X
  707. X  /* Convert token to internal form (in yychar1) for indexing tables with */
  708. X
  709. X  if (yychar <= 0)        /* This means end of input. */
  710. X    {
  711. X      yychar1 = 0;
  712. X      yychar = YYEOF;        /* Don't call YYLEX any more */
  713. X
  714. X#if YYDEBUG != 0
  715. X      if (yydebug)
  716. X    fprintf(stderr, "Now at end of input.\n");
  717. X#endif
  718. X    }
  719. X  else
  720. X    {
  721. X      yychar1 = YYTRANSLATE(yychar);
  722. X
  723. X#if YYDEBUG != 0
  724. X      if (yydebug)
  725. X    fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
  726. X#endif
  727. X    }
  728. X
  729. X  yyn += yychar1;
  730. X  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  731. X    goto yydefault;
  732. X
  733. X  yyn = yytable[yyn];
  734. X
  735. X  /* yyn is what to do for this token type in this state.
  736. X     Negative => reduce, -yyn is rule number.
  737. X     Positive => shift, yyn is new state.
  738. X       New state is final state => don't bother to shift,
  739. X       just return success.
  740. X     0, or most negative number => error.  */
  741. X
  742. X  if (yyn < 0)
  743. X    {
  744. X      if (yyn == YYFLAG)
  745. X    goto yyerrlab;
  746. X      yyn = -yyn;
  747. X      goto yyreduce;
  748. X    }
  749. X  else if (yyn == 0)
  750. X    goto yyerrlab;
  751. X
  752. X  if (yyn == YYFINAL)
  753. X    YYACCEPT;
  754. X
  755. X  /* Shift the lookahead token.  */
  756. X
  757. X#if YYDEBUG != 0
  758. X  if (yydebug)
  759. X    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  760. X#endif
  761. X
  762. X  /* Discard the token being shifted unless it is eof.  */
  763. X  if (yychar != YYEOF)
  764. X    yychar = YYEMPTY;
  765. X
  766. X  *++yyvsp = yylval;
  767. X#ifdef YYLSP_NEEDED
  768. X  *++yylsp = yylloc;
  769. X#endif
  770. X
  771. X  /* count tokens shifted since error; after three, turn off error status.  */
  772. X  if (yyerrstatus) yyerrstatus--;
  773. X
  774. X  yystate = yyn;
  775. X  goto yynewstate;
  776. X
  777. X/* Do the default action for the current state.  */
  778. Xyydefault:
  779. X
  780. X  yyn = yydefact[yystate];
  781. X  if (yyn == 0)
  782. X    goto yyerrlab;
  783. X
  784. X/* Do a reduction.  yyn is the number of a rule to reduce with.  */
  785. Xyyreduce:
  786. X  yylen = yyr2[yyn];
  787. X  yyval = yyvsp[1-yylen]; /* implement default value of the action */
  788. X
  789. X#if YYDEBUG != 0
  790. X  if (yydebug)
  791. X    {
  792. X      int i;
  793. X
  794. X      fprintf (stderr, "Reducing via rule %d (line %d), ",
  795. X           yyn, yyrline[yyn]);
  796. X
  797. X      /* Print the symboles being reduced, and their result.  */
  798. X      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  799. X    fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  800. X      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  801. X    }
  802. X#endif
  803. X
  804. X
  805. X  switch (yyn) {
  806. X
  807. Xcase 2:
  808. X#line 117 "gedcom.b"
  809. X{ clear_head(); ;
  810. X    break;}
  811. Xcase 3:
  812. X#line 117 "gedcom.b"
  813. X{curr_file->header = &curr_head; ;
  814. X    break;}
  815. Xcase 6:
  816. X#line 122 "gedcom.b"
  817. X{curr_head.source = yyvsp[0].str; ;
  818. X    break;}
  819. Xcase 7:
  820. X#line 123 "gedcom.b"
  821. X{ curr_head.dest = yyvsp[0].str; ;
  822. X    break;}
  823. Xcase 8:
  824. X#line 124 "gedcom.b"
  825. X{ curr_head.date = yyvsp[0].str; ;
  826. X    break;}
  827. Xcase 9:
  828. X#line 125 "gedcom.b"
  829. X{ curr_head.charset = yyvsp[0].str; ;
  830. X    break;}
  831. Xcase 10:
  832. X#line 126 "gedcom.b"
  833. X{curr_head.file = yyvsp[0].str; ;
  834. X    break;}
  835. Xcase 11:
  836. X#line 128 "gedcom.b"
  837. X{clear_submitter();;
  838. X    break;}
  839. Xcase 12:
  840. X#line 129 "gedcom.b"
  841. X{set_subm(curr_file,yyvsp[-3].str,&curr_submitter); ;
  842. X    break;}
  843. Xcase 13:
  844. X#line 131 "gedcom.b"
  845. X{;
  846. X    break;}
  847. Xcase 14:
  848. X#line 132 "gedcom.b"
  849. X{;
  850. X    break;}
  851. Xcase 15:
  852. X#line 134 "gedcom.b"
  853. X{ curr_submitter.name = yyvsp[0].str; ;
  854. X    break;}
  855. Xcase 16:
  856. X#line 135 "gedcom.b"
  857. X{ curr_submitter.phone = yyvsp[0].str;;
  858. X    break;}
  859. Xcase 17:
  860. X#line 136 "gedcom.b"
  861. X{ curr_submitter.comments = yyvsp[0].comment;;
  862. X    break;}
  863. Xcase 18:
  864. X#line 137 "gedcom.b"
  865. X{ curr_submitter.addr = yyvsp[0].address;;
  866. X    break;}
  867. Xcase 19:
  868. X#line 138 "gedcom.b"
  869. X{ curr_submitter.stake = yyvsp[0].stake;;
  870. X    break;}
  871. Xcase 20:
  872. X#line 140 "gedcom.b"
  873. X{ int i;
  874. X            yyval.address = Calloc(struct address);
  875. X            yyval.address->addr[0] = yyvsp[-1].str;
  876. X            for(i=0; i< yyvsp[0].comment->lines; i++)
  877. X            {
  878. X                yyval.address->addr[i+1] = yyvsp[0].comment->line[i];
  879. X            }
  880. X            yyval.address->num = yyvsp[0].comment->lines+1;
  881. X            free(yyvsp[0].comment->line);
  882. X            free(yyvsp[0].comment);
  883. X             ;
  884. X    break;}
  885. Xcase 21:
  886. X#line 151 "gedcom.b"
  887. X{ yyval.address = Calloc(struct address);
  888. X            yyval.address->addr[0] = yyvsp[0].str;
  889. X            yyval.address->num = 1;;
  890. X    break;}
  891. Xcase 22:
  892. X#line 155 "gedcom.b"
  893. X{ yyval.comment=Calloc(struct comment);yyval.comment->line=(char **)malloc(sizeof(char *)); yyval.comment->line[0] = yyvsp[0].str; yyval.comment->lines=1;;
  894. X    break;}
  895. Xcase 23:
  896. X#line 156 "gedcom.b"
  897. X{yyval.comment=yyvsp[-2].comment; yyval.comment->line = (char **)realloc(yyval.comment->line,sizeof(char *) * (yyval.comment->lines+1));
  898. X            yyval.comment->line[yyval.comment->lines++] = yyvsp[0].str; ;
  899. X    break;}
  900. Xcase 24:
  901. X#line 159 "gedcom.b"
  902. X{int i; yyval.comment=Calloc(struct comment);yyval.comment->line=(char **)malloc(sizeof(char *) * (yyvsp[0].comment->lines+1));yyval.comment->line[0]=yyvsp[-1].str;
  903. X            for(i=0;i<yyvsp[0].comment->lines;i++){yyval.comment->line[i+1]=yyvsp[0].comment->line[i]; }yyval.comment->lines = yyvsp[0].comment->lines+1; ;
  904. X    break;}
  905. Xcase 25:
  906. X#line 161 "gedcom.b"
  907. X{yyval.comment=Calloc(struct comment);yyval.comment->line = (char **)malloc(sizeof(char *)); yyval.comment->line[0] = yyvsp[0].str;yyval.comment->lines =1;;
  908. X    break;}
  909. Xcase 26:
  910. X#line 163 "gedcom.b"
  911. X{ yyval.stake=Calloc(struct stake);;
  912. X    break;}
  913. Xcase 27:
  914. X#line 164 "gedcom.b"
  915. X{yyval.stake=Calloc(struct stake);yyval.stake->name=yyvsp[0].str; ;
  916. X    break;}
  917. Xcase 28:
  918. X#line 165 "gedcom.b"
  919. X{yyval.stake=Calloc(struct stake);yyval.stake->num=yyvsp[0].str; ;
  920. X    break;}
  921. Xcase 29:
  922. X#line 166 "gedcom.b"
  923. X{yyval.stake=Calloc(struct stake); 
  924. X                 yyval.stake->name = yyvsp[-2].str;
  925. X                 yyval.stake->num = yyvsp[0].str;;
  926. X    break;}
  927. Xcase 30:
  928. X#line 169 "gedcom.b"
  929. X{yyval.stake=Calloc(struct stake);
  930. X                yyval.stake->name = yyvsp[0].str;
  931. X                 yyval.stake->num = yyvsp[-2].str;;
  932. X    break;}
  933. Xcase 31:
  934. X#line 173 "gedcom.b"
  935. X{ ;
  936. X    break;}
  937. Xcase 32:
  938. X#line 174 "gedcom.b"
  939. X{ ;
  940. X    break;}
  941. Xcase 33:
  942. X#line 176 "gedcom.b"
  943. X{ ;
  944. X    break;}
  945. Xcase 34:
  946. X#line 177 "gedcom.b"
  947. X{ ;
  948. X    break;}
  949. Xcase 35:
  950. X#line 179 "gedcom.b"
  951. X{clear_indi(); ;
  952. X    break;}
  953. Xcase 36:
  954. X#line 180 "gedcom.b"
  955. X{set_ind(curr_file,yyvsp[-3].str,&curr_ind); ;
  956. X    break;}
  957. Xcase 37:
  958. X#line 182 "gedcom.b"
  959. X{ ;
  960. X    break;}
  961. Xcase 38:
  962. X#line 183 "gedcom.b"
  963. X{ ;
  964. X    break;}
  965. Xcase 39:
  966. X#line 185 "gedcom.b"
  967. X{ curr_ind.name = yyvsp[0].str; ;
  968. X    break;}
  969. Xcase 40:
  970. X#line 186 "gedcom.b"
  971. X{ curr_ind.title = yyvsp[0].str;;
  972. X    break;}
  973. Xcase 41:
  974. X#line 187 "gedcom.b"
  975. X{ curr_ind.sex = (yyvsp[0].str[0]? yyvsp[0].str[0]:(yyvsp[0].str[1]? yyvsp[0].str[1]: 'x'));
  976. X        if( curr_ind.sex != 'M' && curr_ind.sex != 'F' )
  977. X            fprintf(stderr,"Sex (%c) indecipherable line %d\n", curr_ind.sex,lineno);;
  978. X    break;}
  979. Xcase 42:
  980. X#line 190 "gedcom.b"
  981. X{ curr_ind.givenref = yyvsp[0].str;;
  982. X    break;}
  983. Xcase 43:
  984. X#line 191 "gedcom.b"
  985. X{ curr_ind.birth = yyvsp[0].datplace;;
  986. X    break;}
  987. Xcase 44:
  988. X#line 192 "gedcom.b"
  989. X{ curr_ind.christen = yyvsp[0].datplace;;
  990. X    break;}
  991. Xcase 45:
  992. X#line 193 "gedcom.b"
  993. X{ curr_ind.death = yyvsp[0].datplace;;
  994. X    break;}
  995. Xcase 46:
  996. X#line 194 "gedcom.b"
  997. X{ curr_ind.burial = yyvsp[0].datplace;;
  998. X    break;}
  999. Xcase 47:
  1000. X#line 195 "gedcom.b"
  1001. X{ curr_ind.baptism = yyvsp[0].ordinance;;
  1002. X    break;}
  1003. Xcase 48:
  1004. X#line 196 "gedcom.b"
  1005. X{ curr_ind.endow = yyvsp[0].ordinance;;
  1006. X    break;}
  1007. Xcase 49:
  1008. X#line 197 "gedcom.b"
  1009. X{ curr_ind.child_to_parent = yyvsp[0].ordinance;;
  1010. X    break;}
  1011. Xcase 50:
  1012. X#line 198 "gedcom.b"
  1013. X{ curr_ind.flag = yyvsp[0].str;;
  1014. X    break;}
  1015. Xcase 51:
  1016. X#line 199 "gedcom.b"
  1017. X{ add_spouse(&curr_ind,yyvsp[0].str);  ;
  1018. X    break;}
  1019. Xcase 52:
  1020. X#line 200 "gedcom.b"
  1021. X{ curr_ind.famc = yyvsp[0].str;;
  1022. X    break;}
  1023. Xcase 53:
  1024. X#line 201 "gedcom.b"
  1025. X{ curr_ind.submitter = yyvsp[0].submitt->submitter;curr_ind.submitter_rel = yyvsp[0].submitt->rel;;
  1026. X    break;}
  1027. Xcase 54:
  1028. X#line 202 "gedcom.b"
  1029. X{ curr_ind.destination_flag = yyvsp[0].str;;
  1030. X    break;}
  1031. Xcase 55:
  1032. X#line 203 "gedcom.b"
  1033. X{ if(curr_ind.notes){
  1034. X        /* merge notes */
  1035. X        curr_ind.notes->notes++; /* increment the num of notes */
  1036. X        curr_ind.notes->note = (struct comment *)realloc(curr_ind.notes->note,sizeof(struct comment)*curr_ind.notes->notes);
  1037. X        curr_ind.notes->note[curr_ind.notes->notes-1].lines = yyvsp[0].notelist->note[0].lines;
  1038. X        curr_ind.notes->note[curr_ind.notes->notes-1].line = yyvsp[0].notelist->note[0].line;
  1039. X        yyvsp[0].notelist->note[0].line = 0;
  1040. X        free(yyvsp[0].notelist->note[0]);
  1041. X        free(yyvsp[0].notelist);
  1042. X        } else {
  1043. X        /* stick in */
  1044. X        curr_ind.notes = yyvsp[0].notelist;
  1045. X        };
  1046. X    break;}
  1047. Xcase 56:
  1048. X#line 216 "gedcom.b"
  1049. X{ yyval.datplace = yyvsp[0].datplace; ;
  1050. X    break;}
  1051. Xcase 57:
  1052. X#line 218 "gedcom.b"
  1053. X{yyval.datplace = Calloc(struct datplace); yyval.datplace->date = yyvsp[0].str; ;
  1054. X    break;}
  1055. Xcase 58:
  1056. X#line 219 "gedcom.b"
  1057. X{yyval.datplace = Calloc(struct datplace); yyval.datplace->place = yyvsp[0].str; ;
  1058. X    break;}
  1059. Xcase 59:
  1060. X#line 220 "gedcom.b"
  1061. X{yyval.datplace = Calloc(struct datplace); yyval.datplace->place = yyvsp[0].str;yyval.datplace->date = yyvsp[-2].str; ;
  1062. X    break;}
  1063. Xcase 60:
  1064. X#line 221 "gedcom.b"
  1065. X{yyval.datplace = Calloc(struct datplace); yyval.datplace->place = yyvsp[-2].str;yyval.datplace->date = yyvsp[0].str; ;
  1066. X    break;}
  1067. Xcase 61:
  1068. X#line 223 "gedcom.b"
  1069. X{yyval.datplace=yyvsp[0].datplace; ;
  1070. X    break;}
  1071. Xcase 62:
  1072. X#line 225 "gedcom.b"
  1073. X{yyval.datplace=yyvsp[0].datplace; ;
  1074. X    break;}
  1075. Xcase 63:
  1076. X#line 227 "gedcom.b"
  1077. X{yyval.datplace=yyvsp[0].datplace; ;
  1078. X    break;}
  1079. Xcase 64:
  1080. X#line 229 "gedcom.b"
  1081. X{ yyval.ordinance=yyvsp[0].ordinance; yyval.ordinance->val = yyvsp[-1].str;;
  1082. X    break;}
  1083. Xcase 65:
  1084. X#line 230 "gedcom.b"
  1085. X{ yyval.ordinance= Calloc(struct ordinance); yyval.ordinance->val = yyvsp[0].str;;
  1086. X    break;}
  1087. Xcase 66:
  1088. X#line 232 "gedcom.b"
  1089. X{yyval.ordinance=yyvsp[0].ordinance; ;
  1090. X    break;}
  1091. Xcase 67:
  1092. X#line 233 "gedcom.b"
  1093. X{ yyval.ordinance =yyvsp[-1].ordinance; 
  1094. X            copytempitem(yyval.ordinance,yyvsp[0].ordinance);;
  1095. X    break;}
  1096. Xcase 68:
  1097. X#line 236 "gedcom.b"
  1098. X{ yyval.ordinance = Calloc(struct ordinance); yyval.ordinance->date=yyvsp[0].str;;
  1099. X    break;}
  1100. Xcase 69:
  1101. X#line 237 "gedcom.b"
  1102. X{  yyval.ordinance = Calloc(struct ordinance); strcpy(yyval.ordinance->temp,yyvsp[0].str);;
  1103. X    break;}
  1104. Xcase 70:
  1105. X#line 238 "gedcom.b"
  1106. X{  yyval.ordinance = Calloc(struct ordinance); yyval.ordinance->qual=yyvsp[0].str;;
  1107. X    break;}
  1108. Xcase 71:
  1109. X#line 240 "gedcom.b"
  1110. X{yyval.ordinance=yyvsp[0].ordinance; ;
  1111. X    break;}
  1112. Xcase 72:
  1113. X#line 241 "gedcom.b"
  1114. X{yyval.ordinance =yyvsp[-1].ordinance; 
  1115. X                copytempitem(yyval.ordinance,yyvsp[0].ordinance); ;
  1116. X    break;}
  1117. Xcase 73:
  1118. X#line 244 "gedcom.b"
  1119. X{ yyval.ordinance = Calloc(struct ordinance); yyval.ordinance->date=yyvsp[0].str; ;
  1120. X    break;}
  1121. Xcase 74:
  1122. X#line 245 "gedcom.b"
  1123. X{ yyval.ordinance = Calloc(struct ordinance); strcpy(yyval.ordinance->temp,yyvsp[0].str); ;
  1124. X    break;}
  1125. Xcase 75:
  1126. X#line 246 "gedcom.b"
  1127. X{ yyval.ordinance = Calloc(struct ordinance); yyval.ordinance->qual=yyvsp[0].str; ;
  1128. X    break;}
  1129. Xcase 76:
  1130. X#line 248 "gedcom.b"
  1131. X{ yyval.ordinance=yyvsp[0].ordinance; yyval.ordinance->val = yyvsp[-1].str; ;
  1132. X    break;}
  1133. Xcase 77:
  1134. X#line 249 "gedcom.b"
  1135. X{yyval.ordinance= Calloc(struct ordinance); yyval.ordinance->val = yyvsp[0].str; ;
  1136. X    break;}
  1137. Xcase 78:
  1138. X#line 251 "gedcom.b"
  1139. X{ yyval.ordinance=yyvsp[0].ordinance;yyval.ordinance->val = yyvsp[-1].str; ;
  1140. X    break;}
  1141. Xcase 79:
  1142. X#line 252 "gedcom.b"
  1143. X{yyval.ordinance= Calloc(struct ordinance); yyval.ordinance->val = yyvsp[0].str;;
  1144. X    break;}
  1145. Xcase 80:
  1146. X#line 254 "gedcom.b"
  1147. X{ yyval.ordinance=Calloc(struct ordinance); yyval.ordinance->val = yyvsp[0].str;;
  1148. X    break;}
  1149. Xcase 81:
  1150. X#line 255 "gedcom.b"
  1151. X{yyval.ordinance=yyvsp[0].ordinance; yyval.ordinance->val = yyvsp[-1].str; ;
  1152. X    break;}
  1153. Xcase 82:
  1154. X#line 257 "gedcom.b"
  1155. X{yyval.submitt=Calloc(struct submitt); yyval.submitt->submitter = yyvsp[0].str; ;
  1156. X    break;}
  1157. Xcase 83:
  1158. X#line 258 "gedcom.b"
  1159. X{yyval.submitt=Calloc(struct submitt); yyval.submitt->submitter = yyvsp[-2].str; yyval.submitt->rel = yyvsp[0].str; ;
  1160. X    break;}
  1161. Xcase 84:
  1162. X#line 260 "gedcom.b"
  1163. X{ yyval.notelist=Calloc(struct notelist); yyval.notelist->note=Calloc(struct comment); yyval.notelist->note[0].lines=1;
  1164. X        yyval.notelist->note[0].line = Calloc(char *); yyval.notelist->note[0].line[0] = yyvsp[0].str; yyval.notelist->notes=1;yyval.notelist->note[0].lines = 1;;
  1165. X    break;}
  1166. Xcase 85:
  1167. X#line 262 "gedcom.b"
  1168. X{int i;
  1169. X        yyval.notelist=Calloc(struct notelist); 
  1170. X        yyval.notelist->note=yyvsp[0].comment;
  1171. X        yyval.notelist->note[0].line = (char **)realloc(yyval.notelist->note[0].line,sizeof(char *)*(yyvsp[0].comment->lines+1)); 
  1172. X        yyval.notelist->notes=1; 
  1173. X        for(i=yyvsp[0].comment->lines; i; i--)
  1174. X        {yyvsp[0].comment->line[i]=yyvsp[0].comment->line[i-1];}
  1175. X        yyvsp[0].comment->line[0] = yyvsp[-1].str;yyvsp[0].comment->lines++;;
  1176. X    break;}
  1177. Xcase 86:
  1178. X#line 273 "gedcom.b"
  1179. X{clear_fam();;
  1180. X    break;}
  1181. Xcase 87:
  1182. X#line 274 "gedcom.b"
  1183. X{set_fam(curr_file,yyvsp[-3].str,&curr_fam);;
  1184. X    break;}
  1185. Xcase 88:
  1186. X#line 276 "gedcom.b"
  1187. X{ ;
  1188. X    break;}
  1189. Xcase 89:
  1190. X#line 277 "gedcom.b"
  1191. X{ ;
  1192. X    break;}
  1193. Xcase 90:
  1194. X#line 279 "gedcom.b"
  1195. X{curr_fam.husb = yyvsp[0].str; ;
  1196. X    break;}
  1197. Xcase 91:
  1198. X#line 280 "gedcom.b"
  1199. X{curr_fam.wife = yyvsp[0].str; ;
  1200. X    break;}
  1201. Xcase 92:
  1202. X#line 281 "gedcom.b"
  1203. X{ add_child(&curr_fam, yyvsp[0].child); ;
  1204. X    break;}
  1205. Xcase 93:
  1206. X#line 282 "gedcom.b"
  1207. X{curr_fam.marriage = yyvsp[0].datplace; ;
  1208. X    break;}
  1209. Xcase 94:
  1210. X#line 283 "gedcom.b"
  1211. X{curr_fam.sealspouse = yyvsp[0].ordinance; ;
  1212. X    break;}
  1213. Xcase 95:
  1214. X#line 284 "gedcom.b"
  1215. X{curr_fam.divorce = 1; ;
  1216. X    break;}
  1217. Xcase 96:
  1218. X#line 285 "gedcom.b"
  1219. X{ curr_fam.dest = yyvsp[0].str;;
  1220. X    break;}
  1221. Xcase 97:
  1222. X#line 286 "gedcom.b"
  1223. X{ curr_fam.flag = yyvsp[0].str;;
  1224. X    break;}
  1225. Xcase 98:
  1226. X#line 287 "gedcom.b"
  1227. X{ curr_fam.submitter = yyvsp[0].submitt->submitter;
  1228. X            curr_fam.submitter_rel = yyvsp[0].submitt->rel;;
  1229. X    break;}
  1230. Xcase 99:
  1231. X#line 290 "gedcom.b"
  1232. X{ yyval.child=Calloc(struct child);yyval.child->ref=yyvsp[0].str;;
  1233. X    break;}
  1234. Xcase 100:
  1235. X#line 291 "gedcom.b"
  1236. X{yyval.child=Calloc(struct child);yyval.child->ref = yyvsp[-2].str; yyval.child->slgc =yyvsp[0].ordinance; ;
  1237. X    break;}
  1238. Xcase 101:
  1239. X#line 293 "gedcom.b"
  1240. X{yyval.datplace=yyvsp[0].datplace; ;
  1241. X    break;}
  1242. Xcase 102:
  1243. X#line 295 "gedcom.b"
  1244. X{yyval.ordinance=yyvsp[0].ordinance; yyval.ordinance->val = yyvsp[-1].str;;
  1245. X    break;}
  1246. Xcase 103:
  1247. X#line 296 "gedcom.b"
  1248. X{yyval.ordinance= Calloc(struct ordinance); yyval.ordinance->val = yyvsp[0].str; ;
  1249. X    break;}
  1250. Xcase 104:
  1251. X#line 298 "gedcom.b"
  1252. X{;
  1253. X    break;}
  1254. X}
  1255. X   /* the action file gets copied in in place of this dollarsign */
  1256. X#line 423 "bison.simple"
  1257. X
  1258. X  yyvsp -= yylen;
  1259. X  yyssp -= yylen;
  1260. X#ifdef YYLSP_NEEDED
  1261. X  yylsp -= yylen;
  1262. X#endif
  1263. X
  1264. X#if YYDEBUG != 0
  1265. X  if (yydebug)
  1266. X    {
  1267. X      short *ssp1 = yyss - 1;
  1268. X      fprintf (stderr, "state stack now");
  1269. X      while (ssp1 != yyssp)
  1270. X    fprintf (stderr, " %d", *++ssp1);
  1271. X      fprintf (stderr, "\n");
  1272. X    }
  1273. X#endif
  1274. X
  1275. X  *++yyvsp = yyval;
  1276. X
  1277. X#ifdef YYLSP_NEEDED
  1278. X  yylsp++;
  1279. X  if (yylen == 0)
  1280. X    {
  1281. X      yylsp->first_line = yylloc.first_line;
  1282. X      yylsp->first_column = yylloc.first_column;
  1283. X      yylsp->last_line = (yylsp-1)->last_line;
  1284. X      yylsp->last_column = (yylsp-1)->last_column;
  1285. X      yylsp->text = 0;
  1286. X    }
  1287. X  else
  1288. X    {
  1289. X      yylsp->last_line = (yylsp+yylen-1)->last_line;
  1290. X      yylsp->last_column = (yylsp+yylen-1)->last_column;
  1291. X    }
  1292. X#endif
  1293. X
  1294. X  /* Now "shift" the result of the reduction.
  1295. X     Determine what state that goes to,
  1296. X     based on the state we popped back to
  1297. X     and the rule number reduced by.  */
  1298. X
  1299. X  yyn = yyr1[yyn];
  1300. X
  1301. X  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1302. X  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1303. X    yystate = yytable[yystate];
  1304. X  else
  1305. X    yystate = yydefgoto[yyn - YYNTBASE];
  1306. X
  1307. X  goto yynewstate;
  1308. X
  1309. Xyyerrlab:   /* here on detecting error */
  1310. X
  1311. X  if (! yyerrstatus)
  1312. X    /* If not already recovering from an error, report this error.  */
  1313. X    {
  1314. X      ++yynerrs;
  1315. X
  1316. X#ifdef YYERROR_VERBOSE
  1317. X      yyn = yypact[yystate];
  1318. X
  1319. X      if (yyn > YYFLAG && yyn < YYLAST)
  1320. X    {
  1321. X      int size = 0;
  1322. X      char *msg;
  1323. X      int x, count;
  1324. X
  1325. X      count = 0;
  1326. X      for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1327. X        if (yycheck[x + yyn] == x)
  1328. X          size += strlen(yytname[x]) + 15, count++;
  1329. X      msg = (char *) xmalloc(size + 15);
  1330. X      strcpy(msg, "parse error");
  1331. X
  1332. X      if (count < 5)
  1333. X        {
  1334. X          count = 0;
  1335. X          for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1336. X        if (yycheck[x + yyn] == x)
  1337. X          {
  1338. X            strcat(msg, count == 0 ? ", expecting `" : " or `");
  1339. X            strcat(msg, yytname[x]);
  1340. X            strcat(msg, "'");
  1341. X            count++;
  1342. X          }
  1343. X        }
  1344. X      yyerror(msg);
  1345. X      free(msg);
  1346. X    }
  1347. X      else
  1348. X#endif /* YYERROR_VERBOSE */
  1349. X    yyerror("parse error");
  1350. X    }
  1351. X
  1352. Xyyerrlab1:   /* here on error raised explicitly by an action */
  1353. X
  1354. X  if (yyerrstatus == 3)
  1355. X    {
  1356. X      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1357. X
  1358. X      /* return failure if at end of input */
  1359. X      if (yychar == YYEOF)
  1360. X    YYABORT;
  1361. X
  1362. X#if YYDEBUG != 0
  1363. X      if (yydebug)
  1364. X    fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1365. X#endif
  1366. X
  1367. X      yychar = YYEMPTY;
  1368. X    }
  1369. X
  1370. X  /* Else will try to reuse lookahead token
  1371. X     after shifting the error token.  */
  1372. X
  1373. X  yyerrstatus = 3;        /* Each real token shifted decrements this */
  1374. X
  1375. X  goto yyerrhandle;
  1376. X
  1377. Xyyerrdefault:  /* current state does not do anything special for the error token. */
  1378. X
  1379. X#if 0
  1380. X  /* This is wrong; only states that explicitly want error tokens
  1381. X     should shift them.  */
  1382. X  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1383. X  if (yyn) goto yydefault;
  1384. X#endif
  1385. X
  1386. Xyyerrpop:   /* pop the current state because it cannot handle the error token */
  1387. X
  1388. X  if (yyssp == yyss) YYABORT;
  1389. X  yyvsp--;
  1390. X  yystate = *--yyssp;
  1391. X#ifdef YYLSP_NEEDED
  1392. X  yylsp--;
  1393. X#endif
  1394. X
  1395. X#if YYDEBUG != 0
  1396. X  if (yydebug)
  1397. X    {
  1398. X      short *ssp1 = yyss - 1;
  1399. X      fprintf (stderr, "Error: state stack now");
  1400. X      while (ssp1 != yyssp)
  1401. X    fprintf (stderr, " %d", *++ssp1);
  1402. X      fprintf (stderr, "\n");
  1403. X    }
  1404. X#endif
  1405. X
  1406. Xyyerrhandle:
  1407. X
  1408. X  yyn = yypact[yystate];
  1409. X  if (yyn == YYFLAG)
  1410. X    goto yyerrdefault;
  1411. X
  1412. X  yyn += YYTERROR;
  1413. X  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1414. X    goto yyerrdefault;
  1415. X
  1416. X  yyn = yytable[yyn];
  1417. X  if (yyn < 0)
  1418. X    {
  1419. X      if (yyn == YYFLAG)
  1420. X    goto yyerrpop;
  1421. X      yyn = -yyn;
  1422. X      goto yyreduce;
  1423. X    }
  1424. X  else if (yyn == 0)
  1425. X    goto yyerrpop;
  1426. X
  1427. X  if (yyn == YYFINAL)
  1428. X    YYACCEPT;
  1429. X
  1430. X#if YYDEBUG != 0
  1431. X  if (yydebug)
  1432. X    fprintf(stderr, "Shifting error token, ");
  1433. X#endif
  1434. X
  1435. X  *++yyvsp = yylval;
  1436. X#ifdef YYLSP_NEEDED
  1437. X  *++yylsp = yylloc;
  1438. X#endif
  1439. X
  1440. X  yystate = yyn;
  1441. X  goto yynewstate;
  1442. X}
  1443. X#line 300 "gedcom.b"
  1444. X
  1445. Xvoid copytempitem(a,b)
  1446. Xstruct ordinance *a,*b;
  1447. X{
  1448. X    if( b->val )
  1449. X        a->val = b->val;
  1450. X    if(b->date)
  1451. X        a->date = b->date;
  1452. X    if(b->temp[0] )
  1453. X        strcpy(a->temp,b->temp);
  1454. X    if(b->qual)
  1455. X        a->qual = b->qual;
  1456. X    free(b);
  1457. X}
  1458. X
  1459. Xvoid clear_indi()
  1460. X{
  1461. X    curr_ind.name = 0;
  1462. X    curr_ind.title = 0;
  1463. X    curr_ind.sex = 0;
  1464. X    curr_ind.givenref = 0;
  1465. X    curr_ind.birth = 0;
  1466. X    curr_ind.christen = 0;
  1467. X    curr_ind.death = 0;
  1468. X    curr_ind.burial = 0;
  1469. X    curr_ind.baptism = 0;
  1470. X    curr_ind.endow = 0;
  1471. X    curr_ind.child_to_parent = 0;
  1472. X    curr_ind.flag = 0;
  1473. X    curr_ind.fams = 0;
  1474. X    curr_ind.famc = 0;
  1475. X    curr_ind.submitter = 0;
  1476. X    curr_ind.submitter_rel = 0;
  1477. X    curr_ind.destination_flag = 0;
  1478. X    curr_ind.notes = 0;
  1479. X}
  1480. X
  1481. Xstatic int add_ind(ged,ip)
  1482. Xstruct gedfile *ged;
  1483. Xstruct individ *ip;
  1484. X{
  1485. X    struct indivlist *x=ged->indlist;
  1486. X    if( !ged->indlist )
  1487. X        x = ged->indlist = Calloc(struct indivlist);
  1488. X    if( !x->allocd )
  1489. X    {
  1490. X        x->allocd += 20;
  1491. X        x->ind = Callocs(struct individ *,20);
  1492. X    }
  1493. X    if( x->num == x->allocd )
  1494. X    {
  1495. X        x->allocd += 20;
  1496. X        x->ind = (struct individ **)realloc(x->ind,x->allocd*sizeof(struct individ *));
  1497. X    }
  1498. X    ip->index = x->num;
  1499. X    x->ind[x->num++] = ip;
  1500. X    return ip->index;
  1501. X}
  1502. X
  1503. Xstruct individ *set_ind(ged,ref,curr_in)
  1504. Xstruct gedfile *ged;
  1505. Xchar *ref;
  1506. Xstruct individ *curr_in;
  1507. X{
  1508. X    struct individ *ind;
  1509. X    
  1510. X    if( !ged->indiv )
  1511. X    {
  1512. X        ged->indiv = st_init_table(strcmp,st_strhash);
  1513. X    }
  1514. X    ind = Calloc(struct individ);
  1515. X    *ind = *curr_in;
  1516. X    st_insert(ged->indiv,ref,(char *)ind);
  1517. X    ind->ref = ref;
  1518. X    add_ind(ged,ind);
  1519. X    return ind;
  1520. X}
  1521. X
  1522. Xvoid clear_fam()
  1523. X{
  1524. X    curr_fam.husb = 0;
  1525. X    curr_fam.wife = 0;
  1526. X    curr_fam.kids = 0;
  1527. X    curr_fam.marriage = 0;
  1528. X    curr_fam.sealspouse = 0;
  1529. X    curr_fam.divorce = 0;
  1530. X    curr_fam.dest = 0;
  1531. X    curr_fam.flag = 0;
  1532. X    curr_fam.submitter = 0;
  1533. X    curr_fam.submitter_rel = 0;
  1534. X}
  1535. Xstruct family *set_fam(ged,ref,curr_fa)
  1536. Xchar *ref;
  1537. Xstruct gedfile *ged;
  1538. Xstruct family *curr_fa;
  1539. X{
  1540. X    struct family *fam;
  1541. X    
  1542. X    if( !ged->families )
  1543. X    {
  1544. X        ged->families = st_init_table(strcmp,st_strhash);
  1545. X    }
  1546. X    fam = Calloc(struct family);
  1547. X    *fam = *curr_fa;
  1548. X    st_insert(ged->families,ref,(char *)fam);
  1549. X    fam->ref = ref;
  1550. X    add_fam(ged,fam);
  1551. X    return fam;
  1552. X}
  1553. X
  1554. Xstatic int add_fam(ged,fp)
  1555. Xstruct family *fp;
  1556. Xstruct gedfile *ged;
  1557. X{
  1558. X    struct famlylist *x=ged->famlist;
  1559. X    if( !ged->famlist )
  1560. X        x = ged->famlist = Calloc(struct famlylist);
  1561. X    if( !x->allocd )
  1562. X    {
  1563. X        x->allocd += 20;
  1564. X        x->fam = Callocs(struct family *,20);
  1565. X    }
  1566. X    if( x->num == x->allocd )
  1567. X    {
  1568. X        x->allocd += 20;
  1569. X        x->fam = (struct family **)realloc(x->fam,x->allocd*sizeof(struct family *));
  1570. X    }
  1571. X    fp->index = x->num;
  1572. X    x->fam[x->num++] = fp;
  1573. X    return fp->index;
  1574. X}
  1575. X
  1576. Xvoid clear_head() /* blow nose? */
  1577. X{
  1578. X    curr_head.source = 0;
  1579. X    curr_head.dest = 0;
  1580. X    curr_head.date = 0;
  1581. X    curr_head.file = 0;
  1582. X    curr_head.charset = 0;
  1583. X}
  1584. X
  1585. Xvoid add_submitter(ged,ip)
  1586. Xstruct submitter *ip;
  1587. Xstruct gedfile *ged;
  1588. X{
  1589. X    struct submitlist *x=ged->submitlist;
  1590. X    if( !ged->submitlist )
  1591. X        x = ged->submitlist = Calloc(struct submitlist);
  1592. X    if( !x->allocd )
  1593. X    {
  1594. X        x->allocd += 20;
  1595. X        x->subm = Callocs(struct submitter *,20);
  1596. X    }
  1597. X    if( x->num == x->allocd )
  1598. X    {
  1599. X        x->allocd += 20;
  1600. X        x->subm = (struct submitter **)realloc(x->subm,x->allocd*sizeof(struct submitter *));
  1601. X    }
  1602. X    ip->index = x->num;
  1603. X    x->subm[x->num++] = ip;
  1604. X}
  1605. Xvoid set_subm(ged,ref,curr_submitte)
  1606. Xchar *ref;
  1607. Xstruct gedfile *ged;
  1608. Xstruct submitter *curr_submitte;
  1609. X{
  1610. X    struct submitter *ind;
  1611. X    
  1612. X    if( !ged->submits )
  1613. X    {
  1614. X        ged->submits = st_init_table(strcmp,st_strhash);
  1615. X    }
  1616. X    ind = Calloc(struct submitter);
  1617. X    *ind = *curr_submitte;
  1618. X    st_insert(ged->submits,ref,(char *)ind);
  1619. X    add_submitter(ged,ind);
  1620. X}
  1621. X
  1622. Xvoid clear_submitter()
  1623. X{
  1624. X    curr_submitter.name = 0;
  1625. X     curr_submitter.addr = 0;
  1626. X     curr_submitter.phone = 0;
  1627. X     curr_submitter.stake = 0;
  1628. X     curr_submitter.comments = 0;
  1629. X     curr_submitter.index = 0;
  1630. X}
  1631. X
  1632. Xvoid clear_gedfile()
  1633. X{
  1634. X    curr_file->header = 0;
  1635. X    curr_file->submission = 0;
  1636. X    curr_file->indiv = 0;
  1637. X    curr_file->families = 0;
  1638. X    curr_file->submits = 0;
  1639. X    curr_file->indlist = 0;
  1640. X    curr_file->famlist = 0;
  1641. X    curr_file->submitlist = 0;
  1642. X}
  1643. X
  1644. X
  1645. Xvoid yyerror(s)
  1646. Xchar *s;
  1647. X{
  1648. X    extern int lineno; 
  1649. X    fprintf(stderr,"Parse error in line %d\n",lineno);
  1650. X}
  1651. X
  1652. Xadd_spouse(ind,ref)
  1653. Xstruct individ *ind;
  1654. Xchar *ref;
  1655. X{
  1656. X    if( !ind->fams)
  1657. X    {
  1658. X        ind->fams = Calloc(struct famlist);
  1659. X        ind->fams->family_refs = (char **)malloc(sizeof(char *));
  1660. X        ind->fams->family_refs[ind->fams->num++] = ref;
  1661. X    }
  1662. X    else
  1663. X    {
  1664. X        ind->fams->family_refs = (char **)
  1665. X            realloc(ind->fams->family_refs,
  1666. X                    sizeof(char *)*(ind->fams->num+1));
  1667. X        ind->fams->family_refs[ind->fams->num++] = ref;
  1668. X    }
  1669. X}
  1670. X
  1671. Xadd_child(fam,chil)
  1672. Xstruct family *fam;
  1673. Xstruct child *chil;
  1674. X{
  1675. X    if(!fam->kids)
  1676. X    {
  1677. X        fam->kids=Calloc(struct child_list);
  1678. X        fam->kids->kid=Calloc(struct child);
  1679. X        fam->kids->kid[0] = *chil;
  1680. X        fam->kids->kids=1;
  1681. X    }
  1682. X    else
  1683. X    {
  1684. X        fam->kids->kid=(struct child *)realloc(fam->kids->kid, 
  1685. X                                sizeof(struct child)*(fam->kids->kids+1));
  1686. X        fam->kids->kid[fam->kids->kids++] = *chil;
  1687. X    }
  1688. X}
  1689. SHAR_EOF
  1690. $TOUCH -am 0103115092 gedcom.b.tab.c &&
  1691. chmod 0664 gedcom.b.tab.c ||
  1692. echo "restore of gedcom.b.tab.c failed"
  1693. set `wc -c gedcom.b.tab.c`;Wc_c=$1
  1694. if test "$Wc_c" != "46972"; then
  1695.     echo original size 46972, current size $Wc_c
  1696. fi
  1697. echo "End of part 6, continue with part 7"
  1698. exit 0
  1699.  
  1700. exit 0 # Just in case...
  1701.