Subversion Repositories tendra.SVN

Rev

Rev 5 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
 * Automatically generated from the files:
6 7u83 3
 *	parser.sid
2 7u83 4
 * and
6 7u83 5
 *	parser.act
2 7u83 6
 * by:
6 7u83 7
 *	./sid
2 7u83 8
 */
9
 
10
/* BEGINNING OF HEADER */
11
 
12
 
13
/*
14
    		 Crown Copyright (c) 1997
15
 
16
    This TenDRA(r) Computer Program is subject to Copyright
17
    owned by the United Kingdom Secretary of State for Defence
18
    acting through the Defence Evaluation and Research Agency
19
    (DERA).  It is made available to Recipients with a
20
    royalty-free licence for its use, reproduction, transfer
21
    to other parties and amendment for any purpose not excluding
22
    product development provided that any such use et cetera
23
    shall be deemed to be acceptance of the following conditions:-
24
 
25
        (1) Its Recipients shall ensure that this Notice is
26
        reproduced upon any copies or amended versions of it;
27
 
28
        (2) Any amended version of it shall be clearly marked to
29
        show both the nature of and the organisation responsible
30
        for the relevant amendment or amendments;
31
 
32
        (3) Its onward transfer from a recipient to another
33
        party shall be deemed to be that party's acceptance of
34
        these conditions;
35
 
36
        (4) DERA gives no warranty or assurance as to its
37
        quality or suitability for any purpose and DERA accepts
38
        no liability whatsoever in relation to any use to which
39
        it may be put.
40
*/
41
 
42
 
43
#include "parser.h"
44
#include "action.h"
45
#include "basic.h"
46
#include "bitvec.h"
47
#include "dalloc.h"
48
#include "dstring.h"
49
#include "gen-errors.h"
50
#include "grammar.h"
51
#include "lexer.h"
52
#include "non-local.h"
53
#include "rule.h"
54
#include "scope.h"
55
#include "table.h"
56
#include "types.h"
57
 
58
/*--------------------------------------------------------------------------*/
59
 
60
#define CURRENT_TERMINAL lexer_get_terminal (sid_current_stream)
61
#define ADVANCE_LEXER lexer_next_token (sid_current_stream)
62
#define SAVE_LEXER(x) (lexer_save_terminal (sid_current_stream, (LexerTokenT) (x)))
63
#define RESTORE_LEXER (lexer_restore_terminal (sid_current_stream))
64
#define ALT_LIMIT (UINT_MAX - 1)
65
 
66
/*--------------------------------------------------------------------------*/
67
 
68
LexerStreamP		sid_current_stream;
69
GrammarP		sid_current_grammar;
70
 
71
/*--------------------------------------------------------------------------*/
72
 
73
static TableP		sid_current_table;
74
static EntryListP	sid_current_entry_list;
75
static ScopeStackT	sid_scope_stack;
76
static ScopeStackT	sid_global_scope;
77
static ScopeStackP	sid_current_scope;
78
static EntryP		sid_current_entry;
79
static RuleP		sid_enclosing_rule;
80
static union {
81
    BasicP		basic;
82
    ActionP		action;
83
    RuleP		rule;
84
} sid_current;
85
static BoolT		sid_redefining_entry;
86
static NStringT		sid_maximum_scope;
87
static TypeTupleT	sid_saved_type;
88
static TypeTupleT	sid_current_type;
89
static EntryP		sid_saved_pred_id;
90
static EntryP		sid_current_pred_id;
91
static EntryP		sid_unique_pred_id = NIL (EntryP);
92
static EntryP		sid_predicate_type = NIL (EntryP);
93
static AltP		sid_current_alt;
94
static ItemP		sid_current_item;
95
static unsigned		sid_alternative;
96
static BoolT            sid_internal_rule;
97
static EntryP		sid_external_rule;
98
static unsigned		sid_num_alternatives = 0;
99
static NonLocalEntryP	sid_non_local;
100
static BoolT		sid_propagating_error = FALSE;
101
static BoolT		sid_finished_terminals = FALSE;
102
 
103
/* BEGINNING OF FUNCTION DECLARATIONS */
104
 
6 7u83 105
static void ZR235(void);
106
static void ZR230(void);
107
static void ZR137(void);
108
static void ZR232(void);
109
static void ZR171(void);
110
static void ZR239(void);
111
static void ZR146(void);
112
static void ZR163(void);
113
static void ZR147(void);
114
static void ZR175(void);
115
static void ZR221(void);
116
static void ZR281(NStringT *);
117
static void ZR149(void);
118
static void ZR283(void);
119
static void ZR183(void);
120
static void ZR192(void);
121
static void ZR284(NStringT *);
122
static void ZR285(NStringT *);
123
static void ZR165(void);
124
static void ZR161(void);
125
extern void sid_parse_grammar(void);
126
static void ZR140(void);
127
static void ZR142(void);
128
static void ZR177(void);
129
static void ZR199(void);
130
static void ZR219(void);
131
static void ZR153(void);
132
static void ZR196(void);
133
static void ZR185(void);
134
static void ZR253(void);
135
static void ZR186(void);
136
static void ZR128(void);
137
static void ZR259(void);
138
static void ZR126(void);
139
static void ZR208(void);
140
static void ZR217(void);
141
static void ZR155(void);
142
static void ZR187(void);
143
static void ZR228(void);
144
static void ZR261(void);
145
static void ZR168(void);
146
static void ZR246(void);
147
static void ZR248(void);
148
static void ZR249(void);
149
static void ZR180(void);
150
static void ZR251(void);
151
static void ZR252(void);
2 7u83 152
 
153
/* BEGINNING OF STATIC VARIABLES */
154
 
155
static BoolT ZI0;
156
 
157
/* BEGINNING OF FUNCTION DEFINITIONS */
158
 
159
static void
6 7u83 160
ZR235(void)
2 7u83 161
{
162
    if ((CURRENT_TERMINAL) == 26) {
163
	return;
164
    }
6 7u83 165
  ZL2_235:;
2 7u83 166
    {
6 7u83 167
	ZR232 ();
2 7u83 168
	{
169
	    switch (CURRENT_TERMINAL) {
170
	      case 15:
171
		{
172
		    ADVANCE_LEXER;
6 7u83 173
		    goto ZL2_235;
2 7u83 174
		}
175
		/*UNREACHED*/
176
	      case 26:
177
		RESTORE_LEXER;
178
		goto ZL1;
179
	      default:
180
		break;
181
	    }
182
	}
183
    }
184
    return;
185
  ZL1:;
186
    SAVE_LEXER (26);
187
    return;
188
}
189
 
190
static void
6 7u83 191
ZR230(void)
2 7u83 192
{
193
    if ((CURRENT_TERMINAL) == 26) {
194
	return;
195
    }
196
    {
197
	{
198
 
199
    if (sid_current_entry) {
200
	sid_current_alt = alt_create ();
201
    }
202
	}
6 7u83 203
	ZR228 ();
2 7u83 204
	if ((CURRENT_TERMINAL) == 26) {
205
	    RESTORE_LEXER;
206
	    goto ZL1;
207
	}
208
	{
209
 
210
    if ((sid_current_entry) && (sid_current_alt)) {
211
	if (types_check_names (rule_result (sid_current.rule),
212
			       alt_names (sid_current_alt))) {
213
	    TypeTupleT used;
214
 
215
	    types_copy (&used, rule_result (sid_current.rule));
216
	    item_compute_minimal_dataflow (alt_item_head (sid_current_alt),
217
					   &used);
218
	    types_destroy (&used);
219
	    rule_set_handler (sid_current.rule, sid_current_alt);
220
	} else {
221
	    (void) alt_deallocate (sid_current_alt);
222
	    E_handler_result_mismatch (entry_key (sid_external_rule));
223
	}
224
    }
225
	}
226
    }
227
    return;
228
  ZL1:;
229
    SAVE_LEXER (26);
230
    return;
231
}
232
 
233
static void
6 7u83 234
ZR137(void)
2 7u83 235
{
236
    if ((CURRENT_TERMINAL) == 26) {
237
	return;
238
    }
239
  ZL2_137:;
240
    {
241
	ZR128 ();
242
	{
243
	    if ((CURRENT_TERMINAL) == 26) {
244
		RESTORE_LEXER;
245
		goto ZL1;
246
	    }
247
	    {
248
		{
249
 
250
    (ZI0) = ((CURRENT_TERMINAL == LEXER_TOK_CLOSE_TUPLE) ||
251
		  (CURRENT_TERMINAL == LEXER_TOK_EOF) ||
252
		  (sid_propagating_error));
253
		}
254
		if (!ZI0)
255
		    goto ZL5;
256
		goto ZL3;
257
	    }
258
	    /*UNREACHED*/
259
	  ZL5:;
260
	    switch (CURRENT_TERMINAL) {
261
	      case 23:
262
		{
263
		    ADVANCE_LEXER;
264
		    goto ZL2_137;
265
		}
266
		/*UNREACHED*/
267
	      default:
268
		goto ZL4;
269
	    }
270
	    /*UNREACHED*/
271
	  ZL4:;
272
	    {
273
		{
274
 
275
    if (!sid_propagating_error) {
276
	E_expected_separator ();
277
    }
278
		}
279
		goto ZL2_137;
280
	    }
281
	    /*UNREACHED*/
282
	  ZL3:;
283
	}
284
    }
285
    return;
286
  ZL1:;
287
    SAVE_LEXER (26);
288
    return;
289
}
290
 
291
static void
6 7u83 292
ZR232(void)
2 7u83 293
{
294
    switch (CURRENT_TERMINAL) {
295
      case 17:
296
	{
297
	    {
298
 
299
    if ((++ sid_num_alternatives) == ALT_LIMIT) {
300
	E_too_many_alternatives ();
301
	UNREACHED;
302
    }
303
    if (!sid_internal_rule) {
304
	sid_alternative ++;
305
    }
306
    if (sid_current_entry) {
307
	if (rule_has_empty_alt (sid_current.rule)) {
308
	    E_multiple_empty_alts (entry_key (sid_external_rule));
309
	} else if (!types_equal_zero_tuple (rule_result (sid_current.rule))) {
310
	    E_alt_result_mismatch (entry_key (sid_external_rule),
311
				   sid_alternative);
312
	} else {
313
	    rule_add_empty_alt (sid_current.rule);
314
	}
315
    }
316
	    }
317
	    ADVANCE_LEXER;
6 7u83 318
	    ZR252 ();
2 7u83 319
	    if ((CURRENT_TERMINAL) == 26) {
320
		RESTORE_LEXER;
321
		goto ZL1;
322
	    }
323
	}
324
	break;
325
      case 4: case 6: case 10: case 13: case 18:
326
      case 19: case 24:
327
	{
328
	    {
329
 
330
    if ((++ sid_num_alternatives) == ALT_LIMIT) {
331
	E_too_many_alternatives ();
332
	UNREACHED;
333
    }
334
    if (!sid_internal_rule) {
335
	sid_alternative ++;
336
    }
337
    if (sid_current_entry) {
338
	sid_current_alt = alt_create ();
339
    }
340
	    }
6 7u83 341
	    ZR228 ();
2 7u83 342
	    if ((CURRENT_TERMINAL) == 26) {
343
		RESTORE_LEXER;
344
		goto ZL1;
345
	    }
346
	    {
347
 
348
    if ((sid_current_entry) && (sid_current_alt)) {
349
	if (types_check_names (rule_result (sid_current.rule),
350
			       alt_names (sid_current_alt))) {
351
	    TypeTupleT used;
352
 
353
	    types_copy (&used, rule_result (sid_current.rule));
354
	    item_compute_minimal_dataflow (alt_item_head (sid_current_alt),
355
					   &used);
356
	    types_destroy (&used);
357
	    rule_add_alt (sid_current.rule, sid_current_alt);
358
	} else {
359
	    (void) alt_deallocate (sid_current_alt);
360
	    E_alt_result_mismatch (entry_key (sid_external_rule),
361
				   sid_alternative);
362
	}
363
    }
364
	    }
365
	}
366
	break;
367
      case 26:
368
	return;
369
      default:
370
	goto ZL1;
371
    }
372
    return;
373
  ZL1:;
374
    {
375
	{
376
 
377
    if (!sid_propagating_error) {
378
	E_expected_alternative ();
379
    }
380
	}
381
	{
382
 
383
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
384
	   (CURRENT_TERMINAL != LEXER_TOK_ALT_SEP) &&
385
	   (CURRENT_TERMINAL != LEXER_TOK_HANDLER_SEP) &&
386
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
387
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
388
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
389
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
390
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
391
	    nstring_destroy (lexer_string_value (sid_current_stream));
392
	}
393
	ADVANCE_LEXER;
394
    }
395
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
396
	nstring_destroy (lexer_string_value (sid_current_stream));
397
    }
398
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
399
	ADVANCE_LEXER;
400
    }
401
    sid_propagating_error = TRUE;
402
	}
403
	{
404
 
405
    sid_propagating_error = FALSE;
406
	}
407
    }
408
}
409
 
410
static void
6 7u83 411
ZR171(void)
2 7u83 412
{
413
    switch (CURRENT_TERMINAL) {
414
      case 4: case 18: case 19: case 24:
415
	{
416
	    ZR168 ();
417
	    if ((CURRENT_TERMINAL) == 26) {
418
		RESTORE_LEXER;
419
		goto ZL1;
420
	    }
421
	}
422
	break;
423
      case 26:
424
	return;
425
      default:
426
	break;
427
    }
428
    return;
429
  ZL1:;
430
    SAVE_LEXER (26);
431
    return;
432
}
433
 
434
static void
6 7u83 435
ZR239(void)
2 7u83 436
{
437
    if ((CURRENT_TERMINAL) == 26) {
438
	return;
439
    }
440
    {
441
	NStringT ZI151;
442
 
443
	switch (CURRENT_TERMINAL) {
444
	  case 4:
445
	    {
446
 
447
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
448
	    }
449
	    break;
450
	  default:
451
	    goto ZL1;
452
	}
453
	ADVANCE_LEXER;
454
	{
455
	    switch (CURRENT_TERMINAL) {
456
	      case 5:
457
		{
458
		    ADVANCE_LEXER;
6 7u83 459
		    ZR281 (&ZI151);
2 7u83 460
		    if ((CURRENT_TERMINAL) == 26) {
461
			RESTORE_LEXER;
462
			goto ZL3;
463
		    }
464
		}
465
		break;
466
	      case 9: case 12: case 21:
467
		{
468
		    {
469
 
470
    types_init (&sid_saved_type);
471
    types_init (&sid_current_type);
472
    sid_saved_pred_id   = NIL (EntryP);
473
    sid_current_pred_id = NIL (EntryP);
474
		    }
475
		    {
476
 
477
    sid_current_entry = scope_stack_add_rule (sid_current_scope,
478
					      sid_current_table, &(ZI151),
479
					      sid_enclosing_rule,
480
					      &sid_redefining_entry);
481
    if (sid_current_entry) {
482
	sid_current.rule = entry_get_rule (sid_current_entry);
483
    } else {
484
	E_duplicate_rule ((&ZI151));
485
	nstring_destroy (&(ZI151));
486
    }
487
		    }
6 7u83 488
		    ZR248 ();
2 7u83 489
		    if ((CURRENT_TERMINAL) == 26) {
490
			RESTORE_LEXER;
491
			goto ZL3;
492
		    }
493
		}
494
		break;
495
	      default:
496
		goto ZL3;
497
	    }
498
	    goto ZL2;
499
	  ZL3:;
500
	    {
501
		{
502
 
503
    if (!sid_propagating_error) {
504
	E_expected_other_defn ();
505
    }
506
		}
507
		{
508
 
509
    nstring_destroy (&(ZI151));
510
		}
511
		{
512
 
513
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
514
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
515
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
516
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
517
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
518
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
519
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
520
	    nstring_destroy (lexer_string_value (sid_current_stream));
521
	}
522
	ADVANCE_LEXER;
523
    }
524
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
525
	nstring_destroy (lexer_string_value (sid_current_stream));
526
    }
527
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
528
	ADVANCE_LEXER;
529
    }
530
    sid_propagating_error = TRUE;
531
		}
532
	    }
533
	  ZL2:;
534
	}
535
    }
536
    return;
537
  ZL1:;
538
    SAVE_LEXER (26);
539
    return;
540
}
541
 
542
static void
6 7u83 543
ZR146(void)
2 7u83 544
{
545
    if ((CURRENT_TERMINAL) == 26) {
546
	return;
547
    }
548
    {
549
	switch (CURRENT_TERMINAL) {
550
	  case 8:
551
	    break;
552
	  default:
553
	    goto ZL1;
554
	}
555
	ADVANCE_LEXER;
556
    }
557
    return;
558
  ZL1:;
559
    {
560
	{
561
 
562
    if (!sid_propagating_error) {
563
	E_expected_arrow ();
564
    }
565
	}
566
    }
567
}
568
 
569
static void
6 7u83 570
ZR163(void)
2 7u83 571
{
572
    if ((CURRENT_TERMINAL) == 26) {
573
	return;
574
    }
575
    {
576
	{
577
 
578
    types_init (&sid_current_type);
579
    sid_current_pred_id = NIL (EntryP);
580
	}
581
	ZR185 ();
582
	ZR171 ();
583
	if ((CURRENT_TERMINAL) == 26) {
584
	    RESTORE_LEXER;
585
	    goto ZL1;
586
	}
587
	{
588
 
589
    sid_propagating_error = FALSE;
590
	}
591
	ZR186 ();
592
	if ((CURRENT_TERMINAL) == 26) {
593
	    RESTORE_LEXER;
594
	    goto ZL1;
595
	}
596
    }
597
    return;
598
  ZL1:;
599
    SAVE_LEXER (26);
600
    return;
601
}
602
 
603
static void
6 7u83 604
ZR147(void)
2 7u83 605
{
606
  ZL2_147:;
607
    switch (CURRENT_TERMINAL) {
608
      case 4:
609
	{
610
	    ZR149 ();
611
	    if ((CURRENT_TERMINAL) == 26) {
612
		RESTORE_LEXER;
613
		goto ZL1;
614
	    } else {
615
		goto ZL2_147;
616
	    }
617
	}
618
	/*UNREACHED*/
619
      case 26:
620
	return;
621
      default:
622
	break;
623
    }
624
    return;
625
  ZL1:;
626
    SAVE_LEXER (26);
627
    return;
628
}
629
 
630
static void
6 7u83 631
ZR175(void)
2 7u83 632
{
6 7u83 633
    if ((CURRENT_TERMINAL) == 26) {
634
	return;
635
    }
636
    {
637
	{
638
 
639
    types_init (&sid_current_type);
640
    sid_current_pred_id = NIL (EntryP);
641
	}
642
	ZR185 ();
643
	ZR183 ();
644
	if ((CURRENT_TERMINAL) == 26) {
645
	    RESTORE_LEXER;
646
	    goto ZL1;
647
	}
648
	{
649
 
650
    sid_propagating_error = FALSE;
651
	}
652
	ZR186 ();
653
	if ((CURRENT_TERMINAL) == 26) {
654
	    RESTORE_LEXER;
655
	    goto ZL1;
656
	}
657
    }
658
    return;
659
  ZL1:;
660
    SAVE_LEXER (26);
661
    return;
662
}
663
 
