-
Notifications
You must be signed in to change notification settings - Fork 0
/
ird.h
815 lines (563 loc) · 24.7 KB
/
ird.h
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
#ifndef __IR_ird__
#define __IR_ird__
#define _IR_offsetof(type, field) ((char *)&((type *) 64)->field - (char *) 64)
#line 38 "./ird.sprut"
#include "objstack.h"
#include "position.h"
/* Definitions of predefined types: */
typedef int integer_t;
typedef int bool_t;
typedef char *string_t;
#line 24 "ird.h"
typedef enum IR_node_mode_enum
{
IR_NM_node,
IR_NM_identifier,
IR_NM_code_insertion,
IR_NM_expression,
IR_NM_declaration,
IR_NM_identifier_declaration,
IR_NM_term_declaration,
IR_NM_commutative_declaration,
IR_NM_type_declaration,
IR_NM_code,
IR_NM_local_code,
IR_NM_import_code,
IR_NM_export_code,
IR_NM_union_code,
IR_NM_rule,
IR_NM_pattern,
IR_NM_additional_code,
IR_NM_description,
IR_NM_single_declaration,
IR_NM_single_term_declaration,
IR_NM_single_nonterm_declaration,
IR_NM__root,
IR_NM__error
} IR_node_mode_t;
extern short _IR_node_level [];
extern unsigned char _IR_SF_node [];
extern unsigned char _IR_SF_identifier [];
extern unsigned char _IR_SF_code_insertion [];
extern unsigned char _IR_SF_expression [];
extern unsigned char _IR_SF_declaration [];
extern unsigned char _IR_SF_identifier_declaration [];
extern unsigned char _IR_SF_term_declaration [];
extern unsigned char _IR_SF_commutative_declaration [];
extern unsigned char _IR_SF_type_declaration [];
extern unsigned char _IR_SF_code [];
extern unsigned char _IR_SF_local_code [];
extern unsigned char _IR_SF_import_code [];
extern unsigned char _IR_SF_export_code [];
extern unsigned char _IR_SF_union_code [];
extern unsigned char _IR_SF_rule [];
extern unsigned char _IR_SF_pattern [];
extern unsigned char _IR_SF_additional_code [];
extern unsigned char _IR_SF_description [];
extern unsigned char _IR_SF_single_declaration [];
extern unsigned char _IR_SF_single_term_declaration [];
extern unsigned char _IR_SF_single_nonterm_declaration [];
extern unsigned char _IR_SF__root [];
extern unsigned char _IR_SF__error [];
extern unsigned char *_IR_is_type[];
extern unsigned char _IR_D_type [];
extern unsigned char _IR_D_identifier [];
extern void *_IR_class_structure_array [];
typedef struct IR_node *IR_node_t;
typedef struct _IR_double_link *IR_double_link_t;
struct _IR_double_link
{
IR_node_t field_itself;
IR_node_t link_owner;
void (*set_function) (IR_node_t, IR_node_t);
IR_double_link_t previous_link;
IR_double_link_t next_link;
};
struct _IR_S_node
{
position_t position;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_node _IR_S_node;
} _IR_node;
struct _IR_S_identifier
{
struct _IR_S_node _IR_M_node;
string_t identifier_itself;
IR_node_t next_identifier;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_identifier _IR_S_identifier;
} _IR_identifier;
struct _IR_S_code_insertion
{
struct _IR_S_node _IR_M_node;
string_t code_insertion_itself;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_code_insertion _IR_S_code_insertion;
} _IR_code_insertion;
struct _IR_S_expression
{
struct _IR_S_node _IR_M_node;
string_t expression_itself;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_expression _IR_S_expression;
} _IR_expression;
struct _IR_S_declaration
{
struct _IR_S_node _IR_M_node;
IR_node_t next_declaration;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_declaration _IR_S_declaration;
} _IR_declaration;
struct _IR_S_identifier_declaration
{
struct _IR_S_declaration _IR_M_declaration;
IR_node_t identifier_list;
IR_node_t type;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_identifier_declaration _IR_S_identifier_declaration;
} _IR_identifier_declaration;
struct _IR_S_term_declaration
{
struct _IR_S_identifier_declaration _IR_M_identifier_declaration;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_term_declaration _IR_S_term_declaration;
} _IR_term_declaration;
struct _IR_S_commutative_declaration
{
struct _IR_S_identifier_declaration _IR_M_identifier_declaration;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_commutative_declaration _IR_S_commutative_declaration;
} _IR_commutative_declaration;
struct _IR_S_type_declaration
{
struct _IR_S_identifier_declaration _IR_M_identifier_declaration;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_type_declaration _IR_S_type_declaration;
} _IR_type_declaration;
struct _IR_S_code
{
struct _IR_S_declaration _IR_M_declaration;
IR_node_t code_itself;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_code _IR_S_code;
} _IR_code;
struct _IR_S_local_code
{
struct _IR_S_code _IR_M_code;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_local_code _IR_S_local_code;
} _IR_local_code;
struct _IR_S_import_code
{
struct _IR_S_code _IR_M_code;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_import_code _IR_S_import_code;
} _IR_import_code;
struct _IR_S_export_code
{
struct _IR_S_code _IR_M_code;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_export_code _IR_S_export_code;
} _IR_export_code;
struct _IR_S_union_code
{
struct _IR_S_code _IR_M_code;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_union_code _IR_S_union_code;
} _IR_union_code;
struct _IR_S_rule
{
struct _IR_S_node _IR_M_node;
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;
bool_t new_commutative_rule_flag;
integer_t rule_number;
integer_t nonterm_rule_number;
IR_node_t next_nonterm_rule;
IR_node_t next_chain_rule;
IR_node_t textual_pattern_list;
IR_node_t single_nonterm_declaration;
IR_node_t next_term_rule;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_rule _IR_S_rule;
} _IR_rule;
struct _IR_S_pattern
{
struct _IR_S_node _IR_M_node;
IR_node_t identifier;
IR_node_t pattern_list;
IR_node_t next_pattern;
integer_t original_number;
bool_t commutative_process_flag;
IR_node_t single_declaration;
IR_node_t next_textual_pattern;
integer_t textual_nonterminal_pattern_number;
IR_node_t father;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_pattern _IR_S_pattern;
} _IR_pattern;
struct _IR_S_additional_code
{
struct _IR_S_node _IR_M_node;
string_t additional_code_itself;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_additional_code _IR_S_additional_code;
} _IR_additional_code;
struct _IR_S_description
{
struct _IR_S_node _IR_M_node;
IR_node_t declaration_list;
IR_node_t rule_list;
IR_node_t additional_code;
IR_node_t single_declaration_list;
integer_t number_of_nonterminals;
integer_t max_number_of_rule_nonterminals;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_description _IR_S_description;
} _IR_description;
struct _IR_S_single_declaration
{
struct _IR_S_node _IR_M_node;
IR_node_t identifier;
IR_node_t next_single_declaration;
IR_node_t type;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_single_declaration _IR_S_single_declaration;
} _IR_single_declaration;
struct _IR_S_single_term_declaration
{
struct _IR_S_single_declaration _IR_M_single_declaration;
bool_t commutative_flag;
position_t first_position_in_rules;
IR_node_t term_rule_list;
integer_t arity;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_single_term_declaration _IR_S_single_term_declaration;
} _IR_single_term_declaration;
struct _IR_S_single_nonterm_declaration
{
struct _IR_S_single_declaration _IR_M_single_declaration;
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;
};
typedef struct
{
IR_node_mode_t _IR_node_mode;
struct _IR_S_single_nonterm_declaration _IR_S_single_nonterm_declaration;
} _IR_single_nonterm_declaration;
typedef struct IR_node
{
IR_node_mode_t _IR_node_mode;
} _IR__root;
typedef struct
{
IR_node_mode_t _IR_node_mode;
} _IR__error;
#define IR_NODE_MODE(t) ((t)->_IR_node_mode)
extern const char *IR_node_name[];
extern unsigned char IR_node_size[];
#define IR_NODE_LEVEL(node) _IR_node_level [IR_NODE_MODE (node)]
#define IR_IS_TYPE(type, super) ((_IR_is_type [super] [type /8] >> (type % 8)) & 1)
#define IR_IS_OF_TYPE(node, super)IR_IS_TYPE (IR_NODE_MODE (node), super)
extern void _IR_set_double_field_value
(IR_double_link_t link, IR_node_t value, int disp, int flag);
extern IR_double_link_t IR__first_double_link (IR_node_t node);
#define IR__next_double_link(prev_double_link) ((prev_double_link)->next_link)
#define IR__previous_double_link(next_double_link) ((next_double_link)->previous_link)
#define IR__owner(link) ((link)->link_owner)
#define IR_position(_node) (((_IR_node *) (_node))->_IR_S_node.position)
#define IR_identifier_itself(_node) (((_IR_identifier *) (_node))->_IR_S_identifier.identifier_itself)
#define IR_next_identifier(_node) (((_IR_identifier *) (_node))->_IR_S_identifier.next_identifier)
#define IR_code_insertion_itself(_node) (((_IR_code_insertion *) (_node))->_IR_S_code_insertion.code_insertion_itself)
#define IR_expression_itself(_node) (((_IR_expression *) (_node))->_IR_S_expression.expression_itself)
#define IR_next_declaration(_node) (((_IR_declaration *) (_node))->_IR_S_declaration.next_declaration)
#define IR_identifier_list(_node) (((_IR_identifier_declaration *) (_node))->_IR_S_identifier_declaration.identifier_list)
#define IR_type(_node) (*(IR_node_t *) ((char *) (_node) + _IR_D_type [IR_NODE_MODE ((_node))]))
#define IR_code_itself(_node) (((_IR_code *) (_node))->_IR_S_code.code_itself)
#define IR_nonterm_identifier(_node) (((_IR_rule *) (_node))->_IR_S_rule.nonterm_identifier)
#define IR_pattern(_node) (((_IR_rule *) (_node))->_IR_S_rule.pattern)
#define IR_optional_cost(_node) (((_IR_rule *) (_node))->_IR_S_rule.optional_cost)
#define IR_optional_constraint(_node) (((_IR_rule *) (_node))->_IR_S_rule.optional_constraint)
#define IR_optional_action(_node) (((_IR_rule *) (_node))->_IR_S_rule.optional_action)
#define IR_next_rule(_node) (((_IR_rule *) (_node))->_IR_S_rule.next_rule)
#define IR_new_commutative_rule_flag(_node) (((_IR_rule *) (_node))->_IR_S_rule.new_commutative_rule_flag)
#define IR_rule_number(_node) (((_IR_rule *) (_node))->_IR_S_rule.rule_number)
#define IR_nonterm_rule_number(_node) (((_IR_rule *) (_node))->_IR_S_rule.nonterm_rule_number)
#define IR_next_nonterm_rule(_node) (((_IR_rule *) (_node))->_IR_S_rule.next_nonterm_rule)
#define IR_next_chain_rule(_node) (((_IR_rule *) (_node))->_IR_S_rule.next_chain_rule)
#define IR_textual_pattern_list(_node) (((_IR_rule *) (_node))->_IR_S_rule.textual_pattern_list)
#define IR_single_nonterm_declaration(_node) (((_IR_rule *) (_node))->_IR_S_rule.single_nonterm_declaration)
#define IR_next_term_rule(_node) (((_IR_rule *) (_node))->_IR_S_rule.next_term_rule)
#define IR_identifier(_node) (*(IR_node_t *) ((char *) (_node) + _IR_D_identifier [IR_NODE_MODE ((_node))]))
#define IR_pattern_list(_node) (((_IR_pattern *) (_node))->_IR_S_pattern.pattern_list)
#define IR_next_pattern(_node) (((_IR_pattern *) (_node))->_IR_S_pattern.next_pattern)
#define IR_original_number(_node) (((_IR_pattern *) (_node))->_IR_S_pattern.original_number)
#define IR_commutative_process_flag(_node) (((_IR_pattern *) (_node))->_IR_S_pattern.commutative_process_flag)
#define IR_single_declaration(_node) (((_IR_pattern *) (_node))->_IR_S_pattern.single_declaration)
#define IR_next_textual_pattern(_node) (((_IR_pattern *) (_node))->_IR_S_pattern.next_textual_pattern)
#define IR_textual_nonterminal_pattern_number(_node) (((_IR_pattern *) (_node))->_IR_S_pattern.textual_nonterminal_pattern_number)
#define IR_father(_node) (((_IR_pattern *) (_node))->_IR_S_pattern.father)
#define IR_additional_code_itself(_node) (((_IR_additional_code *) (_node))->_IR_S_additional_code.additional_code_itself)
#define IR_declaration_list(_node) (((_IR_description *) (_node))->_IR_S_description.declaration_list)
#define IR_rule_list(_node) (((_IR_description *) (_node))->_IR_S_description.rule_list)
#define IR_additional_code(_node) (((_IR_description *) (_node))->_IR_S_description.additional_code)
#define IR_single_declaration_list(_node) (((_IR_description *) (_node))->_IR_S_description.single_declaration_list)
#define IR_number_of_nonterminals(_node) (((_IR_description *) (_node))->_IR_S_description.number_of_nonterminals)
#define IR_max_number_of_rule_nonterminals(_node) (((_IR_description *) (_node))->_IR_S_description.max_number_of_rule_nonterminals)
#define IR_next_single_declaration(_node) (((_IR_single_declaration *) (_node))->_IR_S_single_declaration.next_single_declaration)
#define IR_commutative_flag(_node) (((_IR_single_term_declaration *) (_node))->_IR_S_single_term_declaration.commutative_flag)
#define IR_first_position_in_rules(_node) (((_IR_single_term_declaration *) (_node))->_IR_S_single_term_declaration.first_position_in_rules)
#define IR_term_rule_list(_node) (((_IR_single_term_declaration *) (_node))->_IR_S_single_term_declaration.term_rule_list)
#define IR_arity(_node) (((_IR_single_term_declaration *) (_node))->_IR_S_single_term_declaration.arity)
#define IR_number_of_nonterminal_rules(_node) (((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.number_of_nonterminal_rules)
#define IR_nonterm_rule_list(_node) (((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.nonterm_rule_list)
#define IR_chain_rule_list(_node) (((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.chain_rule_list)
#define IR_derivability_flag(_node) (((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.derivability_flag)
#define IR_traverse_number(_node) (((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.traverse_number)
extern void IR__set_double_link (IR_double_link_t link, IR_node_t value);
#define IR_set_position(_node, _value) ((((_IR_node *) (_node))->_IR_S_node.position) = (_value))
#define IR_set_identifier_itself(_node, _value) ((((_IR_identifier *) (_node))->_IR_S_identifier.identifier_itself) = (_value))
#define IR_set_next_identifier(_node, _value) ((((_IR_identifier *) (_node))->_IR_S_identifier.next_identifier) = (_value))
#define IR_set_code_insertion_itself(_node, _value) ((((_IR_code_insertion *) (_node))->_IR_S_code_insertion.code_insertion_itself) = (_value))
#define IR_set_expression_itself(_node, _value) ((((_IR_expression *) (_node))->_IR_S_expression.expression_itself) = (_value))
#define IR_set_next_declaration(_node, _value) ((((_IR_declaration *) (_node))->_IR_S_declaration.next_declaration) = (_value))
#define IR_set_identifier_list(_node, _value) ((((_IR_identifier_declaration *) (_node))->_IR_S_identifier_declaration.identifier_list) = (_value))
#define IR_set_type(_node, _value) ((*(IR_node_t *) ((char *) (_node) + _IR_D_type [IR_NODE_MODE ((_node))])) = (_value))
#define IR_set_code_itself(_node, _value) ((((_IR_code *) (_node))->_IR_S_code.code_itself) = (_value))
#define IR_set_nonterm_identifier(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.nonterm_identifier) = (_value))
#define IR_set_pattern(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.pattern) = (_value))
#define IR_set_optional_cost(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.optional_cost) = (_value))
#define IR_set_optional_constraint(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.optional_constraint) = (_value))
#define IR_set_optional_action(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.optional_action) = (_value))
#define IR_set_next_rule(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.next_rule) = (_value))
#define IR_set_new_commutative_rule_flag(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.new_commutative_rule_flag) = (_value))
#define IR_set_rule_number(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.rule_number) = (_value))
#define IR_set_nonterm_rule_number(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.nonterm_rule_number) = (_value))
#define IR_set_next_nonterm_rule(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.next_nonterm_rule) = (_value))
#define IR_set_next_chain_rule(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.next_chain_rule) = (_value))
#define IR_set_textual_pattern_list(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.textual_pattern_list) = (_value))
#define IR_set_single_nonterm_declaration(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.single_nonterm_declaration) = (_value))
#define IR_set_next_term_rule(_node, _value) ((((_IR_rule *) (_node))->_IR_S_rule.next_term_rule) = (_value))
#define IR_set_identifier(_node, _value) ((*(IR_node_t *) ((char *) (_node) + _IR_D_identifier [IR_NODE_MODE ((_node))])) = (_value))
#define IR_set_pattern_list(_node, _value) ((((_IR_pattern *) (_node))->_IR_S_pattern.pattern_list) = (_value))
#define IR_set_next_pattern(_node, _value) ((((_IR_pattern *) (_node))->_IR_S_pattern.next_pattern) = (_value))
#define IR_set_original_number(_node, _value) ((((_IR_pattern *) (_node))->_IR_S_pattern.original_number) = (_value))
#define IR_set_commutative_process_flag(_node, _value) ((((_IR_pattern *) (_node))->_IR_S_pattern.commutative_process_flag) = (_value))
#define IR_set_single_declaration(_node, _value) ((((_IR_pattern *) (_node))->_IR_S_pattern.single_declaration) = (_value))
#define IR_set_next_textual_pattern(_node, _value) ((((_IR_pattern *) (_node))->_IR_S_pattern.next_textual_pattern) = (_value))
#define IR_set_textual_nonterminal_pattern_number(_node, _value) ((((_IR_pattern *) (_node))->_IR_S_pattern.textual_nonterminal_pattern_number) = (_value))
#define IR_set_father(_node, _value) ((((_IR_pattern *) (_node))->_IR_S_pattern.father) = (_value))
#define IR_set_additional_code_itself(_node, _value) ((((_IR_additional_code *) (_node))->_IR_S_additional_code.additional_code_itself) = (_value))
#define IR_set_declaration_list(_node, _value) ((((_IR_description *) (_node))->_IR_S_description.declaration_list) = (_value))
#define IR_set_rule_list(_node, _value) ((((_IR_description *) (_node))->_IR_S_description.rule_list) = (_value))
#define IR_set_additional_code(_node, _value) ((((_IR_description *) (_node))->_IR_S_description.additional_code) = (_value))
#define IR_set_single_declaration_list(_node, _value) ((((_IR_description *) (_node))->_IR_S_description.single_declaration_list) = (_value))
#define IR_set_number_of_nonterminals(_node, _value) ((((_IR_description *) (_node))->_IR_S_description.number_of_nonterminals) = (_value))
#define IR_set_max_number_of_rule_nonterminals(_node, _value) ((((_IR_description *) (_node))->_IR_S_description.max_number_of_rule_nonterminals) = (_value))
#define IR_set_next_single_declaration(_node, _value) ((((_IR_single_declaration *) (_node))->_IR_S_single_declaration.next_single_declaration) = (_value))
#define IR_set_commutative_flag(_node, _value) ((((_IR_single_term_declaration *) (_node))->_IR_S_single_term_declaration.commutative_flag) = (_value))
#define IR_set_first_position_in_rules(_node, _value) ((((_IR_single_term_declaration *) (_node))->_IR_S_single_term_declaration.first_position_in_rules) = (_value))
#define IR_set_term_rule_list(_node, _value) ((((_IR_single_term_declaration *) (_node))->_IR_S_single_term_declaration.term_rule_list) = (_value))
#define IR_set_arity(_node, _value) ((((_IR_single_term_declaration *) (_node))->_IR_S_single_term_declaration.arity) = (_value))
#define IR_set_number_of_nonterminal_rules(_node, _value) ((((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.number_of_nonterminal_rules) = (_value))
#define IR_set_nonterm_rule_list(_node, _value) ((((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.nonterm_rule_list) = (_value))
#define IR_set_chain_rule_list(_node, _value) ((((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.chain_rule_list) = (_value))
#define IR_set_derivability_flag(_node, _value) ((((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.derivability_flag) = (_value))
#define IR_set_traverse_number(_node, _value) ((((_IR_single_nonterm_declaration *) (_node))->_IR_S_single_nonterm_declaration.traverse_number) = (_value))
extern IR_node_t IR_create_node (IR_node_mode_t node_mode);
extern IR_node_t IR_new_identifier
(position_t position,
string_t identifier_itself,
IR_node_t next_identifier);
extern IR_node_t IR_new_code_insertion
(position_t position,
string_t code_insertion_itself);
extern IR_node_t IR_new_expression
(position_t position,
string_t expression_itself);
extern IR_node_t IR_new_term_declaration
(position_t position,
IR_node_t next_declaration,
IR_node_t identifier_list,
IR_node_t type);
extern IR_node_t IR_new_commutative_declaration
(position_t position,
IR_node_t next_declaration,
IR_node_t identifier_list,
IR_node_t type);
extern IR_node_t IR_new_type_declaration
(position_t position,
IR_node_t next_declaration,
IR_node_t identifier_list,
IR_node_t type);
extern IR_node_t IR_new_local_code
(position_t position,
IR_node_t next_declaration,
IR_node_t code_itself);
extern IR_node_t IR_new_import_code
(position_t position,
IR_node_t next_declaration,
IR_node_t code_itself);
extern IR_node_t IR_new_export_code
(position_t position,
IR_node_t next_declaration,
IR_node_t code_itself);
extern IR_node_t IR_new_union_code
(position_t position,
IR_node_t next_declaration,
IR_node_t code_itself);
extern 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);
extern IR_node_t IR_new_pattern
(position_t position,
IR_node_t identifier,
IR_node_t pattern_list,
IR_node_t next_pattern);
extern IR_node_t IR_new_additional_code
(position_t position,
string_t additional_code_itself);
extern IR_node_t IR_new_description
(position_t position,
IR_node_t declaration_list,
IR_node_t rule_list,
IR_node_t additional_code);
extern 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);
extern 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);
extern IR_node_t IR_copy_node (IR_node_t node);
extern void IR_start (void);
extern void IR_stop (void);
#line 54 "./ird.sprut"
/* These macros for storage management of NONA internal representation: */
/* Start work with the storage manager -- see NONA documentation. */
#define IR_START_ALLOC() OS_CREATE (irp, 0)
/* Finish work with the storage manager -- see NONA documentation. */
#define IR_STOP_ALLOC() OS_DELETE (irp)
/* Allocate storage for internal representation of given size
-- see NONA documentation. */
#define IR_ALLOC(ptr, size, ptr_type)\
do {\
OS_TOP_EXPAND (irp, size); ptr = (ptr_type) OS_TOP_BEGIN (irp);\
OS_TOP_FINISH (irp);\
} while (0);
/* Free storage of internal representation of given size -- see NONA
documentation. */
#define IR_FREE(ptr, size)
/* These macros are analogous to ones of package `object-stack'
worked with storage of NONA internal representation: */
/* Start new internal representation object -- see also package
`object-stack'. */
#define IR_TOP_FINISH() OS_TOP_FINISH (irp)
/* Nullify current internal representation object -- see also package
`object-stack'. */
#define IR_TOP_NULLIFY() OS_TOP_NULLIFY (irp)
/* Shorten current internal representation object on given number bytes -- see
also package `object-stack'. */
#define IR_TOP_SHORTEN(length) OS_TOP_SHORTEN (irp, length)
/* Return start address of current internal representation object -- see also
package `object-stack'. */
#define IR_TOP_BEGIN() OS_TOP_BEGIN (irp)
/* Return length of current internal representation object in bytes -- see
also package `object-stack'. */
#define IR_TOP_LENGTH() OS_TOP_LENGTH (irp)
/* Add byte to the end of current internal representation object -- see also
package `object-stack'. */
#define IR_TOP_ADD_BYTE(b) OS_TOP_ADD_BYTE (irp, b)
/* Add string to the end of current internal representation object -- see also
package `object-stack'. */
#define IR_TOP_ADD_STRING(str) OS_TOP_ADD_STRING (irp, str)
/* Add memory of given length to the end of current internal representation
object -- see also package `object-stack'. */
#define IR_TOP_ADD_MEMORY(mem, length) OS_TOP_ADD_MEMORY (irp, mem, length)
extern os_t irp;
#line 815 "ird.h"
#endif /* __IR_ird__ */