-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathird.c
1160 lines (1037 loc) · 50.2 KB
/
ird.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "ird.h"
#line 128 "./ird.sprut"
/* All internal representation storage is implemented by object stack. See
package `object-stack'. */
os_t irp;
#line 17 "ird.c"
#ifndef IR_START_ALLOC
#define IR_START_ALLOC()
#endif
#ifndef IR_STOP_ALLOC
#define IR_STOP_ALLOC()
#endif
#ifndef IR_ALLOC
#define IR_ALLOC(ptr, size, ptr_type) ((ptr) = (ptr_type) malloc (size))
#endif
#ifndef IR_FREE
#define IR_FREE(ptr, size) free (ptr)
#endif
#ifndef IR_BEGIN_IR_node_t
#define IR_BEGIN_IR_node_t(a) memset (&(a), 0, sizeof (a))
#endif
#ifndef IR_END_IR_node_t
#define IR_END_IR_node_t(a)
#endif
#ifndef IR_COPY_IR_node_t
#define IR_COPY_IR_node_t(a, b) ((a) = (b))
#endif
#ifndef IR_EQUAL_IR_node_t
#define IR_EQUAL_IR_node_t(a, b) ((a) == (b))
#endif
#ifndef IR_PRINT_IR_node_t
#define IR_PRINT_IR_node_t(a) printf ("%lx", (unsigned long) (a))
#endif
#ifndef IR_INPUT_IR_node_t
#define IR_INPUT_IR_node_t(file, field) (fread (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_OUTPUT_IR_node_t
#define IR_OUTPUT_IR_node_t(file, field) (fwrite (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_BEGIN_integer_t
#define IR_BEGIN_integer_t(a) memset (&(a), 0, sizeof (a))
#endif
#ifndef IR_END_integer_t
#define IR_END_integer_t(a)
#endif
#ifndef IR_COPY_integer_t
#define IR_COPY_integer_t(a, b) ((a) = (b))
#endif
#ifndef IR_EQUAL_integer_t
#define IR_EQUAL_integer_t(a, b) ((a) == (b))
#endif
#ifndef IR_PRINT_integer_t
#define IR_PRINT_integer_t(a)
#endif
#ifndef IR_INPUT_integer_t
#define IR_INPUT_integer_t(file, field) (fread (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_OUTPUT_integer_t
#define IR_OUTPUT_integer_t(file, field) (fwrite (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_BEGIN_bool_t
#define IR_BEGIN_bool_t(a) memset (&(a), 0, sizeof (a))
#endif
#ifndef IR_END_bool_t
#define IR_END_bool_t(a)
#endif
#ifndef IR_COPY_bool_t
#define IR_COPY_bool_t(a, b) ((a) = (b))
#endif
#ifndef IR_EQUAL_bool_t
#define IR_EQUAL_bool_t(a, b) ((a) == (b))
#endif
#ifndef IR_PRINT_bool_t
#define IR_PRINT_bool_t(a)
#endif
#ifndef IR_INPUT_bool_t
#define IR_INPUT_bool_t(file, field) (fread (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_OUTPUT_bool_t
#define IR_OUTPUT_bool_t(file, field) (fwrite (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_BEGIN_string_t
#define IR_BEGIN_string_t(a) memset (&(a), 0, sizeof (a))
#endif
#ifndef IR_END_string_t
#define IR_END_string_t(a)
#endif
#ifndef IR_COPY_string_t
#define IR_COPY_string_t(a, b) ((a) = (b))
#endif
#ifndef IR_EQUAL_string_t
#define IR_EQUAL_string_t(a, b) ((a) == (b))
#endif
#ifndef IR_PRINT_string_t
#define IR_PRINT_string_t(a)
#endif
#ifndef IR_INPUT_string_t
#define IR_INPUT_string_t(file, field) (fread (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_OUTPUT_string_t
#define IR_OUTPUT_string_t(file, field) (fwrite (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_BEGIN_position_t
#define IR_BEGIN_position_t(a) memset (&(a), 0, sizeof (a))
#endif
#ifndef IR_END_position_t
#define IR_END_position_t(a)
#endif
#ifndef IR_COPY_position_t
#define IR_COPY_position_t(a, b) ((a) = (b))
#endif
#ifndef IR_EQUAL_position_t
#define IR_EQUAL_position_t(a, b) ((a) == (b))
#endif
#ifndef IR_PRINT_position_t
#define IR_PRINT_position_t(a)
#endif
#ifndef IR_INPUT_position_t
#define IR_INPUT_position_t(file, field) (fread (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
#ifndef IR_OUTPUT_position_t
#define IR_OUTPUT_position_t(file, field) (fwrite (&(field), sizeof (field), 1, (file)) != sizeof (field))
#endif
short _IR_node_level [] =
{
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
};
unsigned char _IR_SF_node [] =
{255, 255, 31
};
unsigned char _IR_SF_identifier [] =
{2, 0, 0
};
unsigned char _IR_SF_code_insertion [] =
{4, 0, 0
};
unsigned char _IR_SF_expression [] =
{8, 0, 0
};
unsigned char _IR_SF_declaration [] =
{240, 63, 0
};
unsigned char _IR_SF_identifier_declaration [] =
{224, 1, 0
};
unsigned char _IR_SF_term_declaration [] =
{64, 0, 0
};
unsigned char _IR_SF_commutative_declaration [] =
{128, 0, 0
};
unsigned char _IR_SF_type_declaration [] =
{0, 1, 0
};
unsigned char _IR_SF_code [] =
{0, 62, 0
};
unsigned char _IR_SF_local_code [] =
{0, 4, 0
};
unsigned char _IR_SF_import_code [] =
{0, 8, 0
};
unsigned char _IR_SF_export_code [] =
{0, 16, 0
};
unsigned char _IR_SF_union_code [] =
{0, 32, 0
};
unsigned char _IR_SF_rule [] =
{0, 64, 0
};
unsigned char _IR_SF_pattern [] =
{0, 128, 0
};
unsigned char _IR_SF_additional_code [] =
{0, 0, 1
};
unsigned char _IR_SF_description [] =
{0, 0, 2
};
unsigned char _IR_SF_single_declaration [] =
{0, 0, 28
};
unsigned char _IR_SF_single_term_declaration [] =
{0, 0, 8
};
unsigned char _IR_SF_single_nonterm_declaration [] =
{0, 0, 16
};
unsigned char _IR_SF__root [] =
{255, 255, 127
};
unsigned char _IR_SF__error [] =
{0, 0, 64
};
unsigned char *_IR_is_type[] =
{
_IR_SF_node,
_IR_SF_identifier,
_IR_SF_code_insertion,
_IR_SF_expression,
_IR_SF_declaration,
_IR_SF_identifier_declaration,
_IR_SF_term_declaration,
_IR_SF_commutative_declaration,
_IR_SF_type_declaration,
_IR_SF_code,
_IR_SF_local_code,
_IR_SF_import_code,
_IR_SF_export_code,
_IR_SF_union_code,
_IR_SF_rule,
_IR_SF_pattern,
_IR_SF_additional_code,
_IR_SF_description,
_IR_SF_single_declaration,
_IR_SF_single_term_declaration,
_IR_SF_single_nonterm_declaration,
_IR_SF__root,
_IR_SF__error
};
unsigned char _IR_D_type [] =
{
0, 0, 0, 0, 0,
_IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)
+ _IR_offsetof (struct _IR_S_identifier_declaration, type),
_IR_offsetof (_IR_term_declaration, _IR_S_term_declaration)
+ _IR_offsetof (struct _IR_S_term_declaration, _IR_M_identifier_declaration)
+ _IR_offsetof (struct _IR_S_identifier_declaration, type),
_IR_offsetof (_IR_commutative_declaration, _IR_S_commutative_declaration)
+ _IR_offsetof (struct _IR_S_commutative_declaration, _IR_M_identifier_declaration)
+ _IR_offsetof (struct _IR_S_identifier_declaration, type),
_IR_offsetof (_IR_type_declaration, _IR_S_type_declaration)
+ _IR_offsetof (struct _IR_S_type_declaration, _IR_M_identifier_declaration)
+ _IR_offsetof (struct _IR_S_identifier_declaration, type),
0, 0, 0, 0, 0, 0, 0, 0, 0,
_IR_offsetof (_IR_single_declaration, _IR_S_single_declaration)
+ _IR_offsetof (struct _IR_S_single_declaration, type),
_IR_offsetof (_IR_single_term_declaration, _IR_S_single_term_declaration)
+ _IR_offsetof (struct _IR_S_single_term_declaration, _IR_M_single_declaration)
+ _IR_offsetof (struct _IR_S_single_declaration, type),
_IR_offsetof (_IR_single_nonterm_declaration, _IR_S_single_nonterm_declaration)
+ _IR_offsetof (struct _IR_S_single_nonterm_declaration, _IR_M_single_declaration)
+ _IR_offsetof (struct _IR_S_single_declaration, type),
0, 0
};
unsigned char _IR_D_identifier [] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
_IR_offsetof (_IR_pattern, _IR_S_pattern)
+ _IR_offsetof (struct _IR_S_pattern, identifier),
0, 0,
_IR_offsetof (_IR_single_declaration, _IR_S_single_declaration)
+ _IR_offsetof (struct _IR_S_single_declaration, identifier),
_IR_offsetof (_IR_single_term_declaration, _IR_S_single_term_declaration)
+ _IR_offsetof (struct _IR_S_single_term_declaration, _IR_M_single_declaration)
+ _IR_offsetof (struct _IR_S_single_declaration, identifier),
_IR_offsetof (_IR_single_nonterm_declaration, _IR_S_single_nonterm_declaration)
+ _IR_offsetof (struct _IR_S_single_nonterm_declaration, _IR_M_single_declaration)
+ _IR_offsetof (struct _IR_S_single_declaration, identifier),
0, 0
};
void *_IR_class_structure_array [] =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
const char *IR_node_name[] =
{
"node",
"identifier",
"code_insertion",
"expression",
"declaration",
"identifier_declaration",
"term_declaration",
"commutative_declaration",
"type_declaration",
"code",
"local_code",
"import_code",
"export_code",
"union_code",
"rule",
"pattern",
"additional_code",
"description",
"single_declaration",
"single_term_declaration",
"single_nonterm_declaration",
"%root",
"%error"
};
unsigned char IR_node_size[] =
{
sizeof (_IR_node),
sizeof (_IR_identifier),
sizeof (_IR_code_insertion),
sizeof (_IR_expression),
sizeof (_IR_declaration),
sizeof (_IR_identifier_declaration),
sizeof (_IR_term_declaration),
sizeof (_IR_commutative_declaration),
sizeof (_IR_type_declaration),
sizeof (_IR_code),
sizeof (_IR_local_code),
sizeof (_IR_import_code),
sizeof (_IR_export_code),
sizeof (_IR_union_code),
sizeof (_IR_rule),
sizeof (_IR_pattern),
sizeof (_IR_additional_code),
sizeof (_IR_description),
sizeof (_IR_single_declaration),
sizeof (_IR_single_term_declaration),
sizeof (_IR_single_nonterm_declaration),
sizeof (_IR__root),
sizeof (_IR__error)
};
static int (* _IR_traverse_guard_function_variable) (IR_node_t node);
static int _IR_current_graph_pass_number;
void _IR_set_double_field_value
(IR_double_link_t link, IR_node_t value, int disp, int flag)
{
}
IR_double_link_t IR__first_double_link (IR_node_t node)
{
return NULL;
}
void IR__set_double_link (IR_double_link_t link, IR_node_t value)
{
#ifdef __IR_DEBUG__
if (link == NULL)
abort ();
#endif /* __IR_DEBUG__ */
(*link->set_function) (link->link_owner, value);
}
static void _IR_node_field_initiation (IR_node_mode_t node_mode, IR_node_t node)
{
switch (node_mode)
{
case IR_NM_node:
IR_BEGIN_position_t ((((_IR_node *) node)->_IR_S_node.position));
break;
case IR_NM_identifier:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_identifier *) node)->_IR_S_identifier._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_string_t ((((_IR_identifier *) node)->_IR_S_identifier.identifier_itself));
IR_BEGIN_IR_node_t ((((_IR_identifier *) node)->_IR_S_identifier.next_identifier));
break;
case IR_NM_code_insertion:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_code_insertion *) node)->_IR_S_code_insertion._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_string_t ((((_IR_code_insertion *) node)->_IR_S_code_insertion.code_insertion_itself));
break;
case IR_NM_expression:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_expression *) node)->_IR_S_expression._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_string_t ((((_IR_expression *) node)->_IR_S_expression.expression_itself));
break;
case IR_NM_declaration:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_declaration *) node)->_IR_S_declaration._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_IR_node_t ((((_IR_declaration *) node)->_IR_S_declaration.next_declaration));
break;
case IR_NM_identifier_declaration:
_IR_node_field_initiation (IR_NM_declaration, (IR_node_t) ((char *) &((_IR_identifier_declaration *) node)->_IR_S_identifier_declaration._IR_M_declaration - _IR_offsetof (_IR_declaration, _IR_S_declaration)));
IR_BEGIN_IR_node_t ((((_IR_identifier_declaration *) node)->_IR_S_identifier_declaration.identifier_list));
IR_BEGIN_IR_node_t ((((_IR_identifier_declaration *) node)->_IR_S_identifier_declaration.type));
break;
case IR_NM_term_declaration:
_IR_node_field_initiation (IR_NM_identifier_declaration, (IR_node_t) ((char *) &((_IR_term_declaration *) node)->_IR_S_term_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)));
break;
case IR_NM_commutative_declaration:
_IR_node_field_initiation (IR_NM_identifier_declaration, (IR_node_t) ((char *) &((_IR_commutative_declaration *) node)->_IR_S_commutative_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)));
break;
case IR_NM_type_declaration:
_IR_node_field_initiation (IR_NM_identifier_declaration, (IR_node_t) ((char *) &((_IR_type_declaration *) node)->_IR_S_type_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)));
break;
case IR_NM_code:
_IR_node_field_initiation (IR_NM_declaration, (IR_node_t) ((char *) &((_IR_code *) node)->_IR_S_code._IR_M_declaration - _IR_offsetof (_IR_declaration, _IR_S_declaration)));
IR_BEGIN_IR_node_t ((((_IR_code *) node)->_IR_S_code.code_itself));
break;
case IR_NM_local_code:
_IR_node_field_initiation (IR_NM_code, (IR_node_t) ((char *) &((_IR_local_code *) node)->_IR_S_local_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)));
break;
case IR_NM_import_code:
_IR_node_field_initiation (IR_NM_code, (IR_node_t) ((char *) &((_IR_import_code *) node)->_IR_S_import_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)));
break;
case IR_NM_export_code:
_IR_node_field_initiation (IR_NM_code, (IR_node_t) ((char *) &((_IR_export_code *) node)->_IR_S_export_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)));
break;
case IR_NM_union_code:
_IR_node_field_initiation (IR_NM_code, (IR_node_t) ((char *) &((_IR_union_code *) node)->_IR_S_union_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)));
break;
case IR_NM_rule:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_rule *) node)->_IR_S_rule._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.nonterm_identifier));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.pattern));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.optional_cost));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.optional_constraint));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.optional_action));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.next_rule));
IR_BEGIN_bool_t ((((_IR_rule *) node)->_IR_S_rule.new_commutative_rule_flag));
IR_BEGIN_integer_t ((((_IR_rule *) node)->_IR_S_rule.rule_number));
IR_BEGIN_integer_t ((((_IR_rule *) node)->_IR_S_rule.nonterm_rule_number));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.next_nonterm_rule));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.next_chain_rule));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.textual_pattern_list));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.single_nonterm_declaration));
IR_BEGIN_IR_node_t ((((_IR_rule *) node)->_IR_S_rule.next_term_rule));
break;
case IR_NM_pattern:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_pattern *) node)->_IR_S_pattern._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_IR_node_t ((((_IR_pattern *) node)->_IR_S_pattern.identifier));
IR_BEGIN_IR_node_t ((((_IR_pattern *) node)->_IR_S_pattern.pattern_list));
IR_BEGIN_IR_node_t ((((_IR_pattern *) node)->_IR_S_pattern.next_pattern));
IR_BEGIN_integer_t ((((_IR_pattern *) node)->_IR_S_pattern.original_number));
IR_BEGIN_bool_t ((((_IR_pattern *) node)->_IR_S_pattern.commutative_process_flag));
IR_BEGIN_IR_node_t ((((_IR_pattern *) node)->_IR_S_pattern.single_declaration));
IR_BEGIN_IR_node_t ((((_IR_pattern *) node)->_IR_S_pattern.next_textual_pattern));
IR_BEGIN_integer_t ((((_IR_pattern *) node)->_IR_S_pattern.textual_nonterminal_pattern_number));
IR_BEGIN_IR_node_t ((((_IR_pattern *) node)->_IR_S_pattern.father));
break;
case IR_NM_additional_code:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_additional_code *) node)->_IR_S_additional_code._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_string_t ((((_IR_additional_code *) node)->_IR_S_additional_code.additional_code_itself));
break;
case IR_NM_description:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_description *) node)->_IR_S_description._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_IR_node_t ((((_IR_description *) node)->_IR_S_description.declaration_list));
IR_BEGIN_IR_node_t ((((_IR_description *) node)->_IR_S_description.rule_list));
IR_BEGIN_IR_node_t ((((_IR_description *) node)->_IR_S_description.additional_code));
IR_BEGIN_IR_node_t ((((_IR_description *) node)->_IR_S_description.single_declaration_list));
IR_BEGIN_integer_t ((((_IR_description *) node)->_IR_S_description.number_of_nonterminals));
IR_BEGIN_integer_t ((((_IR_description *) node)->_IR_S_description.max_number_of_rule_nonterminals));
break;
case IR_NM_single_declaration:
_IR_node_field_initiation (IR_NM_node, (IR_node_t) ((char *) &((_IR_single_declaration *) node)->_IR_S_single_declaration._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_BEGIN_IR_node_t ((((_IR_single_declaration *) node)->_IR_S_single_declaration.identifier));
IR_BEGIN_IR_node_t ((((_IR_single_declaration *) node)->_IR_S_single_declaration.next_single_declaration));
IR_BEGIN_IR_node_t ((((_IR_single_declaration *) node)->_IR_S_single_declaration.type));
break;
case IR_NM_single_term_declaration:
_IR_node_field_initiation (IR_NM_single_declaration, (IR_node_t) ((char *) &((_IR_single_term_declaration *) node)->_IR_S_single_term_declaration._IR_M_single_declaration - _IR_offsetof (_IR_single_declaration, _IR_S_single_declaration)));
IR_BEGIN_bool_t ((((_IR_single_term_declaration *) node)->_IR_S_single_term_declaration.commutative_flag));
IR_BEGIN_position_t ((((_IR_single_term_declaration *) node)->_IR_S_single_term_declaration.first_position_in_rules));
IR_BEGIN_IR_node_t ((((_IR_single_term_declaration *) node)->_IR_S_single_term_declaration.term_rule_list));
IR_BEGIN_integer_t ((((_IR_single_term_declaration *) node)->_IR_S_single_term_declaration.arity));
break;
case IR_NM_single_nonterm_declaration:
_IR_node_field_initiation (IR_NM_single_declaration, (IR_node_t) ((char *) &((_IR_single_nonterm_declaration *) node)->_IR_S_single_nonterm_declaration._IR_M_single_declaration - _IR_offsetof (_IR_single_declaration, _IR_S_single_declaration)));
IR_BEGIN_integer_t ((((_IR_single_nonterm_declaration *) node)->_IR_S_single_nonterm_declaration.number_of_nonterminal_rules));
IR_BEGIN_IR_node_t ((((_IR_single_nonterm_declaration *) node)->_IR_S_single_nonterm_declaration.nonterm_rule_list));
IR_BEGIN_IR_node_t ((((_IR_single_nonterm_declaration *) node)->_IR_S_single_nonterm_declaration.chain_rule_list));
IR_BEGIN_bool_t ((((_IR_single_nonterm_declaration *) node)->_IR_S_single_nonterm_declaration.derivability_flag));
IR_BEGIN_integer_t ((((_IR_single_nonterm_declaration *) node)->_IR_S_single_nonterm_declaration.traverse_number));
break;
case IR_NM__error:
break;
default:
abort ();
break;
}
}
IR_node_t IR_create_node (IR_node_mode_t node_mode)
{
IR_node_t _result;
IR_ALLOC (_result, IR_node_size [node_mode], IR_node_t);
#ifdef __IR_DEBUG__
if (_result == NULL)
abort ();
#endif /* __IR_DEBUG__ */
IR_NODE_MODE (_result) = node_mode;
_IR_node_field_initiation (node_mode, _result);
return _result;
}
IR_node_t IR_new_identifier
(position_t position,
string_t identifier_itself,
IR_node_t next_identifier)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_identifier);
(((_IR_identifier *) _result)->_IR_S_identifier._IR_M_node.position) = position;
(((_IR_identifier *) _result)->_IR_S_identifier.identifier_itself) = identifier_itself;
(((_IR_identifier *) _result)->_IR_S_identifier.next_identifier) = next_identifier;
return _result;
}
IR_node_t IR_new_code_insertion
(position_t position,
string_t code_insertion_itself)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_code_insertion);
(((_IR_code_insertion *) _result)->_IR_S_code_insertion._IR_M_node.position) = position;
(((_IR_code_insertion *) _result)->_IR_S_code_insertion.code_insertion_itself) = code_insertion_itself;
return _result;
}
IR_node_t IR_new_expression
(position_t position,
string_t expression_itself)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_expression);
(((_IR_expression *) _result)->_IR_S_expression._IR_M_node.position) = position;
(((_IR_expression *) _result)->_IR_S_expression.expression_itself) = expression_itself;
return _result;
}
IR_node_t IR_new_term_declaration
(position_t position,
IR_node_t next_declaration,
IR_node_t identifier_list,
IR_node_t type)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_term_declaration);
(((_IR_term_declaration *) _result)->_IR_S_term_declaration._IR_M_identifier_declaration._IR_M_declaration._IR_M_node.position) = position;
(((_IR_term_declaration *) _result)->_IR_S_term_declaration._IR_M_identifier_declaration._IR_M_declaration.next_declaration) = next_declaration;
(((_IR_term_declaration *) _result)->_IR_S_term_declaration._IR_M_identifier_declaration.identifier_list) = identifier_list;
(((_IR_term_declaration *) _result)->_IR_S_term_declaration._IR_M_identifier_declaration.type) = type;
return _result;
}
IR_node_t IR_new_commutative_declaration
(position_t position,
IR_node_t next_declaration,
IR_node_t identifier_list,
IR_node_t type)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_commutative_declaration);
(((_IR_commutative_declaration *) _result)->_IR_S_commutative_declaration._IR_M_identifier_declaration._IR_M_declaration._IR_M_node.position) = position;
(((_IR_commutative_declaration *) _result)->_IR_S_commutative_declaration._IR_M_identifier_declaration._IR_M_declaration.next_declaration) = next_declaration;
(((_IR_commutative_declaration *) _result)->_IR_S_commutative_declaration._IR_M_identifier_declaration.identifier_list) = identifier_list;
(((_IR_commutative_declaration *) _result)->_IR_S_commutative_declaration._IR_M_identifier_declaration.type) = type;
return _result;
}
IR_node_t IR_new_type_declaration
(position_t position,
IR_node_t next_declaration,
IR_node_t identifier_list,
IR_node_t type)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_type_declaration);
(((_IR_type_declaration *) _result)->_IR_S_type_declaration._IR_M_identifier_declaration._IR_M_declaration._IR_M_node.position) = position;
(((_IR_type_declaration *) _result)->_IR_S_type_declaration._IR_M_identifier_declaration._IR_M_declaration.next_declaration) = next_declaration;
(((_IR_type_declaration *) _result)->_IR_S_type_declaration._IR_M_identifier_declaration.identifier_list) = identifier_list;
(((_IR_type_declaration *) _result)->_IR_S_type_declaration._IR_M_identifier_declaration.type) = type;
return _result;
}
IR_node_t IR_new_local_code
(position_t position,
IR_node_t next_declaration,
IR_node_t code_itself)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_local_code);
(((_IR_local_code *) _result)->_IR_S_local_code._IR_M_code._IR_M_declaration._IR_M_node.position) = position;
(((_IR_local_code *) _result)->_IR_S_local_code._IR_M_code._IR_M_declaration.next_declaration) = next_declaration;
(((_IR_local_code *) _result)->_IR_S_local_code._IR_M_code.code_itself) = code_itself;
return _result;
}
IR_node_t IR_new_import_code
(position_t position,
IR_node_t next_declaration,
IR_node_t code_itself)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_import_code);
(((_IR_import_code *) _result)->_IR_S_import_code._IR_M_code._IR_M_declaration._IR_M_node.position) = position;
(((_IR_import_code *) _result)->_IR_S_import_code._IR_M_code._IR_M_declaration.next_declaration) = next_declaration;
(((_IR_import_code *) _result)->_IR_S_import_code._IR_M_code.code_itself) = code_itself;
return _result;
}
IR_node_t IR_new_export_code
(position_t position,
IR_node_t next_declaration,
IR_node_t code_itself)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_export_code);
(((_IR_export_code *) _result)->_IR_S_export_code._IR_M_code._IR_M_declaration._IR_M_node.position) = position;
(((_IR_export_code *) _result)->_IR_S_export_code._IR_M_code._IR_M_declaration.next_declaration) = next_declaration;
(((_IR_export_code *) _result)->_IR_S_export_code._IR_M_code.code_itself) = code_itself;
return _result;
}
IR_node_t IR_new_union_code
(position_t position,
IR_node_t next_declaration,
IR_node_t code_itself)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_union_code);
(((_IR_union_code *) _result)->_IR_S_union_code._IR_M_code._IR_M_declaration._IR_M_node.position) = position;
(((_IR_union_code *) _result)->_IR_S_union_code._IR_M_code._IR_M_declaration.next_declaration) = next_declaration;
(((_IR_union_code *) _result)->_IR_S_union_code._IR_M_code.code_itself) = code_itself;
return _result;
}
IR_node_t IR_new_rule
(position_t position,
IR_node_t nonterm_identifier,
IR_node_t pattern,
IR_node_t optional_cost,
IR_node_t optional_constraint,
IR_node_t optional_action,
IR_node_t next_rule)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_rule);
(((_IR_rule *) _result)->_IR_S_rule._IR_M_node.position) = position;
(((_IR_rule *) _result)->_IR_S_rule.nonterm_identifier) = nonterm_identifier;
(((_IR_rule *) _result)->_IR_S_rule.pattern) = pattern;
(((_IR_rule *) _result)->_IR_S_rule.optional_cost) = optional_cost;
(((_IR_rule *) _result)->_IR_S_rule.optional_constraint) = optional_constraint;
(((_IR_rule *) _result)->_IR_S_rule.optional_action) = optional_action;
(((_IR_rule *) _result)->_IR_S_rule.next_rule) = next_rule;
return _result;
}
IR_node_t IR_new_pattern
(position_t position,
IR_node_t identifier,
IR_node_t pattern_list,
IR_node_t next_pattern)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_pattern);
(((_IR_pattern *) _result)->_IR_S_pattern._IR_M_node.position) = position;
(((_IR_pattern *) _result)->_IR_S_pattern.identifier) = identifier;
(((_IR_pattern *) _result)->_IR_S_pattern.pattern_list) = pattern_list;
(((_IR_pattern *) _result)->_IR_S_pattern.next_pattern) = next_pattern;
return _result;
}
IR_node_t IR_new_additional_code
(position_t position,
string_t additional_code_itself)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_additional_code);
(((_IR_additional_code *) _result)->_IR_S_additional_code._IR_M_node.position) = position;
(((_IR_additional_code *) _result)->_IR_S_additional_code.additional_code_itself) = additional_code_itself;
return _result;
}
IR_node_t IR_new_description
(position_t position,
IR_node_t declaration_list,
IR_node_t rule_list,
IR_node_t additional_code)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_description);
(((_IR_description *) _result)->_IR_S_description._IR_M_node.position) = position;
(((_IR_description *) _result)->_IR_S_description.declaration_list) = declaration_list;
(((_IR_description *) _result)->_IR_S_description.rule_list) = rule_list;
(((_IR_description *) _result)->_IR_S_description.additional_code) = additional_code;
return _result;
}
IR_node_t IR_new_single_term_declaration
(position_t position,
IR_node_t identifier,
IR_node_t next_single_declaration,
IR_node_t type,
bool_t commutative_flag,
position_t first_position_in_rules,
IR_node_t term_rule_list,
integer_t arity)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_single_term_declaration);
(((_IR_single_term_declaration *) _result)->_IR_S_single_term_declaration._IR_M_single_declaration._IR_M_node.position) = position;
(((_IR_single_term_declaration *) _result)->_IR_S_single_term_declaration._IR_M_single_declaration.identifier) = identifier;
(((_IR_single_term_declaration *) _result)->_IR_S_single_term_declaration._IR_M_single_declaration.next_single_declaration) = next_single_declaration;
(((_IR_single_term_declaration *) _result)->_IR_S_single_term_declaration._IR_M_single_declaration.type) = type;
(((_IR_single_term_declaration *) _result)->_IR_S_single_term_declaration.commutative_flag) = commutative_flag;
(((_IR_single_term_declaration *) _result)->_IR_S_single_term_declaration.first_position_in_rules) = first_position_in_rules;
(((_IR_single_term_declaration *) _result)->_IR_S_single_term_declaration.term_rule_list) = term_rule_list;
(((_IR_single_term_declaration *) _result)->_IR_S_single_term_declaration.arity) = arity;
return _result;
}
IR_node_t IR_new_single_nonterm_declaration
(position_t position,
IR_node_t identifier,
IR_node_t next_single_declaration,
IR_node_t type,
integer_t number_of_nonterminal_rules,
IR_node_t nonterm_rule_list,
IR_node_t chain_rule_list,
bool_t derivability_flag,
integer_t traverse_number)
{
IR_node_t _result;
_result = IR_create_node (IR_NM_single_nonterm_declaration);
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration._IR_M_single_declaration._IR_M_node.position) = position;
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration._IR_M_single_declaration.identifier) = identifier;
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration._IR_M_single_declaration.next_single_declaration) = next_single_declaration;
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration._IR_M_single_declaration.type) = type;
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration.number_of_nonterminal_rules) = number_of_nonterminal_rules;
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration.nonterm_rule_list) = nonterm_rule_list;
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration.chain_rule_list) = chain_rule_list;
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration.derivability_flag) = derivability_flag;
(((_IR_single_nonterm_declaration *) _result)->_IR_S_single_nonterm_declaration.traverse_number) = traverse_number;
return _result;
}
static void _IR_copy_node_fields (IR_node_mode_t node_mode, IR_node_t to, IR_node_t from)
{
switch (node_mode)
{
case IR_NM_node:
IR_COPY_position_t ((((_IR_node *) to)->_IR_S_node.position), (((_IR_node *) from)->_IR_S_node.position));
break;
case IR_NM_identifier:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_identifier *) to)->_IR_S_identifier._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_identifier *) from)->_IR_S_identifier._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_string_t ((((_IR_identifier *) to)->_IR_S_identifier.identifier_itself), (((_IR_identifier *) from)->_IR_S_identifier.identifier_itself));
IR_COPY_IR_node_t ((((_IR_identifier *) to)->_IR_S_identifier.next_identifier), (((_IR_identifier *) from)->_IR_S_identifier.next_identifier));
break;
case IR_NM_code_insertion:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_code_insertion *) to)->_IR_S_code_insertion._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_code_insertion *) from)->_IR_S_code_insertion._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_string_t ((((_IR_code_insertion *) to)->_IR_S_code_insertion.code_insertion_itself), (((_IR_code_insertion *) from)->_IR_S_code_insertion.code_insertion_itself));
break;
case IR_NM_expression:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_expression *) to)->_IR_S_expression._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_expression *) from)->_IR_S_expression._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_string_t ((((_IR_expression *) to)->_IR_S_expression.expression_itself), (((_IR_expression *) from)->_IR_S_expression.expression_itself));
break;
case IR_NM_declaration:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_declaration *) to)->_IR_S_declaration._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_declaration *) from)->_IR_S_declaration._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_IR_node_t ((((_IR_declaration *) to)->_IR_S_declaration.next_declaration), (((_IR_declaration *) from)->_IR_S_declaration.next_declaration));
break;
case IR_NM_identifier_declaration:
_IR_copy_node_fields (IR_NM_declaration, (IR_node_t) ((char *) &((_IR_identifier_declaration *) to)->_IR_S_identifier_declaration._IR_M_declaration - _IR_offsetof (_IR_declaration, _IR_S_declaration)), (IR_node_t) ((char *) &((_IR_identifier_declaration *) from)->_IR_S_identifier_declaration._IR_M_declaration - _IR_offsetof (_IR_declaration, _IR_S_declaration)));
IR_COPY_IR_node_t ((((_IR_identifier_declaration *) to)->_IR_S_identifier_declaration.identifier_list), (((_IR_identifier_declaration *) from)->_IR_S_identifier_declaration.identifier_list));
IR_COPY_IR_node_t ((((_IR_identifier_declaration *) to)->_IR_S_identifier_declaration.type), (((_IR_identifier_declaration *) from)->_IR_S_identifier_declaration.type));
break;
case IR_NM_term_declaration:
_IR_copy_node_fields (IR_NM_identifier_declaration, (IR_node_t) ((char *) &((_IR_term_declaration *) to)->_IR_S_term_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)), (IR_node_t) ((char *) &((_IR_term_declaration *) from)->_IR_S_term_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)));
break;
case IR_NM_commutative_declaration:
_IR_copy_node_fields (IR_NM_identifier_declaration, (IR_node_t) ((char *) &((_IR_commutative_declaration *) to)->_IR_S_commutative_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)), (IR_node_t) ((char *) &((_IR_commutative_declaration *) from)->_IR_S_commutative_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)));
break;
case IR_NM_type_declaration:
_IR_copy_node_fields (IR_NM_identifier_declaration, (IR_node_t) ((char *) &((_IR_type_declaration *) to)->_IR_S_type_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)), (IR_node_t) ((char *) &((_IR_type_declaration *) from)->_IR_S_type_declaration._IR_M_identifier_declaration - _IR_offsetof (_IR_identifier_declaration, _IR_S_identifier_declaration)));
break;
case IR_NM_code:
_IR_copy_node_fields (IR_NM_declaration, (IR_node_t) ((char *) &((_IR_code *) to)->_IR_S_code._IR_M_declaration - _IR_offsetof (_IR_declaration, _IR_S_declaration)), (IR_node_t) ((char *) &((_IR_code *) from)->_IR_S_code._IR_M_declaration - _IR_offsetof (_IR_declaration, _IR_S_declaration)));
IR_COPY_IR_node_t ((((_IR_code *) to)->_IR_S_code.code_itself), (((_IR_code *) from)->_IR_S_code.code_itself));
break;
case IR_NM_local_code:
_IR_copy_node_fields (IR_NM_code, (IR_node_t) ((char *) &((_IR_local_code *) to)->_IR_S_local_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)), (IR_node_t) ((char *) &((_IR_local_code *) from)->_IR_S_local_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)));
break;
case IR_NM_import_code:
_IR_copy_node_fields (IR_NM_code, (IR_node_t) ((char *) &((_IR_import_code *) to)->_IR_S_import_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)), (IR_node_t) ((char *) &((_IR_import_code *) from)->_IR_S_import_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)));
break;
case IR_NM_export_code:
_IR_copy_node_fields (IR_NM_code, (IR_node_t) ((char *) &((_IR_export_code *) to)->_IR_S_export_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)), (IR_node_t) ((char *) &((_IR_export_code *) from)->_IR_S_export_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)));
break;
case IR_NM_union_code:
_IR_copy_node_fields (IR_NM_code, (IR_node_t) ((char *) &((_IR_union_code *) to)->_IR_S_union_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)), (IR_node_t) ((char *) &((_IR_union_code *) from)->_IR_S_union_code._IR_M_code - _IR_offsetof (_IR_code, _IR_S_code)));
break;
case IR_NM_rule:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_rule *) to)->_IR_S_rule._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_rule *) from)->_IR_S_rule._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.nonterm_identifier), (((_IR_rule *) from)->_IR_S_rule.nonterm_identifier));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.pattern), (((_IR_rule *) from)->_IR_S_rule.pattern));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.optional_cost), (((_IR_rule *) from)->_IR_S_rule.optional_cost));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.optional_constraint), (((_IR_rule *) from)->_IR_S_rule.optional_constraint));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.optional_action), (((_IR_rule *) from)->_IR_S_rule.optional_action));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.next_rule), (((_IR_rule *) from)->_IR_S_rule.next_rule));
IR_COPY_bool_t ((((_IR_rule *) to)->_IR_S_rule.new_commutative_rule_flag), (((_IR_rule *) from)->_IR_S_rule.new_commutative_rule_flag));
IR_COPY_integer_t ((((_IR_rule *) to)->_IR_S_rule.rule_number), (((_IR_rule *) from)->_IR_S_rule.rule_number));
IR_COPY_integer_t ((((_IR_rule *) to)->_IR_S_rule.nonterm_rule_number), (((_IR_rule *) from)->_IR_S_rule.nonterm_rule_number));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.next_nonterm_rule), (((_IR_rule *) from)->_IR_S_rule.next_nonterm_rule));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.next_chain_rule), (((_IR_rule *) from)->_IR_S_rule.next_chain_rule));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.textual_pattern_list), (((_IR_rule *) from)->_IR_S_rule.textual_pattern_list));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.single_nonterm_declaration), (((_IR_rule *) from)->_IR_S_rule.single_nonterm_declaration));
IR_COPY_IR_node_t ((((_IR_rule *) to)->_IR_S_rule.next_term_rule), (((_IR_rule *) from)->_IR_S_rule.next_term_rule));
break;
case IR_NM_pattern:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_pattern *) to)->_IR_S_pattern._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_pattern *) from)->_IR_S_pattern._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_IR_node_t ((((_IR_pattern *) to)->_IR_S_pattern.identifier), (((_IR_pattern *) from)->_IR_S_pattern.identifier));
IR_COPY_IR_node_t ((((_IR_pattern *) to)->_IR_S_pattern.pattern_list), (((_IR_pattern *) from)->_IR_S_pattern.pattern_list));
IR_COPY_IR_node_t ((((_IR_pattern *) to)->_IR_S_pattern.next_pattern), (((_IR_pattern *) from)->_IR_S_pattern.next_pattern));
IR_COPY_integer_t ((((_IR_pattern *) to)->_IR_S_pattern.original_number), (((_IR_pattern *) from)->_IR_S_pattern.original_number));
IR_COPY_bool_t ((((_IR_pattern *) to)->_IR_S_pattern.commutative_process_flag), (((_IR_pattern *) from)->_IR_S_pattern.commutative_process_flag));
IR_COPY_IR_node_t ((((_IR_pattern *) to)->_IR_S_pattern.single_declaration), (((_IR_pattern *) from)->_IR_S_pattern.single_declaration));
IR_COPY_IR_node_t ((((_IR_pattern *) to)->_IR_S_pattern.next_textual_pattern), (((_IR_pattern *) from)->_IR_S_pattern.next_textual_pattern));
IR_COPY_integer_t ((((_IR_pattern *) to)->_IR_S_pattern.textual_nonterminal_pattern_number), (((_IR_pattern *) from)->_IR_S_pattern.textual_nonterminal_pattern_number));
IR_COPY_IR_node_t ((((_IR_pattern *) to)->_IR_S_pattern.father), (((_IR_pattern *) from)->_IR_S_pattern.father));
break;
case IR_NM_additional_code:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_additional_code *) to)->_IR_S_additional_code._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_additional_code *) from)->_IR_S_additional_code._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_string_t ((((_IR_additional_code *) to)->_IR_S_additional_code.additional_code_itself), (((_IR_additional_code *) from)->_IR_S_additional_code.additional_code_itself));
break;
case IR_NM_description:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_description *) to)->_IR_S_description._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_description *) from)->_IR_S_description._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_IR_node_t ((((_IR_description *) to)->_IR_S_description.declaration_list), (((_IR_description *) from)->_IR_S_description.declaration_list));
IR_COPY_IR_node_t ((((_IR_description *) to)->_IR_S_description.rule_list), (((_IR_description *) from)->_IR_S_description.rule_list));
IR_COPY_IR_node_t ((((_IR_description *) to)->_IR_S_description.additional_code), (((_IR_description *) from)->_IR_S_description.additional_code));
IR_COPY_IR_node_t ((((_IR_description *) to)->_IR_S_description.single_declaration_list), (((_IR_description *) from)->_IR_S_description.single_declaration_list));
IR_COPY_integer_t ((((_IR_description *) to)->_IR_S_description.number_of_nonterminals), (((_IR_description *) from)->_IR_S_description.number_of_nonterminals));
IR_COPY_integer_t ((((_IR_description *) to)->_IR_S_description.max_number_of_rule_nonterminals), (((_IR_description *) from)->_IR_S_description.max_number_of_rule_nonterminals));
break;
case IR_NM_single_declaration:
_IR_copy_node_fields (IR_NM_node, (IR_node_t) ((char *) &((_IR_single_declaration *) to)->_IR_S_single_declaration._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)), (IR_node_t) ((char *) &((_IR_single_declaration *) from)->_IR_S_single_declaration._IR_M_node - _IR_offsetof (_IR_node, _IR_S_node)));
IR_COPY_IR_node_t ((((_IR_single_declaration *) to)->_IR_S_single_declaration.identifier), (((_IR_single_declaration *) from)->_IR_S_single_declaration.identifier));
IR_COPY_IR_node_t ((((_IR_single_declaration *) to)->_IR_S_single_declaration.next_single_declaration), (((_IR_single_declaration *) from)->_IR_S_single_declaration.next_single_declaration));
IR_COPY_IR_node_t ((((_IR_single_declaration *) to)->_IR_S_single_declaration.type), (((_IR_single_declaration *) from)->_IR_S_single_declaration.type));
break;
case IR_NM_single_term_declaration:
_IR_copy_node_fields (IR_NM_single_declaration, (IR_node_t) ((char *) &((_IR_single_term_declaration *) to)->_IR_S_single_term_declaration._IR_M_single_declaration - _IR_offsetof (_IR_single_declaration, _IR_S_single_declaration)), (IR_node_t) ((char *) &((_IR_single_term_declaration *) from)->_IR_S_single_term_declaration._IR_M_single_declaration - _IR_offsetof (_IR_single_declaration, _IR_S_single_declaration)));
IR_COPY_bool_t ((((_IR_single_term_declaration *) to)->_IR_S_single_term_declaration.commutative_flag), (((_IR_single_term_declaration *) from)->_IR_S_single_term_declaration.commutative_flag));
IR_COPY_position_t ((((_IR_single_term_declaration *) to)->_IR_S_single_term_declaration.first_position_in_rules), (((_IR_single_term_declaration *) from)->_IR_S_single_term_declaration.first_position_in_rules));
IR_COPY_IR_node_t ((((_IR_single_term_declaration *) to)->_IR_S_single_term_declaration.term_rule_list), (((_IR_single_term_declaration *) from)->_IR_S_single_term_declaration.term_rule_list));
IR_COPY_integer_t ((((_IR_single_term_declaration *) to)->_IR_S_single_term_declaration.arity), (((_IR_single_term_declaration *) from)->_IR_S_single_term_declaration.arity));
break;
case IR_NM_single_nonterm_declaration:
_IR_copy_node_fields (IR_NM_single_declaration, (IR_node_t) ((char *) &((_IR_single_nonterm_declaration *) to)->_IR_S_single_nonterm_declaration._IR_M_single_declaration - _IR_offsetof (_IR_single_declaration, _IR_S_single_declaration)), (IR_node_t) ((char *) &((_IR_single_nonterm_declaration *) from)->_IR_S_single_nonterm_declaration._IR_M_single_declaration - _IR_offsetof (_IR_single_declaration, _IR_S_single_declaration)));
IR_COPY_integer_t ((((_IR_single_nonterm_declaration *) to)->_IR_S_single_nonterm_declaration.number_of_nonterminal_rules), (((_IR_single_nonterm_declaration *) from)->_IR_S_single_nonterm_declaration.number_of_nonterminal_rules));
IR_COPY_IR_node_t ((((_IR_single_nonterm_declaration *) to)->_IR_S_single_nonterm_declaration.nonterm_rule_list), (((_IR_single_nonterm_declaration *) from)->_IR_S_single_nonterm_declaration.nonterm_rule_list));
IR_COPY_IR_node_t ((((_IR_single_nonterm_declaration *) to)->_IR_S_single_nonterm_declaration.chain_rule_list), (((_IR_single_nonterm_declaration *) from)->_IR_S_single_nonterm_declaration.chain_rule_list));
IR_COPY_bool_t ((((_IR_single_nonterm_declaration *) to)->_IR_S_single_nonterm_declaration.derivability_flag), (((_IR_single_nonterm_declaration *) from)->_IR_S_single_nonterm_declaration.derivability_flag));
IR_COPY_integer_t ((((_IR_single_nonterm_declaration *) to)->_IR_S_single_nonterm_declaration.traverse_number), (((_IR_single_nonterm_declaration *) from)->_IR_S_single_nonterm_declaration.traverse_number));
break;
default:
abort ();
break;
}
}
IR_node_t IR_copy_node (IR_node_t node)
{
IR_node_t _result;
if (node == NULL)
return NULL;
IR_ALLOC (_result, IR_node_size [IR_NODE_MODE (node)], IR_node_t);
#ifdef __IR_DEBUG__
if (_result == NULL)
abort ();
#endif /* __IR_DEBUG__ */
IR_NODE_MODE (_result) = IR_NODE_MODE (node);
_IR_copy_node_fields (IR_NODE_MODE (node), _result, node);
return _result;
}
void IR_start (void)