664
static void
665
ZR221(void)
666
{
2 7u83 667
    switch (CURRENT_TERMINAL) {
6 7u83 668
      case 13:
669
	{
670
	    EntryP ZI194;
671
	    RuleP ZI67;
672
	    AltP ZI223;
673
	    BoolT ZI224;
674
	    ItemP ZI225;
675
 
676
	    ADVANCE_LEXER;
677
	    {
678
 
679
    (ZI194)      = sid_current_entry;
680
    (ZI67)       = sid_current.rule;
681
    (ZI223)        = sid_current_alt;
682
    (ZI224)   = sid_internal_rule;
683
    (ZI225)             = NIL (ItemP);
684
    sid_internal_rule = TRUE;
685
    if ((sid_current_entry) && (sid_current_alt)) {
686
	sid_current_entry = table_add_generated_rule (sid_current_table,
687
						      FALSE);
688
	sid_current.rule  = entry_get_rule (sid_current_entry);
689
	(ZI225)             = item_create (sid_current_entry);
690
	rule_defined (sid_current.rule);
691
	item_inlinable ((ZI225));
692
	types_copy (item_param ((ZI225)), rule_param ((ZI67)));
693
	types_append_copy (item_param ((ZI225)), alt_names ((ZI223)));
694
	types_copy (rule_param (sid_current.rule), item_param ((ZI225)));
695
	types_make_references (rule_param (sid_current.rule),
696
			       item_param ((ZI225)));
697
	alt_add_item ((ZI223), (ZI225));
698
    } else {
699
	sid_current_entry = NIL (EntryP);
700
    }
701
	    }
702
	    ZR219 ();
703
	    if ((CURRENT_TERMINAL) == 26) {
704
		RESTORE_LEXER;
705
		goto ZL1;
706
	    }
707
	    {
708
 
709
    if (((ZI194)) && ((ZI223))) {
710
	rule_compute_result_intersect (sid_current.rule);
711
	types_copy (item_result ((ZI225)), rule_result (sid_current.rule));
712
	types_add_new_names (alt_names ((ZI223)), item_result ((ZI225)),
713
			     sid_unique_pred_id);
714
    }
715
    sid_internal_rule = (ZI224);
716
    sid_current_alt   = (ZI223);
717
    sid_current.rule  = (ZI67);
718
    sid_current_entry = (ZI194);
719
	    }
720
	    ZR251 ();
721
	    ZR252 ();
722
	    if ((CURRENT_TERMINAL) == 26) {
723
		RESTORE_LEXER;
724
		goto ZL1;
725
	    }
726
	}
727
	break;
728
      case 4: case 6: case 10: case 18: case 19:
729
      case 24:
730
	{
731
	    ZR208 ();
732
	    if ((CURRENT_TERMINAL) == 26) {
733
		RESTORE_LEXER;
734
		goto ZL1;
735
	    }
736
	    {
737
 
738
    sid_propagating_error = FALSE;
739
	    }
740
	}
741
	break;
742
      case 26:
743
	return;
744
      default:
745
	goto ZL1;
746
    }
747
    return;
748
  ZL1:;
749
    SAVE_LEXER (26);
750
    return;
751
}
752
 
753
static void
754
ZR281(NStringT *ZI151)
755
{
756
    switch (CURRENT_TERMINAL) {
2 7u83 757
      case 6:
758
	{
759
	    ZR142 ();
760
	    if ((CURRENT_TERMINAL) == 26) {
761
		RESTORE_LEXER;
762
		goto ZL1;
763
	    }
764
	    {
765
 
766
    types_assign (&sid_saved_type, &sid_current_type);
767
    sid_saved_pred_id = sid_current_pred_id;
768
	    }
769
	    ZR146 ();
770
	    ZR142 ();
771
	    if ((CURRENT_TERMINAL) == 26) {
772
		RESTORE_LEXER;
773
		goto ZL1;
774
	    }
775
	    {
776
 
777
    sid_current_entry = scope_stack_add_rule (sid_current_scope,
778
					      sid_current_table, &(*ZI151),
779
					      sid_enclosing_rule,
780
					      &sid_redefining_entry);
781
    if (sid_current_entry) {
782
	sid_current.rule = entry_get_rule (sid_current_entry);
783
    } else {
784
	E_duplicate_rule ((ZI151));
785
	nstring_destroy (&(*ZI151));
786
    }
787
	    }
6 7u83 788
	    ZR248 ();
2 7u83 789
	    if ((CURRENT_TERMINAL) == 26) {
790
		RESTORE_LEXER;
791
		goto ZL1;
792
	    }
793
	}
794
	break;
795
      case 4:
796
	{
797
	    {
798
		{
799
		    NStringT ZI133;
800
 
801
		    switch (CURRENT_TERMINAL) {
802
		      case 4:
803
			{
804
 
805
    nstring_assign (&ZI133, lexer_string_value (sid_current_stream));
806
			}
807
			break;
808
		      default:
809
			goto ZL3;
810
		    }
811
		    ADVANCE_LEXER;
812
		    {
813
 
814
    sid_non_local = NIL (NonLocalEntryP);
815
    if ((sid_enclosing_rule == NIL (RuleP)) ||
816
	(sid_current_scope == &sid_global_scope)) {
817
	E_global_scope_non_local ((ZI151));
818
	nstring_destroy (&(*ZI151));
819
    } else {
820
	EntryP type = table_get_type (sid_current_table, (&ZI133));
821
 
822
	if (type == NIL (EntryP)) {
823
	    E_unknown_type ((&ZI133));
824
	    nstring_destroy (&(*ZI151));
825
	} else {
826
	    EntryP name = scope_stack_add_non_local (sid_current_scope,
827
						     sid_current_table,
828
						     &(*ZI151), type,
829
						     sid_enclosing_rule);
830
 
831
	    if (name) {
832
		NonLocalListP non_locals = rule_non_locals (sid_enclosing_rule);
833
		sid_non_local = non_local_list_add (non_locals, name, type);
834
	    } else {
835
		E_duplicate_non_local ((ZI151));
836
		nstring_destroy (&(*ZI151));
837
	    }
838
	}
839
    }
840
    nstring_destroy (&(ZI133));
841
		    }
842
		    {
843
			switch (CURRENT_TERMINAL) {
844
			  case 12:
845
			    {
846
				ADVANCE_LEXER;
847
				{
848
				    {
849
					switch (CURRENT_TERMINAL) {
850
					  case 10:
851
					    break;
852
					  default:
853
					    goto ZL7;
854
					}
855
					ADVANCE_LEXER;
856
				    }
857
				    goto ZL6;
858
				  ZL7:;
859
				    {
860
					{
861
 
862
    if (!sid_propagating_error) {
863
	E_expected_begin_action ();
864
    }
865
					}
866
				    }
867
				  ZL6:;
868
				}
869
				{
870
				    {
871
					NStringT ZI49;
872
 
873
					switch (CURRENT_TERMINAL) {
874
					  case 4:
875
					    {
876
 
877
    nstring_assign (&ZI49, lexer_string_value (sid_current_stream));
878
					    }
879
					    break;
880
					  default:
881
					    goto ZL9;
882
					}
883
					ADVANCE_LEXER;
884
					{
885
 
886
    EntryP entry = scope_stack_get_action (&sid_scope_stack, sid_current_table,
887
					   (&ZI49));
888
 
889
    if (entry == NIL (EntryP)) {
890
	E_unknown_action ((&ZI49));
891
    } else if (sid_non_local) {
892
	EntryP     type   = non_local_entry_get_type (sid_non_local);
893
	KeyP       name   = entry_key (non_local_entry_get_name (sid_non_local));
894
	ActionP    action = entry_get_action (entry);
895
	TypeTupleP param  = action_param (action);
896
	TypeTupleP result = action_result (action);
897
	TypeTupleT tuple;
898
	TypeTupleT ref_tuple;
899
 
900
	types_init (&tuple);
901
	types_init (&ref_tuple);
902
	types_add_type_entry (&tuple, type, FALSE);
903
	types_add_type_entry (&ref_tuple, type, TRUE);
904
	if ((!types_equal (param, &tuple)) &&
905
	    (!types_equal (param, &ref_tuple)) &&
906
	    (!types_equal_zero_tuple (param))) {
907
	    E_initialiser_param_mismatch (name, &tuple, &ref_tuple, param);
908
	}
909
	if (!types_equal (result, &tuple)) {
910
	    E_initialiser_result_mismatch (name, &tuple, result);
911
	}
912
	types_destroy (&ref_tuple);
913
	types_destroy (&tuple);
914
	non_local_entry_set_initialiser (sid_non_local, entry);
915
    }
916
    nstring_destroy (&(ZI49));
917
					}
6 7u83 918
					ZR246 ();
919
					ZR252 ();
2 7u83 920
					if ((CURRENT_TERMINAL) == 26) {
921
					    RESTORE_LEXER;
922
					    goto ZL9;
923
					}
924
				    }
925
				    goto ZL8;
926
				  ZL9:;
927
				    {
928
					{
929
 
930
    if (!sid_propagating_error) {
931
	E_expected_identifier ();
932
    }
933
					}
934
				    }
935
				  ZL8:;
936
				}
937
			    }
938
			    break;
939
			  case 9:
940
			    {
941
				ADVANCE_LEXER;
942
			    }
943
			    break;
944
			  default:
945
			    goto ZL5;
946
			}
947
			goto ZL4;
948
		      ZL5:;
949
			{
950
			    {
951
 
952
    if (!sid_propagating_error) {
953
	E_expected_terminator_or_define ();
954
    }
955
			    }
956
			}
957
		      ZL4:;
958
		    }
959
		}
960
		goto ZL2;
961
	      ZL3:;
962
		{
963
		    {
964
 
965
    if (!sid_propagating_error) {
966
	E_expected_identifier ();
967
    }
968
		    }
969
		    {
970
 
971
    nstring_destroy (&(*ZI151));
972
		    }
973
		    {
974
 
975
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
976
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
977
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
978
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
979
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
980
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
981
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
982
	    nstring_destroy (lexer_string_value (sid_current_stream));
983
	}
984
	ADVANCE_LEXER;
985
    }
986
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
987
	nstring_destroy (lexer_string_value (sid_current_stream));
988
    }
989
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
990
	ADVANCE_LEXER;
991
    }
992
    sid_propagating_error = TRUE;
993
		    }
994
		}
995
	      ZL2:;
996
	    }
997
	}
998
	break;
999
      case 26:
1000
	return;
1001
      default:
1002
	goto ZL1;
1003
    }
1004
    return;
1005
  ZL1:;
1006
    SAVE_LEXER (26);
1007
    return;
1008
}
1009
 
1010
static void
6 7u83 1011
ZR149(void)
2 7u83 1012
{
1013
    if ((CURRENT_TERMINAL) == 26) {
1014
	return;
1015
    }
1016
    {
6 7u83 1017
	NStringT ZI151;
2 7u83 1018
 
6 7u83 1019
	switch (CURRENT_TERMINAL) {
1020
	  case 4:
1021
	    {
1022
 
1023
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
1024
	    }
1025
	    break;
1026
	  default:
2 7u83 1027
	    goto ZL1;
1028
	}
6 7u83 1029
	ADVANCE_LEXER;
2 7u83 1030
	{
1031
 
6 7u83 1032
    if (table_add_type (sid_current_table, &(ZI151)) == NIL (EntryP)) {
1033
	E_duplicate_type ((&ZI151));
1034
	nstring_destroy (&(ZI151));
1035
    }
2 7u83 1036
	}
6 7u83 1037
	ZR252 ();
2 7u83 1038
	if ((CURRENT_TERMINAL) == 26) {
1039
	    RESTORE_LEXER;
1040
	    goto ZL1;
1041
	}
1042
    }
1043
    return;
1044
  ZL1:;
1045
    SAVE_LEXER (26);
1046
    return;
1047
}
1048
 
1049
static void
6 7u83 1050
ZR283(void)
2 7u83 1051
{
1052
    switch (CURRENT_TERMINAL) {
1053
      case 18:
1054
	{
1055
	    {
1056
 
1057
    if (sid_current_pred_id) {
1058
	E_multi_predicate_return ();
1059
    } else if (sid_unique_pred_id == NIL (EntryP)) {
1060
	sid_unique_pred_id = grammar_get_predicate_id (sid_current_grammar);
1061
    }
1062
    sid_current_pred_id = sid_unique_pred_id;
1063
    types_add_name_entry (&sid_current_type, sid_current_pred_id);
1064
	    }
1065
	    ADVANCE_LEXER;
1066
	    {
1067
 
1068
    types_assign (&sid_saved_type, &sid_current_type);
1069
    sid_saved_pred_id = sid_current_pred_id;
1070
	    }
6 7u83 1071
	    ZR249 ();
2 7u83 1072
	    ZR199 ();
1073
	    if ((CURRENT_TERMINAL) == 26) {
1074
		RESTORE_LEXER;
1075
		goto ZL1;
1076
	    }
1077
	}
1078
	break;
1079
      case 19:
1080
	{
1081
	    {
1082
 
1083
    EntryP entry = table_add_generated_name (sid_current_table);
1084
 
1085
    types_add_name_entry (&sid_current_type, entry);
1086
	    }
1087
	    ADVANCE_LEXER;
1088
	    {
1089
 
1090
    types_assign (&sid_saved_type, &sid_current_type);
1091
    sid_saved_pred_id = sid_current_pred_id;
1092
	    }
6 7u83 1093
	    ZR249 ();
2 7u83 1094
	    ZR199 ();
1095
	    if ((CURRENT_TERMINAL) == 26) {
1096
		RESTORE_LEXER;
1097
		goto ZL1;
1098
	    }
1099
	}
1100
	break;
1101
      case 10:
1102
	{
1103
	    {
1104
 
1105
    types_assign (&sid_saved_type, &sid_current_type);
1106
    sid_saved_pred_id = sid_current_pred_id;
1107
	    }
1108
	    ADVANCE_LEXER;
6 7u83 1109
	    ZR217 ();
2 7u83 1110
	    if ((CURRENT_TERMINAL) == 26) {
1111
		RESTORE_LEXER;
1112
		goto ZL1;
1113
	    }
1114
	}
1115
	break;
1116
      case 26:
1117
	return;
1118
      default:
1119
	goto ZL1;
1120
    }
1121
    return;
1122
  ZL1:;
1123
    SAVE_LEXER (26);
1124
    return;
1125
}
1126
 
1127
static void
6 7u83 1128
ZR183(void)
2 7u83 1129
{
6 7u83 1130
    switch (CURRENT_TERMINAL) {
1131
      case 4: case 24:
1132
	{
1133
	    ZR180 ();
1134
	    if ((CURRENT_TERMINAL) == 26) {
1135
		RESTORE_LEXER;
1136
		goto ZL1;
1137
	    }
1138
	}
1139
	break;
1140
      case 26:
2 7u83 1141
	return;
6 7u83 1142
      default:
1143
	break;
2 7u83 1144
    }
6 7u83 1145
    return;
1146
  ZL1:;
1147
    SAVE_LEXER (26);
1148
    return;
1149
}
2 7u83 1150
 
6 7u83 1151
static void
1152
ZR192(void)
1153
{
1154
    switch (CURRENT_TERMINAL) {
1155
      case 21:
1156
	{
1157
	    EntryP ZI194;
1158
	    RuleP ZI67;
1159
 
1160
	    ADVANCE_LEXER;
2 7u83 1161
	    {
1162
 
6 7u83 1163
    (ZI194)       = sid_current_entry;
1164
    (ZI67)        = sid_enclosing_rule;
1165
 
1166
    sid_enclosing_rule = sid_current.rule;
2 7u83 1167
	    }
6 7u83 1168
	    ZR161 ();
1169
	    if ((CURRENT_TERMINAL) == 26) {
1170
		RESTORE_LEXER;
1171
		goto ZL1;
1172
	    }
1173
	    {
2 7u83 1174
 
6 7u83 1175
    sid_current_entry  = (ZI194);
1176
    sid_current.rule   = sid_enclosing_rule;
1177
    sid_enclosing_rule = (ZI67);
1178
    sid_alternative    = 0;
1179
    sid_internal_rule  = FALSE;
1180
    sid_external_rule  = sid_current_entry;
1181
    nstring_init (&sid_maximum_scope);
1182
	    }
1183
	    {
1184
		{
1185
		    switch (CURRENT_TERMINAL) {
1186
		      case 22:
1187
			break;
1188
		      default:
1189
			goto ZL3;
1190
		    }
1191
		    ADVANCE_LEXER;
1192
		}
1193
		goto ZL2;
1194
	      ZL3:;
1195
		{
1196
		    {
1197
 
1198
    if (!sid_propagating_error) {
1199
	E_expected_end_scope ();
2 7u83 1200
    }
6 7u83 1201
		    }
1202
		}
1203
	      ZL2:;
1204
	    }
2 7u83 1205
	}
6 7u83 1206
	break;
1207
      case 26:
1208
	return;
1209
      default:
1210
	break;
2 7u83 1211
    }
1212
    return;
1213
  ZL1:;
1214
    SAVE_LEXER (26);
1215
    return;
1216
}
1217
 
1218
static void
6 7u83 1219
ZR284(NStringT *ZI151)
2 7u83 1220
{
1221
    switch (CURRENT_TERMINAL) {
1222
      case 12:
1223
	{
1224
	    {
1225
 
1226
    NStringT scope;
1227
    EntryP   non_local_entry = scope_stack_get_non_local (&sid_scope_stack,
1228
							  sid_current_table,
1229
							  (ZI151), &scope);
1230
    EntryP   name_entry      = table_get_entry (sid_current_table, (ZI151));
1231
 
1232
    if (name_entry) {
1233
	if ((sid_current_entry) && (sid_current_alt)) {
1234
	    if ((!types_contains (alt_names (sid_current_alt), name_entry)) &&
1235
		(!types_contains (rule_param (sid_current.rule),
1236
				  name_entry))) {
1237
		name_entry = NIL (EntryP);
1238
	    }
1239
	} else {
1240
	    name_entry = NIL (EntryP);
1241
	}
1242
    }
1243
    if (name_entry) {
1244
	types_add_name_and_type (&sid_current_type, name_entry, NIL (EntryP),
1245
				 FALSE);
1246
	if (non_local_entry) {
1247
	    nstring_destroy (&scope);
1248
	}
1249
	nstring_destroy (&(*ZI151));
1250
    } else if (non_local_entry) {
1251
	types_add_name_and_type (&sid_current_type, non_local_entry,
1252
				 NIL (EntryP), FALSE);
1253
	if (nstring_length (&scope) > nstring_length (&sid_maximum_scope)) {
1254
	    nstring_destroy (&sid_maximum_scope);
1255
	    nstring_assign (&sid_maximum_scope, &scope);
1256
	} else {
1257
	    nstring_destroy (&scope);
1258
	}
1259
	nstring_destroy (&(*ZI151));
1260
    } else {
1261
	types_add_name (&sid_current_type, sid_current_table, &(*ZI151), FALSE);
1262
    }
1263
	    }
1264
	    {
1265
 
1266
    types_assign (&sid_saved_type, &sid_current_type);
1267
    sid_saved_pred_id = sid_current_pred_id;
1268
	    }
1269
	    ADVANCE_LEXER;
1270
	    ZR199 ();
1271
	    if ((CURRENT_TERMINAL) == 26) {
1272
		RESTORE_LEXER;
1273
		goto ZL1;
1274
	    }
1275
	}
1276
	break;
1277
      case 6: case 9:
1278
	{
1279
	    {
1280
 
1281
    types_assign (&sid_saved_type, &sid_current_type);
1282
    sid_saved_pred_id = sid_current_pred_id;
1283
	    }
6 7u83 1284
	    ZR285 (ZI151);
2 7u83 1285
	    if ((CURRENT_TERMINAL) == 26) {
1286
		RESTORE_LEXER;
1287
		goto ZL1;
1288
	    }
1289
	}
1290
	break;
1291
      case 26:
1292
	return;
1293
      default:
1294
	goto ZL1;
1295
    }
1296
    return;
1297
  ZL1:;
1298
    SAVE_LEXER (26);
1299
    return;
1300
}
1301
 
