Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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