1302
static void
6 7u83 1303
ZR285(NStringT *ZI151)
2 7u83 1304
{
1305
    switch (CURRENT_TERMINAL) {
1306
      case 6:
1307
	{
1308
	    ZR175 ();
1309
	    if ((CURRENT_TERMINAL) == 26) {
1310
		RESTORE_LEXER;
1311
		goto ZL1;
1312
	    }
1313
	    {
1314
 
1315
    TypeTupleP param  = NIL (TypeTupleP);
1316
    TypeTupleP result = NIL (TypeTupleP);
1317
    EntryP     entry  = NIL (EntryP);
1318
    RuleP      rule;
1319
    BasicP     basic;
1320
 
1321
    if ((sid_current_entry) && (sid_current_alt)) {
1322
	entry = scope_stack_get_rule (&sid_scope_stack, sid_current_table,
1323
				      (ZI151));
1324
	if (entry) {
1325
	    sid_current_item = item_create (entry);
1326
	    rule             = entry_get_rule (entry);
1327
	    param            = rule_param (rule);
1328
	    result           = rule_result (rule);
1329
	} else {
1330
	    entry = table_get_basic (sid_current_table, (ZI151));
1331
	    if (entry) {
1332
		sid_current_item = item_create (entry);
1333
		basic            = entry_get_basic (entry);
1334
		param            = NIL (TypeTupleP);
1335
		result           = basic_result (basic);
1336
		if (basic_get_ignored (basic)) {
1337
		    E_ignored_basic_call ((ZI151));
1338
		}
1339
	    } else {
1340
		E_unknown_rule_or_basic ((ZI151));
1341
		sid_current_item = NIL (ItemP);
1342
	    }
1343
	}
1344
    } else {
1345
	sid_current_item = NIL (ItemP);
1346
    }
1347
    nstring_destroy (&(*ZI151));
1348
    if (sid_current_item) {
1349
	BoolT errored = FALSE;
1350
	KeyP  key     = entry_key (entry);
1351
 
1352
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
1353
			   alt_names (sid_current_alt), E_undefined_name,
1354
			   entry_key (sid_external_rule), sid_alternative)) {
1355
	    if (param) {
1356
		if (types_equal (&sid_current_type, param)) {
1357
		    item_add_param (sid_current_item, &sid_current_type);
1358
		} else {
1359
		    E_rule_param_call_mismatch (key, param, &sid_current_type);
1360
		    types_destroy (&sid_current_type);
1361
		    errored = TRUE;
1362
		}
1363
	    } else {
1364
		if (!types_equal_zero_tuple (&sid_current_type)) {
1365
		    E_basic_param_call_mismatch (key, &sid_current_type);
1366
		    types_destroy (&sid_current_type);
1367
		    errored = TRUE;
1368
		}
1369
	    }
1370
	} else {
1371
	    types_destroy (&sid_current_type);
1372
	    errored = TRUE;
1373
	}
1374
	if (types_disjoint_names (&sid_saved_type)) {
1375
	    if (types_check_undefined (&sid_saved_type,
1376
				       rule_param (sid_current.rule),
1377
				       alt_names (sid_current_alt),
1378
				       E_redefined_name,
1379
				       entry_key (sid_external_rule),
1380
				       sid_alternative)) {
1381
		if (types_fillin_types (&sid_saved_type, result)) {
1382
		    types_add_new_names (alt_names (sid_current_alt),
1383
					 &sid_saved_type, sid_unique_pred_id);
1384
		    if (sid_saved_pred_id) {
1385
			E_predicate ();
1386
		    }
1387
		    item_add_result (sid_current_item, &sid_saved_type);
1388
		} else {
1389
		    if (param) {
1390
			E_rule_result_call_mismatch (key, result,
1391
						     &sid_saved_type);
1392
		    } else {
1393
			E_basic_result_call_mismatch (key, result,
1394
						      &sid_saved_type);
1395
		    }
1396
		    types_destroy (&sid_saved_type);
1397
		    errored = TRUE;
1398
		}
1399
	    } else {
1400
		types_destroy (&sid_saved_type);
1401
		errored = TRUE;
1402
	    }
1403
	} else {
1404
	    if (param) {
1405
		E_rule_result_call_clash (key, &sid_saved_type);
1406
	    } else {
1407
		E_basic_result_call_clash (key, &sid_saved_type);
1408
	    }
1409
	    types_destroy (&sid_saved_type);
1410
	    errored = TRUE;
1411
	}
1412
	if (errored) {
1413
	    (void) item_deallocate (sid_current_item);
1414
	    sid_current_item = NIL (ItemP);
1415
	    (void) alt_deallocate (sid_current_alt);
1416
	    sid_current_alt  = NIL (AltP);
1417
	} else {
1418
	    alt_add_item (sid_current_alt, sid_current_item);
1419
	}
1420
    } else {
1421
	if (sid_current_alt) {
1422
	    (void) alt_deallocate (sid_current_alt);
1423
	    sid_current_alt = NIL (AltP);
1424
	}
1425
	types_destroy (&sid_saved_type);
1426
	types_destroy (&sid_current_type);
1427
    }
1428
	    }
6 7u83 1429
	    ZR252 ();
2 7u83 1430
	    if ((CURRENT_TERMINAL) == 26) {
1431
		RESTORE_LEXER;
1432
		goto ZL1;
1433
	    }
1434
	}
1435
	break;
1436
      case 9:
1437
	{
1438
	    {
1439
 
1440
    types_init (&sid_current_type);
1441
    sid_current_pred_id = NIL (EntryP);
1442
	    }
1443
	    {
1444
 
1445
    TypeTupleP param  = NIL (TypeTupleP);
1446
    TypeTupleP result = NIL (TypeTupleP);
1447
    EntryP     entry  = NIL (EntryP);
1448
    RuleP      rule;
1449
    BasicP     basic;
1450
 
1451
    if ((sid_current_entry) && (sid_current_alt)) {
1452
	entry = scope_stack_get_rule (&sid_scope_stack, sid_current_table,
1453
				      (ZI151));
1454
	if (entry) {
1455
	    sid_current_item = item_create (entry);
1456
	    rule             = entry_get_rule (entry);
1457
	    param            = rule_param (rule);
1458
	    result           = rule_result (rule);
1459
	} else {
1460
	    entry = table_get_basic (sid_current_table, (ZI151));
1461
	    if (entry) {
1462
		sid_current_item = item_create (entry);
1463
		basic            = entry_get_basic (entry);
1464
		param            = NIL (TypeTupleP);
1465
		result           = basic_result (basic);
1466
		if (basic_get_ignored (basic)) {
1467
		    E_ignored_basic_call ((ZI151));
1468
		}
1469
	    } else {
1470
		E_unknown_rule_or_basic ((ZI151));
1471
		sid_current_item = NIL (ItemP);
1472
	    }
1473
	}
1474
    } else {
1475
	sid_current_item = NIL (ItemP);
1476
    }
1477
    nstring_destroy (&(*ZI151));
1478
    if (sid_current_item) {
1479
	BoolT errored = FALSE;
1480
	KeyP  key     = entry_key (entry);
1481
 
1482
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
1483
			   alt_names (sid_current_alt), E_undefined_name,
1484
			   entry_key (sid_external_rule), sid_alternative)) {
1485
	    if (param) {
1486
		if (types_equal (&sid_current_type, param)) {
1487
		    item_add_param (sid_current_item, &sid_current_type);
1488
		} else {
1489
		    E_rule_param_call_mismatch (key, param, &sid_current_type);
1490
		    types_destroy (&sid_current_type);
1491
		    errored = TRUE;
1492
		}
1493
	    } else {
1494
		if (!types_equal_zero_tuple (&sid_current_type)) {
1495
		    E_basic_param_call_mismatch (key, &sid_current_type);
1496
		    types_destroy (&sid_current_type);
1497
		    errored = TRUE;
1498
		}
1499
	    }
1500
	} else {
1501
	    types_destroy (&sid_current_type);
1502
	    errored = TRUE;
1503
	}
1504
	if (types_disjoint_names (&sid_saved_type)) {
1505
	    if (types_check_undefined (&sid_saved_type,
1506
				       rule_param (sid_current.rule),
1507
				       alt_names (sid_current_alt),
1508
				       E_redefined_name,
1509
				       entry_key (sid_external_rule),
1510
				       sid_alternative)) {
1511
		if (types_fillin_types (&sid_saved_type, result)) {
1512
		    types_add_new_names (alt_names (sid_current_alt),
1513
					 &sid_saved_type, sid_unique_pred_id);
1514
		    if (sid_saved_pred_id) {
1515
			E_predicate ();
1516
		    }
1517
		    item_add_result (sid_current_item, &sid_saved_type);
1518
		} else {
1519
		    if (param) {
1520
			E_rule_result_call_mismatch (key, result,
1521
						     &sid_saved_type);
1522
		    } else {
1523
			E_basic_result_call_mismatch (key, result,
1524
						      &sid_saved_type);
1525
		    }
1526
		    types_destroy (&sid_saved_type);
1527
		    errored = TRUE;
1528
		}
1529
	    } else {
1530
		types_destroy (&sid_saved_type);
1531
		errored = TRUE;
1532
	    }
1533
	} else {
1534
	    if (param) {
1535
		E_rule_result_call_clash (key, &sid_saved_type);
1536
	    } else {
1537
		E_basic_result_call_clash (key, &sid_saved_type);
1538
	    }
1539
	    types_destroy (&sid_saved_type);
1540
	    errored = TRUE;
1541
	}
1542
	if (errored) {
1543
	    (void) item_deallocate (sid_current_item);
1544
	    sid_current_item = NIL (ItemP);
1545
	    (void) alt_deallocate (sid_current_alt);
1546
	    sid_current_alt  = NIL (AltP);
1547
	} else {
1548
	    alt_add_item (sid_current_alt, sid_current_item);
1549
	}
1550
    } else {
1551
	if (sid_current_alt) {
1552
	    (void) alt_deallocate (sid_current_alt);
1553
	    sid_current_alt = NIL (AltP);
1554
	}
1555
	types_destroy (&sid_saved_type);
1556
	types_destroy (&sid_current_type);
1557
    }
1558
	    }
1559
	    ADVANCE_LEXER;
1560
	}
1561
	break;
1562
      case 26:
1563
	return;
1564
      default:
1565
	goto ZL1;
1566
    }
1567
    return;
1568
  ZL1:;
1569
    SAVE_LEXER (26);
1570
    return;
1571
}
1572
 
1573
static void
6 7u83 1574
ZR165(void)
2 7u83 1575
{
1576
    switch (CURRENT_TERMINAL) {
1577
      case 4:
1578
	{
1579
	    NStringT ZI151;
1580
 
1581
	    {
1582
 
1583
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
1584
	    }
1585
	    ADVANCE_LEXER;
1586
	    {
1587
 
1588
    NStringT scope;
1589
    EntryP   non_local_entry = scope_stack_get_non_local (&sid_scope_stack,
1590
							  sid_current_table,
1591
							  (&ZI151), &scope);
1592
    EntryP   name_entry      = table_get_entry (sid_current_table, (&ZI151));
1593
 
1594
    if (name_entry) {
1595
	if ((sid_current_entry) && (sid_current_alt)) {
1596
	    if ((!types_contains (alt_names (sid_current_alt), name_entry)) &&
1597
		(!types_contains (rule_param (sid_current.rule),
1598
				  name_entry))) {
1599
		name_entry = NIL (EntryP);
1600
	    }
1601
	} else {
1602
	    name_entry = NIL (EntryP);
1603
	}
1604
    }
1605
    if (name_entry) {
1606
	types_add_name_and_type (&sid_current_type, name_entry, NIL (EntryP),
1607
				 FALSE);
1608
	if (non_local_entry) {
1609
	    nstring_destroy (&scope);
1610
	}
1611
	nstring_destroy (&(ZI151));
1612
    } else if (non_local_entry) {
1613
	types_add_name_and_type (&sid_current_type, non_local_entry,
1614
				 NIL (EntryP), FALSE);
1615
	if (nstring_length (&scope) > nstring_length (&sid_maximum_scope)) {
1616
	    nstring_destroy (&sid_maximum_scope);
1617
	    nstring_assign (&sid_maximum_scope, &scope);
1618
	} else {
1619
	    nstring_destroy (&scope);
1620
	}
1621
	nstring_destroy (&(ZI151));
1622
    } else {
1623
	types_add_name (&sid_current_type, sid_current_table, &(ZI151), FALSE);
1624
    }
1625
	    }
1626
	}
1627
	break;
1628
      case 19:
1629
	{
1630
	    ADVANCE_LEXER;
1631
	    {
1632
 
1633
    EntryP entry = table_add_generated_name (sid_current_table);
1634
 
1635
    types_add_name_entry (&sid_current_type, entry);
1636
	    }
1637
	}
1638
	break;
1639
      case 18:
1640
	{
1641
	    ADVANCE_LEXER;
1642
	    {
1643
 
1644
    if (sid_current_pred_id) {
1645
	E_multi_predicate_return ();
1646
    } else if (sid_unique_pred_id == NIL (EntryP)) {
1647
	sid_unique_pred_id = grammar_get_predicate_id (sid_current_grammar);
1648
    }
1649
    sid_current_pred_id = sid_unique_pred_id;
1650
    types_add_name_entry (&sid_current_type, sid_current_pred_id);
1651
	    }
1652
	}
1653
	break;
1654
      case 24:
1655
	{
1656
	    ADVANCE_LEXER;
1657
	    {
1658
		{
1659
		    NStringT ZI151;
1660
 
1661
		    switch (CURRENT_TERMINAL) {
1662
		      case 4:
1663
			{
1664
 
1665
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
1666
			}
1667
			break;
1668
		      default:
1669
			goto ZL3;
1670
		    }
1671
		    ADVANCE_LEXER;
1672
		    {
1673
 
1674
    NStringT scope;
1675
    EntryP   non_local_entry = scope_stack_get_non_local (&sid_scope_stack,
1676
							  sid_current_table,
1677
							  (&ZI151), &scope);
1678
    EntryP   name_entry      = table_get_entry (sid_current_table, (&ZI151));
1679
 
1680
    if (name_entry) {
1681
	if ((sid_current_entry) && (sid_current_alt)) {
1682
	    if ((!types_contains (alt_names (sid_current_alt), name_entry)) &&
1683
		(!types_contains (rule_param (sid_current.rule),
1684
				  name_entry))) {
1685
		name_entry = NIL (EntryP);
1686
	    }
1687
	} else {
1688
	    name_entry = NIL (EntryP);
1689
	}
1690
    }
1691
    if (name_entry) {
1692
	types_add_name_and_type_var (&sid_current_type, name_entry,
1693
				     NIL (EntryP));
1694
	if (non_local_entry) {
1695
	    nstring_destroy (&scope);
1696
	}
1697
	nstring_destroy (&(ZI151));
1698
    } else if (non_local_entry) {
1699
	types_add_name_and_type_var (&sid_current_type, non_local_entry,
1700
				     NIL (EntryP));
1701
	if (nstring_length (&scope) > nstring_length (&sid_maximum_scope)) {
1702
	    nstring_destroy (&sid_maximum_scope);
1703
	    nstring_assign (&sid_maximum_scope, &scope);
1704
	} else {
1705
	    nstring_destroy (&scope);
1706
	}
1707
	nstring_destroy (&(ZI151));
1708
    } else {
1709
	E_undefined_assignment ((&ZI151));
1710
	types_add_name (&sid_current_type, sid_current_table, &(ZI151), FALSE);
1711
    }
1712
		    }
1713
		}
1714
		goto ZL2;
1715
	      ZL3:;
1716
		{
1717
		    {
1718
 
1719
    if (!sid_propagating_error) {
1720
	E_expected_identifier ();
1721
    }
1722
		    }
1723
		}
1724
	      ZL2:;
1725
	    }
1726
	}
1727
	break;
1728
      case 26:
1729
	return;
1730
      default:
1731
	goto ZL1;
1732
    }
1733
    return;
1734
  ZL1:;
1735
    {
1736
	{
1737
 
1738
    if (!sid_propagating_error) {
1739
	E_expected_lhs_name ();
1740
    }
1741
	}
1742
	{
1743
 
1744
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
1745
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
1746
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
1747
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
1748
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
1749
	    nstring_destroy (lexer_string_value (sid_current_stream));
1750
	}
1751
	ADVANCE_LEXER;
1752
    }
1753
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
1754
	nstring_destroy (lexer_string_value (sid_current_stream));
1755
    }
1756
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
1757
	ADVANCE_LEXER;
1758
    }
1759
    sid_propagating_error = TRUE;
1760
	}
1761
    }
1762
}
1763
 
1764
static void
6 7u83 1765
ZR161(void)
2 7u83 1766
{
1767
    if ((CURRENT_TERMINAL) == 26) {
1768
	return;
1769
    }
1770
  ZL2_161:;
1771
    {
6 7u83 1772
	ZR253 ();
2 7u83 1773
	if ((CURRENT_TERMINAL) == 26) {
1774
	    RESTORE_LEXER;
1775
	    goto ZL1;
1776
	}
1777
	{
1778
 
1779
    sid_propagating_error = FALSE;
1780
	}
1781
	{
1782
	    {
1783
		{
1784
 
1785
    (ZI0) = ((CURRENT_TERMINAL == LEXER_TOK_EOF) ||
1786
		  (CURRENT_TERMINAL == LEXER_TOK_END_SCOPE) ||
1787
		  (CURRENT_TERMINAL == LEXER_TOK_BLT_ENTRY));
1788
		}
1789
		if (!ZI0)
1790
		    goto ZL4;
1791
		goto ZL3;
1792
	    }
1793
	    /*UNREACHED*/
1794
	  ZL4:;
1795
	    switch (CURRENT_TERMINAL) {
1796
	      case 4: case 10: case 20:
1797
		{
1798
		    goto ZL2_161;
1799
		}
1800
		/*UNREACHED*/
1801
	      default:
1802
		goto ZL1;
1803
	    }
1804
	  ZL3:;
1805
	}
1806
    }
1807
    return;
1808
  ZL1:;
1809
    {
1810
	{
1811
 
1812
    if (!sid_propagating_error) {
1813
	E_expected_production_defn ();
1814
    }
1815
	}
1816
	{
1817
 
1818
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
1819
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
1820
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
1821
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
1822
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
1823
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
1824
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
1825
	    nstring_destroy (lexer_string_value (sid_current_stream));
1826
	}
1827
	ADVANCE_LEXER;
1828
    }
1829
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
1830
	nstring_destroy (lexer_string_value (sid_current_stream));
1831
    }
1832
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
1833
	ADVANCE_LEXER;
1834
    }
1835
    sid_propagating_error = TRUE;
1836
	}
1837
	{
1838
 
1839
    sid_propagating_error = FALSE;
1840
	}
1841
	{
1842
	    {
1843
		{
1844
 
1845
    (ZI0) = ((CURRENT_TERMINAL == LEXER_TOK_EOF) ||
1846
		  (CURRENT_TERMINAL == LEXER_TOK_END_SCOPE) ||
1847
		  (CURRENT_TERMINAL == LEXER_TOK_BLT_ENTRY));
1848
		}
1849
		if (!ZI0)
1850
		    goto ZL7;
1851
	    }
1852
	    goto ZL6;
1853
	  ZL7:;
1854
	    {
1855
		goto ZL2_161;
1856
	    }
1857
	    /*UNREACHED*/
1858
	  ZL6:;
1859
	}
1860
    }
1861
}
1862
 
1863
void
6 7u83 1864
sid_parse_grammar(void)
2 7u83 1865
{
1866
    if ((CURRENT_TERMINAL) == 26) {
1867
	return;
1868
    }
1869
    {
1870
	{
1871
 
1872
sid_current_table      = grammar_table (sid_current_grammar);
1873
sid_current_entry_list = grammar_entry_list (sid_current_grammar);
1874
scope_stack_init (&sid_scope_stack);
1875
scope_stack_init (&sid_global_scope);
1876
	}
1877
	{
1878
	    {
1879
		switch (CURRENT_TERMINAL) {
1880
		  case 0:
1881
		    break;
1882
		  default:
1883
		    goto ZL3;
1884
		}
1885
		ADVANCE_LEXER;
1886
	    }
1887
	    goto ZL2;
1888
	  ZL3:;
1889
	    {
1890
		{
1891
 
1892
    if (!sid_propagating_error) {
1893
	E_expected_blt_types ();
1894
    }
1895
		}
1896
	    }
1897
	  ZL2:;
1898
	}
1899
	ZR147 ();
1900
	{
1901
	    if ((CURRENT_TERMINAL) == 26) {
1902
		RESTORE_LEXER;
1903
		goto ZL1;
1904
	    }
1905
	    {
1906
		switch (CURRENT_TERMINAL) {
1907
		  case 1:
1908
		    break;
1909
		  default:
1910
		    goto ZL5;
1911
		}
1912
		ADVANCE_LEXER;
1913
	    }
1914
	    goto ZL4;
1915
	  ZL5:;
1916
	    {
1917
		{
1918
 
1919
    if (!sid_propagating_error) {
1920
	E_expected_blt_terminals ();
1921
    }
1922
		}
1923
	    }
1924
	  ZL4:;
1925
	}
1926
	ZR153 ();
1927
	if ((CURRENT_TERMINAL) == 26) {
1928
	    RESTORE_LEXER;
1929
	    goto ZL1;
1930
	}
1931
	{
1932
 
1933
    unsigned max_terminal = grammar_max_terminal (sid_current_grammar);
1934
 
1935
    bitvec_set_size (max_terminal);
1936
    sid_finished_terminals = TRUE;
1937
	}
1938
	{
1939
	    {
1940
		switch (CURRENT_TERMINAL) {
1941
		  case 2:
1942
		    break;
1943
		  default:
1944
		    goto ZL7;
1945
		}
1946
		ADVANCE_LEXER;
1947
	    }
1948
	    goto ZL6;
1949
	  ZL7:;
1950
	    {
1951
		{
1952
 
1953
    if (!sid_propagating_error) {
1954
	E_expected_blt_productions ();
1955
    }
1956
		}
1957
	    }
1958
	  ZL6:;
1959
	}
1960
	ZR161 ();
1961
	{
1962
	    if ((CURRENT_TERMINAL) == 26) {
1963
		RESTORE_LEXER;
1964
		goto ZL1;
1965
	    }
1966
	    {
1967
		switch (CURRENT_TERMINAL) {
1968
		  case 3:
1969
		    break;
1970
		  default:
1971
		    goto ZL9;
1972
		}
1973
		ADVANCE_LEXER;
1974
	    }
1975
	    goto ZL8;
1976
	  ZL9:;
1977
	    {
1978
		{
1979
 
1980
    if (!sid_propagating_error) {
1981
	E_expected_blt_entry ();
1982
    }
1983
		}
1984
	    }
1985
	  ZL8:;
1986
	}
6 7u83 1987
	ZR259 ();
1988
	ZR252 ();
2 7u83 1989
	{
1990
	    if ((CURRENT_TERMINAL) == 26) {
1991
		RESTORE_LEXER;
1992
		goto ZL1;
1993
	    }
1994
	    {
1995
		switch (CURRENT_TERMINAL) {
1996
		  case 25:
1997
		    break;
1998
		  default:
1999
		    goto ZL11;
2000
		}
2001
		ADVANCE_LEXER;
2002
	    }
2003
	    goto ZL10;
2004
	  ZL11:;
2005
	    {
2006
		{
2007
 
2008
    if (!sid_propagating_error) {
2009
	E_expected_eof ();
2010
    }
2011
		}
2012
	    }
2013
	  ZL10:;
2014
	}
2015
    }
2016
    return;
2017
  ZL1:;
2018
    {
2019
	{
2020
 
2021
    UNREACHED;
2022
	}
2023
    }
2024
}
2025
 
2026
static void
6 7u83 2027
ZR140(void)
2 7u83 2028
{
2029
    switch (CURRENT_TERMINAL) {
2030
      case 4: case 5:
2031
	{
2032
	    ZR137 ();
2033
	    if ((CURRENT_TERMINAL) == 26) {
2034
		RESTORE_LEXER;
2035
		goto ZL1;
2036
	    }
2037
	}
2038
	break;
2039
      case 26:
2040
	return;
2041
      default:
2042
	break;
2043
    }
2044
    return;
2045
  ZL1:;
2046
    SAVE_LEXER (26);
2047
    return;
2048
}
2049
 
2050
static void
6 7u83 2051
ZR142(void)
2 7u83 2052
{
2053
    if ((CURRENT_TERMINAL) == 26) {
2054
	return;
2055
    }
2056
    {
2057
	{
2058
 
2059
    types_init (&sid_current_type);
2060
    sid_current_pred_id = NIL (EntryP);
2061
	}
2062
	ZR185 ();
2063
	ZR140 ();
2064
	if ((CURRENT_TERMINAL) == 26) {
2065
	    RESTORE_LEXER;
2066
	    goto ZL1;
2067
	}
2068
	{
2069
 
2070
    sid_propagating_error = FALSE;
2071
	}
2072
	ZR186 ();
2073
	if ((CURRENT_TERMINAL) == 26) {
2074
	    RESTORE_LEXER;
2075
	    goto ZL1;
2076
	}
2077
    }
2078
    return;
2079
  ZL1:;
2080
    SAVE_LEXER (26);
2081
    return;
2082
}
2083
 
2084
static void
6 7u83 2085
ZR177(void)
2 7u83 2086
{
2087
    switch (CURRENT_TERMINAL) {
2088
      case 4:
2089
	{
2090
	    NStringT ZI151;
2091
 
2092
	    {
2093
 
2094
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
2095
	    }
2096
	    ADVANCE_LEXER;
2097
	    {
2098
 
2099
    NStringT scope;
2100
    EntryP   non_local_entry = scope_stack_get_non_local (&sid_scope_stack,
2101
							  sid_current_table,
2102
							  (&ZI151), &scope);
2103
    EntryP   name_entry      = table_get_entry (sid_current_table, (&ZI151));
2104
 
2105
    if (name_entry) {
2106
	if ((sid_current_entry) && (sid_current_alt)) {
2107
	    if ((!types_contains (alt_names (sid_current_alt), name_entry)) &&
2108
		(!types_contains (rule_param (sid_current.rule),
2109
				  name_entry))) {
2110
		name_entry = NIL (EntryP);
2111
	    }
2112
	} else {
2113
	    name_entry = NIL (EntryP);
2114
	}
2115
    }
2116
    if (name_entry) {
2117
	types_add_name_and_type (&sid_current_type, name_entry, NIL (EntryP),
2118
				 FALSE);
2119
	if (non_local_entry) {
2120
	    nstring_destroy (&scope);
2121
	}
2122
	nstring_destroy (&(ZI151));
2123
    } else if (non_local_entry) {
2124
	types_add_name_and_type (&sid_current_type, non_local_entry,
2125
				 NIL (EntryP), FALSE);
2126
	if (nstring_length (&scope) > nstring_length (&sid_maximum_scope)) {
2127
	    nstring_destroy (&sid_maximum_scope);
2128
	    nstring_assign (&sid_maximum_scope, &scope);
2129
	} else {
2130
	    nstring_destroy (&scope);
2131
	}
2132
	nstring_destroy (&(ZI151));
2133
    } else {
2134
	types_add_name (&sid_current_type, sid_current_table, &(ZI151), FALSE);
2135
    }
2136
	    }
2137
	}
2138
	break;
2139
      case 24:
2140
	{
2141
	    ADVANCE_LEXER;
2142
	    {
2143
		{
2144
		    NStringT ZI151;
2145
 
2146
		    switch (CURRENT_TERMINAL) {
2147
		      case 4:
2148
			{
2149
 
2150
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
2151
			}
2152
			break;
2153
		      default:
2154
			goto ZL3;
2155
		    }
2156
		    ADVANCE_LEXER;
2157
		    {
2158
 
2159
    NStringT scope;
2160
    EntryP   non_local_entry = scope_stack_get_non_local (&sid_scope_stack,
2161
							  sid_current_table,
2162
							  (&ZI151), &scope);
2163
    EntryP   name_entry      = table_get_entry (sid_current_table, (&ZI151));
2164
 
2165
    if (name_entry) {
2166
	if ((sid_current_entry) && (sid_current_alt)) {
2167
	    if ((!types_contains (alt_names (sid_current_alt), name_entry)) &&
2168
		(!types_contains (rule_param (sid_current.rule),
2169
				  name_entry))) {
2170
		name_entry = NIL (EntryP);
2171
	    }
2172
	} else {
2173
	    name_entry = NIL (EntryP);
2174
	}
2175
    }
2176
    if (name_entry) {
2177
	types_add_name_and_type (&sid_current_type, name_entry, NIL (EntryP),
2178
				 TRUE);
2179
	if (non_local_entry) {
2180
	    nstring_destroy (&scope);
2181
	}
2182
	nstring_destroy (&(ZI151));
2183
    } else if (non_local_entry) {
2184
	types_add_name_and_type (&sid_current_type, non_local_entry,
2185
				 NIL (EntryP), TRUE);
2186
	if (nstring_length (&scope) > nstring_length (&sid_maximum_scope)) {
2187
	    nstring_destroy (&sid_maximum_scope);
2188
	    nstring_assign (&sid_maximum_scope, &scope);
2189
	} else {
2190
	    nstring_destroy (&scope);
2191
	}
2192
	nstring_destroy (&(ZI151));
2193
    } else {
2194
	types_add_name (&sid_current_type, sid_current_table, &(ZI151), TRUE);
2195
    }
2196
		    }
2197
		}
2198
		goto ZL2;
2199
	      ZL3:;
2200
		{
2201
		    {
2202
 
2203
    if (!sid_propagating_error) {
2204
	E_expected_identifier ();
2205
    }
2206
		    }
2207
		    {
2208
 
2209
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
2210
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
2211
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
2212
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
2213
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2214
	    nstring_destroy (lexer_string_value (sid_current_stream));
2215
	}
2216
	ADVANCE_LEXER;
2217
    }
2218
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2219
	nstring_destroy (lexer_string_value (sid_current_stream));
2220
    }
2221
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
2222
	ADVANCE_LEXER;
2223
    }
2224
    sid_propagating_error = TRUE;
2225
		    }
2226
		}
2227
	      ZL2:;
2228
	    }
2229
	}
2230
	break;
2231
      case 26:
2232
	return;
2233
      default:
2234
	goto ZL1;
2235
    }
2236
    return;
2237
  ZL1:;
2238
    {
2239
	{
2240
 
2241
    if (!sid_propagating_error) {
2242
	E_expected_rhs_name ();
2243
    }
2244
	}
2245
	{
2246
 
2247
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
2248
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
2249
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
2250
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
2251
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2252
	    nstring_destroy (lexer_string_value (sid_current_stream));
2253
	}
2254
	ADVANCE_LEXER;
2255
    }
2256
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2257
	nstring_destroy (lexer_string_value (sid_current_stream));
2258
    }
2259
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
2260
	ADVANCE_LEXER;
2261
    }
2262
    sid_propagating_error = TRUE;
2263
	}
2264
    }
2265
}
2266
 
2267
static void
6 7u83 2268
ZR199(void)
2 7u83 2269
{
2270
    switch (CURRENT_TERMINAL) {
2271
      case 10:
2272
	{
2273
	    ADVANCE_LEXER;
6 7u83 2274
	    ZR217 ();
2 7u83 2275
	    if ((CURRENT_TERMINAL) == 26) {
2276
		RESTORE_LEXER;
2277
		goto ZL1;
2278
	    }
2279
	}
2280
	break;
2281
      case 4:
2282
	{
2283
	    NStringT ZI151;
2284
 
2285
	    {
2286
 
2287
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
2288
	    }
2289
	    ADVANCE_LEXER;
2290
	    {
2291
		switch (CURRENT_TERMINAL) {
2292
		  case 6:
2293
		    {
2294
			ZR175 ();
2295
			if ((CURRENT_TERMINAL) == 26) {
2296
			    RESTORE_LEXER;
2297
			    goto ZL3;
2298
			}
2299
			{
2300
 
2301
    TypeTupleP param  = NIL (TypeTupleP);
2302
    TypeTupleP result = NIL (TypeTupleP);
2303
    EntryP     entry  = NIL (EntryP);
2304
    RuleP      rule;
2305
    BasicP     basic;
2306
 
2307
    if ((sid_current_entry) && (sid_current_alt)) {
2308
	entry = scope_stack_get_rule (&sid_scope_stack, sid_current_table,
2309
				      (&ZI151));
2310
	if (entry) {
2311
	    sid_current_item = item_create (entry);
2312
	    rule             = entry_get_rule (entry);
2313
	    param            = rule_param (rule);
2314
	    result           = rule_result (rule);
2315
	} else {
2316
	    entry = table_get_basic (sid_current_table, (&ZI151));
2317
	    if (entry) {
2318
		sid_current_item = item_create (entry);
2319
		basic            = entry_get_basic (entry);
2320
		param            = NIL (TypeTupleP);
2321
		result           = basic_result (basic);
2322
		if (basic_get_ignored (basic)) {
2323
		    E_ignored_basic_call ((&ZI151));
2324
		}
2325
	    } else {
2326
		E_unknown_rule_or_basic ((&ZI151));
2327
		sid_current_item = NIL (ItemP);
2328
	    }
2329
	}
2330
    } else {
2331
	sid_current_item = NIL (ItemP);
2332
    }
2333
    nstring_destroy (&(ZI151));
2334
    if (sid_current_item) {
2335
	BoolT errored = FALSE;
2336
	KeyP  key     = entry_key (entry);
2337
 
2338
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
2339
			   alt_names (sid_current_alt), E_undefined_name,
2340
			   entry_key (sid_external_rule), sid_alternative)) {
2341
	    if (param) {
2342
		if (types_equal (&sid_current_type, param)) {
2343
		    item_add_param (sid_current_item, &sid_current_type);
2344
		} else {
2345
		    E_rule_param_call_mismatch (key, param, &sid_current_type);
2346
		    types_destroy (&sid_current_type);
2347
		    errored = TRUE;
2348
		}
2349
	    } else {
2350
		if (!types_equal_zero_tuple (&sid_current_type)) {
2351
		    E_basic_param_call_mismatch (key, &sid_current_type);
2352
		    types_destroy (&sid_current_type);
2353
		    errored = TRUE;
2354
		}
2355
	    }
2356
	} else {
2357
	    types_destroy (&sid_current_type);
2358
	    errored = TRUE;
2359
	}
2360
	if (types_disjoint_names (&sid_saved_type)) {
2361
	    if (types_check_undefined (&sid_saved_type,
2362
				       rule_param (sid_current.rule),
2363
				       alt_names (sid_current_alt),
2364
				       E_redefined_name,
2365
				       entry_key (sid_external_rule),
2366
				       sid_alternative)) {
2367
		if (types_fillin_types (&sid_saved_type, result)) {
2368
		    types_add_new_names (alt_names (sid_current_alt),
2369
					 &sid_saved_type, sid_unique_pred_id);
2370
		    if (sid_saved_pred_id) {
2371
			E_predicate ();
2372
		    }
2373
		    item_add_result (sid_current_item, &sid_saved_type);
2374
		} else {
2375
		    if (param) {
2376
			E_rule_result_call_mismatch (key, result,
2377
						     &sid_saved_type);
2378
		    } else {
2379
			E_basic_result_call_mismatch (key, result,
2380
						      &sid_saved_type);
2381
		    }
2382
		    types_destroy (&sid_saved_type);
2383
		    errored = TRUE;
2384
		}
2385
	    } else {
2386
		types_destroy (&sid_saved_type);
2387
		errored = TRUE;
2388
	    }
2389
	} else {
2390
	    if (param) {
2391
		E_rule_result_call_clash (key, &sid_saved_type);
2392
	    } else {
2393
		E_basic_result_call_clash (key, &sid_saved_type);
2394
	    }
2395
	    types_destroy (&sid_saved_type);
2396
	    errored = TRUE;
2397
	}
2398
	if (errored) {
2399
	    (void) item_deallocate (sid_current_item);
2400
	    sid_current_item = NIL (ItemP);
2401
	    (void) alt_deallocate (sid_current_alt);
2402
	    sid_current_alt  = NIL (AltP);
2403
	} else {
2404
	    alt_add_item (sid_current_alt, sid_current_item);
2405
	}
2406
    } else {
2407
	if (sid_current_alt) {
2408
	    (void) alt_deallocate (sid_current_alt);
2409
	    sid_current_alt = NIL (AltP);
2410
	}
2411
	types_destroy (&sid_saved_type);
2412
	types_destroy (&sid_current_type);
2413
    }
2414
			}
6 7u83 2415
			ZR252 ();
2 7u83 2416
			if ((CURRENT_TERMINAL) == 26) {
2417
			    RESTORE_LEXER;
2418
			    goto ZL3;
2419
			}
2420
		    }
2421
		    break;
2422
		  case 9:
2423
		    {
2424
			{
2425
 
2426
    types_init (&sid_current_type);
2427
    sid_current_pred_id = NIL (EntryP);
2428
			}
2429
			{
2430
 
2431
    EntryP     name_entry = table_get_entry (sid_current_table, (&ZI151));
2432
    EntryP     entry      = NIL (EntryP);
2433
    TypeTupleP param      = NIL (TypeTupleP);
2434
    TypeTupleP result     = NIL (TypeTupleP);
2435
    RuleP      rule;
2436
    BasicP     basic;
2437
 
2438
    if ((sid_current_entry) && (sid_current_alt)) {
2439
	if ((name_entry != NIL (EntryP)) &&
2440
	    (!types_contains (alt_names (sid_current_alt), name_entry)) &&
2441
	    (!types_contains (rule_param (sid_current.rule), name_entry))) {
2442
	    name_entry = NIL (EntryP);
2443
	}
2444
	entry = scope_stack_get_rule (&sid_scope_stack, sid_current_table,
2445
				      (&ZI151));
2446
	if (entry) {
2447
	    sid_current_item = item_create (entry);
2448
	    rule             = entry_get_rule (entry);
2449
	    param            = rule_param (rule);
2450
	    result           = rule_result (rule);
2451
	} else {
2452
	    entry = table_get_basic (sid_current_table, (&ZI151));
2453
	    if (entry) {
2454
		sid_current_item = item_create (entry);
2455
		basic            = entry_get_basic (entry);
2456
		param            = NIL (TypeTupleP);
2457
		result           = basic_result (basic);
2458
		if ((name_entry == NIL (EntryP)) &&
2459
		    basic_get_ignored (basic)) {
2460
		    E_ignored_basic_call ((&ZI151));
2461
		}
2462
	    }
2463
	}
2464
	if ((entry == NIL (EntryP)) && (name_entry == NIL (EntryP))) {
2465
	    NStringT scope;
2466
 
2467
	    name_entry = scope_stack_get_non_local (&sid_scope_stack,
2468
						    sid_current_table,
2469
						    (&ZI151), &scope);
2470
	    if (name_entry) {
2471
		if (nstring_length (&scope) >
2472
		    nstring_length (&sid_maximum_scope)) {
2473
		    nstring_destroy (&sid_maximum_scope);
2474
		    nstring_assign (&sid_maximum_scope, &scope);
2475
		} else {
2476
		    nstring_destroy (&scope);
2477
		}
2478
	    } else {
2479
		E_unknown_rule_or_basic ((&ZI151));
2480
	    }
2481
	} else if ((entry != NIL (EntryP)) && (name_entry != NIL (EntryP))) {
2482
	    E_ambiguous_call ((&ZI151));
2483
	    entry      = NIL (EntryP);
2484
	    name_entry = NIL (EntryP);
2485
	}
2486
    } else {
2487
	name_entry = NIL (EntryP);
2488
    }
2489
    nstring_destroy (&(ZI151));
2490
    if (entry) {
2491
	BoolT errored = FALSE;
2492
	KeyP  key     = entry_key (entry);
2493
 
2494
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
2495
			   alt_names (sid_current_alt), E_undefined_name,
2496
			   entry_key (sid_external_rule), sid_alternative)) {
2497
	    if (param) {
2498
		if (types_equal (&sid_current_type, param)) {
2499
		    item_add_param (sid_current_item, &sid_current_type);
2500
		} else {
2501
		    E_rule_param_call_mismatch (key, param, &sid_current_type);
2502
		    types_destroy (&sid_current_type);
2503
		    errored = TRUE;
2504
		}
2505
	    } else {
2506
		if (!types_equal_zero_tuple (&sid_current_type)) {
2507
		    E_basic_param_call_mismatch (key, &sid_current_type);
2508
		    types_destroy (&sid_current_type);
2509
		    errored = TRUE;
2510
		}
2511
	    }
2512
	} else {
2513
	    types_destroy (&sid_current_type);
2514
	    errored = TRUE;
2515
	}
2516
	if (types_disjoint_names (&sid_saved_type)) {
2517
	    if (types_check_undefined (&sid_saved_type,
2518
				       rule_param (sid_current.rule),
2519
				       alt_names (sid_current_alt),
2520
				       E_redefined_name,
2521
				       entry_key (sid_external_rule),
2522
				       sid_alternative)) {
2523
		if (types_fillin_types (&sid_saved_type, result)) {
2524
		    types_add_new_names (alt_names (sid_current_alt),
2525
					 &sid_saved_type, sid_unique_pred_id);
2526
		    if (sid_saved_pred_id) {
2527
			E_predicate ();
2528
		    }
2529
		    item_add_result (sid_current_item, &sid_saved_type);
2530
		} else {
2531
		    if (param) {
2532
			E_rule_result_call_mismatch (key, result,
2533
						     &sid_saved_type);
2534
		    } else {
2535
			E_basic_result_call_mismatch (key, result,
2536
						      &sid_saved_type);
2537
		    }
2538
		    types_destroy (&sid_saved_type);
2539
		    errored = TRUE;
2540
		}
2541
	    } else {
2542
		types_destroy (&sid_saved_type);
2543
		errored = TRUE;
2544
	    }
2545
	} else {
2546
	    if (param) {
2547
		E_rule_result_call_clash (key, &sid_saved_type);
2548
	    } else {
2549
		E_basic_result_call_clash (key, &sid_saved_type);
2550
	    }
2551
	    types_destroy (&sid_saved_type);
2552
	    errored = TRUE;
2553
	}
2554
	if (errored) {
2555
	    (void) item_deallocate (sid_current_item);
2556
	    sid_current_item = NIL (ItemP);
2557
	    (void) alt_deallocate (sid_current_alt);
2558
	    sid_current_alt  = NIL (AltP);
2559
	} else {
2560
	    alt_add_item (sid_current_alt, sid_current_item);
2561
	}
2562
    } else if (name_entry) {
2563
	types_add_name_entry (&sid_current_type, name_entry);
2564
	entry = table_add_rename (sid_current_table);
2565
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
2566
			   alt_names (sid_current_alt), E_undefined_name,
2567
			   entry_key (sid_external_rule), sid_alternative)) {
2568
	    if (types_contains_references (&sid_current_type)) {
2569
		E_identity_param_has_refs (&sid_current_type,
2570
					   entry_key (sid_external_rule),
2571
					   sid_alternative);
2572
		types_destroy (&sid_current_type);
2573
		sid_current_item = NIL (ItemP);
2574
	    } else {
2575
		sid_current_item = item_create (entry);
2576
		item_add_param (sid_current_item, &sid_current_type);
2577
	    }
2578
	} else {
2579
	    types_destroy (&sid_current_type);
2580
	    sid_current_item = NIL (ItemP);
2581
	}
2582
	if (types_disjoint_names (&sid_saved_type)) {
2583
	    if (types_check_undefined (&sid_saved_type,
2584
				       rule_param (sid_current.rule),
2585
				       alt_names (sid_current_alt),
2586
				       E_redefined_name,
2587
				       entry_key (sid_external_rule),
2588
				       sid_alternative)) {
2589
		if (sid_current_item) {
2590
		    if (types_fillin_types (&sid_saved_type,
2591
					    item_param (sid_current_item))) {
2592
			types_add_new_names (alt_names (sid_current_alt),
2593
					     &sid_saved_type,
2594
					     sid_unique_pred_id);
2595
			if (sid_saved_pred_id) {
2596
			    E_predicate ();
2597
			}
2598
			item_add_result (sid_current_item, &sid_saved_type);
2599
			alt_add_item (sid_current_alt, sid_current_item);
2600
		    } else {
2601
			E_identity_mismatch (item_param (sid_current_item),
2602
					     &sid_saved_type);
2603
			types_destroy (&sid_saved_type);
2604
			(void) item_deallocate (sid_current_item);
2605
			sid_current_item = NIL (ItemP);
2606
		    }
2607
		}
2608
	    } else {
2609
		types_destroy (&sid_saved_type);
2610
		if (sid_current_item) {
2611
		    (void) item_deallocate (sid_current_item);
2612
		    sid_current_item = NIL (ItemP);
2613
		}
2614
	    }
2615
	} else {
2616
	    E_identity_result_clash (&sid_saved_type);
2617
	    types_destroy (&sid_saved_type);
2618
	    if (sid_current_item) {
2619
		(void) item_deallocate (sid_current_item);
2620
		sid_current_item = NIL (ItemP);
2621
	    }
2622
	}
2623
	if (sid_current_item == NIL (ItemP)) {
2624
	    (void) alt_deallocate (sid_current_alt);
2625
	    sid_current_alt = NIL (AltP);
2626
	}
2627
    } else {
2628
	if (sid_current_alt) {
2629
	    (void) alt_deallocate (sid_current_alt);
2630
	    sid_current_alt = NIL (AltP);
2631
	}
2632
	types_destroy (&sid_saved_type);
2633
	types_destroy (&sid_current_type);
2634
    }
2635
			}
2636
			ADVANCE_LEXER;
2637
		    }
2638
		    break;
2639
		  default:
2640
		    goto ZL3;
2641
		}
2642
		goto ZL2;
2643
	      ZL3:;
2644
		{
2645
		    {
2646
 
2647
    if (!sid_propagating_error) {
2648
	E_expected_tuple_or_term ();
2649
    }
2650
		    }
2651
		    {
2652
 
2653
    nstring_destroy (&(ZI151));
2654
		    }
2655
		    {
2656
 
2657
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
2658
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
2659
	   (CURRENT_TERMINAL != LEXER_TOK_ALT_SEP) &&
2660
	   (CURRENT_TERMINAL != LEXER_TOK_HANDLER_SEP) &&
2661
	   (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
2662
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
2663
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
2664
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
2665
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
2666
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2667
	    nstring_destroy (lexer_string_value (sid_current_stream));
2668
	}
2669
	ADVANCE_LEXER;
2670
    }
2671
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2672
	nstring_destroy (lexer_string_value (sid_current_stream));
2673
    }
2674
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
2675
	ADVANCE_LEXER;
2676
    }
2677
    sid_propagating_error = TRUE;
2678
		    }
2679
		}
2680
	      ZL2:;
2681
	    }
2682
	}
2683
	break;
2684
      case 6:
2685
	{
2686
	    ZR175 ();
2687
	    if ((CURRENT_TERMINAL) == 26) {
2688
		RESTORE_LEXER;
2689
		goto ZL1;
2690
	    }
2691
	    {
2692
 
2693
    if ((sid_current_entry) && (sid_current_alt)) {
2694
	EntryP entry = table_add_rename (sid_current_table);
2695
 
2696
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
2697
			   alt_names (sid_current_alt), E_undefined_name,
2698
			   entry_key (sid_external_rule), sid_alternative)) {
2699
	    if (types_contains_references (&sid_current_type)) {
2700
		E_identity_param_has_refs (&sid_current_type,
2701
					   entry_key (sid_external_rule),
2702
					   sid_alternative);
2703
		types_destroy (&sid_current_type);
2704
		sid_current_item = NIL (ItemP);
2705
	    } else {
2706
		sid_current_item = item_create (entry);
2707
		item_add_param (sid_current_item, &sid_current_type);
2708
	    }
2709
	} else {
2710
	    types_destroy (&sid_current_type);
2711
	    sid_current_item = NIL (ItemP);
2712
	}
2713
	if (types_disjoint_names (&sid_saved_type)) {
2714
	    if (types_check_undefined (&sid_saved_type,
2715
				       rule_param (sid_current.rule),
2716
				       alt_names (sid_current_alt),
2717
				       E_redefined_name,
2718
				       entry_key (sid_external_rule),
2719
				       sid_alternative)) {
2720
		if (sid_current_item) {
2721
		    if (types_fillin_types (&sid_saved_type,
2722
					    item_param (sid_current_item))) {
2723
			types_add_new_names (alt_names (sid_current_alt),
2724
					     &sid_saved_type,
2725
					     sid_unique_pred_id);
2726
			if (sid_saved_pred_id) {
2727
			    E_predicate ();
2728
			}
2729
			item_add_result (sid_current_item, &sid_saved_type);
2730
			alt_add_item (sid_current_alt, sid_current_item);
2731
		    } else {
2732
			E_identity_mismatch (item_param (sid_current_item),
2733
					     &sid_saved_type);
2734
			types_destroy (&sid_saved_type);
2735
			(void) item_deallocate (sid_current_item);
2736
			sid_current_item = NIL (ItemP);
2737
		    }
2738
		}
2739
	    } else {
2740
		types_destroy (&sid_saved_type);
2741
		if (sid_current_item) {
2742
		    (void) item_deallocate (sid_current_item);
2743
		    sid_current_item = NIL (ItemP);
2744
		}
2745
	    }
2746
	} else {
2747
	    E_identity_result_clash (&sid_saved_type);
2748
	    types_destroy (&sid_saved_type);
2749
	    if (sid_current_item) {
2750
		(void) item_deallocate (sid_current_item);
2751
		sid_current_item = NIL (ItemP);
2752
	    }
2753
	}
2754
	if (sid_current_item == NIL (ItemP)) {
2755
	    (void) alt_deallocate (sid_current_alt);
2756
	    sid_current_alt = NIL (AltP);
2757
	}
2758
    } else {
2759
	types_destroy (&sid_saved_type);
2760
	types_destroy (&sid_current_type);
2761
    }
2762
	    }
6 7u83 2763
	    ZR252 ();
2 7u83 2764
	    if ((CURRENT_TERMINAL) == 26) {
2765
		RESTORE_LEXER;
2766
		goto ZL1;
2767
	    }
2768
	}
2769
	break;
2770
      case 24:
2771
	{
2772
	    {
2773
 
2774
    types_init (&sid_current_type);
2775
    sid_current_pred_id = NIL (EntryP);
2776
	    }
2777
	    ADVANCE_LEXER;
2778
	    {
2779
		{
2780
		    NStringT ZI151;
2781
 
2782
		    switch (CURRENT_TERMINAL) {
2783
		      case 4:
2784
			{
2785
 
2786
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
2787
			}
2788
			break;
2789
		      default:
2790
			goto ZL5;
2791
		    }
2792
		    ADVANCE_LEXER;
2793
		    {
2794
 
2795
    NStringT scope;
2796
    EntryP   non_local_entry = scope_stack_get_non_local (&sid_scope_stack,
2797
							  sid_current_table,
2798
							  (&ZI151), &scope);
2799
    EntryP   name_entry      = table_get_entry (sid_current_table, (&ZI151));
2800
 
2801
    if (name_entry) {
2802
	if ((sid_current_entry) && (sid_current_alt)) {
2803
	    if ((!types_contains (alt_names (sid_current_alt), name_entry)) &&
2804
		(!types_contains (rule_param (sid_current.rule),
2805
				  name_entry))) {
2806
		name_entry = NIL (EntryP);
2807
	    }
2808
	} else {
2809
	    name_entry = NIL (EntryP);
2810
	}
2811
    }
2812
    if (name_entry) {
2813
	types_add_name_and_type (&sid_current_type, name_entry, NIL (EntryP),
2814
				 TRUE);
2815
	if (non_local_entry) {
2816
	    nstring_destroy (&scope);
2817
	}
2818
	nstring_destroy (&(ZI151));
2819
    } else if (non_local_entry) {
2820
	types_add_name_and_type (&sid_current_type, non_local_entry,
2821
				 NIL (EntryP), TRUE);
2822
	if (nstring_length (&scope) > nstring_length (&sid_maximum_scope)) {
2823
	    nstring_destroy (&sid_maximum_scope);
2824
	    nstring_assign (&sid_maximum_scope, &scope);
2825
	} else {
2826
	    nstring_destroy (&scope);
2827
	}
2828
	nstring_destroy (&(ZI151));
2829
    } else {
2830
	types_add_name (&sid_current_type, sid_current_table, &(ZI151), TRUE);
2831
    }
2832
		    }
2833
		    {
2834
 
2835
    if ((sid_current_entry) && (sid_current_alt)) {
2836
	EntryP entry = table_add_rename (sid_current_table);
2837
 
2838
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
2839
			   alt_names (sid_current_alt), E_undefined_name,
2840
			   entry_key (sid_external_rule), sid_alternative)) {
2841
	    if (types_contains_references (&sid_current_type)) {
2842
		E_identity_param_has_refs (&sid_current_type,
2843
					   entry_key (sid_external_rule),
2844
					   sid_alternative);
2845
		types_destroy (&sid_current_type);
2846
		sid_current_item = NIL (ItemP);
2847
	    } else {
2848
		sid_current_item = item_create (entry);
2849
		item_add_param (sid_current_item, &sid_current_type);
2850
	    }
2851
	} else {
2852
	    types_destroy (&sid_current_type);
2853
	    sid_current_item = NIL (ItemP);
2854
	}
2855
	if (types_disjoint_names (&sid_saved_type)) {
2856
	    if (types_check_undefined (&sid_saved_type,
2857
				       rule_param (sid_current.rule),
2858
				       alt_names (sid_current_alt),
2859
				       E_redefined_name,
2860
				       entry_key (sid_external_rule),
2861
				       sid_alternative)) {
2862
		if (sid_current_item) {
2863
		    if (types_fillin_types (&sid_saved_type,
2864
					    item_param (sid_current_item))) {
2865
			types_add_new_names (alt_names (sid_current_alt),
2866
					     &sid_saved_type,
2867
					     sid_unique_pred_id);
2868
			if (sid_saved_pred_id) {
2869
			    E_predicate ();
2870
			}
2871
			item_add_result (sid_current_item, &sid_saved_type);
2872
			alt_add_item (sid_current_alt, sid_current_item);
2873
		    } else {
2874
			E_identity_mismatch (item_param (sid_current_item),
2875
					     &sid_saved_type);
2876
			types_destroy (&sid_saved_type);
2877
			(void) item_deallocate (sid_current_item);
2878
			sid_current_item = NIL (ItemP);
2879
		    }
2880
		}
2881
	    } else {
2882
		types_destroy (&sid_saved_type);
2883
		if (sid_current_item) {
2884
		    (void) item_deallocate (sid_current_item);
2885
		    sid_current_item = NIL (ItemP);
2886
		}
2887
	    }
2888
	} else {
2889
	    E_identity_result_clash (&sid_saved_type);
2890
	    types_destroy (&sid_saved_type);
2891
	    if (sid_current_item) {
2892
		(void) item_deallocate (sid_current_item);
2893
		sid_current_item = NIL (ItemP);
2894
	    }
2895
	}
2896
	if (sid_current_item == NIL (ItemP)) {
2897
	    (void) alt_deallocate (sid_current_alt);
2898
	    sid_current_alt = NIL (AltP);
2899
	}
2900
    } else {
2901
	types_destroy (&sid_saved_type);
2902
	types_destroy (&sid_current_type);
2903
    }
2904
		    }
6 7u83 2905
		    ZR252 ();
2906
		    if ((CURRENT_TERMINAL) == 26) {
2907
			RESTORE_LEXER;
2908
			goto ZL5;
2909
		    }
2 7u83 2910
		}
2911
		goto ZL4;
2912
	      ZL5:;
2913
		{
2914
		    {
2915
 
2916
    if (!sid_propagating_error) {
2917
	E_expected_identifier ();
2918
    }
2919
		    }
2920
		    {
2921
 
2922
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
2923
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
2924
	   (CURRENT_TERMINAL != LEXER_TOK_ALT_SEP) &&
2925
	   (CURRENT_TERMINAL != LEXER_TOK_HANDLER_SEP) &&
2926
	   (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
2927
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
2928
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
2929
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
2930
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
2931
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2932
	    nstring_destroy (lexer_string_value (sid_current_stream));
2933
	}
2934
	ADVANCE_LEXER;
2935
    }
2936
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2937
	nstring_destroy (lexer_string_value (sid_current_stream));
2938
    }
2939
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
2940
	ADVANCE_LEXER;
2941
    }
2942
    sid_propagating_error = TRUE;
2943
		    }
2944
		}
2945
	      ZL4:;
2946
	    }
2947
	}
2948
	break;
2949
      case 26:
2950
	return;
2951
      default:
2952
	goto ZL1;
2953
    }
2954
    return;
2955
  ZL1:;
2956
    {
2957
	{
2958
 
2959
    if (!sid_propagating_error) {
2960
	E_expected_item_rhs ();
2961
    }
2962
	}
2963
	{
2964
 
2965
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
2966
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
2967
	   (CURRENT_TERMINAL != LEXER_TOK_ALT_SEP) &&
2968
	   (CURRENT_TERMINAL != LEXER_TOK_HANDLER_SEP) &&
2969
	   (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
2970
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
2971
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
2972
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
2973
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
2974
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2975
	    nstring_destroy (lexer_string_value (sid_current_stream));
2976
	}
2977
	ADVANCE_LEXER;
2978
    }
2979
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
2980
	nstring_destroy (lexer_string_value (sid_current_stream));
2981
    }
2982
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
2983
	ADVANCE_LEXER;
2984
    }
2985
    sid_propagating_error = TRUE;
2986
	}
2987
    }
2988
}
2989
 
2990
static void
6 7u83 2991
ZR219(void)
2 7u83 2992
{
2993
    if ((CURRENT_TERMINAL) == 26) {
2994
	return;
2995
    }
2996
    {
6 7u83 2997
	ZR235 ();
2 7u83 2998
	{
2999
	    switch (CURRENT_TERMINAL) {
3000
	      case 16:
3001
		{
3002
		    ADVANCE_LEXER;
6 7u83 3003
		    ZR230 ();
2 7u83 3004
		    if ((CURRENT_TERMINAL) == 26) {
3005
			RESTORE_LEXER;
3006
			goto ZL1;
3007
		    }
3008
		}
3009
		break;
3010
	      case 26:
3011
		RESTORE_LEXER;
3012
		goto ZL1;
3013
	      default:
3014
		break;
3015
	    }
3016
	}
3017
    }
3018
    return;
3019
  ZL1:;
3020
    SAVE_LEXER (26);
3021
    return;
3022
}
3023
 
3024
static void
6 7u83 3025
ZR153(void)
2 7u83 3026
{
3027
    if ((CURRENT_TERMINAL) == 26) {
3028
	return;
3029
    }
3030
  ZL2_153:;
3031
    {
3032
	ZR155 ();
3033
	if ((CURRENT_TERMINAL) == 26) {
3034
	    RESTORE_LEXER;
3035
	    goto ZL1;
3036
	}
3037
	{
3038
 
3039
    sid_propagating_error = FALSE;
3040
	}
3041
	{
3042
	    switch (CURRENT_TERMINAL) {
3043
	      case 4: case 19:
3044
		{
3045
		    goto ZL2_153;
3046
		}
3047
		/*UNREACHED*/
3048
	      default:
3049
		break;
3050
	    }
3051
	}
3052
    }
3053
    return;
3054
  ZL1:;
3055
    SAVE_LEXER (26);
3056
    return;
3057
}
3058
 
3059
static void
6 7u83 3060
ZR196(void)
2 7u83 3061
{
3062
    switch (CURRENT_TERMINAL) {
3063
      case 6:
3064
	{
3065
	    ZR175 ();
3066
	    if ((CURRENT_TERMINAL) == 26) {
3067
		RESTORE_LEXER;
3068
		goto ZL1;
3069
	    }
3070
	    {
3071
 
3072
    if (sid_current_item) {
3073
	BoolT   errored = FALSE;
3074
	EntryP  entry   = item_entry (sid_current_item);
3075
	ActionP action  = entry_get_action (entry);
3076
 
3077
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
3078
			   alt_names (sid_current_alt), E_undefined_name,
3079
			   entry_key (sid_external_rule), sid_alternative)) {
3080
	    if (types_equal (&sid_current_type, action_param (action))) {
3081
		item_add_param (sid_current_item, &sid_current_type);
3082
	    } else {
3083
		E_action_param_call_mismatch (entry_key (entry),
3084
					      action_param (action),
3085
					      &sid_current_type);
3086
		types_destroy (&sid_current_type);
3087
		errored = TRUE;
3088
	    }
3089
	} else {
3090
	    types_destroy (&sid_current_type);
3091
	    errored = TRUE;
3092
	}
3093
	if (types_disjoint_names (&sid_saved_type)) {
3094
	    if (types_check_undefined (&sid_saved_type,
3095
				       rule_param (sid_current.rule),
3096
				       alt_names (sid_current_alt),
3097
				       E_redefined_name,
3098
				       entry_key (sid_external_rule),
3099
				       sid_alternative)) {
3100
		if (types_fillin_types (&sid_saved_type,
3101
					action_result (action))) {
3102
		    types_add_new_names (alt_names (sid_current_alt),
3103
					 &sid_saved_type, sid_unique_pred_id);
3104
		    if (sid_saved_pred_id) {
3105
			BoolT  reference;
3106
			EntryP type = types_find_name_type (&sid_saved_type,
3107
							    sid_saved_pred_id,
3108
							    &reference);
3109
 
3110
			ASSERT ((type != NIL (EntryP)) && (!reference));
3111
			if (sid_predicate_type) {
3112
			    if (type != sid_predicate_type) {
3113
				E_predicate_type (sid_predicate_type, type);
3114
			    }
3115
			} else {
3116
			    grammar_set_predicate_type (sid_current_grammar,
3117
							type);
3118
			    sid_predicate_type = type;
3119
			}
3120
			item_to_predicate (sid_current_item);
3121
		    }
3122
		    item_add_result (sid_current_item, &sid_saved_type);
3123
		} else {
3124
		    E_action_result_call_mismatch (entry_key (entry),
3125
						   action_result (action),
3126
						   &sid_saved_type);
3127
		    types_destroy (&sid_saved_type);
3128
		    errored = TRUE;
3129
		}
3130
	    } else {
3131
		types_destroy (&sid_saved_type);
3132
		errored = TRUE;
3133
	    }
3134
	} else {
3135
	    E_action_result_call_clash (entry_key (entry), &sid_saved_type);
3136
	    types_destroy (&sid_saved_type);
3137
	    errored = TRUE;
3138
	}
3139
	if (errored) {
3140
	    (void) item_deallocate (sid_current_item);
3141
	    sid_current_item = NIL (ItemP);
3142
	    (void) alt_deallocate (sid_current_alt);
3143
	    sid_current_alt  = NIL (AltP);
3144
	} else {
3145
	    alt_add_item (sid_current_alt, sid_current_item);
3146
	}
3147
    } else {
3148
	types_destroy (&sid_saved_type);
3149
	types_destroy (&sid_current_type);
3150
    }
3151
	    }
6 7u83 3152
	    ZR252 ();
2 7u83 3153
	    if ((CURRENT_TERMINAL) == 26) {
3154
		RESTORE_LEXER;
3155
		goto ZL1;
3156
	    }
3157
	}
3158
	break;
3159
      case 9:
3160
	{
3161
	    {
3162
 
3163
    types_init (&sid_current_type);
3164
    sid_current_pred_id = NIL (EntryP);
3165
	    }
3166
	    {
3167
 
3168
    if (sid_current_item) {
3169
	BoolT   errored = FALSE;
3170
	EntryP  entry   = item_entry (sid_current_item);
3171
	ActionP action  = entry_get_action (entry);
3172
 
3173
	if (types_resolve (&sid_current_type, rule_param (sid_current.rule),
3174
			   alt_names (sid_current_alt), E_undefined_name,
3175
			   entry_key (sid_external_rule), sid_alternative)) {
3176
	    if (types_equal (&sid_current_type, action_param (action))) {
3177
		item_add_param (sid_current_item, &sid_current_type);
3178
	    } else {
3179
		E_action_param_call_mismatch (entry_key (entry),
3180
					      action_param (action),
3181
					      &sid_current_type);
3182
		types_destroy (&sid_current_type);
3183
		errored = TRUE;
3184
	    }
3185
	} else {
3186
	    types_destroy (&sid_current_type);
3187
	    errored = TRUE;
3188
	}
3189
	if (types_disjoint_names (&sid_saved_type)) {
3190
	    if (types_check_undefined (&sid_saved_type,
3191
				       rule_param (sid_current.rule),
3192
				       alt_names (sid_current_alt),
3193
				       E_redefined_name,
3194
				       entry_key (sid_external_rule),
3195
				       sid_alternative)) {
3196
		if (types_fillin_types (&sid_saved_type,
3197
					action_result (action))) {
3198
		    types_add_new_names (alt_names (sid_current_alt),
3199
					 &sid_saved_type, sid_unique_pred_id);
3200
		    if (sid_saved_pred_id) {
3201
			BoolT  reference;
3202
			EntryP type = types_find_name_type (&sid_saved_type,
3203
							    sid_saved_pred_id,
3204
							    &reference);
3205
 
3206
			ASSERT ((type != NIL (EntryP)) && (!reference));
3207
			if (sid_predicate_type) {
3208
			    if (type != sid_predicate_type) {
3209
				E_predicate_type (sid_predicate_type, type);
3210
			    }
3211
			} else {
3212
			    grammar_set_predicate_type (sid_current_grammar,
3213
							type);
3214
			    sid_predicate_type = type;
3215
			}
3216
			item_to_predicate (sid_current_item);
3217
		    }
3218
		    item_add_result (sid_current_item, &sid_saved_type);
3219
		} else {
3220
		    E_action_result_call_mismatch (entry_key (entry),
3221
						   action_result (action),
3222
						   &sid_saved_type);
3223
		    types_destroy (&sid_saved_type);
3224
		    errored = TRUE;
3225
		}
3226
	    } else {
3227
		types_destroy (&sid_saved_type);
3228
		errored = TRUE;
3229
	    }
3230
	} else {
3231
	    E_action_result_call_clash (entry_key (entry), &sid_saved_type);
3232
	    types_destroy (&sid_saved_type);
3233
	    errored = TRUE;
3234
	}
3235
	if (errored) {
3236
	    (void) item_deallocate (sid_current_item);
3237
	    sid_current_item = NIL (ItemP);
3238
	    (void) alt_deallocate (sid_current_alt);
3239
	    sid_current_alt  = NIL (AltP);
3240
	} else {
3241
	    alt_add_item (sid_current_alt, sid_current_item);
3242
	}
3243
    } else {
3244
	types_destroy (&sid_saved_type);
3245
	types_destroy (&sid_current_type);
3246
    }
3247
	    }
3248
	    ADVANCE_LEXER;
3249
	}
3250
	break;
3251
      case 26:
3252
	return;
3253
      default:
3254
	goto ZL1;
3255
    }
3256
    return;
3257
  ZL1:;
3258
    {
3259
	{
3260
 
3261
    if (!sid_propagating_error) {
3262
	E_expected_tuple_or_term ();
3263
    }
3264
	}
3265
	{
3266
 
3267
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3268
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3269
	   (CURRENT_TERMINAL != LEXER_TOK_ALT_SEP) &&
3270
	   (CURRENT_TERMINAL != LEXER_TOK_HANDLER_SEP) &&
3271
	   (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
3272
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
3273
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
3274
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
3275
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
3276
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3277
	    nstring_destroy (lexer_string_value (sid_current_stream));
3278
	}
3279
	ADVANCE_LEXER;
3280
    }
3281
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3282
	nstring_destroy (lexer_string_value (sid_current_stream));
3283
    }
3284
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3285
	ADVANCE_LEXER;
3286
    }
3287
    sid_propagating_error = TRUE;
3288
	}
3289
    }
3290
}
3291
 
3292
static void
6 7u83 3293
ZR185(void)
2 7u83 3294
{
3295
    if ((CURRENT_TERMINAL) == 26) {
3296
	return;
3297
    }
3298
    {
3299
	switch (CURRENT_TERMINAL) {
3300
	  case 6:
3301
	    break;
3302
	  default:
3303
	    goto ZL1;
3304
	}
3305
	ADVANCE_LEXER;
3306
    }
3307
    return;
3308
  ZL1:;
3309
    {
3310
	{
3311
 
3312
    if (!sid_propagating_error) {
3313
	E_expected_open_tuple ();
3314
    }
3315
	}
3316
    }
3317
}
3318
 
3319
static void
6 7u83 3320
ZR253(void)
2 7u83 3321
{
3322
    if ((CURRENT_TERMINAL) == 26) {
3323
	return;
3324
    }
3325
    {
3326
	{
3327
	    switch (CURRENT_TERMINAL) {
3328
	      case 20:
3329
		{
3330
		    ADVANCE_LEXER;
3331
		    {
3332
 
3333
    sid_current_scope = &sid_global_scope;
3334
		    }
3335
		}
3336
		break;
3337
	      default:
3338
		{
3339
		    {
3340
 
3341
    sid_current_scope = &sid_scope_stack;
3342
		    }
3343
		}
3344
		break;
3345
	    }
3346
	}
3347
	{
3348
	    switch (CURRENT_TERMINAL) {
3349
	      case 10:
3350
		{
3351
		    ZR187 ();
3352
		    if ((CURRENT_TERMINAL) == 26) {
3353
			RESTORE_LEXER;
3354
			goto ZL1;
3355
		    }
3356
		}
3357
		break;
3358
	      case 4:
3359
		{
6 7u83 3360
		    ZR239 ();
2 7u83 3361
		    if ((CURRENT_TERMINAL) == 26) {
3362
			RESTORE_LEXER;
3363
			goto ZL1;
3364
		    }
3365
		}
3366
		break;
3367
	      default:
3368
		goto ZL1;
3369
	    }
3370
	}
3371
    }
3372
    return;
3373
  ZL1:;
3374
    SAVE_LEXER (26);
3375
    return;
3376
}
3377
 
3378
static void
6 7u83 3379
ZR186(void)
2 7u83 3380
{
3381
    if ((CURRENT_TERMINAL) == 26) {
3382
	return;
3383
    }
3384
    {
3385
	switch (CURRENT_TERMINAL) {
3386
	  case 7:
3387
	    break;
3388
	  default:
3389
	    goto ZL1;
3390
	}
3391
	ADVANCE_LEXER;
3392
    }
3393
    return;
3394
  ZL1:;
3395
    {
3396
	{
3397
 
3398
    if (!sid_propagating_error) {
3399
	E_expected_close_tuple ();
3400
    }
3401
	}
3402
    }
3403
}
3404
 
3405
static void
6 7u83 3406
ZR128(void)
2 7u83 3407
{
3408
    switch (CURRENT_TERMINAL) {
3409
      case 4:
3410
	{
3411
	    NStringT ZI130;
3412
 
3413
	    {
3414
 
3415
    nstring_assign (&ZI130, lexer_string_value (sid_current_stream));
3416
	    }
3417
	    ADVANCE_LEXER;
3418
	    {
3419
		{
3420
		    switch (CURRENT_TERMINAL) {
3421
		      case 5:
3422
			break;
3423
		      default:
3424
			goto ZL3;
3425
		    }
3426
		    ADVANCE_LEXER;
3427
		}
3428
		goto ZL2;
3429
	      ZL3:;
3430
		{
3431
		    {
3432
 
3433
    if (!sid_propagating_error) {
3434
	E_expected_typemark ();
3435
    }
3436
		    }
3437
		}
3438
	      ZL2:;
3439
	    }
3440
	    {
3441
		{
3442
		    NStringT ZI133;
3443
 
3444
		    switch (CURRENT_TERMINAL) {
3445
		      case 4:
3446
			{
3447
 
3448
    nstring_assign (&ZI133, lexer_string_value (sid_current_stream));
3449
			}
3450
			break;
3451
		      default:
3452
			goto ZL5;
3453
		    }
3454
		    ADVANCE_LEXER;
3455
		    {
3456
			switch (CURRENT_TERMINAL) {
3457
			  case 24:
3458
			    {
3459
				ADVANCE_LEXER;
3460
				{
3461
 
3462
    if (!types_add_typed_name (&sid_current_type, sid_current_table, &(ZI130),
3463
			       (&ZI133), TRUE)) {
3464
	E_unknown_type ((&ZI133));
3465
    }
3466
    nstring_destroy (&(ZI133));
3467
				}
3468
			    }
3469
			    break;
3470
			  default:
3471
			    {
3472
				{
3473
 
3474
    if (!types_add_typed_name (&sid_current_type, sid_current_table, &(ZI130),
3475
			       (&ZI133), FALSE)) {
3476
	E_unknown_type ((&ZI133));
3477
    }
3478
    nstring_destroy (&(ZI133));
3479
				}
3480
			    }
3481
			    break;
3482
			}
3483
		    }
3484
		}
3485
		goto ZL4;
3486
	      ZL5:;
3487
		{
3488
		    {
3489
 
3490
    if (!sid_propagating_error) {
3491
	E_expected_identifier ();
3492
    }
3493
		    }
3494
		    {
3495
 
3496
    nstring_destroy (&(ZI130));
3497
		    }
3498
		    {
3499
 
3500
    if (sid_finished_terminals) {
3501
	while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3502
	       (CURRENT_TERMINAL != LEXER_TOK_DEFINE) &&
3503
	       (CURRENT_TERMINAL != LEXER_TOK_BEGIN_SCOPE) &&
3504
	       (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
3505
	       (CURRENT_TERMINAL != LEXER_TOK_SEPARATOR) &&
3506
	       (CURRENT_TERMINAL != LEXER_TOK_CLOSE_TUPLE) &&
3507
	       (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3508
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
3509
	    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3510
		nstring_destroy (lexer_string_value (sid_current_stream));
3511
	    }
3512
	    ADVANCE_LEXER;
3513
	}
3514
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3515
	    nstring_destroy (lexer_string_value (sid_current_stream));
3516
	}
3517
	if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3518
	    ADVANCE_LEXER;
3519
	}
3520
    } else {
3521
	while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3522
	       (CURRENT_TERMINAL != LEXER_TOK_SEPARATOR) &&
3523
	       (CURRENT_TERMINAL != LEXER_TOK_CLOSE_TUPLE) &&
3524
	       (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3525
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
3526
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
3527
	    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3528
		nstring_destroy (lexer_string_value (sid_current_stream));
3529
	    }
3530
	    ADVANCE_LEXER;
3531
	}
3532
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3533
	    nstring_destroy (lexer_string_value (sid_current_stream));
3534
	}
3535
	if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3536
	    ADVANCE_LEXER;
3537
	}
3538
    }
3539
    sid_propagating_error = TRUE;
3540
		    }
3541
		}
3542
	      ZL4:;
3543
	    }
3544
	}
3545
	break;
3546
      case 5:
3547
	{
3548
	    ADVANCE_LEXER;
3549
	    {
3550
		{
3551
		    NStringT ZI133;
3552
 
3553
		    switch (CURRENT_TERMINAL) {
3554
		      case 4:
3555
			{
3556
 
3557
    nstring_assign (&ZI133, lexer_string_value (sid_current_stream));
3558
			}
3559
			break;
3560
		      default:
3561
			goto ZL8;
3562
		    }
3563
		    ADVANCE_LEXER;
3564
		    {
3565
			switch (CURRENT_TERMINAL) {
3566
			  case 24:
3567
			    {
3568
				ADVANCE_LEXER;
3569
				{
3570
 
3571
    if (!types_add_type (&sid_current_type, sid_current_table, (&ZI133), TRUE)) {
3572
	E_unknown_type ((&ZI133));
3573
    }
3574
    nstring_destroy (&(ZI133));
3575
				}
3576
			    }
3577
			    break;
3578
			  default:
3579
			    {
3580
				{
3581
 
3582
    if (!types_add_type (&sid_current_type, sid_current_table, (&ZI133),
3583
			 FALSE)) {
3584
	E_unknown_type ((&ZI133));
3585
    }
3586
    nstring_destroy (&(ZI133));
3587
				}
3588
			    }
3589
			    break;
3590
			}
3591
		    }
3592
		}
3593
		goto ZL7;
3594
	      ZL8:;
3595
		{
3596
		    {
3597
 
3598
    if (!sid_propagating_error) {
3599
	E_expected_identifier ();
3600
    }
3601
		    }
3602
		    {
3603
 
3604
    if (sid_finished_terminals) {
3605
	while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3606
	       (CURRENT_TERMINAL != LEXER_TOK_DEFINE) &&
3607
	       (CURRENT_TERMINAL != LEXER_TOK_BEGIN_SCOPE) &&
3608
	       (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
3609
	       (CURRENT_TERMINAL != LEXER_TOK_SEPARATOR) &&
3610
	       (CURRENT_TERMINAL != LEXER_TOK_CLOSE_TUPLE) &&
3611
	       (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3612
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
3613
	    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3614
		nstring_destroy (lexer_string_value (sid_current_stream));
3615
	    }
3616
	    ADVANCE_LEXER;
3617
	}
3618
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3619
	    nstring_destroy (lexer_string_value (sid_current_stream));
3620
	}
3621
	if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3622
	    ADVANCE_LEXER;
3623
	}
3624
    } else {
3625
	while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3626
	       (CURRENT_TERMINAL != LEXER_TOK_SEPARATOR) &&
3627
	       (CURRENT_TERMINAL != LEXER_TOK_CLOSE_TUPLE) &&
3628
	       (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3629
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
3630
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
3631
	    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3632
		nstring_destroy (lexer_string_value (sid_current_stream));
3633
	    }
3634
	    ADVANCE_LEXER;
3635
	}
3636
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3637
	    nstring_destroy (lexer_string_value (sid_current_stream));
3638
	}
3639
	if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3640
	    ADVANCE_LEXER;
3641
	}
3642
    }
3643
    sid_propagating_error = TRUE;
3644
		    }
3645
		}
3646
	      ZL7:;
3647
	    }
3648
	}
3649
	break;
3650
      case 26:
3651
	return;
3652
      default:
3653
	goto ZL1;
3654
    }
3655
    return;
3656
  ZL1:;
3657
    {
3658
	{
3659
 
3660
    if (!sid_propagating_error) {
3661
	E_expected_tuple_defn ();
3662
    }
3663
	}
3664
	{
3665
 
3666
    if (sid_finished_terminals) {
3667
	while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3668
	       (CURRENT_TERMINAL != LEXER_TOK_DEFINE) &&
3669
	       (CURRENT_TERMINAL != LEXER_TOK_BEGIN_SCOPE) &&
3670
	       (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
3671
	       (CURRENT_TERMINAL != LEXER_TOK_SEPARATOR) &&
3672
	       (CURRENT_TERMINAL != LEXER_TOK_CLOSE_TUPLE) &&
3673
	       (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3674
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
3675
	    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3676
		nstring_destroy (lexer_string_value (sid_current_stream));
3677
	    }
3678
	    ADVANCE_LEXER;
3679
	}
3680
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3681
	    nstring_destroy (lexer_string_value (sid_current_stream));
3682
	}
3683
	if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3684
	    ADVANCE_LEXER;
3685
	}
3686
    } else {
3687
	while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3688
	       (CURRENT_TERMINAL != LEXER_TOK_SEPARATOR) &&
3689
	       (CURRENT_TERMINAL != LEXER_TOK_CLOSE_TUPLE) &&
3690
	       (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3691
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
3692
	       (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
3693
	    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3694
		nstring_destroy (lexer_string_value (sid_current_stream));
3695
	    }
3696
	    ADVANCE_LEXER;
3697
	}
3698
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3699
	    nstring_destroy (lexer_string_value (sid_current_stream));
3700
	}
3701
	if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3702
	    ADVANCE_LEXER;
3703
	}
3704
    }
3705
    sid_propagating_error = TRUE;
3706
	}
3707
    }
3708
}
3709
 
3710
static void
6 7u83 3711
ZR259(void)
2 7u83 3712
{
3713
    if ((CURRENT_TERMINAL) == 26) {
3714
	return;
3715
    }
6 7u83 3716
  ZL2_259:;
2 7u83 3717
    {
6 7u83 3718
	ZR261 ();
2 7u83 3719
	{
3720
	    if ((CURRENT_TERMINAL) == 26) {
3721
		RESTORE_LEXER;
3722
		goto ZL1;
3723
	    }
3724
	    {
3725
		{
3726
 
3727
    (ZI0) = (CURRENT_TERMINAL == LEXER_TOK_TERMINATOR);
3728
		}
3729
		if (!ZI0)
3730
		    goto ZL5;
3731
		goto ZL3;
3732
	    }
3733
	    /*UNREACHED*/
3734
	  ZL5:;
3735
	    switch (CURRENT_TERMINAL) {
3736
	      case 23:
3737
		{
3738
		    ADVANCE_LEXER;
6 7u83 3739
		    goto ZL2_259;
2 7u83 3740
		}
3741
		/*UNREACHED*/
3742
	      default:
3743
		goto ZL4;
3744
	    }
3745
	    /*UNREACHED*/
3746
	  ZL4:;
3747
	    {
3748
		{
3749
 
3750
    if (!sid_propagating_error) {
3751
	E_expected_separator ();
3752
    }
3753
		}
3754
		{
3755
 
3756
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3757
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3758
	   (CURRENT_TERMINAL != LEXER_TOK_SEPARATOR)) {
3759
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3760
	    nstring_destroy (lexer_string_value (sid_current_stream));
3761
	}
3762
	ADVANCE_LEXER;
3763
    }
3764
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3765
	nstring_destroy (lexer_string_value (sid_current_stream));
3766
    }
3767
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3768
	ADVANCE_LEXER;
3769
    }
3770
    sid_propagating_error = TRUE;
3771
		}
3772
		{
3773
 
3774
    sid_propagating_error = FALSE;
3775
		}
3776
		{
3777
		    {
3778
			{
3779
 
3780
    (ZI0) = (CURRENT_TERMINAL != LEXER_TOK_SEPARATOR);
3781
			}
3782
			if (!ZI0)
3783
			    goto ZL7;
3784
		    }
3785
		    goto ZL6;
3786
		  ZL7:;
3787
		    {
6 7u83 3788
			goto ZL2_259;
2 7u83 3789
		    }
3790
		    /*UNREACHED*/
3791
		  ZL6:;
3792
		}
3793
	    }
3794
	  ZL3:;
3795
	}
3796
    }
3797
    return;
3798
  ZL1:;
3799
    SAVE_LEXER (26);
3800
    return;
3801
}
3802
 
3803
static void
6 7u83 3804
ZR126(void)
2 7u83 3805
{
3806
    switch (CURRENT_TERMINAL) {
3807
      case 5:
3808
	{
3809
	    ADVANCE_LEXER;
3810
	    ZR142 ();
3811
	    if ((CURRENT_TERMINAL) == 26) {
3812
		RESTORE_LEXER;
3813
		goto ZL1;
3814
	    }
3815
	    {
3816
 
3817
    types_assign (&sid_saved_type, &sid_current_type);
3818
    sid_saved_pred_id = sid_current_pred_id;
3819
	    }
3820
	    ZR146 ();
3821
	    ZR142 ();
3822
	    if ((CURRENT_TERMINAL) == 26) {
3823
		RESTORE_LEXER;
3824
		goto ZL1;
3825
	    }
3826
	}
3827
	break;
3828
      default:
3829
	{
3830
	    {
3831
 
3832
    types_init (&sid_saved_type);
3833
    types_init (&sid_current_type);
3834
    sid_saved_pred_id   = NIL (EntryP);
3835
    sid_current_pred_id = NIL (EntryP);
3836
	    }
3837
	}
3838
	break;
3839
      case 26:
3840
	return;
3841
    }
3842
    return;
3843
  ZL1:;
3844
    SAVE_LEXER (26);
3845
    return;
3846
}
3847
 
3848
static void
6 7u83 3849
ZR208(void)
2 7u83 3850
{
3851
    switch (CURRENT_TERMINAL) {
3852
      case 4:
3853
	{
3854
	    NStringT ZI151;
3855
 
3856
	    {
3857
 
3858
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
3859
	    }
3860
	    ADVANCE_LEXER;
3861
	    {
3862
		{
3863
		    {
3864
 
3865
    types_init (&sid_current_type);
3866
    sid_current_pred_id = NIL (EntryP);
3867
		    }
6 7u83 3868
		    ZR284 (&ZI151);
2 7u83 3869
		    if ((CURRENT_TERMINAL) == 26) {
3870
			RESTORE_LEXER;
3871
			goto ZL3;
3872
		    }
3873
		}
3874
		goto ZL2;
3875
	      ZL3:;
3876
		{
3877
		    {
3878
 
3879
    if (!sid_propagating_error) {
3880
	E_expected_tuple_def_or_term ();
3881
    }
3882
		    }
3883
		    {
3884
 
3885
    nstring_destroy (&(ZI151));
3886
		    }
3887
		    {
3888
 
3889
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
3890
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
3891
	   (CURRENT_TERMINAL != LEXER_TOK_ALT_SEP) &&
3892
	   (CURRENT_TERMINAL != LEXER_TOK_HANDLER_SEP) &&
3893
	   (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
3894
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
3895
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
3896
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
3897
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
3898
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3899
	    nstring_destroy (lexer_string_value (sid_current_stream));
3900
	}
3901
	ADVANCE_LEXER;
3902
    }
3903
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
3904
	nstring_destroy (lexer_string_value (sid_current_stream));
3905
    }
3906
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
3907
	ADVANCE_LEXER;
3908
    }
3909
    sid_propagating_error = TRUE;
3910
		    }
3911
		}
3912
	      ZL2:;
3913
	    }
3914
	}
3915
	break;
3916
      case 24:
3917
	{
3918
	    ADVANCE_LEXER;
3919
	    {
3920
		{
3921
		    NStringT ZI151;
3922
 
3923
		    switch (CURRENT_TERMINAL) {
3924
		      case 4:
3925
			{
3926
 
3927
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
3928
			}
3929
			break;
3930
		      default:
3931
			goto ZL5;
3932
		    }
3933
		    ADVANCE_LEXER;
3934
		    {
3935
 
3936
    types_init (&sid_current_type);
3937
    sid_current_pred_id = NIL (EntryP);
3938
		    }
3939
		    {
3940
 
3941
    NStringT scope;
3942
    EntryP   non_local_entry = scope_stack_get_non_local (&sid_scope_stack,
3943
							  sid_current_table,
3944
							  (&ZI151), &scope);
3945
    EntryP   name_entry      = table_get_entry (sid_current_table, (&ZI151));
3946
 
3947
    if (name_entry) {
3948
	if ((sid_current_entry) && (sid_current_alt)) {
3949
	    if ((!types_contains (alt_names (sid_current_alt), name_entry)) &&
3950
		(!types_contains (rule_param (sid_current.rule),
3951
				  name_entry))) {
3952
		name_entry = NIL (EntryP);
3953
	    }
3954
	} else {
3955
	    name_entry = NIL (EntryP);
3956
	}
3957
    }
3958
    if (name_entry) {
3959
	types_add_name_and_type_var (&sid_current_type, name_entry,
3960
				     NIL (EntryP));
3961
	if (non_local_entry) {
3962
	    nstring_destroy (&scope);
3963
	}
3964
	nstring_destroy (&(ZI151));
3965
    } else if (non_local_entry) {
3966
	types_add_name_and_type_var (&sid_current_type, non_local_entry,
3967
				     NIL (EntryP));
3968
	if (nstring_length (&scope) > nstring_length (&sid_maximum_scope)) {
3969
	    nstring_destroy (&sid_maximum_scope);
3970
	    nstring_assign (&sid_maximum_scope, &scope);
3971
	} else {
3972
	    nstring_destroy (&scope);
3973
	}
3974
	nstring_destroy (&(ZI151));
3975
    } else {
3976
	E_undefined_assignment ((&ZI151));
3977
	types_add_name (&sid_current_type, sid_current_table, &(ZI151), FALSE);
3978
    }
3979
		    }
3980
		    {
3981
 
3982
    types_assign (&sid_saved_type, &sid_current_type);
3983
    sid_saved_pred_id = sid_current_pred_id;
3984
		    }
6 7u83 3985
		    ZR249 ();
2 7u83 3986
		    ZR199 ();
3987
		    if ((CURRENT_TERMINAL) == 26) {
3988
			RESTORE_LEXER;
3989
			goto ZL5;
3990
		    }
3991
		}
3992
		goto ZL4;
3993
	      ZL5:;
3994
		{
3995
		    {
3996
 
3997
    if (!sid_propagating_error) {
3998
	E_expected_identifier ();
3999
    }
4000
		    }
4001
		}
4002
	      ZL4:;
4003
	    }
4004
	}
4005
	break;
4006
      case 6:
4007
	{
4008
	    ZR163 ();
4009
	    if ((CURRENT_TERMINAL) == 26) {
4010
		RESTORE_LEXER;
4011
		goto ZL1;
4012
	    }
4013
	    {
4014
 
4015
    types_assign (&sid_saved_type, &sid_current_type);
4016
    sid_saved_pred_id = sid_current_pred_id;
4017
	    }
6 7u83 4018
	    ZR249 ();
2 7u83 4019
	    ZR199 ();
4020
	    if ((CURRENT_TERMINAL) == 26) {
4021
		RESTORE_LEXER;
4022
		goto ZL1;
4023
	    }
4024
	}
4025
	break;
4026
      case 10: case 18: case 19:
4027
	{
4028
	    {
4029
 
4030
    types_init (&sid_current_type);
4031
    sid_current_pred_id = NIL (EntryP);
4032
	    }
6 7u83 4033
	    ZR283 ();
2 7u83 4034
	    if ((CURRENT_TERMINAL) == 26) {
4035
		RESTORE_LEXER;
4036
		goto ZL1;
4037
	    }
4038
	}
4039
	break;
4040
      case 26:
4041
	return;
4042
      default:
4043
	goto ZL1;
4044
    }
4045
    return;
4046
  ZL1:;
4047
    SAVE_LEXER (26);
4048
    return;
4049
}
4050
 
4051
static void
6 7u83 4052
ZR217(void)
2 7u83 4053
{
4054
    if ((CURRENT_TERMINAL) == 26) {
4055
	return;
4056
    }
4057
    {
4058
	NStringT ZI151;
4059
 
4060
	switch (CURRENT_TERMINAL) {
4061
	  case 4:
4062
	    {
4063
 
4064
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
4065
	    }
4066
	    break;
4067
	  default:
4068
	    goto ZL1;
4069
	}
4070
	ADVANCE_LEXER;
4071
	{
4072
 
4073
    if ((sid_current_entry) && (sid_current_alt)) {
4074
	EntryP entry = scope_stack_get_action (&sid_scope_stack,
4075
					       sid_current_table, (&ZI151));
4076
 
4077
	if (entry) {
4078
	    sid_current_item = item_create (entry);
4079
	} else {
4080
	    E_unknown_action ((&ZI151));
4081
	    sid_current_item = NIL (ItemP);
4082
	    (void) alt_deallocate (sid_current_alt);
4083
	    sid_current_alt  = NIL (AltP);
4084
	}
4085
    } else {
4086
	sid_current_item = NIL (ItemP);
4087
    }
4088
    nstring_destroy (&(ZI151));
4089
	}
6 7u83 4090
	ZR246 ();
2 7u83 4091
	ZR196 ();
4092
	if ((CURRENT_TERMINAL) == 26) {
4093
	    RESTORE_LEXER;
4094
	    goto ZL1;
4095
	}
4096
    }
4097
    return;
4098
  ZL1:;
4099
    {
4100
	{
4101
 
4102
    if (!sid_propagating_error) {
4103
	E_expected_identifier ();
4104
    }
4105
	}
4106
	{
4107
 
4108
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
4109
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
4110
	   (CURRENT_TERMINAL != LEXER_TOK_ALT_SEP) &&
4111
	   (CURRENT_TERMINAL != LEXER_TOK_HANDLER_SEP) &&
4112
	   (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
4113
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
4114
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
4115
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
4116
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
4117
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4118
	    nstring_destroy (lexer_string_value (sid_current_stream));
4119
	}
4120
	ADVANCE_LEXER;
4121
    }
4122
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4123
	nstring_destroy (lexer_string_value (sid_current_stream));
4124
    }
4125
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
4126
	ADVANCE_LEXER;
4127
    }
4128
    sid_propagating_error = TRUE;
4129
	}
4130
    }
4131
}
4132
 
4133
static void
6 7u83 4134
ZR155(void)
2 7u83 4135
{
4136
    switch (CURRENT_TERMINAL) {
4137
      case 4:
4138
	{
4139
	    NStringT ZI151;
4140
 
4141
	    {
4142
 
4143
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
4144
	    }
4145
	    ADVANCE_LEXER;
4146
	    {
4147
 
4148
    sid_current_entry = table_add_basic (sid_current_table, &(ZI151),
4149
					 sid_current_grammar, FALSE);
4150
    if (sid_current_entry == NIL (EntryP)) {
4151
	E_duplicate_basic ((&ZI151));
4152
	nstring_destroy (&(ZI151));
4153
    } else {
4154
	sid_current.basic = entry_get_basic (sid_current_entry);
4155
    }
4156
	    }
4157
	    ZR126 ();
4158
	    if ((CURRENT_TERMINAL) == 26) {
4159
		RESTORE_LEXER;
4160
		goto ZL1;
4161
	    }
4162
	    {
4163
 
4164
    if (sid_current_entry) {
4165
	KeyP key = entry_key (sid_current_entry);
4166
 
4167
	if (types_contains_names (&sid_saved_type)) {
4168
	    E_basic_param_has_names (key, &sid_saved_type);
4169
	}
4170
	if (types_contains_names (&sid_current_type)) {
4171
	    E_basic_result_has_names (key, &sid_current_type);
4172
	}
4173
	if (types_contains_references (&sid_current_type)) {
4174
	    E_basic_result_has_refs (key, &sid_current_type);
4175
	}
4176
	if (!types_equal_zero_tuple (&sid_saved_type)) {
4177
	    E_basic_param_mismatch (key, &sid_saved_type);
4178
	}
4179
	types_assign (basic_result (sid_current.basic), &sid_current_type);
4180
    } else {
4181
	types_destroy (&sid_current_type);
4182
    }
4183
    types_destroy (&sid_saved_type);
4184
	    }
6 7u83 4185
	    ZR252 ();
2 7u83 4186
	    if ((CURRENT_TERMINAL) == 26) {
4187
		RESTORE_LEXER;
4188
		goto ZL1;
4189
	    }
4190
	}
4191
	break;
4192
      case 19:
4193
	{
4194
	    ADVANCE_LEXER;
4195
	    {
4196
		{
4197
		    NStringT ZI151;
4198
 
4199
		    switch (CURRENT_TERMINAL) {
4200
		      case 4:
4201
			{
4202
 
4203
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
4204
			}
4205
			break;
4206
		      default:
4207
			goto ZL3;
4208
		    }
4209
		    ADVANCE_LEXER;
4210
		    {
4211
 
4212
    sid_current_entry = table_add_basic (sid_current_table, &(ZI151),
4213
					 sid_current_grammar, TRUE);
4214
    if (sid_current_entry == NIL (EntryP)) {
4215
	E_duplicate_basic ((&ZI151));
4216
	nstring_destroy (&(ZI151));
4217
    } else {
4218
	sid_current.basic = entry_get_basic (sid_current_entry);
4219
    }
4220
		    }
4221
		    ZR126 ();
4222
		    if ((CURRENT_TERMINAL) == 26) {
4223
			RESTORE_LEXER;
4224
			goto ZL3;
4225
		    }
4226
		    {
4227
 
4228
    if (sid_current_entry) {
4229
	KeyP key = entry_key (sid_current_entry);
4230
 
4231
	if (types_contains_names (&sid_saved_type)) {
4232
	    E_basic_param_has_names (key, &sid_saved_type);
4233
	}
4234
	if (types_contains_names (&sid_current_type)) {
4235
	    E_basic_result_has_names (key, &sid_current_type);
4236
	}
4237
	if (types_contains_references (&sid_current_type)) {
4238
	    E_basic_result_has_refs (key, &sid_current_type);
4239
	}
4240
	if (!types_equal_zero_tuple (&sid_saved_type)) {
4241
	    E_basic_param_mismatch (key, &sid_saved_type);
4242
	}
4243
	types_assign (basic_result (sid_current.basic), &sid_current_type);
4244
    } else {
4245
	types_destroy (&sid_current_type);
4246
    }
4247
    types_destroy (&sid_saved_type);
4248
		    }
6 7u83 4249
		    ZR252 ();
2 7u83 4250
		    if ((CURRENT_TERMINAL) == 26) {
4251
			RESTORE_LEXER;
4252
			goto ZL3;
4253
		    }
4254
		}
4255
		goto ZL2;
4256
	      ZL3:;
4257
		{
4258
		    {
4259
 
4260
    if (!sid_propagating_error) {
4261
	E_expected_identifier ();
4262
    }
4263
		    }
4264
		    {
4265
 
4266
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
4267
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
4268
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
4269
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
4270
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4271
	    nstring_destroy (lexer_string_value (sid_current_stream));
4272
	}
4273
	ADVANCE_LEXER;
4274
    }
4275
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4276
	nstring_destroy (lexer_string_value (sid_current_stream));
4277
    }
4278
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
4279
	ADVANCE_LEXER;
4280
    }
4281
    sid_propagating_error = TRUE;
4282
		    }
4283
		}
4284
	      ZL2:;
4285
	    }
4286
	}
4287
	break;
4288
      case 26:
4289
	return;
4290
      default:
4291
	goto ZL1;
4292
    }
4293
    return;
4294
  ZL1:;
4295
    {
4296
	{
4297
 
4298
    if (!sid_propagating_error) {
4299
	E_expected_terminal_decn ();
4300
    }
4301
	}
4302
	{
4303
 
4304
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
4305
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
4306
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
4307
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
4308
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4309
	    nstring_destroy (lexer_string_value (sid_current_stream));
4310
	}
4311
	ADVANCE_LEXER;
4312
    }
4313
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4314
	nstring_destroy (lexer_string_value (sid_current_stream));
4315
    }
4316
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
4317
	ADVANCE_LEXER;
4318
    }
4319
    sid_propagating_error = TRUE;
4320
	}
4321
    }
4322
}
4323
 
4324
static void
6 7u83 4325
ZR187(void)
2 7u83 4326
{
4327
    if ((CURRENT_TERMINAL) == 26) {
4328
	return;
4329
    }
4330
    {
4331
	switch (CURRENT_TERMINAL) {
4332
	  case 10:
4333
	    break;
4334
	  default:
4335
	    goto ZL1;
4336
	}
4337
	ADVANCE_LEXER;
4338
	{
4339
	    {
4340
		NStringT ZI151;
4341
 
4342
		switch (CURRENT_TERMINAL) {
4343
		  case 4:
4344
		    {
4345
 
4346
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
4347
		    }
4348
		    break;
4349
		  default:
4350
		    goto ZL3;
4351
		}
4352
		ADVANCE_LEXER;
4353
		{
4354
 
4355
    sid_current_entry = scope_stack_add_action (sid_current_scope,
4356
						sid_current_table, &(ZI151),
4357
						sid_enclosing_rule,
4358
						&sid_redefining_entry);
4359
    if (sid_current_entry) {
4360
	sid_current.action = entry_get_action (sid_current_entry);
4361
    } else {
4362
	E_duplicate_action ((&ZI151));
4363
	nstring_destroy (&(ZI151));
4364
    }
4365
		}
6 7u83 4366
		ZR246 ();
2 7u83 4367
		ZR126 ();
4368
		if ((CURRENT_TERMINAL) == 26) {
4369
		    RESTORE_LEXER;
4370
		    goto ZL3;
4371
		}
4372
		{
4373
 
4374
    if (sid_current_entry) {
4375
	KeyP       key     = entry_key (sid_current_entry);
4376
	TypeTupleP param   = action_param (sid_current.action);
4377
	TypeTupleP result  = action_result (sid_current.action);
4378
	BoolT      errored = FALSE;
4379
 
4380
	if (types_contains_names (&sid_saved_type)) {
4381
	    E_action_param_has_names (key, &sid_saved_type);
4382
	    errored = TRUE;
4383
	}
4384
	if (sid_redefining_entry) {
4385
	    if (!types_equal (param, &sid_saved_type)) {
4386
		E_action_param_mismatch (key, param, &sid_saved_type);
4387
		errored = TRUE;
4388
	    }
4389
	}
4390
	if (types_contains_names (&sid_current_type)) {
4391
	    E_action_result_has_names (key, &sid_current_type);
4392
	    errored = TRUE;
4393
	}
4394
	if (types_contains_references (&sid_current_type)) {
4395
	    E_action_result_has_refs (key, &sid_current_type);
4396
	    errored = TRUE;
4397
	}
4398
	if (sid_redefining_entry) {
4399
	    if (!types_equal (result, &sid_current_type)) {
4400
		E_action_result_mismatch (key, result, &sid_current_type);
4401
		errored = TRUE;
4402
	    }
4403
	}
4404
	if (errored || sid_redefining_entry) {
4405
	    types_destroy (&sid_saved_type);
4406
	    types_destroy (&sid_current_type);
4407
	} else {
4408
	    types_assign (param, &sid_saved_type);
4409
	    types_assign (result, &sid_current_type);
4410
	}
4411
    } else {
4412
	types_destroy (&sid_saved_type);
4413
	types_destroy (&sid_current_type);
4414
    }
4415
		}
6 7u83 4416
		ZR252 ();
2 7u83 4417
		if ((CURRENT_TERMINAL) == 26) {
4418
		    RESTORE_LEXER;
4419
		    goto ZL3;
4420
		}
4421
	    }
4422
	    goto ZL2;
4423
	  ZL3:;
4424
	    {
4425
		{
4426
 
4427
    if (!sid_propagating_error) {
4428
	E_expected_identifier ();
4429
    }
4430
		}
4431
		{
4432
 
4433
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
4434
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
4435
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
4436
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
4437
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
4438
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4439
	    nstring_destroy (lexer_string_value (sid_current_stream));
4440
	}
4441
	ADVANCE_LEXER;
4442
    }
4443
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4444
	nstring_destroy (lexer_string_value (sid_current_stream));
4445
    }
4446
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
4447
	ADVANCE_LEXER;
4448
    }
4449
    sid_propagating_error = TRUE;
4450
		}
4451
	    }
4452
	  ZL2:;
4453
	}
4454
    }
4455
    return;
4456
  ZL1:;
4457
    SAVE_LEXER (26);
4458
    return;
4459
}
4460
 
4461
static void
6 7u83 4462
ZR228(void)
2 7u83 4463
{
4464
    if ((CURRENT_TERMINAL) == 26) {
4465
	return;
4466
    }
6 7u83 4467
  ZL2_228:;
2 7u83 4468
    {
6 7u83 4469
	ZR221 ();
2 7u83 4470
	{
4471
	    switch (CURRENT_TERMINAL) {
4472
	      case 4: case 6: case 10: case 13: case 18:
4473
	      case 19: case 24:
4474
		{
6 7u83 4475
		    goto ZL2_228;
2 7u83 4476
		}
4477
		/*UNREACHED*/
4478
	      case 26:
4479
		RESTORE_LEXER;
4480
		goto ZL1;
4481
	      default:
4482
		break;
4483
	    }
4484
	}
4485
    }
4486
    return;
4487
  ZL1:;
4488
    {
4489
	{
4490
 
4491
    if (!sid_propagating_error) {
4492
	E_expected_item ();
4493
    }
4494
	}
4495
	{
4496
 
4497
    while ((CURRENT_TERMINAL != LEXER_TOK_EOF) &&
4498
	   (CURRENT_TERMINAL != LEXER_TOK_TERMINATOR) &&
4499
	   (CURRENT_TERMINAL != LEXER_TOK_ALT_SEP) &&
4500
	   (CURRENT_TERMINAL != LEXER_TOK_HANDLER_SEP) &&
4501
	   (CURRENT_TERMINAL != LEXER_TOK_BEGIN_RULE) &&
4502
	   (CURRENT_TERMINAL != LEXER_TOK_END_RULE) &&
4503
	   (CURRENT_TERMINAL != LEXER_TOK_END_SCOPE) &&
4504
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_PRODUCTIONS) &&
4505
	   (CURRENT_TERMINAL != LEXER_TOK_BLT_ENTRY)) {
4506
	if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4507
	    nstring_destroy (lexer_string_value (sid_current_stream));
4508
	}
4509
	ADVANCE_LEXER;
4510
    }
4511
    if (CURRENT_TERMINAL == LEXER_TOK_IDENTIFIER) {
4512
	nstring_destroy (lexer_string_value (sid_current_stream));
4513
    }
4514
    if (CURRENT_TERMINAL != LEXER_TOK_EOF) {
4515
	ADVANCE_LEXER;
4516
    }
4517
    sid_propagating_error = TRUE;
4518
	}
4519
	{
4520
 
4521
    sid_propagating_error = FALSE;
4522
	}
4523
    }
4524
}
4525
 
4526
static void
6 7u83 4527
ZR261(void)
2 7u83 4528
{
4529
    if ((CURRENT_TERMINAL) == 26) {
4530
	return;
4531
    }
4532
    {
4533
	NStringT ZI151;
4534
 
4535
	switch (CURRENT_TERMINAL) {
4536
	  case 4:
4537
	    {
4538
 
4539
    nstring_assign (&ZI151, lexer_string_value (sid_current_stream));
4540
	    }
4541
	    break;
4542
	  default:
4543
	    goto ZL1;
4544
	}
4545
	ADVANCE_LEXER;
4546
	{
4547
 
4548
    EntryP entry = table_get_rule (sid_current_table, (&ZI151));
4549
 
4550
    if (entry) {
4551
	if (entry_list_contains (sid_current_entry_list, entry)) {
4552
	    E_mult_entry (entry_key (entry));
4553
	} else {
4554
	    entry_list_add (sid_current_entry_list, entry);
4555
	    rule_required (entry_get_rule (entry));
4556
	}
4557
    } else {
4558
	E_unknown_rule ((&ZI151));
4559
    }
4560
    nstring_destroy (&(ZI151));
4561
	}
4562
    }
4563
    return;
4564
  ZL1:;
4565
    {
4566
	{
4567
 
4568
    if (!sid_propagating_error) {
4569
	E_expected_identifier ();
4570
    }
4571
	}
4572
    }
4573
}
4574
 
4575
static void
6 7u83 4576
ZR168(void)
2 7u83 4577
{
4578
    if ((CURRENT_TERMINAL) == 26) {
4579
	return;
4580
    }
4581
  ZL2_168:;
4582
    {
4583
	ZR165 ();
4584
	{
4585
	    if ((CURRENT_TERMINAL) == 26) {
4586
		RESTORE_LEXER;
4587
		goto ZL1;
4588
	    }
4589
	    {
4590
		{
4591
 
4592
    (ZI0) = ((CURRENT_TERMINAL == LEXER_TOK_CLOSE_TUPLE) ||
4593
		  (CURRENT_TERMINAL == LEXER_TOK_EOF) ||
4594
		  (sid_propagating_error));
4595
		}
4596
		if (!ZI0)
4597
		    goto ZL5;
4598
		goto ZL3;
4599
	    }
4600
	    /*UNREACHED*/
4601
	  ZL5:;
4602
	    switch (CURRENT_TERMINAL) {
4603
	      case 23:
4604
		{
4605
		    ADVANCE_LEXER;
4606
		    goto ZL2_168;
4607
		}
4608
		/*UNREACHED*/
4609
	      default:
4610
		goto ZL4;
4611
	    }
4612
	    /*UNREACHED*/
4613
	  ZL4:;
4614
	    {
4615
		{
4616
 
4617
    if (!sid_propagating_error) {
4618
	E_expected_separator ();
4619
    }
4620
		}
4621
		goto ZL2_168;
4622
	    }
4623
	    /*UNREACHED*/
4624
	  ZL3:;
4625
	}
4626
    }
4627
    return;
4628
  ZL1:;
4629
    SAVE_LEXER (26);
4630
    return;
4631
}
4632
 
4633
static void
6 7u83 4634
ZR246(void)
2 7u83 4635
{
4636
    if ((CURRENT_TERMINAL) == 26) {
4637
	return;
4638
    }
4639
    {
4640
	switch (CURRENT_TERMINAL) {
4641
	  case 11:
4642
	    break;
4643
	  default:
4644
	    goto ZL1;
4645
	}
4646
	ADVANCE_LEXER;
4647
    }
4648
    return;
4649
  ZL1:;
4650
    {
4651
	{
4652
 
4653
    if (!sid_propagating_error) {
4654
	E_expected_end_action ();
4655
    }
4656
	}
4657
    }
4658
}
4659
 
4660
static void
6 7u83 4661
ZR248(void)
2 7u83 4662
{
4663
    switch (CURRENT_TERMINAL) {
4664
      case 12: case 21:
4665
	{
4666
	    {
4667
 
4668
    if (sid_current_entry) {
4669
	KeyP key = entry_key (sid_current_entry);
4670
 
4671
	if (rule_is_defined (sid_current.rule)) {
4672
	    E_rule_already_defined (key);
4673
	    sid_current_entry = NIL (EntryP);
4674
	    types_destroy (&sid_saved_type);
4675
	    types_destroy (&sid_current_type);
4676
	} else {
4677
	    TypeTupleP param   = rule_param (sid_current.rule);
4678
	    TypeTupleP result  = rule_result (sid_current.rule);
4679
	    BoolT      errored = FALSE;
4680
 
4681
	    rule_defined (sid_current.rule);
4682
	    if (!types_disjoint_names (&sid_saved_type)) {
4683
		E_rule_param_clash (key, &sid_saved_type);
4684
		errored = TRUE;
4685
	    }
4686
	    if (types_check_shadowing (&sid_saved_type, &sid_scope_stack,
4687
				       sid_current.rule)) {
4688
		errored = TRUE;
4689
	    }
4690
	    if (sid_redefining_entry) {
4691
		if (!types_fillin_names (param, &sid_saved_type)) {
4692
		    E_rule_param_mismatch (key, param, &sid_saved_type);
4693
		    errored = TRUE;
4694
		}
4695
		types_destroy (&sid_saved_type);
4696
	    } else {
4697
		types_assign (param, &sid_saved_type);
4698
	    }
4699
	    if (!types_disjoint_names (&sid_current_type)) {
4700
		E_rule_result_clash (key, &sid_current_type);
4701
		errored = TRUE;
4702
	    }
4703
	    if (types_check_shadowing (&sid_current_type, &sid_scope_stack,
4704
				       sid_current.rule)) {
4705
		errored = TRUE;
4706
	    }
4707
	    if (types_contains_references (&sid_current_type)) {
4708
		E_rule_result_has_refs (key, &sid_current_type);
4709
		errored = TRUE;
4710
	    }
4711
	    if (sid_redefining_entry) {
4712
		if (!types_fillin_names (result, &sid_current_type)) {
4713
		    E_rule_result_mismatch (key, result, &sid_current_type);
4714
		    errored = TRUE;
4715
		}
4716
		types_destroy (&sid_current_type);
4717
	    } else {
4718
		types_assign (result, &sid_current_type);
4719
	    }
4720
	    if (errored) {
4721
		sid_current_entry = NIL (EntryP);
4722
	    } else {
4723
		if (types_intersect (param, result)) {
4724
		    E_rule_formal_clash (key, param, result);
4725
		    sid_current_entry = NIL (EntryP);
4726
		}
4727
	    }
4728
	}
4729
    } else {
4730
	types_destroy (&sid_saved_type);
4731
	types_destroy (&sid_current_type);
4732
    }
4733
    sid_alternative   = 0;
4734
    sid_internal_rule = FALSE;
4735
    sid_external_rule = sid_current_entry;
4736
    nstring_init (&sid_maximum_scope);
4737
	    }
4738
	    {
4739
 
4740
    if (sid_current_entry) {
4741
	KeyP     key   = entry_key (sid_current_entry);
4742
	NStringP scope = key_get_string (key);
4743
 
4744
	scope_stack_push (&sid_scope_stack, scope);
4745
    }
4746
	    }
4747
	    ZR192 ();
6 7u83 4748
	    ZR249 ();
2 7u83 4749
	    {
4750
		if ((CURRENT_TERMINAL) == 26) {
4751
		    RESTORE_LEXER;
4752
		    goto ZL1;
4753
		}
4754
		{
4755
		    switch (CURRENT_TERMINAL) {
4756
		      case 13:
4757
			break;
4758
		      default:
4759
			goto ZL3;
4760
		    }
4761
		    ADVANCE_LEXER;
4762
		}
4763
		goto ZL2;
4764
	      ZL3:;
4765
		{
4766
		    {
4767
 
4768
    if (!sid_propagating_error) {
4769
	E_expected_begin_rule ();
4770
    }
4771
		    }
4772
		}
4773
	      ZL2:;
4774
	    }
6 7u83 4775
	    ZR219 ();
4776
	    ZR251 ();
2 7u83 4777
	    if ((CURRENT_TERMINAL) == 26) {
4778
		RESTORE_LEXER;
4779
		goto ZL1;
4780
	    }
4781
	    {
4782
 
4783
    if (sid_current_entry) {
4784
	scope_stack_pop (&sid_scope_stack);
4785
    }
4786
	    }
4787
	    {
4788
 
4789
    if (sid_current_entry) {
4790
	nstring_assign (rule_maximum_scope (sid_current.rule),
4791
			&sid_maximum_scope);
4792
    } else {
4793
	nstring_destroy (&sid_maximum_scope);
4794
    }
4795
	    }
6 7u83 4796
	    ZR252 ();
2 7u83 4797
	    if ((CURRENT_TERMINAL) == 26) {
4798
		RESTORE_LEXER;
4799
		goto ZL1;
4800
	    }
4801
	}
4802
	break;
4803
      case 9:
4804
	{
4805
	    {
4806
 
4807
    if (sid_current_entry) {
4808
	KeyP       key     = entry_key (sid_current_entry);
4809
	TypeTupleP param   = rule_param (sid_current.rule);
4810
	TypeTupleP result  = rule_result (sid_current.rule);
4811
	BoolT      errored = FALSE;
4812
 
4813
	if (types_contains_names (&sid_saved_type)) {
4814
	    E_rule_param_has_names (key, &sid_saved_type);
4815
	    errored = TRUE;
4816
	}
4817
	if (sid_redefining_entry) {
4818
	    if (!types_equal (param, &sid_saved_type)) {
4819
		E_rule_param_mismatch (key, param, &sid_saved_type);
4820
		errored = TRUE;
4821
	    }
4822
	}
4823
	if (types_contains_names (&sid_current_type)) {
4824
	    E_rule_result_has_names (key, &sid_current_type);
4825
	    errored = TRUE;
4826
	}
4827
	if (types_contains_references (&sid_current_type)) {
4828
	    E_rule_result_has_refs (key, &sid_current_type);
4829
	    errored = TRUE;
4830
	}
4831
	if (sid_redefining_entry) {
4832
	    if (!types_equal (result, &sid_current_type)) {
4833
		E_rule_result_mismatch (key, result, &sid_current_type);
4834
		errored = TRUE;
4835
	    }
4836
	}
4837
	if (errored || sid_redefining_entry) {
4838
	    types_destroy (&sid_saved_type);
4839
	    types_destroy (&sid_current_type);
4840
	} else {
4841
	    types_assign (param, &sid_saved_type);
4842
	    types_assign (result, &sid_current_type);
4843
	}
4844
    } else {
4845
	types_destroy (&sid_saved_type);
4846
	types_destroy (&sid_current_type);
4847
    }
4848
	    }
4849
	    ADVANCE_LEXER;
4850
	}
4851
	break;
4852
      case 26:
4853
	return;
4854
      default:
4855
	goto ZL1;
4856
    }
4857
    return;
4858
  ZL1:;
4859
    SAVE_LEXER (26);
4860
    return;
4861
}
4862
 
4863
static void
6 7u83 4864
ZR249(void)
2 7u83 4865
{
4866
    if ((CURRENT_TERMINAL) == 26) {
4867
	return;
4868
    }
4869
    {
4870
	switch (CURRENT_TERMINAL) {
4871
	  case 12:
4872
	    break;
4873
	  default:
4874
	    goto ZL1;
4875
	}
4876
	ADVANCE_LEXER;
4877
    }
4878
    return;
4879
  ZL1:;
4880
    {
4881
	{
4882
 
4883
    if (!sid_propagating_error) {
4884
	E_expected_define ();
4885
    }
4886
	}
4887
    }
4888
}
4889
 
4890
static void
6 7u83 4891
ZR180(void)
2 7u83 4892
{
4893
    if ((CURRENT_TERMINAL) == 26) {
4894
	return;
4895
    }
4896
  ZL2_180:;
4897
    {
4898
	ZR177 ();
4899
	{
4900
	    if ((CURRENT_TERMINAL) == 26) {
4901
		RESTORE_LEXER;
4902
		goto ZL1;
4903
	    }
4904
	    {
4905
		{
4906
 
4907
    (ZI0) = ((CURRENT_TERMINAL == LEXER_TOK_CLOSE_TUPLE) ||
4908
		  (CURRENT_TERMINAL == LEXER_TOK_EOF) ||
4909
		  (sid_propagating_error));
4910
		}
4911
		if (!ZI0)
4912
		    goto ZL5;
4913
		goto ZL3;
4914
	    }
4915
	    /*UNREACHED*/
4916
	  ZL5:;
4917
	    switch (CURRENT_TERMINAL) {
4918
	      case 23:
4919
		{
4920
		    ADVANCE_LEXER;
4921
		    goto ZL2_180;
4922
		}
4923
		/*UNREACHED*/
4924
	      default:
4925
		goto ZL4;
4926
	    }
4927
	    /*UNREACHED*/
4928
	  ZL4:;
4929
	    {
4930
		{
4931
 
4932
    if (!sid_propagating_error) {
4933
	E_expected_separator ();
4934
    }
4935
		}
4936
		goto ZL2_180;
4937
	    }
4938
	    /*UNREACHED*/
4939
	  ZL3:;
4940
	}
4941
    }
4942
    return;
4943
  ZL1:;
4944
    SAVE_LEXER (26);
4945
    return;
4946
}
4947
 
4948
static void
6 7u83 4949
ZR251(void)
2 7u83 4950
{
4951
    if ((CURRENT_TERMINAL) == 26) {
4952
	return;
4953
    }
4954
    {
4955
	switch (CURRENT_TERMINAL) {
6 7u83 4956
	  case 14:
4957
	    break;
4958
	  default:
4959
	    goto ZL1;
4960
	}
4961
	ADVANCE_LEXER;
4962
    }
4963
    return;
4964
  ZL1:;
4965
    {
4966
	{
4967
 
4968
    if (!sid_propagating_error) {
4969
	E_expected_end_rule ();
4970
    }
4971
	}
4972
    }
4973
}
4974
 
4975
static void
4976
ZR252(void)
4977
{
4978
    if ((CURRENT_TERMINAL) == 26) {
4979
	return;
4980
    }
4981
    {
4982
	switch (CURRENT_TERMINAL) {
2 7u83 4983
	  case 9:
4984
	    break;
4985
	  default:
4986
	    goto ZL1;
4987
	}
4988
	ADVANCE_LEXER;
4989
    }
4990
    return;
4991
  ZL1:;
4992
    {
4993
	{
4994
 
4995
    if (!sid_propagating_error) {
4996
	E_expected_terminator ();
4997
    }
4998
	}
4999
    }
5000
}
5001
 
5002
/* BEGINNING OF TRAILER */
5003
 
5004
 
5005
 
5006
/* END OF FILE */