parser: move things from parser_prod to parser_nodes
[nit.git] / src / parser / parser_prod.nit
1 # Production AST nodes full definition.
2 # This file was generated by SableCC (http://www.sablecc.org/).
3 package parser_prod
4
5 import lexer
6 intrude import parser_nodes
7 private import tables
8
9 redef class AModule
10 private init empty_init do end
11
12 init init_amodule (
13 n_moduledecl: nullable AModuledecl,
14 n_imports: Collection[Object], # Should be Collection[AImport]
15 n_extern_code_blocks: Collection[Object], # Should be Collection[AExternCodeBlock]
16 n_classdefs: Collection[Object] # Should be Collection[AClassdef]
17 )
18 do
19 empty_init
20 _n_moduledecl = n_moduledecl
21 if n_moduledecl != null then
22 n_moduledecl.parent = self
23 end
24 for n in n_imports do
25 assert n isa AImport
26 _n_imports.add(n)
27 n.parent = self
28 end
29 for n in n_extern_code_blocks do
30 assert n isa AExternCodeBlock
31 _n_extern_code_blocks.add(n)
32 n.parent = self
33 end
34 for n in n_classdefs do
35 assert n isa AClassdef
36 _n_classdefs.add(n)
37 n.parent = self
38 end
39 end
40
41 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
42 do
43 if _n_moduledecl == old_child then
44 if new_child != null then
45 new_child.parent = self
46 assert new_child isa AModuledecl
47 _n_moduledecl = new_child
48 else
49 _n_moduledecl = null
50 end
51 return
52 end
53 for i in [0.._n_imports.length[ do
54 if _n_imports[i] == old_child then
55 if new_child != null then
56 assert new_child isa AImport
57 _n_imports[i] = new_child
58 new_child.parent = self
59 else
60 _n_imports.remove_at(i)
61 end
62 return
63 end
64 end
65 for i in [0.._n_extern_code_blocks.length[ do
66 if _n_extern_code_blocks[i] == old_child then
67 if new_child != null then
68 assert new_child isa AExternCodeBlock
69 _n_extern_code_blocks[i] = new_child
70 new_child.parent = self
71 else
72 _n_extern_code_blocks.remove_at(i)
73 end
74 return
75 end
76 end
77 for i in [0.._n_classdefs.length[ do
78 if _n_classdefs[i] == old_child then
79 if new_child != null then
80 assert new_child isa AClassdef
81 _n_classdefs[i] = new_child
82 new_child.parent = self
83 else
84 _n_classdefs.remove_at(i)
85 end
86 return
87 end
88 end
89 end
90
91 redef fun visit_all(v: Visitor)
92 do
93 if _n_moduledecl != null then
94 v.enter_visit(_n_moduledecl.as(not null))
95 end
96 for n in _n_imports do
97 v.enter_visit(n)
98 end
99 for n in _n_extern_code_blocks do
100 v.enter_visit(n)
101 end
102 for n in _n_classdefs do
103 v.enter_visit(n)
104 end
105 end
106 end
107 redef class AModuledecl
108 private init empty_init do end
109
110 init init_amoduledecl (
111 n_doc: nullable ADoc,
112 n_kwmodule: nullable TKwmodule,
113 n_name: nullable AModuleName,
114 n_annotations: nullable AAnnotations
115 )
116 do
117 empty_init
118 _n_doc = n_doc
119 if n_doc != null then
120 n_doc.parent = self
121 end
122 _n_kwmodule = n_kwmodule.as(not null)
123 n_kwmodule.parent = self
124 _n_name = n_name.as(not null)
125 n_name.parent = self
126 _n_annotations = n_annotations
127 if n_annotations != null then
128 n_annotations.parent = self
129 end
130 end
131
132 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
133 do
134 if _n_doc == old_child then
135 if new_child != null then
136 new_child.parent = self
137 assert new_child isa ADoc
138 _n_doc = new_child
139 else
140 _n_doc = null
141 end
142 return
143 end
144 if _n_kwmodule == old_child then
145 if new_child != null then
146 new_child.parent = self
147 assert new_child isa TKwmodule
148 _n_kwmodule = new_child
149 else
150 abort
151 end
152 return
153 end
154 if _n_name == old_child then
155 if new_child != null then
156 new_child.parent = self
157 assert new_child isa AModuleName
158 _n_name = new_child
159 else
160 abort
161 end
162 return
163 end
164 if _n_annotations == old_child then
165 if new_child != null then
166 new_child.parent = self
167 assert new_child isa AAnnotations
168 _n_annotations = new_child
169 else
170 _n_annotations = null
171 end
172 return
173 end
174 end
175
176 redef fun visit_all(v: Visitor)
177 do
178 if _n_doc != null then
179 v.enter_visit(_n_doc.as(not null))
180 end
181 v.enter_visit(_n_kwmodule)
182 v.enter_visit(_n_name)
183 if _n_annotations != null then
184 v.enter_visit(_n_annotations.as(not null))
185 end
186 end
187 end
188 redef class AStdImport
189 private init empty_init do end
190
191 init init_astdimport (
192 n_visibility: nullable AVisibility,
193 n_kwimport: nullable TKwimport,
194 n_name: nullable AModuleName,
195 n_annotations: nullable AAnnotations
196 )
197 do
198 empty_init
199 _n_visibility = n_visibility.as(not null)
200 n_visibility.parent = self
201 _n_kwimport = n_kwimport.as(not null)
202 n_kwimport.parent = self
203 _n_name = n_name.as(not null)
204 n_name.parent = self
205 _n_annotations = n_annotations
206 if n_annotations != null then
207 n_annotations.parent = self
208 end
209 end
210
211 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
212 do
213 if _n_visibility == old_child then
214 if new_child != null then
215 new_child.parent = self
216 assert new_child isa AVisibility
217 _n_visibility = new_child
218 else
219 abort
220 end
221 return
222 end
223 if _n_kwimport == old_child then
224 if new_child != null then
225 new_child.parent = self
226 assert new_child isa TKwimport
227 _n_kwimport = new_child
228 else
229 abort
230 end
231 return
232 end
233 if _n_name == old_child then
234 if new_child != null then
235 new_child.parent = self
236 assert new_child isa AModuleName
237 _n_name = new_child
238 else
239 abort
240 end
241 return
242 end
243 if _n_annotations == old_child then
244 if new_child != null then
245 new_child.parent = self
246 assert new_child isa AAnnotations
247 _n_annotations = new_child
248 else
249 _n_annotations = null
250 end
251 return
252 end
253 end
254
255 redef fun visit_all(v: Visitor)
256 do
257 v.enter_visit(_n_visibility)
258 v.enter_visit(_n_kwimport)
259 v.enter_visit(_n_name)
260 if _n_annotations != null then
261 v.enter_visit(_n_annotations.as(not null))
262 end
263 end
264 end
265 redef class ANoImport
266 private init empty_init do end
267
268 init init_anoimport (
269 n_visibility: nullable AVisibility,
270 n_kwimport: nullable TKwimport,
271 n_kwend: nullable TKwend
272 )
273 do
274 empty_init
275 _n_visibility = n_visibility.as(not null)
276 n_visibility.parent = self
277 _n_kwimport = n_kwimport.as(not null)
278 n_kwimport.parent = self
279 _n_kwend = n_kwend.as(not null)
280 n_kwend.parent = self
281 end
282
283 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
284 do
285 if _n_visibility == old_child then
286 if new_child != null then
287 new_child.parent = self
288 assert new_child isa AVisibility
289 _n_visibility = new_child
290 else
291 abort
292 end
293 return
294 end
295 if _n_kwimport == old_child then
296 if new_child != null then
297 new_child.parent = self
298 assert new_child isa TKwimport
299 _n_kwimport = new_child
300 else
301 abort
302 end
303 return
304 end
305 if _n_kwend == old_child then
306 if new_child != null then
307 new_child.parent = self
308 assert new_child isa TKwend
309 _n_kwend = new_child
310 else
311 abort
312 end
313 return
314 end
315 end
316
317 redef fun visit_all(v: Visitor)
318 do
319 v.enter_visit(_n_visibility)
320 v.enter_visit(_n_kwimport)
321 v.enter_visit(_n_kwend)
322 end
323 end
324 redef class APublicVisibility
325 private init empty_init do end
326
327 init init_apublicvisibility
328 do
329 empty_init
330 end
331
332 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
333 do
334 end
335
336 redef fun visit_all(v: Visitor)
337 do
338 end
339 end
340 redef class APrivateVisibility
341 private init empty_init do end
342
343 init init_aprivatevisibility (
344 n_kwprivate: nullable TKwprivate
345 )
346 do
347 empty_init
348 _n_kwprivate = n_kwprivate.as(not null)
349 n_kwprivate.parent = self
350 end
351
352 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
353 do
354 if _n_kwprivate == old_child then
355 if new_child != null then
356 new_child.parent = self
357 assert new_child isa TKwprivate
358 _n_kwprivate = new_child
359 else
360 abort
361 end
362 return
363 end
364 end
365
366 redef fun visit_all(v: Visitor)
367 do
368 v.enter_visit(_n_kwprivate)
369 end
370 end
371 redef class AProtectedVisibility
372 private init empty_init do end
373
374 init init_aprotectedvisibility (
375 n_kwprotected: nullable TKwprotected
376 )
377 do
378 empty_init
379 _n_kwprotected = n_kwprotected.as(not null)
380 n_kwprotected.parent = self
381 end
382
383 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
384 do
385 if _n_kwprotected == old_child then
386 if new_child != null then
387 new_child.parent = self
388 assert new_child isa TKwprotected
389 _n_kwprotected = new_child
390 else
391 abort
392 end
393 return
394 end
395 end
396
397 redef fun visit_all(v: Visitor)
398 do
399 v.enter_visit(_n_kwprotected)
400 end
401 end
402 redef class AIntrudeVisibility
403 private init empty_init do end
404
405 init init_aintrudevisibility (
406 n_kwintrude: nullable TKwintrude
407 )
408 do
409 empty_init
410 _n_kwintrude = n_kwintrude.as(not null)
411 n_kwintrude.parent = self
412 end
413
414 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
415 do
416 if _n_kwintrude == old_child then
417 if new_child != null then
418 new_child.parent = self
419 assert new_child isa TKwintrude
420 _n_kwintrude = new_child
421 else
422 abort
423 end
424 return
425 end
426 end
427
428 redef fun visit_all(v: Visitor)
429 do
430 v.enter_visit(_n_kwintrude)
431 end
432 end
433 redef class AStdClassdef
434 private init empty_init do end
435
436 init init_astdclassdef (
437 n_doc: nullable ADoc,
438 n_kwredef: nullable TKwredef,
439 n_visibility: nullable AVisibility,
440 n_classkind: nullable AClasskind,
441 n_id: nullable TClassid,
442 n_formaldefs: Collection[Object], # Should be Collection[AFormaldef]
443 n_annotations: nullable AAnnotations,
444 n_extern_code_block: nullable AExternCodeBlock,
445 n_superclasses: Collection[Object], # Should be Collection[ASuperclass]
446 n_propdefs: Collection[Object], # Should be Collection[APropdef]
447 n_kwend: nullable TKwend
448 )
449 do
450 empty_init
451 _n_doc = n_doc
452 if n_doc != null then
453 n_doc.parent = self
454 end
455 _n_kwredef = n_kwredef
456 if n_kwredef != null then
457 n_kwredef.parent = self
458 end
459 _n_visibility = n_visibility.as(not null)
460 n_visibility.parent = self
461 _n_classkind = n_classkind.as(not null)
462 n_classkind.parent = self
463 _n_id = n_id
464 if n_id != null then
465 n_id.parent = self
466 end
467 for n in n_formaldefs do
468 assert n isa AFormaldef
469 _n_formaldefs.add(n)
470 n.parent = self
471 end
472 _n_annotations = n_annotations
473 if n_annotations != null then
474 n_annotations.parent = self
475 end
476 _n_extern_code_block = n_extern_code_block
477 if n_extern_code_block != null then
478 n_extern_code_block.parent = self
479 end
480 for n in n_superclasses do
481 assert n isa ASuperclass
482 _n_superclasses.add(n)
483 n.parent = self
484 end
485 for n in n_propdefs do
486 assert n isa APropdef
487 _n_propdefs.add(n)
488 n.parent = self
489 end
490 _n_kwend = n_kwend.as(not null)
491 n_kwend.parent = self
492 end
493
494 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
495 do
496 if _n_doc == old_child then
497 if new_child != null then
498 new_child.parent = self
499 assert new_child isa ADoc
500 _n_doc = new_child
501 else
502 _n_doc = null
503 end
504 return
505 end
506 if _n_kwredef == old_child then
507 if new_child != null then
508 new_child.parent = self
509 assert new_child isa TKwredef
510 _n_kwredef = new_child
511 else
512 _n_kwredef = null
513 end
514 return
515 end
516 if _n_visibility == old_child then
517 if new_child != null then
518 new_child.parent = self
519 assert new_child isa AVisibility
520 _n_visibility = new_child
521 else
522 abort
523 end
524 return
525 end
526 if _n_classkind == old_child then
527 if new_child != null then
528 new_child.parent = self
529 assert new_child isa AClasskind
530 _n_classkind = new_child
531 else
532 abort
533 end
534 return
535 end
536 if _n_id == old_child then
537 if new_child != null then
538 new_child.parent = self
539 assert new_child isa TClassid
540 _n_id = new_child
541 else
542 _n_id = null
543 end
544 return
545 end
546 for i in [0.._n_formaldefs.length[ do
547 if _n_formaldefs[i] == old_child then
548 if new_child != null then
549 assert new_child isa AFormaldef
550 _n_formaldefs[i] = new_child
551 new_child.parent = self
552 else
553 _n_formaldefs.remove_at(i)
554 end
555 return
556 end
557 end
558 if _n_annotations == old_child then
559 if new_child != null then
560 new_child.parent = self
561 assert new_child isa AAnnotations
562 _n_annotations = new_child
563 else
564 _n_annotations = null
565 end
566 return
567 end
568 if _n_extern_code_block == old_child then
569 if new_child != null then
570 new_child.parent = self
571 assert new_child isa AExternCodeBlock
572 _n_extern_code_block = new_child
573 else
574 _n_extern_code_block = null
575 end
576 return
577 end
578 for i in [0.._n_superclasses.length[ do
579 if _n_superclasses[i] == old_child then
580 if new_child != null then
581 assert new_child isa ASuperclass
582 _n_superclasses[i] = new_child
583 new_child.parent = self
584 else
585 _n_superclasses.remove_at(i)
586 end
587 return
588 end
589 end
590 for i in [0.._n_propdefs.length[ do
591 if _n_propdefs[i] == old_child then
592 if new_child != null then
593 assert new_child isa APropdef
594 _n_propdefs[i] = new_child
595 new_child.parent = self
596 else
597 _n_propdefs.remove_at(i)
598 end
599 return
600 end
601 end
602 if _n_kwend == old_child then
603 if new_child != null then
604 new_child.parent = self
605 assert new_child isa TKwend
606 _n_kwend = new_child
607 else
608 abort
609 end
610 return
611 end
612 end
613
614 redef fun visit_all(v: Visitor)
615 do
616 if _n_doc != null then
617 v.enter_visit(_n_doc.as(not null))
618 end
619 if _n_kwredef != null then
620 v.enter_visit(_n_kwredef.as(not null))
621 end
622 v.enter_visit(_n_visibility)
623 v.enter_visit(_n_classkind)
624 if _n_id != null then
625 v.enter_visit(_n_id.as(not null))
626 end
627 for n in _n_formaldefs do
628 v.enter_visit(n)
629 end
630 if _n_annotations != null then
631 v.enter_visit(_n_annotations.as(not null))
632 end
633 if _n_extern_code_block != null then
634 v.enter_visit(_n_extern_code_block.as(not null))
635 end
636 for n in _n_superclasses do
637 v.enter_visit(n)
638 end
639 for n in _n_propdefs do
640 v.enter_visit(n)
641 end
642 v.enter_visit(_n_kwend)
643 end
644 end
645 redef class ATopClassdef
646 private init empty_init do end
647
648 init init_atopclassdef (
649 n_propdefs: Collection[Object] # Should be Collection[APropdef]
650 )
651 do
652 empty_init
653 for n in n_propdefs do
654 assert n isa APropdef
655 _n_propdefs.add(n)
656 n.parent = self
657 end
658 end
659
660 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
661 do
662 for i in [0.._n_propdefs.length[ do
663 if _n_propdefs[i] == old_child then
664 if new_child != null then
665 assert new_child isa APropdef
666 _n_propdefs[i] = new_child
667 new_child.parent = self
668 else
669 _n_propdefs.remove_at(i)
670 end
671 return
672 end
673 end
674 end
675
676 redef fun visit_all(v: Visitor)
677 do
678 for n in _n_propdefs do
679 v.enter_visit(n)
680 end
681 end
682 end
683 redef class AMainClassdef
684 private init empty_init do end
685
686 init init_amainclassdef (
687 n_propdefs: Collection[Object] # Should be Collection[APropdef]
688 )
689 do
690 empty_init
691 for n in n_propdefs do
692 assert n isa APropdef
693 _n_propdefs.add(n)
694 n.parent = self
695 end
696 end
697
698 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
699 do
700 for i in [0.._n_propdefs.length[ do
701 if _n_propdefs[i] == old_child then
702 if new_child != null then
703 assert new_child isa APropdef
704 _n_propdefs[i] = new_child
705 new_child.parent = self
706 else
707 _n_propdefs.remove_at(i)
708 end
709 return
710 end
711 end
712 end
713
714 redef fun visit_all(v: Visitor)
715 do
716 for n in _n_propdefs do
717 v.enter_visit(n)
718 end
719 end
720 end
721 redef class AConcreteClasskind
722 private init empty_init do end
723
724 init init_aconcreteclasskind (
725 n_kwclass: nullable TKwclass
726 )
727 do
728 empty_init
729 _n_kwclass = n_kwclass.as(not null)
730 n_kwclass.parent = self
731 end
732
733 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
734 do
735 if _n_kwclass == old_child then
736 if new_child != null then
737 new_child.parent = self
738 assert new_child isa TKwclass
739 _n_kwclass = new_child
740 else
741 abort
742 end
743 return
744 end
745 end
746
747 redef fun visit_all(v: Visitor)
748 do
749 v.enter_visit(_n_kwclass)
750 end
751 end
752 redef class AAbstractClasskind
753 private init empty_init do end
754
755 init init_aabstractclasskind (
756 n_kwabstract: nullable TKwabstract,
757 n_kwclass: nullable TKwclass
758 )
759 do
760 empty_init
761 _n_kwabstract = n_kwabstract.as(not null)
762 n_kwabstract.parent = self
763 _n_kwclass = n_kwclass.as(not null)
764 n_kwclass.parent = self
765 end
766
767 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
768 do
769 if _n_kwabstract == old_child then
770 if new_child != null then
771 new_child.parent = self
772 assert new_child isa TKwabstract
773 _n_kwabstract = new_child
774 else
775 abort
776 end
777 return
778 end
779 if _n_kwclass == old_child then
780 if new_child != null then
781 new_child.parent = self
782 assert new_child isa TKwclass
783 _n_kwclass = new_child
784 else
785 abort
786 end
787 return
788 end
789 end
790
791 redef fun visit_all(v: Visitor)
792 do
793 v.enter_visit(_n_kwabstract)
794 v.enter_visit(_n_kwclass)
795 end
796 end
797 redef class AInterfaceClasskind
798 private init empty_init do end
799
800 init init_ainterfaceclasskind (
801 n_kwinterface: nullable TKwinterface
802 )
803 do
804 empty_init
805 _n_kwinterface = n_kwinterface.as(not null)
806 n_kwinterface.parent = self
807 end
808
809 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
810 do
811 if _n_kwinterface == old_child then
812 if new_child != null then
813 new_child.parent = self
814 assert new_child isa TKwinterface
815 _n_kwinterface = new_child
816 else
817 abort
818 end
819 return
820 end
821 end
822
823 redef fun visit_all(v: Visitor)
824 do
825 v.enter_visit(_n_kwinterface)
826 end
827 end
828 redef class AEnumClasskind
829 private init empty_init do end
830
831 init init_aenumclasskind (
832 n_kwenum: nullable TKwenum
833 )
834 do
835 empty_init
836 _n_kwenum = n_kwenum.as(not null)
837 n_kwenum.parent = self
838 end
839
840 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
841 do
842 if _n_kwenum == old_child then
843 if new_child != null then
844 new_child.parent = self
845 assert new_child isa TKwenum
846 _n_kwenum = new_child
847 else
848 abort
849 end
850 return
851 end
852 end
853
854 redef fun visit_all(v: Visitor)
855 do
856 v.enter_visit(_n_kwenum)
857 end
858 end
859 redef class AExternClasskind
860 private init empty_init do end
861
862 init init_aexternclasskind (
863 n_kwextern: nullable TKwextern,
864 n_kwclass: nullable TKwclass
865 )
866 do
867 empty_init
868 _n_kwextern = n_kwextern.as(not null)
869 n_kwextern.parent = self
870 _n_kwclass = n_kwclass
871 if n_kwclass != null then
872 n_kwclass.parent = self
873 end
874 end
875
876 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
877 do
878 if _n_kwextern == old_child then
879 if new_child != null then
880 new_child.parent = self
881 assert new_child isa TKwextern
882 _n_kwextern = new_child
883 else
884 abort
885 end
886 return
887 end
888 if _n_kwclass == old_child then
889 if new_child != null then
890 new_child.parent = self
891 assert new_child isa TKwclass
892 _n_kwclass = new_child
893 else
894 _n_kwclass = null
895 end
896 return
897 end
898 end
899
900 redef fun visit_all(v: Visitor)
901 do
902 v.enter_visit(_n_kwextern)
903 if _n_kwclass != null then
904 v.enter_visit(_n_kwclass.as(not null))
905 end
906 end
907 end
908 redef class AFormaldef
909 private init empty_init do end
910
911 init init_aformaldef (
912 n_id: nullable TClassid,
913 n_type: nullable AType,
914 n_annotations: nullable AAnnotations
915 )
916 do
917 empty_init
918 _n_id = n_id.as(not null)
919 n_id.parent = self
920 _n_type = n_type
921 if n_type != null then
922 n_type.parent = self
923 end
924 _n_annotations = n_annotations
925 if n_annotations != null then
926 n_annotations.parent = self
927 end
928 end
929
930 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
931 do
932 if _n_id == old_child then
933 if new_child != null then
934 new_child.parent = self
935 assert new_child isa TClassid
936 _n_id = new_child
937 else
938 abort
939 end
940 return
941 end
942 if _n_type == old_child then
943 if new_child != null then
944 new_child.parent = self
945 assert new_child isa AType
946 _n_type = new_child
947 else
948 _n_type = null
949 end
950 return
951 end
952 if _n_annotations == old_child then
953 if new_child != null then
954 new_child.parent = self
955 assert new_child isa AAnnotations
956 _n_annotations = new_child
957 else
958 _n_annotations = null
959 end
960 return
961 end
962 end
963
964 redef fun visit_all(v: Visitor)
965 do
966 v.enter_visit(_n_id)
967 if _n_type != null then
968 v.enter_visit(_n_type.as(not null))
969 end
970 if _n_annotations != null then
971 v.enter_visit(_n_annotations.as(not null))
972 end
973 end
974 end
975 redef class ASuperclass
976 private init empty_init do end
977
978 init init_asuperclass (
979 n_kwsuper: nullable TKwsuper,
980 n_type: nullable AType,
981 n_annotations: nullable AAnnotations
982 )
983 do
984 empty_init
985 _n_kwsuper = n_kwsuper.as(not null)
986 n_kwsuper.parent = self
987 _n_type = n_type.as(not null)
988 n_type.parent = self
989 _n_annotations = n_annotations
990 if n_annotations != null then
991 n_annotations.parent = self
992 end
993 end
994
995 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
996 do
997 if _n_kwsuper == old_child then
998 if new_child != null then
999 new_child.parent = self
1000 assert new_child isa TKwsuper
1001 _n_kwsuper = new_child
1002 else
1003 abort
1004 end
1005 return
1006 end
1007 if _n_type == old_child then
1008 if new_child != null then
1009 new_child.parent = self
1010 assert new_child isa AType
1011 _n_type = new_child
1012 else
1013 abort
1014 end
1015 return
1016 end
1017 if _n_annotations == old_child then
1018 if new_child != null then
1019 new_child.parent = self
1020 assert new_child isa AAnnotations
1021 _n_annotations = new_child
1022 else
1023 _n_annotations = null
1024 end
1025 return
1026 end
1027 end
1028
1029 redef fun visit_all(v: Visitor)
1030 do
1031 v.enter_visit(_n_kwsuper)
1032 v.enter_visit(_n_type)
1033 if _n_annotations != null then
1034 v.enter_visit(_n_annotations.as(not null))
1035 end
1036 end
1037 end
1038 redef class AAttrPropdef
1039 private init empty_init do end
1040
1041 init init_aattrpropdef (
1042 n_doc: nullable ADoc,
1043 n_readable: nullable AAble,
1044 n_writable: nullable AAble,
1045 n_kwredef: nullable TKwredef,
1046 n_visibility: nullable AVisibility,
1047 n_kwvar: nullable TKwvar,
1048 n_id: nullable TAttrid,
1049 n_id2: nullable TId,
1050 n_type: nullable AType,
1051 n_annotations: nullable AAnnotations,
1052 n_expr: nullable AExpr
1053 )
1054 do
1055 empty_init
1056 _n_doc = n_doc
1057 if n_doc != null then
1058 n_doc.parent = self
1059 end
1060 _n_readable = n_readable
1061 if n_readable != null then
1062 n_readable.parent = self
1063 end
1064 _n_writable = n_writable
1065 if n_writable != null then
1066 n_writable.parent = self
1067 end
1068 _n_kwredef = n_kwredef
1069 if n_kwredef != null then
1070 n_kwredef.parent = self
1071 end
1072 _n_visibility = n_visibility.as(not null)
1073 n_visibility.parent = self
1074 _n_kwvar = n_kwvar.as(not null)
1075 n_kwvar.parent = self
1076 _n_id = n_id
1077 if n_id != null then
1078 n_id.parent = self
1079 end
1080 _n_id2 = n_id2
1081 if n_id2 != null then
1082 n_id2.parent = self
1083 end
1084 _n_type = n_type
1085 if n_type != null then
1086 n_type.parent = self
1087 end
1088 _n_annotations = n_annotations
1089 if n_annotations != null then
1090 n_annotations.parent = self
1091 end
1092 _n_expr = n_expr
1093 if n_expr != null then
1094 n_expr.parent = self
1095 end
1096 end
1097
1098 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1099 do
1100 if _n_doc == old_child then
1101 if new_child != null then
1102 new_child.parent = self
1103 assert new_child isa ADoc
1104 _n_doc = new_child
1105 else
1106 _n_doc = null
1107 end
1108 return
1109 end
1110 if _n_readable == old_child then
1111 if new_child != null then
1112 new_child.parent = self
1113 assert new_child isa AAble
1114 _n_readable = new_child
1115 else
1116 _n_readable = null
1117 end
1118 return
1119 end
1120 if _n_writable == old_child then
1121 if new_child != null then
1122 new_child.parent = self
1123 assert new_child isa AAble
1124 _n_writable = new_child
1125 else
1126 _n_writable = null
1127 end
1128 return
1129 end
1130 if _n_kwredef == old_child then
1131 if new_child != null then
1132 new_child.parent = self
1133 assert new_child isa TKwredef
1134 _n_kwredef = new_child
1135 else
1136 _n_kwredef = null
1137 end
1138 return
1139 end
1140 if _n_visibility == old_child then
1141 if new_child != null then
1142 new_child.parent = self
1143 assert new_child isa AVisibility
1144 _n_visibility = new_child
1145 else
1146 abort
1147 end
1148 return
1149 end
1150 if _n_kwvar == old_child then
1151 if new_child != null then
1152 new_child.parent = self
1153 assert new_child isa TKwvar
1154 _n_kwvar = new_child
1155 else
1156 abort
1157 end
1158 return
1159 end
1160 if _n_id == old_child then
1161 if new_child != null then
1162 new_child.parent = self
1163 assert new_child isa TAttrid
1164 _n_id = new_child
1165 else
1166 _n_id = null
1167 end
1168 return
1169 end
1170 if _n_id2 == old_child then
1171 if new_child != null then
1172 new_child.parent = self
1173 assert new_child isa TId
1174 _n_id2 = new_child
1175 else
1176 _n_id2 = null
1177 end
1178 return
1179 end
1180 if _n_type == old_child then
1181 if new_child != null then
1182 new_child.parent = self
1183 assert new_child isa AType
1184 _n_type = new_child
1185 else
1186 _n_type = null
1187 end
1188 return
1189 end
1190 if _n_annotations == old_child then
1191 if new_child != null then
1192 new_child.parent = self
1193 assert new_child isa AAnnotations
1194 _n_annotations = new_child
1195 else
1196 _n_annotations = null
1197 end
1198 return
1199 end
1200 if _n_expr == old_child then
1201 if new_child != null then
1202 new_child.parent = self
1203 assert new_child isa AExpr
1204 _n_expr = new_child
1205 else
1206 _n_expr = null
1207 end
1208 return
1209 end
1210 end
1211
1212 redef fun visit_all(v: Visitor)
1213 do
1214 if _n_doc != null then
1215 v.enter_visit(_n_doc.as(not null))
1216 end
1217 if _n_readable != null then
1218 v.enter_visit(_n_readable.as(not null))
1219 end
1220 if _n_writable != null then
1221 v.enter_visit(_n_writable.as(not null))
1222 end
1223 if _n_kwredef != null then
1224 v.enter_visit(_n_kwredef.as(not null))
1225 end
1226 v.enter_visit(_n_visibility)
1227 v.enter_visit(_n_kwvar)
1228 if _n_id != null then
1229 v.enter_visit(_n_id.as(not null))
1230 end
1231 if _n_id2 != null then
1232 v.enter_visit(_n_id2.as(not null))
1233 end
1234 if _n_type != null then
1235 v.enter_visit(_n_type.as(not null))
1236 end
1237 if _n_annotations != null then
1238 v.enter_visit(_n_annotations.as(not null))
1239 end
1240 if _n_expr != null then
1241 v.enter_visit(_n_expr.as(not null))
1242 end
1243 end
1244 end
1245 redef class AMethPropdef
1246 private init empty_init do end
1247
1248 init init_amethpropdef (
1249 n_doc: nullable ADoc,
1250 n_kwredef: nullable TKwredef,
1251 n_visibility: nullable AVisibility,
1252 n_methid: nullable AMethid,
1253 n_signature: nullable ASignature
1254 )
1255 do
1256 empty_init
1257 _n_doc = n_doc
1258 if n_doc != null then
1259 n_doc.parent = self
1260 end
1261 _n_kwredef = n_kwredef
1262 if n_kwredef != null then
1263 n_kwredef.parent = self
1264 end
1265 _n_visibility = n_visibility.as(not null)
1266 n_visibility.parent = self
1267 _n_methid = n_methid.as(not null)
1268 n_methid.parent = self
1269 _n_signature = n_signature.as(not null)
1270 n_signature.parent = self
1271 end
1272
1273 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1274 do
1275 if _n_doc == old_child then
1276 if new_child != null then
1277 new_child.parent = self
1278 assert new_child isa ADoc
1279 _n_doc = new_child
1280 else
1281 _n_doc = null
1282 end
1283 return
1284 end
1285 if _n_kwredef == old_child then
1286 if new_child != null then
1287 new_child.parent = self
1288 assert new_child isa TKwredef
1289 _n_kwredef = new_child
1290 else
1291 _n_kwredef = null
1292 end
1293 return
1294 end
1295 if _n_visibility == old_child then
1296 if new_child != null then
1297 new_child.parent = self
1298 assert new_child isa AVisibility
1299 _n_visibility = new_child
1300 else
1301 abort
1302 end
1303 return
1304 end
1305 if _n_methid == old_child then
1306 if new_child != null then
1307 new_child.parent = self
1308 assert new_child isa AMethid
1309 _n_methid = new_child
1310 else
1311 abort
1312 end
1313 return
1314 end
1315 if _n_signature == old_child then
1316 if new_child != null then
1317 new_child.parent = self
1318 assert new_child isa ASignature
1319 _n_signature = new_child
1320 else
1321 abort
1322 end
1323 return
1324 end
1325 end
1326
1327 redef fun visit_all(v: Visitor)
1328 do
1329 if _n_doc != null then
1330 v.enter_visit(_n_doc.as(not null))
1331 end
1332 if _n_kwredef != null then
1333 v.enter_visit(_n_kwredef.as(not null))
1334 end
1335 v.enter_visit(_n_visibility)
1336 v.enter_visit(_n_methid)
1337 v.enter_visit(_n_signature)
1338 end
1339 end
1340 redef class ADeferredMethPropdef
1341 private init empty_init do end
1342
1343 init init_adeferredmethpropdef (
1344 n_doc: nullable ADoc,
1345 n_kwredef: nullable TKwredef,
1346 n_visibility: nullable AVisibility,
1347 n_kwmeth: nullable TKwmeth,
1348 n_methid: nullable AMethid,
1349 n_signature: nullable ASignature,
1350 n_annotations: nullable AAnnotations
1351 )
1352 do
1353 empty_init
1354 _n_doc = n_doc
1355 if n_doc != null then
1356 n_doc.parent = self
1357 end
1358 _n_kwredef = n_kwredef
1359 if n_kwredef != null then
1360 n_kwredef.parent = self
1361 end
1362 _n_visibility = n_visibility.as(not null)
1363 n_visibility.parent = self
1364 _n_kwmeth = n_kwmeth.as(not null)
1365 n_kwmeth.parent = self
1366 _n_methid = n_methid.as(not null)
1367 n_methid.parent = self
1368 _n_signature = n_signature.as(not null)
1369 n_signature.parent = self
1370 _n_annotations = n_annotations
1371 if n_annotations != null then
1372 n_annotations.parent = self
1373 end
1374 end
1375
1376 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1377 do
1378 if _n_doc == old_child then
1379 if new_child != null then
1380 new_child.parent = self
1381 assert new_child isa ADoc
1382 _n_doc = new_child
1383 else
1384 _n_doc = null
1385 end
1386 return
1387 end
1388 if _n_kwredef == old_child then
1389 if new_child != null then
1390 new_child.parent = self
1391 assert new_child isa TKwredef
1392 _n_kwredef = new_child
1393 else
1394 _n_kwredef = null
1395 end
1396 return
1397 end
1398 if _n_visibility == old_child then
1399 if new_child != null then
1400 new_child.parent = self
1401 assert new_child isa AVisibility
1402 _n_visibility = new_child
1403 else
1404 abort
1405 end
1406 return
1407 end
1408 if _n_kwmeth == old_child then
1409 if new_child != null then
1410 new_child.parent = self
1411 assert new_child isa TKwmeth
1412 _n_kwmeth = new_child
1413 else
1414 abort
1415 end
1416 return
1417 end
1418 if _n_methid == old_child then
1419 if new_child != null then
1420 new_child.parent = self
1421 assert new_child isa AMethid
1422 _n_methid = new_child
1423 else
1424 abort
1425 end
1426 return
1427 end
1428 if _n_signature == old_child then
1429 if new_child != null then
1430 new_child.parent = self
1431 assert new_child isa ASignature
1432 _n_signature = new_child
1433 else
1434 abort
1435 end
1436 return
1437 end
1438 if _n_annotations == old_child then
1439 if new_child != null then
1440 new_child.parent = self
1441 assert new_child isa AAnnotations
1442 _n_annotations = new_child
1443 else
1444 _n_annotations = null
1445 end
1446 return
1447 end
1448 end
1449
1450 redef fun visit_all(v: Visitor)
1451 do
1452 if _n_doc != null then
1453 v.enter_visit(_n_doc.as(not null))
1454 end
1455 if _n_kwredef != null then
1456 v.enter_visit(_n_kwredef.as(not null))
1457 end
1458 v.enter_visit(_n_visibility)
1459 v.enter_visit(_n_kwmeth)
1460 v.enter_visit(_n_methid)
1461 v.enter_visit(_n_signature)
1462 if _n_annotations != null then
1463 v.enter_visit(_n_annotations.as(not null))
1464 end
1465 end
1466 end
1467 redef class AInternMethPropdef
1468 private init empty_init do end
1469
1470 init init_ainternmethpropdef (
1471 n_doc: nullable ADoc,
1472 n_kwredef: nullable TKwredef,
1473 n_visibility: nullable AVisibility,
1474 n_kwmeth: nullable TKwmeth,
1475 n_methid: nullable AMethid,
1476 n_signature: nullable ASignature
1477 )
1478 do
1479 empty_init
1480 _n_doc = n_doc
1481 if n_doc != null then
1482 n_doc.parent = self
1483 end
1484 _n_kwredef = n_kwredef
1485 if n_kwredef != null then
1486 n_kwredef.parent = self
1487 end
1488 _n_visibility = n_visibility.as(not null)
1489 n_visibility.parent = self
1490 _n_kwmeth = n_kwmeth.as(not null)
1491 n_kwmeth.parent = self
1492 _n_methid = n_methid.as(not null)
1493 n_methid.parent = self
1494 _n_signature = n_signature.as(not null)
1495 n_signature.parent = self
1496 end
1497
1498 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1499 do
1500 if _n_doc == old_child then
1501 if new_child != null then
1502 new_child.parent = self
1503 assert new_child isa ADoc
1504 _n_doc = new_child
1505 else
1506 _n_doc = null
1507 end
1508 return
1509 end
1510 if _n_kwredef == old_child then
1511 if new_child != null then
1512 new_child.parent = self
1513 assert new_child isa TKwredef
1514 _n_kwredef = new_child
1515 else
1516 _n_kwredef = null
1517 end
1518 return
1519 end
1520 if _n_visibility == old_child then
1521 if new_child != null then
1522 new_child.parent = self
1523 assert new_child isa AVisibility
1524 _n_visibility = new_child
1525 else
1526 abort
1527 end
1528 return
1529 end
1530 if _n_kwmeth == old_child then
1531 if new_child != null then
1532 new_child.parent = self
1533 assert new_child isa TKwmeth
1534 _n_kwmeth = new_child
1535 else
1536 abort
1537 end
1538 return
1539 end
1540 if _n_methid == old_child then
1541 if new_child != null then
1542 new_child.parent = self
1543 assert new_child isa AMethid
1544 _n_methid = new_child
1545 else
1546 abort
1547 end
1548 return
1549 end
1550 if _n_signature == old_child then
1551 if new_child != null then
1552 new_child.parent = self
1553 assert new_child isa ASignature
1554 _n_signature = new_child
1555 else
1556 abort
1557 end
1558 return
1559 end
1560 end
1561
1562 redef fun visit_all(v: Visitor)
1563 do
1564 if _n_doc != null then
1565 v.enter_visit(_n_doc.as(not null))
1566 end
1567 if _n_kwredef != null then
1568 v.enter_visit(_n_kwredef.as(not null))
1569 end
1570 v.enter_visit(_n_visibility)
1571 v.enter_visit(_n_kwmeth)
1572 v.enter_visit(_n_methid)
1573 v.enter_visit(_n_signature)
1574 end
1575 end
1576 redef class AExternMethPropdef
1577 private init empty_init do end
1578
1579 init init_aexternmethpropdef (
1580 n_doc: nullable ADoc,
1581 n_kwredef: nullable TKwredef,
1582 n_visibility: nullable AVisibility,
1583 n_kwmeth: nullable TKwmeth,
1584 n_methid: nullable AMethid,
1585 n_signature: nullable ASignature,
1586 n_extern: nullable TString,
1587 n_extern_calls: nullable AExternCalls,
1588 n_extern_code_block: nullable AExternCodeBlock
1589 )
1590 do
1591 empty_init
1592 _n_doc = n_doc
1593 if n_doc != null then
1594 n_doc.parent = self
1595 end
1596 _n_kwredef = n_kwredef
1597 if n_kwredef != null then
1598 n_kwredef.parent = self
1599 end
1600 _n_visibility = n_visibility.as(not null)
1601 n_visibility.parent = self
1602 _n_kwmeth = n_kwmeth.as(not null)
1603 n_kwmeth.parent = self
1604 _n_methid = n_methid.as(not null)
1605 n_methid.parent = self
1606 _n_signature = n_signature.as(not null)
1607 n_signature.parent = self
1608 _n_extern = n_extern
1609 if n_extern != null then
1610 n_extern.parent = self
1611 end
1612 _n_extern_calls = n_extern_calls
1613 if n_extern_calls != null then
1614 n_extern_calls.parent = self
1615 end
1616 _n_extern_code_block = n_extern_code_block
1617 if n_extern_code_block != null then
1618 n_extern_code_block.parent = self
1619 end
1620 end
1621
1622 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1623 do
1624 if _n_doc == old_child then
1625 if new_child != null then
1626 new_child.parent = self
1627 assert new_child isa ADoc
1628 _n_doc = new_child
1629 else
1630 _n_doc = null
1631 end
1632 return
1633 end
1634 if _n_kwredef == old_child then
1635 if new_child != null then
1636 new_child.parent = self
1637 assert new_child isa TKwredef
1638 _n_kwredef = new_child
1639 else
1640 _n_kwredef = null
1641 end
1642 return
1643 end
1644 if _n_visibility == old_child then
1645 if new_child != null then
1646 new_child.parent = self
1647 assert new_child isa AVisibility
1648 _n_visibility = new_child
1649 else
1650 abort
1651 end
1652 return
1653 end
1654 if _n_kwmeth == old_child then
1655 if new_child != null then
1656 new_child.parent = self
1657 assert new_child isa TKwmeth
1658 _n_kwmeth = new_child
1659 else
1660 abort
1661 end
1662 return
1663 end
1664 if _n_methid == old_child then
1665 if new_child != null then
1666 new_child.parent = self
1667 assert new_child isa AMethid
1668 _n_methid = new_child
1669 else
1670 abort
1671 end
1672 return
1673 end
1674 if _n_signature == old_child then
1675 if new_child != null then
1676 new_child.parent = self
1677 assert new_child isa ASignature
1678 _n_signature = new_child
1679 else
1680 abort
1681 end
1682 return
1683 end
1684 if _n_extern == old_child then
1685 if new_child != null then
1686 new_child.parent = self
1687 assert new_child isa TString
1688 _n_extern = new_child
1689 else
1690 _n_extern = null
1691 end
1692 return
1693 end
1694 if _n_extern_calls == old_child then
1695 if new_child != null then
1696 new_child.parent = self
1697 assert new_child isa AExternCalls
1698 _n_extern_calls = new_child
1699 else
1700 _n_extern_calls = null
1701 end
1702 return
1703 end
1704 if _n_extern_code_block == old_child then
1705 if new_child != null then
1706 new_child.parent = self
1707 assert new_child isa AExternCodeBlock
1708 _n_extern_code_block = new_child
1709 else
1710 _n_extern_code_block = null
1711 end
1712 return
1713 end
1714 end
1715
1716 redef fun visit_all(v: Visitor)
1717 do
1718 if _n_doc != null then
1719 v.enter_visit(_n_doc.as(not null))
1720 end
1721 if _n_kwredef != null then
1722 v.enter_visit(_n_kwredef.as(not null))
1723 end
1724 v.enter_visit(_n_visibility)
1725 v.enter_visit(_n_kwmeth)
1726 v.enter_visit(_n_methid)
1727 v.enter_visit(_n_signature)
1728 if _n_extern != null then
1729 v.enter_visit(_n_extern.as(not null))
1730 end
1731 if _n_extern_calls != null then
1732 v.enter_visit(_n_extern_calls.as(not null))
1733 end
1734 if _n_extern_code_block != null then
1735 v.enter_visit(_n_extern_code_block.as(not null))
1736 end
1737 end
1738 end
1739 redef class AConcreteMethPropdef
1740 private init empty_init do end
1741
1742 init init_aconcretemethpropdef (
1743 n_doc: nullable ADoc,
1744 n_kwredef: nullable TKwredef,
1745 n_visibility: nullable AVisibility,
1746 n_kwmeth: nullable TKwmeth,
1747 n_methid: nullable AMethid,
1748 n_signature: nullable ASignature,
1749 n_annotations: nullable AAnnotations,
1750 n_block: nullable AExpr
1751 )
1752 do
1753 empty_init
1754 _n_doc = n_doc
1755 if n_doc != null then
1756 n_doc.parent = self
1757 end
1758 _n_kwredef = n_kwredef
1759 if n_kwredef != null then
1760 n_kwredef.parent = self
1761 end
1762 _n_visibility = n_visibility.as(not null)
1763 n_visibility.parent = self
1764 _n_kwmeth = n_kwmeth.as(not null)
1765 n_kwmeth.parent = self
1766 _n_methid = n_methid.as(not null)
1767 n_methid.parent = self
1768 _n_signature = n_signature.as(not null)
1769 n_signature.parent = self
1770 _n_annotations = n_annotations
1771 if n_annotations != null then
1772 n_annotations.parent = self
1773 end
1774 _n_block = n_block
1775 if n_block != null then
1776 n_block.parent = self
1777 end
1778 end
1779
1780 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1781 do
1782 if _n_doc == old_child then
1783 if new_child != null then
1784 new_child.parent = self
1785 assert new_child isa ADoc
1786 _n_doc = new_child
1787 else
1788 _n_doc = null
1789 end
1790 return
1791 end
1792 if _n_kwredef == old_child then
1793 if new_child != null then
1794 new_child.parent = self
1795 assert new_child isa TKwredef
1796 _n_kwredef = new_child
1797 else
1798 _n_kwredef = null
1799 end
1800 return
1801 end
1802 if _n_visibility == old_child then
1803 if new_child != null then
1804 new_child.parent = self
1805 assert new_child isa AVisibility
1806 _n_visibility = new_child
1807 else
1808 abort
1809 end
1810 return
1811 end
1812 if _n_kwmeth == old_child then
1813 if new_child != null then
1814 new_child.parent = self
1815 assert new_child isa TKwmeth
1816 _n_kwmeth = new_child
1817 else
1818 abort
1819 end
1820 return
1821 end
1822 if _n_methid == old_child then
1823 if new_child != null then
1824 new_child.parent = self
1825 assert new_child isa AMethid
1826 _n_methid = new_child
1827 else
1828 abort
1829 end
1830 return
1831 end
1832 if _n_signature == old_child then
1833 if new_child != null then
1834 new_child.parent = self
1835 assert new_child isa ASignature
1836 _n_signature = new_child
1837 else
1838 abort
1839 end
1840 return
1841 end
1842 if _n_annotations == old_child then
1843 if new_child != null then
1844 new_child.parent = self
1845 assert new_child isa AAnnotations
1846 _n_annotations = new_child
1847 else
1848 _n_annotations = null
1849 end
1850 return
1851 end
1852 if _n_block == old_child then
1853 if new_child != null then
1854 new_child.parent = self
1855 assert new_child isa AExpr
1856 _n_block = new_child
1857 else
1858 _n_block = null
1859 end
1860 return
1861 end
1862 end
1863
1864 redef fun visit_all(v: Visitor)
1865 do
1866 if _n_doc != null then
1867 v.enter_visit(_n_doc.as(not null))
1868 end
1869 if _n_kwredef != null then
1870 v.enter_visit(_n_kwredef.as(not null))
1871 end
1872 v.enter_visit(_n_visibility)
1873 v.enter_visit(_n_kwmeth)
1874 v.enter_visit(_n_methid)
1875 v.enter_visit(_n_signature)
1876 if _n_annotations != null then
1877 v.enter_visit(_n_annotations.as(not null))
1878 end
1879 if _n_block != null then
1880 v.enter_visit(_n_block.as(not null))
1881 end
1882 end
1883 end
1884 redef class AConcreteInitPropdef
1885 private init empty_init do end
1886
1887 init init_aconcreteinitpropdef (
1888 n_doc: nullable ADoc,
1889 n_kwredef: nullable TKwredef,
1890 n_visibility: nullable AVisibility,
1891 n_kwinit: nullable TKwinit,
1892 n_methid: nullable AMethid,
1893 n_signature: nullable ASignature,
1894 n_annotations: nullable AAnnotations,
1895 n_block: nullable AExpr
1896 )
1897 do
1898 empty_init
1899 _n_doc = n_doc
1900 if n_doc != null then
1901 n_doc.parent = self
1902 end
1903 _n_kwredef = n_kwredef
1904 if n_kwredef != null then
1905 n_kwredef.parent = self
1906 end
1907 _n_visibility = n_visibility.as(not null)
1908 n_visibility.parent = self
1909 _n_kwinit = n_kwinit.as(not null)
1910 n_kwinit.parent = self
1911 _n_methid = n_methid
1912 if n_methid != null then
1913 n_methid.parent = self
1914 end
1915 _n_signature = n_signature.as(not null)
1916 n_signature.parent = self
1917 _n_annotations = n_annotations
1918 if n_annotations != null then
1919 n_annotations.parent = self
1920 end
1921 _n_block = n_block
1922 if n_block != null then
1923 n_block.parent = self
1924 end
1925 end
1926
1927 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1928 do
1929 if _n_doc == old_child then
1930 if new_child != null then
1931 new_child.parent = self
1932 assert new_child isa ADoc
1933 _n_doc = new_child
1934 else
1935 _n_doc = null
1936 end
1937 return
1938 end
1939 if _n_kwredef == old_child then
1940 if new_child != null then
1941 new_child.parent = self
1942 assert new_child isa TKwredef
1943 _n_kwredef = new_child
1944 else
1945 _n_kwredef = null
1946 end
1947 return
1948 end
1949 if _n_visibility == old_child then
1950 if new_child != null then
1951 new_child.parent = self
1952 assert new_child isa AVisibility
1953 _n_visibility = new_child
1954 else
1955 abort
1956 end
1957 return
1958 end
1959 if _n_kwinit == old_child then
1960 if new_child != null then
1961 new_child.parent = self
1962 assert new_child isa TKwinit
1963 _n_kwinit = new_child
1964 else
1965 abort
1966 end
1967 return
1968 end
1969 if _n_methid == old_child then
1970 if new_child != null then
1971 new_child.parent = self
1972 assert new_child isa AMethid
1973 _n_methid = new_child
1974 else
1975 _n_methid = null
1976 end
1977 return
1978 end
1979 if _n_signature == old_child then
1980 if new_child != null then
1981 new_child.parent = self
1982 assert new_child isa ASignature
1983 _n_signature = new_child
1984 else
1985 abort
1986 end
1987 return
1988 end
1989 if _n_annotations == old_child then
1990 if new_child != null then
1991 new_child.parent = self
1992 assert new_child isa AAnnotations
1993 _n_annotations = new_child
1994 else
1995 _n_annotations = null
1996 end
1997 return
1998 end
1999 if _n_block == old_child then
2000 if new_child != null then
2001 new_child.parent = self
2002 assert new_child isa AExpr
2003 _n_block = new_child
2004 else
2005 _n_block = null
2006 end
2007 return
2008 end
2009 end
2010
2011 redef fun visit_all(v: Visitor)
2012 do
2013 if _n_doc != null then
2014 v.enter_visit(_n_doc.as(not null))
2015 end
2016 if _n_kwredef != null then
2017 v.enter_visit(_n_kwredef.as(not null))
2018 end
2019 v.enter_visit(_n_visibility)
2020 v.enter_visit(_n_kwinit)
2021 if _n_methid != null then
2022 v.enter_visit(_n_methid.as(not null))
2023 end
2024 v.enter_visit(_n_signature)
2025 if _n_annotations != null then
2026 v.enter_visit(_n_annotations.as(not null))
2027 end
2028 if _n_block != null then
2029 v.enter_visit(_n_block.as(not null))
2030 end
2031 end
2032 end
2033 redef class AExternInitPropdef
2034 private init empty_init do end
2035
2036 init init_aexterninitpropdef (
2037 n_doc: nullable ADoc,
2038 n_kwredef: nullable TKwredef,
2039 n_visibility: nullable AVisibility,
2040 n_kwnew: nullable TKwnew,
2041 n_methid: nullable AMethid,
2042 n_signature: nullable ASignature,
2043 n_extern: nullable TString,
2044 n_extern_calls: nullable AExternCalls,
2045 n_extern_code_block: nullable AExternCodeBlock
2046 )
2047 do
2048 empty_init
2049 _n_doc = n_doc
2050 if n_doc != null then
2051 n_doc.parent = self
2052 end
2053 _n_kwredef = n_kwredef
2054 if n_kwredef != null then
2055 n_kwredef.parent = self
2056 end
2057 _n_visibility = n_visibility.as(not null)
2058 n_visibility.parent = self
2059 _n_kwnew = n_kwnew.as(not null)
2060 n_kwnew.parent = self
2061 _n_methid = n_methid
2062 if n_methid != null then
2063 n_methid.parent = self
2064 end
2065 _n_signature = n_signature.as(not null)
2066 n_signature.parent = self
2067 _n_extern = n_extern
2068 if n_extern != null then
2069 n_extern.parent = self
2070 end
2071 _n_extern_calls = n_extern_calls
2072 if n_extern_calls != null then
2073 n_extern_calls.parent = self
2074 end
2075 _n_extern_code_block = n_extern_code_block
2076 if n_extern_code_block != null then
2077 n_extern_code_block.parent = self
2078 end
2079 end
2080
2081 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2082 do
2083 if _n_doc == old_child then
2084 if new_child != null then
2085 new_child.parent = self
2086 assert new_child isa ADoc
2087 _n_doc = new_child
2088 else
2089 _n_doc = null
2090 end
2091 return
2092 end
2093 if _n_kwredef == old_child then
2094 if new_child != null then
2095 new_child.parent = self
2096 assert new_child isa TKwredef
2097 _n_kwredef = new_child
2098 else
2099 _n_kwredef = null
2100 end
2101 return
2102 end
2103 if _n_visibility == old_child then
2104 if new_child != null then
2105 new_child.parent = self
2106 assert new_child isa AVisibility
2107 _n_visibility = new_child
2108 else
2109 abort
2110 end
2111 return
2112 end
2113 if _n_kwnew == old_child then
2114 if new_child != null then
2115 new_child.parent = self
2116 assert new_child isa TKwnew
2117 _n_kwnew = new_child
2118 else
2119 abort
2120 end
2121 return
2122 end
2123 if _n_methid == old_child then
2124 if new_child != null then
2125 new_child.parent = self
2126 assert new_child isa AMethid
2127 _n_methid = new_child
2128 else
2129 _n_methid = null
2130 end
2131 return
2132 end
2133 if _n_signature == old_child then
2134 if new_child != null then
2135 new_child.parent = self
2136 assert new_child isa ASignature
2137 _n_signature = new_child
2138 else
2139 abort
2140 end
2141 return
2142 end
2143 if _n_extern == old_child then
2144 if new_child != null then
2145 new_child.parent = self
2146 assert new_child isa TString
2147 _n_extern = new_child
2148 else
2149 _n_extern = null
2150 end
2151 return
2152 end
2153 if _n_extern_calls == old_child then
2154 if new_child != null then
2155 new_child.parent = self
2156 assert new_child isa AExternCalls
2157 _n_extern_calls = new_child
2158 else
2159 _n_extern_calls = null
2160 end
2161 return
2162 end
2163 if _n_extern_code_block == old_child then
2164 if new_child != null then
2165 new_child.parent = self
2166 assert new_child isa AExternCodeBlock
2167 _n_extern_code_block = new_child
2168 else
2169 _n_extern_code_block = null
2170 end
2171 return
2172 end
2173 end
2174
2175 redef fun visit_all(v: Visitor)
2176 do
2177 if _n_doc != null then
2178 v.enter_visit(_n_doc.as(not null))
2179 end
2180 if _n_kwredef != null then
2181 v.enter_visit(_n_kwredef.as(not null))
2182 end
2183 v.enter_visit(_n_visibility)
2184 v.enter_visit(_n_kwnew)
2185 if _n_methid != null then
2186 v.enter_visit(_n_methid.as(not null))
2187 end
2188 v.enter_visit(_n_signature)
2189 if _n_extern != null then
2190 v.enter_visit(_n_extern.as(not null))
2191 end
2192 if _n_extern_calls != null then
2193 v.enter_visit(_n_extern_calls.as(not null))
2194 end
2195 if _n_extern_code_block != null then
2196 v.enter_visit(_n_extern_code_block.as(not null))
2197 end
2198 end
2199 end
2200 redef class AMainMethPropdef
2201 private init empty_init do end
2202
2203 init init_amainmethpropdef (
2204 n_kwredef: nullable TKwredef,
2205 n_block: nullable AExpr
2206 )
2207 do
2208 empty_init
2209 _n_kwredef = n_kwredef
2210 if n_kwredef != null then
2211 n_kwredef.parent = self
2212 end
2213 _n_block = n_block
2214 if n_block != null then
2215 n_block.parent = self
2216 end
2217 end
2218
2219 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2220 do
2221 if _n_kwredef == old_child then
2222 if new_child != null then
2223 new_child.parent = self
2224 assert new_child isa TKwredef
2225 _n_kwredef = new_child
2226 else
2227 _n_kwredef = null
2228 end
2229 return
2230 end
2231 if _n_block == old_child then
2232 if new_child != null then
2233 new_child.parent = self
2234 assert new_child isa AExpr
2235 _n_block = new_child
2236 else
2237 _n_block = null
2238 end
2239 return
2240 end
2241 end
2242
2243 redef fun visit_all(v: Visitor)
2244 do
2245 if _n_kwredef != null then
2246 v.enter_visit(_n_kwredef.as(not null))
2247 end
2248 if _n_block != null then
2249 v.enter_visit(_n_block.as(not null))
2250 end
2251 end
2252 end
2253 redef class ATypePropdef
2254 private init empty_init do end
2255
2256 init init_atypepropdef (
2257 n_doc: nullable ADoc,
2258 n_kwredef: nullable TKwredef,
2259 n_visibility: nullable AVisibility,
2260 n_kwtype: nullable TKwtype,
2261 n_id: nullable TClassid,
2262 n_type: nullable AType,
2263 n_annotations: nullable AAnnotations
2264 )
2265 do
2266 empty_init
2267 _n_doc = n_doc
2268 if n_doc != null then
2269 n_doc.parent = self
2270 end
2271 _n_kwredef = n_kwredef
2272 if n_kwredef != null then
2273 n_kwredef.parent = self
2274 end
2275 _n_visibility = n_visibility.as(not null)
2276 n_visibility.parent = self
2277 _n_kwtype = n_kwtype.as(not null)
2278 n_kwtype.parent = self
2279 _n_id = n_id.as(not null)
2280 n_id.parent = self
2281 _n_type = n_type.as(not null)
2282 n_type.parent = self
2283 _n_annotations = n_annotations
2284 if n_annotations != null then
2285 n_annotations.parent = self
2286 end
2287 end
2288
2289 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2290 do
2291 if _n_doc == old_child then
2292 if new_child != null then
2293 new_child.parent = self
2294 assert new_child isa ADoc
2295 _n_doc = new_child
2296 else
2297 _n_doc = null
2298 end
2299 return
2300 end
2301 if _n_kwredef == old_child then
2302 if new_child != null then
2303 new_child.parent = self
2304 assert new_child isa TKwredef
2305 _n_kwredef = new_child
2306 else
2307 _n_kwredef = null
2308 end
2309 return
2310 end
2311 if _n_visibility == old_child then
2312 if new_child != null then
2313 new_child.parent = self
2314 assert new_child isa AVisibility
2315 _n_visibility = new_child
2316 else
2317 abort
2318 end
2319 return
2320 end
2321 if _n_kwtype == old_child then
2322 if new_child != null then
2323 new_child.parent = self
2324 assert new_child isa TKwtype
2325 _n_kwtype = new_child
2326 else
2327 abort
2328 end
2329 return
2330 end
2331 if _n_id == old_child then
2332 if new_child != null then
2333 new_child.parent = self
2334 assert new_child isa TClassid
2335 _n_id = new_child
2336 else
2337 abort
2338 end
2339 return
2340 end
2341 if _n_type == old_child then
2342 if new_child != null then
2343 new_child.parent = self
2344 assert new_child isa AType
2345 _n_type = new_child
2346 else
2347 abort
2348 end
2349 return
2350 end
2351 if _n_annotations == old_child then
2352 if new_child != null then
2353 new_child.parent = self
2354 assert new_child isa AAnnotations
2355 _n_annotations = new_child
2356 else
2357 _n_annotations = null
2358 end
2359 return
2360 end
2361 end
2362
2363 redef fun visit_all(v: Visitor)
2364 do
2365 if _n_doc != null then
2366 v.enter_visit(_n_doc.as(not null))
2367 end
2368 if _n_kwredef != null then
2369 v.enter_visit(_n_kwredef.as(not null))
2370 end
2371 v.enter_visit(_n_visibility)
2372 v.enter_visit(_n_kwtype)
2373 v.enter_visit(_n_id)
2374 v.enter_visit(_n_type)
2375 if _n_annotations != null then
2376 v.enter_visit(_n_annotations.as(not null))
2377 end
2378 end
2379 end
2380 redef class AReadAble
2381 private init empty_init do end
2382
2383 init init_areadable (
2384 n_kwredef: nullable TKwredef,
2385 n_kwreadable: nullable TKwreadable
2386 )
2387 do
2388 empty_init
2389 _n_kwredef = n_kwredef
2390 if n_kwredef != null then
2391 n_kwredef.parent = self
2392 end
2393 _n_kwreadable = n_kwreadable.as(not null)
2394 n_kwreadable.parent = self
2395 end
2396
2397 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2398 do
2399 if _n_kwredef == old_child then
2400 if new_child != null then
2401 new_child.parent = self
2402 assert new_child isa TKwredef
2403 _n_kwredef = new_child
2404 else
2405 _n_kwredef = null
2406 end
2407 return
2408 end
2409 if _n_kwreadable == old_child then
2410 if new_child != null then
2411 new_child.parent = self
2412 assert new_child isa TKwreadable
2413 _n_kwreadable = new_child
2414 else
2415 abort
2416 end
2417 return
2418 end
2419 end
2420
2421 redef fun visit_all(v: Visitor)
2422 do
2423 if _n_kwredef != null then
2424 v.enter_visit(_n_kwredef.as(not null))
2425 end
2426 v.enter_visit(_n_kwreadable)
2427 end
2428 end
2429 redef class AWriteAble
2430 private init empty_init do end
2431
2432 init init_awriteable (
2433 n_kwredef: nullable TKwredef,
2434 n_visibility: nullable AVisibility,
2435 n_kwwritable: nullable TKwwritable
2436 )
2437 do
2438 empty_init
2439 _n_kwredef = n_kwredef
2440 if n_kwredef != null then
2441 n_kwredef.parent = self
2442 end
2443 _n_visibility = n_visibility
2444 if n_visibility != null then
2445 n_visibility.parent = self
2446 end
2447 _n_kwwritable = n_kwwritable.as(not null)
2448 n_kwwritable.parent = self
2449 end
2450
2451 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2452 do
2453 if _n_kwredef == old_child then
2454 if new_child != null then
2455 new_child.parent = self
2456 assert new_child isa TKwredef
2457 _n_kwredef = new_child
2458 else
2459 _n_kwredef = null
2460 end
2461 return
2462 end
2463 if _n_visibility == old_child then
2464 if new_child != null then
2465 new_child.parent = self
2466 assert new_child isa AVisibility
2467 _n_visibility = new_child
2468 else
2469 _n_visibility = null
2470 end
2471 return
2472 end
2473 if _n_kwwritable == old_child then
2474 if new_child != null then
2475 new_child.parent = self
2476 assert new_child isa TKwwritable
2477 _n_kwwritable = new_child
2478 else
2479 abort
2480 end
2481 return
2482 end
2483 end
2484
2485 redef fun visit_all(v: Visitor)
2486 do
2487 if _n_kwredef != null then
2488 v.enter_visit(_n_kwredef.as(not null))
2489 end
2490 if _n_visibility != null then
2491 v.enter_visit(_n_visibility.as(not null))
2492 end
2493 v.enter_visit(_n_kwwritable)
2494 end
2495 end
2496 redef class AIdMethid
2497 private init empty_init do end
2498
2499 init init_aidmethid (
2500 n_id: nullable TId
2501 )
2502 do
2503 empty_init
2504 _n_id = n_id.as(not null)
2505 n_id.parent = self
2506 end
2507
2508 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2509 do
2510 if _n_id == old_child then
2511 if new_child != null then
2512 new_child.parent = self
2513 assert new_child isa TId
2514 _n_id = new_child
2515 else
2516 abort
2517 end
2518 return
2519 end
2520 end
2521
2522 redef fun visit_all(v: Visitor)
2523 do
2524 v.enter_visit(_n_id)
2525 end
2526 end
2527 redef class APlusMethid
2528 private init empty_init do end
2529
2530 init init_aplusmethid (
2531 n_plus: nullable TPlus
2532 )
2533 do
2534 empty_init
2535 _n_plus = n_plus.as(not null)
2536 n_plus.parent = self
2537 end
2538
2539 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2540 do
2541 if _n_plus == old_child then
2542 if new_child != null then
2543 new_child.parent = self
2544 assert new_child isa TPlus
2545 _n_plus = new_child
2546 else
2547 abort
2548 end
2549 return
2550 end
2551 end
2552
2553 redef fun visit_all(v: Visitor)
2554 do
2555 v.enter_visit(_n_plus)
2556 end
2557 end
2558 redef class AMinusMethid
2559 private init empty_init do end
2560
2561 init init_aminusmethid (
2562 n_minus: nullable TMinus
2563 )
2564 do
2565 empty_init
2566 _n_minus = n_minus.as(not null)
2567 n_minus.parent = self
2568 end
2569
2570 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2571 do
2572 if _n_minus == old_child then
2573 if new_child != null then
2574 new_child.parent = self
2575 assert new_child isa TMinus
2576 _n_minus = new_child
2577 else
2578 abort
2579 end
2580 return
2581 end
2582 end
2583
2584 redef fun visit_all(v: Visitor)
2585 do
2586 v.enter_visit(_n_minus)
2587 end
2588 end
2589 redef class AStarMethid
2590 private init empty_init do end
2591
2592 init init_astarmethid (
2593 n_star: nullable TStar
2594 )
2595 do
2596 empty_init
2597 _n_star = n_star.as(not null)
2598 n_star.parent = self
2599 end
2600
2601 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2602 do
2603 if _n_star == old_child then
2604 if new_child != null then
2605 new_child.parent = self
2606 assert new_child isa TStar
2607 _n_star = new_child
2608 else
2609 abort
2610 end
2611 return
2612 end
2613 end
2614
2615 redef fun visit_all(v: Visitor)
2616 do
2617 v.enter_visit(_n_star)
2618 end
2619 end
2620 redef class ASlashMethid
2621 private init empty_init do end
2622
2623 init init_aslashmethid (
2624 n_slash: nullable TSlash
2625 )
2626 do
2627 empty_init
2628 _n_slash = n_slash.as(not null)
2629 n_slash.parent = self
2630 end
2631
2632 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2633 do
2634 if _n_slash == old_child then
2635 if new_child != null then
2636 new_child.parent = self
2637 assert new_child isa TSlash
2638 _n_slash = new_child
2639 else
2640 abort
2641 end
2642 return
2643 end
2644 end
2645
2646 redef fun visit_all(v: Visitor)
2647 do
2648 v.enter_visit(_n_slash)
2649 end
2650 end
2651 redef class APercentMethid
2652 private init empty_init do end
2653
2654 init init_apercentmethid (
2655 n_percent: nullable TPercent
2656 )
2657 do
2658 empty_init
2659 _n_percent = n_percent.as(not null)
2660 n_percent.parent = self
2661 end
2662
2663 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2664 do
2665 if _n_percent == old_child then
2666 if new_child != null then
2667 new_child.parent = self
2668 assert new_child isa TPercent
2669 _n_percent = new_child
2670 else
2671 abort
2672 end
2673 return
2674 end
2675 end
2676
2677 redef fun visit_all(v: Visitor)
2678 do
2679 v.enter_visit(_n_percent)
2680 end
2681 end
2682 redef class AEqMethid
2683 private init empty_init do end
2684
2685 init init_aeqmethid (
2686 n_eq: nullable TEq
2687 )
2688 do
2689 empty_init
2690 _n_eq = n_eq.as(not null)
2691 n_eq.parent = self
2692 end
2693
2694 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2695 do
2696 if _n_eq == old_child then
2697 if new_child != null then
2698 new_child.parent = self
2699 assert new_child isa TEq
2700 _n_eq = new_child
2701 else
2702 abort
2703 end
2704 return
2705 end
2706 end
2707
2708 redef fun visit_all(v: Visitor)
2709 do
2710 v.enter_visit(_n_eq)
2711 end
2712 end
2713 redef class ANeMethid
2714 private init empty_init do end
2715
2716 init init_anemethid (
2717 n_ne: nullable TNe
2718 )
2719 do
2720 empty_init
2721 _n_ne = n_ne.as(not null)
2722 n_ne.parent = self
2723 end
2724
2725 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2726 do
2727 if _n_ne == old_child then
2728 if new_child != null then
2729 new_child.parent = self
2730 assert new_child isa TNe
2731 _n_ne = new_child
2732 else
2733 abort
2734 end
2735 return
2736 end
2737 end
2738
2739 redef fun visit_all(v: Visitor)
2740 do
2741 v.enter_visit(_n_ne)
2742 end
2743 end
2744 redef class ALeMethid
2745 private init empty_init do end
2746
2747 init init_alemethid (
2748 n_le: nullable TLe
2749 )
2750 do
2751 empty_init
2752 _n_le = n_le.as(not null)
2753 n_le.parent = self
2754 end
2755
2756 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2757 do
2758 if _n_le == old_child then
2759 if new_child != null then
2760 new_child.parent = self
2761 assert new_child isa TLe
2762 _n_le = new_child
2763 else
2764 abort
2765 end
2766 return
2767 end
2768 end
2769
2770 redef fun visit_all(v: Visitor)
2771 do
2772 v.enter_visit(_n_le)
2773 end
2774 end
2775 redef class AGeMethid
2776 private init empty_init do end
2777
2778 init init_agemethid (
2779 n_ge: nullable TGe
2780 )
2781 do
2782 empty_init
2783 _n_ge = n_ge.as(not null)
2784 n_ge.parent = self
2785 end
2786
2787 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2788 do
2789 if _n_ge == old_child then
2790 if new_child != null then
2791 new_child.parent = self
2792 assert new_child isa TGe
2793 _n_ge = new_child
2794 else
2795 abort
2796 end
2797 return
2798 end
2799 end
2800
2801 redef fun visit_all(v: Visitor)
2802 do
2803 v.enter_visit(_n_ge)
2804 end
2805 end
2806 redef class ALtMethid
2807 private init empty_init do end
2808
2809 init init_altmethid (
2810 n_lt: nullable TLt
2811 )
2812 do
2813 empty_init
2814 _n_lt = n_lt.as(not null)
2815 n_lt.parent = self
2816 end
2817
2818 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2819 do
2820 if _n_lt == old_child then
2821 if new_child != null then
2822 new_child.parent = self
2823 assert new_child isa TLt
2824 _n_lt = new_child
2825 else
2826 abort
2827 end
2828 return
2829 end
2830 end
2831
2832 redef fun visit_all(v: Visitor)
2833 do
2834 v.enter_visit(_n_lt)
2835 end
2836 end
2837 redef class AGtMethid
2838 private init empty_init do end
2839
2840 init init_agtmethid (
2841 n_gt: nullable TGt
2842 )
2843 do
2844 empty_init
2845 _n_gt = n_gt.as(not null)
2846 n_gt.parent = self
2847 end
2848
2849 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2850 do
2851 if _n_gt == old_child then
2852 if new_child != null then
2853 new_child.parent = self
2854 assert new_child isa TGt
2855 _n_gt = new_child
2856 else
2857 abort
2858 end
2859 return
2860 end
2861 end
2862
2863 redef fun visit_all(v: Visitor)
2864 do
2865 v.enter_visit(_n_gt)
2866 end
2867 end
2868 redef class ALlMethid
2869 private init empty_init do end
2870
2871 init init_allmethid (
2872 n_ll: nullable TLl
2873 )
2874 do
2875 empty_init
2876 _n_ll = n_ll.as(not null)
2877 n_ll.parent = self
2878 end
2879
2880 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2881 do
2882 if _n_ll == old_child then
2883 if new_child != null then
2884 new_child.parent = self
2885 assert new_child isa TLl
2886 _n_ll = new_child
2887 else
2888 abort
2889 end
2890 return
2891 end
2892 end
2893
2894 redef fun visit_all(v: Visitor)
2895 do
2896 v.enter_visit(_n_ll)
2897 end
2898 end
2899 redef class AGgMethid
2900 private init empty_init do end
2901
2902 init init_aggmethid (
2903 n_gg: nullable TGg
2904 )
2905 do
2906 empty_init
2907 _n_gg = n_gg.as(not null)
2908 n_gg.parent = self
2909 end
2910
2911 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2912 do
2913 if _n_gg == old_child then
2914 if new_child != null then
2915 new_child.parent = self
2916 assert new_child isa TGg
2917 _n_gg = new_child
2918 else
2919 abort
2920 end
2921 return
2922 end
2923 end
2924
2925 redef fun visit_all(v: Visitor)
2926 do
2927 v.enter_visit(_n_gg)
2928 end
2929 end
2930 redef class ABraMethid
2931 private init empty_init do end
2932
2933 init init_abramethid (
2934 n_obra: nullable TObra,
2935 n_cbra: nullable TCbra
2936 )
2937 do
2938 empty_init
2939 _n_obra = n_obra.as(not null)
2940 n_obra.parent = self
2941 _n_cbra = n_cbra.as(not null)
2942 n_cbra.parent = self
2943 end
2944
2945 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2946 do
2947 if _n_obra == old_child then
2948 if new_child != null then
2949 new_child.parent = self
2950 assert new_child isa TObra
2951 _n_obra = new_child
2952 else
2953 abort
2954 end
2955 return
2956 end
2957 if _n_cbra == old_child then
2958 if new_child != null then
2959 new_child.parent = self
2960 assert new_child isa TCbra
2961 _n_cbra = new_child
2962 else
2963 abort
2964 end
2965 return
2966 end
2967 end
2968
2969 redef fun visit_all(v: Visitor)
2970 do
2971 v.enter_visit(_n_obra)
2972 v.enter_visit(_n_cbra)
2973 end
2974 end
2975 redef class AStarshipMethid
2976 private init empty_init do end
2977
2978 init init_astarshipmethid (
2979 n_starship: nullable TStarship
2980 )
2981 do
2982 empty_init
2983 _n_starship = n_starship.as(not null)
2984 n_starship.parent = self
2985 end
2986
2987 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2988 do
2989 if _n_starship == old_child then
2990 if new_child != null then
2991 new_child.parent = self
2992 assert new_child isa TStarship
2993 _n_starship = new_child
2994 else
2995 abort
2996 end
2997 return
2998 end
2999 end
3000
3001 redef fun visit_all(v: Visitor)
3002 do
3003 v.enter_visit(_n_starship)
3004 end
3005 end
3006 redef class AAssignMethid
3007 private init empty_init do end
3008
3009 init init_aassignmethid (
3010 n_id: nullable TId,
3011 n_assign: nullable TAssign
3012 )
3013 do
3014 empty_init
3015 _n_id = n_id.as(not null)
3016 n_id.parent = self
3017 _n_assign = n_assign.as(not null)
3018 n_assign.parent = self
3019 end
3020
3021 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3022 do
3023 if _n_id == old_child then
3024 if new_child != null then
3025 new_child.parent = self
3026 assert new_child isa TId
3027 _n_id = new_child
3028 else
3029 abort
3030 end
3031 return
3032 end
3033 if _n_assign == old_child then
3034 if new_child != null then
3035 new_child.parent = self
3036 assert new_child isa TAssign
3037 _n_assign = new_child
3038 else
3039 abort
3040 end
3041 return
3042 end
3043 end
3044
3045 redef fun visit_all(v: Visitor)
3046 do
3047 v.enter_visit(_n_id)
3048 v.enter_visit(_n_assign)
3049 end
3050 end
3051 redef class ABraassignMethid
3052 private init empty_init do end
3053
3054 init init_abraassignmethid (
3055 n_obra: nullable TObra,
3056 n_cbra: nullable TCbra,
3057 n_assign: nullable TAssign
3058 )
3059 do
3060 empty_init
3061 _n_obra = n_obra.as(not null)
3062 n_obra.parent = self
3063 _n_cbra = n_cbra.as(not null)
3064 n_cbra.parent = self
3065 _n_assign = n_assign.as(not null)
3066 n_assign.parent = self
3067 end
3068
3069 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3070 do
3071 if _n_obra == old_child then
3072 if new_child != null then
3073 new_child.parent = self
3074 assert new_child isa TObra
3075 _n_obra = new_child
3076 else
3077 abort
3078 end
3079 return
3080 end
3081 if _n_cbra == old_child then
3082 if new_child != null then
3083 new_child.parent = self
3084 assert new_child isa TCbra
3085 _n_cbra = new_child
3086 else
3087 abort
3088 end
3089 return
3090 end
3091 if _n_assign == old_child then
3092 if new_child != null then
3093 new_child.parent = self
3094 assert new_child isa TAssign
3095 _n_assign = new_child
3096 else
3097 abort
3098 end
3099 return
3100 end
3101 end
3102
3103 redef fun visit_all(v: Visitor)
3104 do
3105 v.enter_visit(_n_obra)
3106 v.enter_visit(_n_cbra)
3107 v.enter_visit(_n_assign)
3108 end
3109 end
3110 redef class ASignature
3111 private init empty_init do end
3112
3113 init init_asignature (
3114 n_opar: nullable TOpar,
3115 n_params: Collection[Object], # Should be Collection[AParam]
3116 n_cpar: nullable TCpar,
3117 n_type: nullable AType,
3118 n_closure_decls: Collection[Object] # Should be Collection[AClosureDecl]
3119 )
3120 do
3121 empty_init
3122 _n_opar = n_opar
3123 if n_opar != null then
3124 n_opar.parent = self
3125 end
3126 for n in n_params do
3127 assert n isa AParam
3128 _n_params.add(n)
3129 n.parent = self
3130 end
3131 _n_cpar = n_cpar
3132 if n_cpar != null then
3133 n_cpar.parent = self
3134 end
3135 _n_type = n_type
3136 if n_type != null then
3137 n_type.parent = self
3138 end
3139 for n in n_closure_decls do
3140 assert n isa AClosureDecl
3141 _n_closure_decls.add(n)
3142 n.parent = self
3143 end
3144 end
3145
3146 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3147 do
3148 if _n_opar == old_child then
3149 if new_child != null then
3150 new_child.parent = self
3151 assert new_child isa TOpar
3152 _n_opar = new_child
3153 else
3154 _n_opar = null
3155 end
3156 return
3157 end
3158 for i in [0.._n_params.length[ do
3159 if _n_params[i] == old_child then
3160 if new_child != null then
3161 assert new_child isa AParam
3162 _n_params[i] = new_child
3163 new_child.parent = self
3164 else
3165 _n_params.remove_at(i)
3166 end
3167 return
3168 end
3169 end
3170 if _n_cpar == old_child then
3171 if new_child != null then
3172 new_child.parent = self
3173 assert new_child isa TCpar
3174 _n_cpar = new_child
3175 else
3176 _n_cpar = null
3177 end
3178 return
3179 end
3180 if _n_type == old_child then
3181 if new_child != null then
3182 new_child.parent = self
3183 assert new_child isa AType
3184 _n_type = new_child
3185 else
3186 _n_type = null
3187 end
3188 return
3189 end
3190 for i in [0.._n_closure_decls.length[ do
3191 if _n_closure_decls[i] == old_child then
3192 if new_child != null then
3193 assert new_child isa AClosureDecl
3194 _n_closure_decls[i] = new_child
3195 new_child.parent = self
3196 else
3197 _n_closure_decls.remove_at(i)
3198 end
3199 return
3200 end
3201 end
3202 end
3203
3204 redef fun visit_all(v: Visitor)
3205 do
3206 if _n_opar != null then
3207 v.enter_visit(_n_opar.as(not null))
3208 end
3209 for n in _n_params do
3210 v.enter_visit(n)
3211 end
3212 if _n_cpar != null then
3213 v.enter_visit(_n_cpar.as(not null))
3214 end
3215 if _n_type != null then
3216 v.enter_visit(_n_type.as(not null))
3217 end
3218 for n in _n_closure_decls do
3219 v.enter_visit(n)
3220 end
3221 end
3222 end
3223 redef class AParam
3224 private init empty_init do end
3225
3226 init init_aparam (
3227 n_id: nullable TId,
3228 n_type: nullable AType,
3229 n_dotdotdot: nullable TDotdotdot,
3230 n_annotations: nullable AAnnotations
3231 )
3232 do
3233 empty_init
3234 _n_id = n_id.as(not null)
3235 n_id.parent = self
3236 _n_type = n_type
3237 if n_type != null then
3238 n_type.parent = self
3239 end
3240 _n_dotdotdot = n_dotdotdot
3241 if n_dotdotdot != null then
3242 n_dotdotdot.parent = self
3243 end
3244 _n_annotations = n_annotations
3245 if n_annotations != null then
3246 n_annotations.parent = self
3247 end
3248 end
3249
3250 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3251 do
3252 if _n_id == old_child then
3253 if new_child != null then
3254 new_child.parent = self
3255 assert new_child isa TId
3256 _n_id = new_child
3257 else
3258 abort
3259 end
3260 return
3261 end
3262 if _n_type == old_child then
3263 if new_child != null then
3264 new_child.parent = self
3265 assert new_child isa AType
3266 _n_type = new_child
3267 else
3268 _n_type = null
3269 end
3270 return
3271 end
3272 if _n_dotdotdot == old_child then
3273 if new_child != null then
3274 new_child.parent = self
3275 assert new_child isa TDotdotdot
3276 _n_dotdotdot = new_child
3277 else
3278 _n_dotdotdot = null
3279 end
3280 return
3281 end
3282 if _n_annotations == old_child then
3283 if new_child != null then
3284 new_child.parent = self
3285 assert new_child isa AAnnotations
3286 _n_annotations = new_child
3287 else
3288 _n_annotations = null
3289 end
3290 return
3291 end
3292 end
3293
3294 redef fun visit_all(v: Visitor)
3295 do
3296 v.enter_visit(_n_id)
3297 if _n_type != null then
3298 v.enter_visit(_n_type.as(not null))
3299 end
3300 if _n_dotdotdot != null then
3301 v.enter_visit(_n_dotdotdot.as(not null))
3302 end
3303 if _n_annotations != null then
3304 v.enter_visit(_n_annotations.as(not null))
3305 end
3306 end
3307 end
3308 redef class AClosureDecl
3309 private init empty_init do end
3310
3311 init init_aclosuredecl (
3312 n_kwbreak: nullable TKwbreak,
3313 n_bang: nullable TBang,
3314 n_id: nullable TId,
3315 n_signature: nullable ASignature,
3316 n_expr: nullable AExpr
3317 )
3318 do
3319 empty_init
3320 _n_kwbreak = n_kwbreak
3321 if n_kwbreak != null then
3322 n_kwbreak.parent = self
3323 end
3324 _n_bang = n_bang.as(not null)
3325 n_bang.parent = self
3326 _n_id = n_id.as(not null)
3327 n_id.parent = self
3328 _n_signature = n_signature.as(not null)
3329 n_signature.parent = self
3330 _n_expr = n_expr
3331 if n_expr != null then
3332 n_expr.parent = self
3333 end
3334 end
3335
3336 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3337 do
3338 if _n_kwbreak == old_child then
3339 if new_child != null then
3340 new_child.parent = self
3341 assert new_child isa TKwbreak
3342 _n_kwbreak = new_child
3343 else
3344 _n_kwbreak = null
3345 end
3346 return
3347 end
3348 if _n_bang == old_child then
3349 if new_child != null then
3350 new_child.parent = self
3351 assert new_child isa TBang
3352 _n_bang = new_child
3353 else
3354 abort
3355 end
3356 return
3357 end
3358 if _n_id == old_child then
3359 if new_child != null then
3360 new_child.parent = self
3361 assert new_child isa TId
3362 _n_id = new_child
3363 else
3364 abort
3365 end
3366 return
3367 end
3368 if _n_signature == old_child then
3369 if new_child != null then
3370 new_child.parent = self
3371 assert new_child isa ASignature
3372 _n_signature = new_child
3373 else
3374 abort
3375 end
3376 return
3377 end
3378 if _n_expr == old_child then
3379 if new_child != null then
3380 new_child.parent = self
3381 assert new_child isa AExpr
3382 _n_expr = new_child
3383 else
3384 _n_expr = null
3385 end
3386 return
3387 end
3388 end
3389
3390 redef fun visit_all(v: Visitor)
3391 do
3392 if _n_kwbreak != null then
3393 v.enter_visit(_n_kwbreak.as(not null))
3394 end
3395 v.enter_visit(_n_bang)
3396 v.enter_visit(_n_id)
3397 v.enter_visit(_n_signature)
3398 if _n_expr != null then
3399 v.enter_visit(_n_expr.as(not null))
3400 end
3401 end
3402 end
3403 redef class AType
3404 private init empty_init do end
3405
3406 init init_atype (
3407 n_kwnullable: nullable TKwnullable,
3408 n_id: nullable TClassid,
3409 n_types: Collection[Object], # Should be Collection[AType]
3410 n_annotations: nullable AAnnotations
3411 )
3412 do
3413 empty_init
3414 _n_kwnullable = n_kwnullable
3415 if n_kwnullable != null then
3416 n_kwnullable.parent = self
3417 end
3418 _n_id = n_id.as(not null)
3419 n_id.parent = self
3420 for n in n_types do
3421 assert n isa AType
3422 _n_types.add(n)
3423 n.parent = self
3424 end
3425 _n_annotations = n_annotations
3426 if n_annotations != null then
3427 n_annotations.parent = self
3428 end
3429 end
3430
3431 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3432 do
3433 if _n_kwnullable == old_child then
3434 if new_child != null then
3435 new_child.parent = self
3436 assert new_child isa TKwnullable
3437 _n_kwnullable = new_child
3438 else
3439 _n_kwnullable = null
3440 end
3441 return
3442 end
3443 if _n_id == old_child then
3444 if new_child != null then
3445 new_child.parent = self
3446 assert new_child isa TClassid
3447 _n_id = new_child
3448 else
3449 abort
3450 end
3451 return
3452 end
3453 for i in [0.._n_types.length[ do
3454 if _n_types[i] == old_child then
3455 if new_child != null then
3456 assert new_child isa AType
3457 _n_types[i] = new_child
3458 new_child.parent = self
3459 else
3460 _n_types.remove_at(i)
3461 end
3462 return
3463 end
3464 end
3465 if _n_annotations == old_child then
3466 if new_child != null then
3467 new_child.parent = self
3468 assert new_child isa AAnnotations
3469 _n_annotations = new_child
3470 else
3471 _n_annotations = null
3472 end
3473 return
3474 end
3475 end
3476
3477 redef fun visit_all(v: Visitor)
3478 do
3479 if _n_kwnullable != null then
3480 v.enter_visit(_n_kwnullable.as(not null))
3481 end
3482 v.enter_visit(_n_id)
3483 for n in _n_types do
3484 v.enter_visit(n)
3485 end
3486 if _n_annotations != null then
3487 v.enter_visit(_n_annotations.as(not null))
3488 end
3489 end
3490 end
3491 redef class ALabel
3492 private init empty_init do end
3493
3494 init init_alabel (
3495 n_kwlabel: nullable TKwlabel,
3496 n_id: nullable TId
3497 )
3498 do
3499 empty_init
3500 _n_kwlabel = n_kwlabel.as(not null)
3501 n_kwlabel.parent = self
3502 _n_id = n_id.as(not null)
3503 n_id.parent = self
3504 end
3505
3506 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3507 do
3508 if _n_kwlabel == old_child then
3509 if new_child != null then
3510 new_child.parent = self
3511 assert new_child isa TKwlabel
3512 _n_kwlabel = new_child
3513 else
3514 abort
3515 end
3516 return
3517 end
3518 if _n_id == old_child then
3519 if new_child != null then
3520 new_child.parent = self
3521 assert new_child isa TId
3522 _n_id = new_child
3523 else
3524 abort
3525 end
3526 return
3527 end
3528 end
3529
3530 redef fun visit_all(v: Visitor)
3531 do
3532 v.enter_visit(_n_kwlabel)
3533 v.enter_visit(_n_id)
3534 end
3535 end
3536 redef class ABlockExpr
3537 private init empty_init do end
3538
3539 init init_ablockexpr (
3540 n_expr: Collection[Object], # Should be Collection[AExpr]
3541 n_kwend: nullable TKwend
3542 )
3543 do
3544 empty_init
3545 for n in n_expr do
3546 assert n isa AExpr
3547 _n_expr.add(n)
3548 n.parent = self
3549 end
3550 _n_kwend = n_kwend
3551 if n_kwend != null then
3552 n_kwend.parent = self
3553 end
3554 end
3555
3556 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3557 do
3558 for i in [0.._n_expr.length[ do
3559 if _n_expr[i] == old_child then
3560 if new_child != null then
3561 assert new_child isa AExpr
3562 _n_expr[i] = new_child
3563 new_child.parent = self
3564 else
3565 _n_expr.remove_at(i)
3566 end
3567 return
3568 end
3569 end
3570 if _n_kwend == old_child then
3571 if new_child != null then
3572 new_child.parent = self
3573 assert new_child isa TKwend
3574 _n_kwend = new_child
3575 else
3576 _n_kwend = null
3577 end
3578 return
3579 end
3580 end
3581
3582 redef fun visit_all(v: Visitor)
3583 do
3584 for n in _n_expr do
3585 v.enter_visit(n)
3586 end
3587 if _n_kwend != null then
3588 v.enter_visit(_n_kwend.as(not null))
3589 end
3590 end
3591 end
3592 redef class AVardeclExpr
3593 private init empty_init do end
3594
3595 init init_avardeclexpr (
3596 n_kwvar: nullable TKwvar,
3597 n_id: nullable TId,
3598 n_type: nullable AType,
3599 n_assign: nullable TAssign,
3600 n_expr: nullable AExpr,
3601 n_annotations: nullable AAnnotations
3602 )
3603 do
3604 empty_init
3605 _n_kwvar = n_kwvar.as(not null)
3606 n_kwvar.parent = self
3607 _n_id = n_id.as(not null)
3608 n_id.parent = self
3609 _n_type = n_type
3610 if n_type != null then
3611 n_type.parent = self
3612 end
3613 _n_assign = n_assign
3614 if n_assign != null then
3615 n_assign.parent = self
3616 end
3617 _n_expr = n_expr
3618 if n_expr != null then
3619 n_expr.parent = self
3620 end
3621 _n_annotations = n_annotations
3622 if n_annotations != null then
3623 n_annotations.parent = self
3624 end
3625 end
3626
3627 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3628 do
3629 if _n_kwvar == old_child then
3630 if new_child != null then
3631 new_child.parent = self
3632 assert new_child isa TKwvar
3633 _n_kwvar = new_child
3634 else
3635 abort
3636 end
3637 return
3638 end
3639 if _n_id == old_child then
3640 if new_child != null then
3641 new_child.parent = self
3642 assert new_child isa TId
3643 _n_id = new_child
3644 else
3645 abort
3646 end
3647 return
3648 end
3649 if _n_type == old_child then
3650 if new_child != null then
3651 new_child.parent = self
3652 assert new_child isa AType
3653 _n_type = new_child
3654 else
3655 _n_type = null
3656 end
3657 return
3658 end
3659 if _n_assign == old_child then
3660 if new_child != null then
3661 new_child.parent = self
3662 assert new_child isa TAssign
3663 _n_assign = new_child
3664 else
3665 _n_assign = null
3666 end
3667 return
3668 end
3669 if _n_expr == old_child then
3670 if new_child != null then
3671 new_child.parent = self
3672 assert new_child isa AExpr
3673 _n_expr = new_child
3674 else
3675 _n_expr = null
3676 end
3677 return
3678 end
3679 if _n_annotations == old_child then
3680 if new_child != null then
3681 new_child.parent = self
3682 assert new_child isa AAnnotations
3683 _n_annotations = new_child
3684 else
3685 _n_annotations = null
3686 end
3687 return
3688 end
3689 end
3690
3691 redef fun visit_all(v: Visitor)
3692 do
3693 v.enter_visit(_n_kwvar)
3694 v.enter_visit(_n_id)
3695 if _n_type != null then
3696 v.enter_visit(_n_type.as(not null))
3697 end
3698 if _n_assign != null then
3699 v.enter_visit(_n_assign.as(not null))
3700 end
3701 if _n_expr != null then
3702 v.enter_visit(_n_expr.as(not null))
3703 end
3704 if _n_annotations != null then
3705 v.enter_visit(_n_annotations.as(not null))
3706 end
3707 end
3708 end
3709 redef class AReturnExpr
3710 private init empty_init do end
3711
3712 init init_areturnexpr (
3713 n_kwreturn: nullable TKwreturn,
3714 n_expr: nullable AExpr
3715 )
3716 do
3717 empty_init
3718 _n_kwreturn = n_kwreturn
3719 if n_kwreturn != null then
3720 n_kwreturn.parent = self
3721 end
3722 _n_expr = n_expr
3723 if n_expr != null then
3724 n_expr.parent = self
3725 end
3726 end
3727
3728 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3729 do
3730 if _n_kwreturn == old_child then
3731 if new_child != null then
3732 new_child.parent = self
3733 assert new_child isa TKwreturn
3734 _n_kwreturn = new_child
3735 else
3736 _n_kwreturn = null
3737 end
3738 return
3739 end
3740 if _n_expr == old_child then
3741 if new_child != null then
3742 new_child.parent = self
3743 assert new_child isa AExpr
3744 _n_expr = new_child
3745 else
3746 _n_expr = null
3747 end
3748 return
3749 end
3750 end
3751
3752 redef fun visit_all(v: Visitor)
3753 do
3754 if _n_kwreturn != null then
3755 v.enter_visit(_n_kwreturn.as(not null))
3756 end
3757 if _n_expr != null then
3758 v.enter_visit(_n_expr.as(not null))
3759 end
3760 end
3761 end
3762 redef class ABreakExpr
3763 private init empty_init do end
3764
3765 init init_abreakexpr (
3766 n_kwbreak: nullable TKwbreak,
3767 n_label: nullable ALabel,
3768 n_expr: nullable AExpr
3769 )
3770 do
3771 empty_init
3772 _n_kwbreak = n_kwbreak.as(not null)
3773 n_kwbreak.parent = self
3774 _n_label = n_label
3775 if n_label != null then
3776 n_label.parent = self
3777 end
3778 _n_expr = n_expr
3779 if n_expr != null then
3780 n_expr.parent = self
3781 end
3782 end
3783
3784 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3785 do
3786 if _n_kwbreak == old_child then
3787 if new_child != null then
3788 new_child.parent = self
3789 assert new_child isa TKwbreak
3790 _n_kwbreak = new_child
3791 else
3792 abort
3793 end
3794 return
3795 end
3796 if _n_label == old_child then
3797 if new_child != null then
3798 new_child.parent = self
3799 assert new_child isa ALabel
3800 _n_label = new_child
3801 else
3802 _n_label = null
3803 end
3804 return
3805 end
3806 if _n_expr == old_child then
3807 if new_child != null then
3808 new_child.parent = self
3809 assert new_child isa AExpr
3810 _n_expr = new_child
3811 else
3812 _n_expr = null
3813 end
3814 return
3815 end
3816 end
3817
3818 redef fun visit_all(v: Visitor)
3819 do
3820 v.enter_visit(_n_kwbreak)
3821 if _n_label != null then
3822 v.enter_visit(_n_label.as(not null))
3823 end
3824 if _n_expr != null then
3825 v.enter_visit(_n_expr.as(not null))
3826 end
3827 end
3828 end
3829 redef class AAbortExpr
3830 private init empty_init do end
3831
3832 init init_aabortexpr (
3833 n_kwabort: nullable TKwabort
3834 )
3835 do
3836 empty_init
3837 _n_kwabort = n_kwabort.as(not null)
3838 n_kwabort.parent = self
3839 end
3840
3841 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3842 do
3843 if _n_kwabort == old_child then
3844 if new_child != null then
3845 new_child.parent = self
3846 assert new_child isa TKwabort
3847 _n_kwabort = new_child
3848 else
3849 abort
3850 end
3851 return
3852 end
3853 end
3854
3855 redef fun visit_all(v: Visitor)
3856 do
3857 v.enter_visit(_n_kwabort)
3858 end
3859 end
3860 redef class AContinueExpr
3861 private init empty_init do end
3862
3863 init init_acontinueexpr (
3864 n_kwcontinue: nullable TKwcontinue,
3865 n_label: nullable ALabel,
3866 n_expr: nullable AExpr
3867 )
3868 do
3869 empty_init
3870 _n_kwcontinue = n_kwcontinue
3871 if n_kwcontinue != null then
3872 n_kwcontinue.parent = self
3873 end
3874 _n_label = n_label
3875 if n_label != null then
3876 n_label.parent = self
3877 end
3878 _n_expr = n_expr
3879 if n_expr != null then
3880 n_expr.parent = self
3881 end
3882 end
3883
3884 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3885 do
3886 if _n_kwcontinue == old_child then
3887 if new_child != null then
3888 new_child.parent = self
3889 assert new_child isa TKwcontinue
3890 _n_kwcontinue = new_child
3891 else
3892 _n_kwcontinue = null
3893 end
3894 return
3895 end
3896 if _n_label == old_child then
3897 if new_child != null then
3898 new_child.parent = self
3899 assert new_child isa ALabel
3900 _n_label = new_child
3901 else
3902 _n_label = null
3903 end
3904 return
3905 end
3906 if _n_expr == old_child then
3907 if new_child != null then
3908 new_child.parent = self
3909 assert new_child isa AExpr
3910 _n_expr = new_child
3911 else
3912 _n_expr = null
3913 end
3914 return
3915 end
3916 end
3917
3918 redef fun visit_all(v: Visitor)
3919 do
3920 if _n_kwcontinue != null then
3921 v.enter_visit(_n_kwcontinue.as(not null))
3922 end
3923 if _n_label != null then
3924 v.enter_visit(_n_label.as(not null))
3925 end
3926 if _n_expr != null then
3927 v.enter_visit(_n_expr.as(not null))
3928 end
3929 end
3930 end
3931 redef class ADoExpr
3932 private init empty_init do end
3933
3934 init init_adoexpr (
3935 n_kwdo: nullable TKwdo,
3936 n_block: nullable AExpr,
3937 n_label: nullable ALabel
3938 )
3939 do
3940 empty_init
3941 _n_kwdo = n_kwdo.as(not null)
3942 n_kwdo.parent = self
3943 _n_block = n_block
3944 if n_block != null then
3945 n_block.parent = self
3946 end
3947 _n_label = n_label
3948 if n_label != null then
3949 n_label.parent = self
3950 end
3951 end
3952
3953 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3954 do
3955 if _n_kwdo == old_child then
3956 if new_child != null then
3957 new_child.parent = self
3958 assert new_child isa TKwdo
3959 _n_kwdo = new_child
3960 else
3961 abort
3962 end
3963 return
3964 end
3965 if _n_block == old_child then
3966 if new_child != null then
3967 new_child.parent = self
3968 assert new_child isa AExpr
3969 _n_block = new_child
3970 else
3971 _n_block = null
3972 end
3973 return
3974 end
3975 if _n_label == old_child then
3976 if new_child != null then
3977 new_child.parent = self
3978 assert new_child isa ALabel
3979 _n_label = new_child
3980 else
3981 _n_label = null
3982 end
3983 return
3984 end
3985 end
3986
3987 redef fun visit_all(v: Visitor)
3988 do
3989 v.enter_visit(_n_kwdo)
3990 if _n_block != null then
3991 v.enter_visit(_n_block.as(not null))
3992 end
3993 if _n_label != null then
3994 v.enter_visit(_n_label.as(not null))
3995 end
3996 end
3997 end
3998 redef class AIfExpr
3999 private init empty_init do end
4000
4001 init init_aifexpr (
4002 n_kwif: nullable TKwif,
4003 n_expr: nullable AExpr,
4004 n_then: nullable AExpr,
4005 n_else: nullable AExpr
4006 )
4007 do
4008 empty_init
4009 _n_kwif = n_kwif.as(not null)
4010 n_kwif.parent = self
4011 _n_expr = n_expr.as(not null)
4012 n_expr.parent = self
4013 _n_then = n_then
4014 if n_then != null then
4015 n_then.parent = self
4016 end
4017 _n_else = n_else
4018 if n_else != null then
4019 n_else.parent = self
4020 end
4021 end
4022
4023 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4024 do
4025 if _n_kwif == old_child then
4026 if new_child != null then
4027 new_child.parent = self
4028 assert new_child isa TKwif
4029 _n_kwif = new_child
4030 else
4031 abort
4032 end
4033 return
4034 end
4035 if _n_expr == old_child then
4036 if new_child != null then
4037 new_child.parent = self
4038 assert new_child isa AExpr
4039 _n_expr = new_child
4040 else
4041 abort
4042 end
4043 return
4044 end
4045 if _n_then == old_child then
4046 if new_child != null then
4047 new_child.parent = self
4048 assert new_child isa AExpr
4049 _n_then = new_child
4050 else
4051 _n_then = null
4052 end
4053 return
4054 end
4055 if _n_else == old_child then
4056 if new_child != null then
4057 new_child.parent = self
4058 assert new_child isa AExpr
4059 _n_else = new_child
4060 else
4061 _n_else = null
4062 end
4063 return
4064 end
4065 end
4066
4067 redef fun visit_all(v: Visitor)
4068 do
4069 v.enter_visit(_n_kwif)
4070 v.enter_visit(_n_expr)
4071 if _n_then != null then
4072 v.enter_visit(_n_then.as(not null))
4073 end
4074 if _n_else != null then
4075 v.enter_visit(_n_else.as(not null))
4076 end
4077 end
4078 end
4079 redef class AIfexprExpr
4080 private init empty_init do end
4081
4082 init init_aifexprexpr (
4083 n_kwif: nullable TKwif,
4084 n_expr: nullable AExpr,
4085 n_kwthen: nullable TKwthen,
4086 n_then: nullable AExpr,
4087 n_kwelse: nullable TKwelse,
4088 n_else: nullable AExpr
4089 )
4090 do
4091 empty_init
4092 _n_kwif = n_kwif.as(not null)
4093 n_kwif.parent = self
4094 _n_expr = n_expr.as(not null)
4095 n_expr.parent = self
4096 _n_kwthen = n_kwthen.as(not null)
4097 n_kwthen.parent = self
4098 _n_then = n_then.as(not null)
4099 n_then.parent = self
4100 _n_kwelse = n_kwelse.as(not null)
4101 n_kwelse.parent = self
4102 _n_else = n_else.as(not null)
4103 n_else.parent = self
4104 end
4105
4106 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4107 do
4108 if _n_kwif == old_child then
4109 if new_child != null then
4110 new_child.parent = self
4111 assert new_child isa TKwif
4112 _n_kwif = new_child
4113 else
4114 abort
4115 end
4116 return
4117 end
4118 if _n_expr == old_child then
4119 if new_child != null then
4120 new_child.parent = self
4121 assert new_child isa AExpr
4122 _n_expr = new_child
4123 else
4124 abort
4125 end
4126 return
4127 end
4128 if _n_kwthen == old_child then
4129 if new_child != null then
4130 new_child.parent = self
4131 assert new_child isa TKwthen
4132 _n_kwthen = new_child
4133 else
4134 abort
4135 end
4136 return
4137 end
4138 if _n_then == old_child then
4139 if new_child != null then
4140 new_child.parent = self
4141 assert new_child isa AExpr
4142 _n_then = new_child
4143 else
4144 abort
4145 end
4146 return
4147 end
4148 if _n_kwelse == old_child then
4149 if new_child != null then
4150 new_child.parent = self
4151 assert new_child isa TKwelse
4152 _n_kwelse = new_child
4153 else
4154 abort
4155 end
4156 return
4157 end
4158 if _n_else == old_child then
4159 if new_child != null then
4160 new_child.parent = self
4161 assert new_child isa AExpr
4162 _n_else = new_child
4163 else
4164 abort
4165 end
4166 return
4167 end
4168 end
4169
4170 redef fun visit_all(v: Visitor)
4171 do
4172 v.enter_visit(_n_kwif)
4173 v.enter_visit(_n_expr)
4174 v.enter_visit(_n_kwthen)
4175 v.enter_visit(_n_then)
4176 v.enter_visit(_n_kwelse)
4177 v.enter_visit(_n_else)
4178 end
4179 end
4180 redef class AWhileExpr
4181 private init empty_init do end
4182
4183 init init_awhileexpr (
4184 n_kwwhile: nullable TKwwhile,
4185 n_expr: nullable AExpr,
4186 n_kwdo: nullable TKwdo,
4187 n_block: nullable AExpr,
4188 n_label: nullable ALabel
4189 )
4190 do
4191 empty_init
4192 _n_kwwhile = n_kwwhile.as(not null)
4193 n_kwwhile.parent = self
4194 _n_expr = n_expr.as(not null)
4195 n_expr.parent = self
4196 _n_kwdo = n_kwdo.as(not null)
4197 n_kwdo.parent = self
4198 _n_block = n_block
4199 if n_block != null then
4200 n_block.parent = self
4201 end
4202 _n_label = n_label
4203 if n_label != null then
4204 n_label.parent = self
4205 end
4206 end
4207
4208 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4209 do
4210 if _n_kwwhile == old_child then
4211 if new_child != null then
4212 new_child.parent = self
4213 assert new_child isa TKwwhile
4214 _n_kwwhile = new_child
4215 else
4216 abort
4217 end
4218 return
4219 end
4220 if _n_expr == old_child then
4221 if new_child != null then
4222 new_child.parent = self
4223 assert new_child isa AExpr
4224 _n_expr = new_child
4225 else
4226 abort
4227 end
4228 return
4229 end
4230 if _n_kwdo == old_child then
4231 if new_child != null then
4232 new_child.parent = self
4233 assert new_child isa TKwdo
4234 _n_kwdo = new_child
4235 else
4236 abort
4237 end
4238 return
4239 end
4240 if _n_block == old_child then
4241 if new_child != null then
4242 new_child.parent = self
4243 assert new_child isa AExpr
4244 _n_block = new_child
4245 else
4246 _n_block = null
4247 end
4248 return
4249 end
4250 if _n_label == old_child then
4251 if new_child != null then
4252 new_child.parent = self
4253 assert new_child isa ALabel
4254 _n_label = new_child
4255 else
4256 _n_label = null
4257 end
4258 return
4259 end
4260 end
4261
4262 redef fun visit_all(v: Visitor)
4263 do
4264 v.enter_visit(_n_kwwhile)
4265 v.enter_visit(_n_expr)
4266 v.enter_visit(_n_kwdo)
4267 if _n_block != null then
4268 v.enter_visit(_n_block.as(not null))
4269 end
4270 if _n_label != null then
4271 v.enter_visit(_n_label.as(not null))
4272 end
4273 end
4274 end
4275 redef class ALoopExpr
4276 private init empty_init do end
4277
4278 init init_aloopexpr (
4279 n_kwloop: nullable TKwloop,
4280 n_block: nullable AExpr,
4281 n_label: nullable ALabel
4282 )
4283 do
4284 empty_init
4285 _n_kwloop = n_kwloop.as(not null)
4286 n_kwloop.parent = self
4287 _n_block = n_block
4288 if n_block != null then
4289 n_block.parent = self
4290 end
4291 _n_label = n_label
4292 if n_label != null then
4293 n_label.parent = self
4294 end
4295 end
4296
4297 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4298 do
4299 if _n_kwloop == old_child then
4300 if new_child != null then
4301 new_child.parent = self
4302 assert new_child isa TKwloop
4303 _n_kwloop = new_child
4304 else
4305 abort
4306 end
4307 return
4308 end
4309 if _n_block == old_child then
4310 if new_child != null then
4311 new_child.parent = self
4312 assert new_child isa AExpr
4313 _n_block = new_child
4314 else
4315 _n_block = null
4316 end
4317 return
4318 end
4319 if _n_label == old_child then
4320 if new_child != null then
4321 new_child.parent = self
4322 assert new_child isa ALabel
4323 _n_label = new_child
4324 else
4325 _n_label = null
4326 end
4327 return
4328 end
4329 end
4330
4331 redef fun visit_all(v: Visitor)
4332 do
4333 v.enter_visit(_n_kwloop)
4334 if _n_block != null then
4335 v.enter_visit(_n_block.as(not null))
4336 end
4337 if _n_label != null then
4338 v.enter_visit(_n_label.as(not null))
4339 end
4340 end
4341 end
4342 redef class AForExpr
4343 private init empty_init do end
4344
4345 init init_aforexpr (
4346 n_kwfor: nullable TKwfor,
4347 n_ids: Collection[Object], # Should be Collection[TId]
4348 n_expr: nullable AExpr,
4349 n_kwdo: nullable TKwdo,
4350 n_block: nullable AExpr,
4351 n_label: nullable ALabel
4352 )
4353 do
4354 empty_init
4355 _n_kwfor = n_kwfor.as(not null)
4356 n_kwfor.parent = self
4357 for n in n_ids do
4358 assert n isa TId
4359 _n_ids.add(n)
4360 n.parent = self
4361 end
4362 _n_expr = n_expr.as(not null)
4363 n_expr.parent = self
4364 _n_kwdo = n_kwdo.as(not null)
4365 n_kwdo.parent = self
4366 _n_block = n_block
4367 if n_block != null then
4368 n_block.parent = self
4369 end
4370 _n_label = n_label
4371 if n_label != null then
4372 n_label.parent = self
4373 end
4374 end
4375
4376 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4377 do
4378 if _n_kwfor == old_child then
4379 if new_child != null then
4380 new_child.parent = self
4381 assert new_child isa TKwfor
4382 _n_kwfor = new_child
4383 else
4384 abort
4385 end
4386 return
4387 end
4388 for i in [0.._n_ids.length[ do
4389 if _n_ids[i] == old_child then
4390 if new_child != null then
4391 assert new_child isa TId
4392 _n_ids[i] = new_child
4393 new_child.parent = self
4394 else
4395 _n_ids.remove_at(i)
4396 end
4397 return
4398 end
4399 end
4400 if _n_expr == old_child then
4401 if new_child != null then
4402 new_child.parent = self
4403 assert new_child isa AExpr
4404 _n_expr = new_child
4405 else
4406 abort
4407 end
4408 return
4409 end
4410 if _n_kwdo == old_child then
4411 if new_child != null then
4412 new_child.parent = self
4413 assert new_child isa TKwdo
4414 _n_kwdo = new_child
4415 else
4416 abort
4417 end
4418 return
4419 end
4420 if _n_block == old_child then
4421 if new_child != null then
4422 new_child.parent = self
4423 assert new_child isa AExpr
4424 _n_block = new_child
4425 else
4426 _n_block = null
4427 end
4428 return
4429 end
4430 if _n_label == old_child then
4431 if new_child != null then
4432 new_child.parent = self
4433 assert new_child isa ALabel
4434 _n_label = new_child
4435 else
4436 _n_label = null
4437 end
4438 return
4439 end
4440 end
4441
4442 redef fun visit_all(v: Visitor)
4443 do
4444 v.enter_visit(_n_kwfor)
4445 for n in _n_ids do
4446 v.enter_visit(n)
4447 end
4448 v.enter_visit(_n_expr)
4449 v.enter_visit(_n_kwdo)
4450 if _n_block != null then
4451 v.enter_visit(_n_block.as(not null))
4452 end
4453 if _n_label != null then
4454 v.enter_visit(_n_label.as(not null))
4455 end
4456 end
4457 end
4458 redef class AAssertExpr
4459 private init empty_init do end
4460
4461 init init_aassertexpr (
4462 n_kwassert: nullable TKwassert,
4463 n_id: nullable TId,
4464 n_expr: nullable AExpr,
4465 n_else: nullable AExpr
4466 )
4467 do
4468 empty_init
4469 _n_kwassert = n_kwassert.as(not null)
4470 n_kwassert.parent = self
4471 _n_id = n_id
4472 if n_id != null then
4473 n_id.parent = self
4474 end
4475 _n_expr = n_expr.as(not null)
4476 n_expr.parent = self
4477 _n_else = n_else
4478 if n_else != null then
4479 n_else.parent = self
4480 end
4481 end
4482
4483 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4484 do
4485 if _n_kwassert == old_child then
4486 if new_child != null then
4487 new_child.parent = self
4488 assert new_child isa TKwassert
4489 _n_kwassert = new_child
4490 else
4491 abort
4492 end
4493 return
4494 end
4495 if _n_id == old_child then
4496 if new_child != null then
4497 new_child.parent = self
4498 assert new_child isa TId
4499 _n_id = new_child
4500 else
4501 _n_id = null
4502 end
4503 return
4504 end
4505 if _n_expr == old_child then
4506 if new_child != null then
4507 new_child.parent = self
4508 assert new_child isa AExpr
4509 _n_expr = new_child
4510 else
4511 abort
4512 end
4513 return
4514 end
4515 if _n_else == old_child then
4516 if new_child != null then
4517 new_child.parent = self
4518 assert new_child isa AExpr
4519 _n_else = new_child
4520 else
4521 _n_else = null
4522 end
4523 return
4524 end
4525 end
4526
4527 redef fun visit_all(v: Visitor)
4528 do
4529 v.enter_visit(_n_kwassert)
4530 if _n_id != null then
4531 v.enter_visit(_n_id.as(not null))
4532 end
4533 v.enter_visit(_n_expr)
4534 if _n_else != null then
4535 v.enter_visit(_n_else.as(not null))
4536 end
4537 end
4538 end
4539 redef class AOnceExpr
4540 private init empty_init do end
4541
4542 init init_aonceexpr (
4543 n_kwonce: nullable TKwonce,
4544 n_expr: nullable AExpr
4545 )
4546 do
4547 empty_init
4548 _n_kwonce = n_kwonce.as(not null)
4549 n_kwonce.parent = self
4550 _n_expr = n_expr.as(not null)
4551 n_expr.parent = self
4552 end
4553
4554 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4555 do
4556 if _n_kwonce == old_child then
4557 if new_child != null then
4558 new_child.parent = self
4559 assert new_child isa TKwonce
4560 _n_kwonce = new_child
4561 else
4562 abort
4563 end
4564 return
4565 end
4566 if _n_expr == old_child then
4567 if new_child != null then
4568 new_child.parent = self
4569 assert new_child isa AExpr
4570 _n_expr = new_child
4571 else
4572 abort
4573 end
4574 return
4575 end
4576 end
4577
4578 redef fun visit_all(v: Visitor)
4579 do
4580 v.enter_visit(_n_kwonce)
4581 v.enter_visit(_n_expr)
4582 end
4583 end
4584 redef class ASendExpr
4585 private init empty_init do end
4586
4587 init init_asendexpr (
4588 n_expr: nullable AExpr
4589 )
4590 do
4591 empty_init
4592 _n_expr = n_expr.as(not null)
4593 n_expr.parent = self
4594 end
4595
4596 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4597 do
4598 if _n_expr == old_child then
4599 if new_child != null then
4600 new_child.parent = self
4601 assert new_child isa AExpr
4602 _n_expr = new_child
4603 else
4604 abort
4605 end
4606 return
4607 end
4608 end
4609
4610 redef fun visit_all(v: Visitor)
4611 do
4612 v.enter_visit(_n_expr)
4613 end
4614 end
4615 redef class ABinopExpr
4616 private init empty_init do end
4617
4618 init init_abinopexpr (
4619 n_expr: nullable AExpr,
4620 n_expr2: nullable AExpr
4621 )
4622 do
4623 empty_init
4624 _n_expr = n_expr.as(not null)
4625 n_expr.parent = self
4626 _n_expr2 = n_expr2.as(not null)
4627 n_expr2.parent = self
4628 end
4629
4630 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4631 do
4632 if _n_expr == old_child then
4633 if new_child != null then
4634 new_child.parent = self
4635 assert new_child isa AExpr
4636 _n_expr = new_child
4637 else
4638 abort
4639 end
4640 return
4641 end
4642 if _n_expr2 == old_child then
4643 if new_child != null then
4644 new_child.parent = self
4645 assert new_child isa AExpr
4646 _n_expr2 = new_child
4647 else
4648 abort
4649 end
4650 return
4651 end
4652 end
4653
4654 redef fun visit_all(v: Visitor)
4655 do
4656 v.enter_visit(_n_expr)
4657 v.enter_visit(_n_expr2)
4658 end
4659 end
4660 redef class AOrExpr
4661 private init empty_init do end
4662
4663 init init_aorexpr (
4664 n_expr: nullable AExpr,
4665 n_expr2: nullable AExpr
4666 )
4667 do
4668 empty_init
4669 _n_expr = n_expr.as(not null)
4670 n_expr.parent = self
4671 _n_expr2 = n_expr2.as(not null)
4672 n_expr2.parent = self
4673 end
4674
4675 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4676 do
4677 if _n_expr == old_child then
4678 if new_child != null then
4679 new_child.parent = self
4680 assert new_child isa AExpr
4681 _n_expr = new_child
4682 else
4683 abort
4684 end
4685 return
4686 end
4687 if _n_expr2 == old_child then
4688 if new_child != null then
4689 new_child.parent = self
4690 assert new_child isa AExpr
4691 _n_expr2 = new_child
4692 else
4693 abort
4694 end
4695 return
4696 end
4697 end
4698
4699 redef fun visit_all(v: Visitor)
4700 do
4701 v.enter_visit(_n_expr)
4702 v.enter_visit(_n_expr2)
4703 end
4704 end
4705 redef class AAndExpr
4706 private init empty_init do end
4707
4708 init init_aandexpr (
4709 n_expr: nullable AExpr,
4710 n_expr2: nullable AExpr
4711 )
4712 do
4713 empty_init
4714 _n_expr = n_expr.as(not null)
4715 n_expr.parent = self
4716 _n_expr2 = n_expr2.as(not null)
4717 n_expr2.parent = self
4718 end
4719
4720 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4721 do
4722 if _n_expr == old_child then
4723 if new_child != null then
4724 new_child.parent = self
4725 assert new_child isa AExpr
4726 _n_expr = new_child
4727 else
4728 abort
4729 end
4730 return
4731 end
4732 if _n_expr2 == old_child then
4733 if new_child != null then
4734 new_child.parent = self
4735 assert new_child isa AExpr
4736 _n_expr2 = new_child
4737 else
4738 abort
4739 end
4740 return
4741 end
4742 end
4743
4744 redef fun visit_all(v: Visitor)
4745 do
4746 v.enter_visit(_n_expr)
4747 v.enter_visit(_n_expr2)
4748 end
4749 end
4750 redef class AOrElseExpr
4751 private init empty_init do end
4752
4753 init init_aorelseexpr (
4754 n_expr: nullable AExpr,
4755 n_expr2: nullable AExpr
4756 )
4757 do
4758 empty_init
4759 _n_expr = n_expr.as(not null)
4760 n_expr.parent = self
4761 _n_expr2 = n_expr2.as(not null)
4762 n_expr2.parent = self
4763 end
4764
4765 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4766 do
4767 if _n_expr == old_child then
4768 if new_child != null then
4769 new_child.parent = self
4770 assert new_child isa AExpr
4771 _n_expr = new_child
4772 else
4773 abort
4774 end
4775 return
4776 end
4777 if _n_expr2 == old_child then
4778 if new_child != null then
4779 new_child.parent = self
4780 assert new_child isa AExpr
4781 _n_expr2 = new_child
4782 else
4783 abort
4784 end
4785 return
4786 end
4787 end
4788
4789 redef fun visit_all(v: Visitor)
4790 do
4791 v.enter_visit(_n_expr)
4792 v.enter_visit(_n_expr2)
4793 end
4794 end
4795 redef class ANotExpr
4796 private init empty_init do end
4797
4798 init init_anotexpr (
4799 n_kwnot: nullable TKwnot,
4800 n_expr: nullable AExpr
4801 )
4802 do
4803 empty_init
4804 _n_kwnot = n_kwnot.as(not null)
4805 n_kwnot.parent = self
4806 _n_expr = n_expr.as(not null)
4807 n_expr.parent = self
4808 end
4809
4810 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4811 do
4812 if _n_kwnot == old_child then
4813 if new_child != null then
4814 new_child.parent = self
4815 assert new_child isa TKwnot
4816 _n_kwnot = new_child
4817 else
4818 abort
4819 end
4820 return
4821 end
4822 if _n_expr == old_child then
4823 if new_child != null then
4824 new_child.parent = self
4825 assert new_child isa AExpr
4826 _n_expr = new_child
4827 else
4828 abort
4829 end
4830 return
4831 end
4832 end
4833
4834 redef fun visit_all(v: Visitor)
4835 do
4836 v.enter_visit(_n_kwnot)
4837 v.enter_visit(_n_expr)
4838 end
4839 end
4840 redef class AEqExpr
4841 private init empty_init do end
4842
4843 init init_aeqexpr (
4844 n_expr: nullable AExpr,
4845 n_expr2: nullable AExpr
4846 )
4847 do
4848 empty_init
4849 _n_expr = n_expr.as(not null)
4850 n_expr.parent = self
4851 _n_expr2 = n_expr2.as(not null)
4852 n_expr2.parent = self
4853 end
4854
4855 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4856 do
4857 if _n_expr == old_child then
4858 if new_child != null then
4859 new_child.parent = self
4860 assert new_child isa AExpr
4861 _n_expr = new_child
4862 else
4863 abort
4864 end
4865 return
4866 end
4867 if _n_expr2 == old_child then
4868 if new_child != null then
4869 new_child.parent = self
4870 assert new_child isa AExpr
4871 _n_expr2 = new_child
4872 else
4873 abort
4874 end
4875 return
4876 end
4877 end
4878
4879 redef fun visit_all(v: Visitor)
4880 do
4881 v.enter_visit(_n_expr)
4882 v.enter_visit(_n_expr2)
4883 end
4884 end
4885 redef class AEeExpr
4886 private init empty_init do end
4887
4888 init init_aeeexpr (
4889 n_expr: nullable AExpr,
4890 n_expr2: nullable AExpr
4891 )
4892 do
4893 empty_init
4894 _n_expr = n_expr.as(not null)
4895 n_expr.parent = self
4896 _n_expr2 = n_expr2.as(not null)
4897 n_expr2.parent = self
4898 end
4899
4900 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4901 do
4902 if _n_expr == old_child then
4903 if new_child != null then
4904 new_child.parent = self
4905 assert new_child isa AExpr
4906 _n_expr = new_child
4907 else
4908 abort
4909 end
4910 return
4911 end
4912 if _n_expr2 == old_child then
4913 if new_child != null then
4914 new_child.parent = self
4915 assert new_child isa AExpr
4916 _n_expr2 = new_child
4917 else
4918 abort
4919 end
4920 return
4921 end
4922 end
4923
4924 redef fun visit_all(v: Visitor)
4925 do
4926 v.enter_visit(_n_expr)
4927 v.enter_visit(_n_expr2)
4928 end
4929 end
4930 redef class ANeExpr
4931 private init empty_init do end
4932
4933 init init_aneexpr (
4934 n_expr: nullable AExpr,
4935 n_expr2: nullable AExpr
4936 )
4937 do
4938 empty_init
4939 _n_expr = n_expr.as(not null)
4940 n_expr.parent = self
4941 _n_expr2 = n_expr2.as(not null)
4942 n_expr2.parent = self
4943 end
4944
4945 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4946 do
4947 if _n_expr == old_child then
4948 if new_child != null then
4949 new_child.parent = self
4950 assert new_child isa AExpr
4951 _n_expr = new_child
4952 else
4953 abort
4954 end
4955 return
4956 end
4957 if _n_expr2 == old_child then
4958 if new_child != null then
4959 new_child.parent = self
4960 assert new_child isa AExpr
4961 _n_expr2 = new_child
4962 else
4963 abort
4964 end
4965 return
4966 end
4967 end
4968
4969 redef fun visit_all(v: Visitor)
4970 do
4971 v.enter_visit(_n_expr)
4972 v.enter_visit(_n_expr2)
4973 end
4974 end
4975 redef class ALtExpr
4976 private init empty_init do end
4977
4978 init init_altexpr (
4979 n_expr: nullable AExpr,
4980 n_expr2: nullable AExpr
4981 )
4982 do
4983 empty_init
4984 _n_expr = n_expr.as(not null)
4985 n_expr.parent = self
4986 _n_expr2 = n_expr2.as(not null)
4987 n_expr2.parent = self
4988 end
4989
4990 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4991 do
4992 if _n_expr == old_child then
4993 if new_child != null then
4994 new_child.parent = self
4995 assert new_child isa AExpr
4996 _n_expr = new_child
4997 else
4998 abort
4999 end
5000 return
5001 end
5002 if _n_expr2 == old_child then
5003 if new_child != null then
5004 new_child.parent = self
5005 assert new_child isa AExpr
5006 _n_expr2 = new_child
5007 else
5008 abort
5009 end
5010 return
5011 end
5012 end
5013
5014 redef fun visit_all(v: Visitor)
5015 do
5016 v.enter_visit(_n_expr)
5017 v.enter_visit(_n_expr2)
5018 end
5019 end
5020 redef class ALeExpr
5021 private init empty_init do end
5022
5023 init init_aleexpr (
5024 n_expr: nullable AExpr,
5025 n_expr2: nullable AExpr
5026 )
5027 do
5028 empty_init
5029 _n_expr = n_expr.as(not null)
5030 n_expr.parent = self
5031 _n_expr2 = n_expr2.as(not null)
5032 n_expr2.parent = self
5033 end
5034
5035 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5036 do
5037 if _n_expr == old_child then
5038 if new_child != null then
5039 new_child.parent = self
5040 assert new_child isa AExpr
5041 _n_expr = new_child
5042 else
5043 abort
5044 end
5045 return
5046 end
5047 if _n_expr2 == old_child then
5048 if new_child != null then
5049 new_child.parent = self
5050 assert new_child isa AExpr
5051 _n_expr2 = new_child
5052 else
5053 abort
5054 end
5055 return
5056 end
5057 end
5058
5059 redef fun visit_all(v: Visitor)
5060 do
5061 v.enter_visit(_n_expr)
5062 v.enter_visit(_n_expr2)
5063 end
5064 end
5065 redef class ALlExpr
5066 private init empty_init do end
5067
5068 init init_allexpr (
5069 n_expr: nullable AExpr,
5070 n_expr2: nullable AExpr
5071 )
5072 do
5073 empty_init
5074 _n_expr = n_expr.as(not null)
5075 n_expr.parent = self
5076 _n_expr2 = n_expr2.as(not null)
5077 n_expr2.parent = self
5078 end
5079
5080 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5081 do
5082 if _n_expr == old_child then
5083 if new_child != null then
5084 new_child.parent = self
5085 assert new_child isa AExpr
5086 _n_expr = new_child
5087 else
5088 abort
5089 end
5090 return
5091 end
5092 if _n_expr2 == old_child then
5093 if new_child != null then
5094 new_child.parent = self
5095 assert new_child isa AExpr
5096 _n_expr2 = new_child
5097 else
5098 abort
5099 end
5100 return
5101 end
5102 end
5103
5104 redef fun visit_all(v: Visitor)
5105 do
5106 v.enter_visit(_n_expr)
5107 v.enter_visit(_n_expr2)
5108 end
5109 end
5110 redef class AGtExpr
5111 private init empty_init do end
5112
5113 init init_agtexpr (
5114 n_expr: nullable AExpr,
5115 n_expr2: nullable AExpr
5116 )
5117 do
5118 empty_init
5119 _n_expr = n_expr.as(not null)
5120 n_expr.parent = self
5121 _n_expr2 = n_expr2.as(not null)
5122 n_expr2.parent = self
5123 end
5124
5125 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5126 do
5127 if _n_expr == old_child then
5128 if new_child != null then
5129 new_child.parent = self
5130 assert new_child isa AExpr
5131 _n_expr = new_child
5132 else
5133 abort
5134 end
5135 return
5136 end
5137 if _n_expr2 == old_child then
5138 if new_child != null then
5139 new_child.parent = self
5140 assert new_child isa AExpr
5141 _n_expr2 = new_child
5142 else
5143 abort
5144 end
5145 return
5146 end
5147 end
5148
5149 redef fun visit_all(v: Visitor)
5150 do
5151 v.enter_visit(_n_expr)
5152 v.enter_visit(_n_expr2)
5153 end
5154 end
5155 redef class AGeExpr
5156 private init empty_init do end
5157
5158 init init_ageexpr (
5159 n_expr: nullable AExpr,
5160 n_expr2: nullable AExpr
5161 )
5162 do
5163 empty_init
5164 _n_expr = n_expr.as(not null)
5165 n_expr.parent = self
5166 _n_expr2 = n_expr2.as(not null)
5167 n_expr2.parent = self
5168 end
5169
5170 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5171 do
5172 if _n_expr == old_child then
5173 if new_child != null then
5174 new_child.parent = self
5175 assert new_child isa AExpr
5176 _n_expr = new_child
5177 else
5178 abort
5179 end
5180 return
5181 end
5182 if _n_expr2 == old_child then
5183 if new_child != null then
5184 new_child.parent = self
5185 assert new_child isa AExpr
5186 _n_expr2 = new_child
5187 else
5188 abort
5189 end
5190 return
5191 end
5192 end
5193
5194 redef fun visit_all(v: Visitor)
5195 do
5196 v.enter_visit(_n_expr)
5197 v.enter_visit(_n_expr2)
5198 end
5199 end
5200 redef class AGgExpr
5201 private init empty_init do end
5202
5203 init init_aggexpr (
5204 n_expr: nullable AExpr,
5205 n_expr2: nullable AExpr
5206 )
5207 do
5208 empty_init
5209 _n_expr = n_expr.as(not null)
5210 n_expr.parent = self
5211 _n_expr2 = n_expr2.as(not null)
5212 n_expr2.parent = self
5213 end
5214
5215 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5216 do
5217 if _n_expr == old_child then
5218 if new_child != null then
5219 new_child.parent = self
5220 assert new_child isa AExpr
5221 _n_expr = new_child
5222 else
5223 abort
5224 end
5225 return
5226 end
5227 if _n_expr2 == old_child then
5228 if new_child != null then
5229 new_child.parent = self
5230 assert new_child isa AExpr
5231 _n_expr2 = new_child
5232 else
5233 abort
5234 end
5235 return
5236 end
5237 end
5238
5239 redef fun visit_all(v: Visitor)
5240 do
5241 v.enter_visit(_n_expr)
5242 v.enter_visit(_n_expr2)
5243 end
5244 end
5245 redef class AIsaExpr
5246 private init empty_init do end
5247
5248 init init_aisaexpr (
5249 n_expr: nullable AExpr,
5250 n_type: nullable AType
5251 )
5252 do
5253 empty_init
5254 _n_expr = n_expr.as(not null)
5255 n_expr.parent = self
5256 _n_type = n_type.as(not null)
5257 n_type.parent = self
5258 end
5259
5260 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5261 do
5262 if _n_expr == old_child then
5263 if new_child != null then
5264 new_child.parent = self
5265 assert new_child isa AExpr
5266 _n_expr = new_child
5267 else
5268 abort
5269 end
5270 return
5271 end
5272 if _n_type == old_child then
5273 if new_child != null then
5274 new_child.parent = self
5275 assert new_child isa AType
5276 _n_type = new_child
5277 else
5278 abort
5279 end
5280 return
5281 end
5282 end
5283
5284 redef fun visit_all(v: Visitor)
5285 do
5286 v.enter_visit(_n_expr)
5287 v.enter_visit(_n_type)
5288 end
5289 end
5290 redef class APlusExpr
5291 private init empty_init do end
5292
5293 init init_aplusexpr (
5294 n_expr: nullable AExpr,
5295 n_expr2: nullable AExpr
5296 )
5297 do
5298 empty_init
5299 _n_expr = n_expr.as(not null)
5300 n_expr.parent = self
5301 _n_expr2 = n_expr2.as(not null)
5302 n_expr2.parent = self
5303 end
5304
5305 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5306 do
5307 if _n_expr == old_child then
5308 if new_child != null then
5309 new_child.parent = self
5310 assert new_child isa AExpr
5311 _n_expr = new_child
5312 else
5313 abort
5314 end
5315 return
5316 end
5317 if _n_expr2 == old_child then
5318 if new_child != null then
5319 new_child.parent = self
5320 assert new_child isa AExpr
5321 _n_expr2 = new_child
5322 else
5323 abort
5324 end
5325 return
5326 end
5327 end
5328
5329 redef fun visit_all(v: Visitor)
5330 do
5331 v.enter_visit(_n_expr)
5332 v.enter_visit(_n_expr2)
5333 end
5334 end
5335 redef class AMinusExpr
5336 private init empty_init do end
5337
5338 init init_aminusexpr (
5339 n_expr: nullable AExpr,
5340 n_expr2: nullable AExpr
5341 )
5342 do
5343 empty_init
5344 _n_expr = n_expr.as(not null)
5345 n_expr.parent = self
5346 _n_expr2 = n_expr2.as(not null)
5347 n_expr2.parent = self
5348 end
5349
5350 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5351 do
5352 if _n_expr == old_child then
5353 if new_child != null then
5354 new_child.parent = self
5355 assert new_child isa AExpr
5356 _n_expr = new_child
5357 else
5358 abort
5359 end
5360 return
5361 end
5362 if _n_expr2 == old_child then
5363 if new_child != null then
5364 new_child.parent = self
5365 assert new_child isa AExpr
5366 _n_expr2 = new_child
5367 else
5368 abort
5369 end
5370 return
5371 end
5372 end
5373
5374 redef fun visit_all(v: Visitor)
5375 do
5376 v.enter_visit(_n_expr)
5377 v.enter_visit(_n_expr2)
5378 end
5379 end
5380 redef class AStarshipExpr
5381 private init empty_init do end
5382
5383 init init_astarshipexpr (
5384 n_expr: nullable AExpr,
5385 n_expr2: nullable AExpr
5386 )
5387 do
5388 empty_init
5389 _n_expr = n_expr.as(not null)
5390 n_expr.parent = self
5391 _n_expr2 = n_expr2.as(not null)
5392 n_expr2.parent = self
5393 end
5394
5395 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5396 do
5397 if _n_expr == old_child then
5398 if new_child != null then
5399 new_child.parent = self
5400 assert new_child isa AExpr
5401 _n_expr = new_child
5402 else
5403 abort
5404 end
5405 return
5406 end
5407 if _n_expr2 == old_child then
5408 if new_child != null then
5409 new_child.parent = self
5410 assert new_child isa AExpr
5411 _n_expr2 = new_child
5412 else
5413 abort
5414 end
5415 return
5416 end
5417 end
5418
5419 redef fun visit_all(v: Visitor)
5420 do
5421 v.enter_visit(_n_expr)
5422 v.enter_visit(_n_expr2)
5423 end
5424 end
5425 redef class AStarExpr
5426 private init empty_init do end
5427
5428 init init_astarexpr (
5429 n_expr: nullable AExpr,
5430 n_expr2: nullable AExpr
5431 )
5432 do
5433 empty_init
5434 _n_expr = n_expr.as(not null)
5435 n_expr.parent = self
5436 _n_expr2 = n_expr2.as(not null)
5437 n_expr2.parent = self
5438 end
5439
5440 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5441 do
5442 if _n_expr == old_child then
5443 if new_child != null then
5444 new_child.parent = self
5445 assert new_child isa AExpr
5446 _n_expr = new_child
5447 else
5448 abort
5449 end
5450 return
5451 end
5452 if _n_expr2 == old_child then
5453 if new_child != null then
5454 new_child.parent = self
5455 assert new_child isa AExpr
5456 _n_expr2 = new_child
5457 else
5458 abort
5459 end
5460 return
5461 end
5462 end
5463
5464 redef fun visit_all(v: Visitor)
5465 do
5466 v.enter_visit(_n_expr)
5467 v.enter_visit(_n_expr2)
5468 end
5469 end
5470 redef class ASlashExpr
5471 private init empty_init do end
5472
5473 init init_aslashexpr (
5474 n_expr: nullable AExpr,
5475 n_expr2: nullable AExpr
5476 )
5477 do
5478 empty_init
5479 _n_expr = n_expr.as(not null)
5480 n_expr.parent = self
5481 _n_expr2 = n_expr2.as(not null)
5482 n_expr2.parent = self
5483 end
5484
5485 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5486 do
5487 if _n_expr == old_child then
5488 if new_child != null then
5489 new_child.parent = self
5490 assert new_child isa AExpr
5491 _n_expr = new_child
5492 else
5493 abort
5494 end
5495 return
5496 end
5497 if _n_expr2 == old_child then
5498 if new_child != null then
5499 new_child.parent = self
5500 assert new_child isa AExpr
5501 _n_expr2 = new_child
5502 else
5503 abort
5504 end
5505 return
5506 end
5507 end
5508
5509 redef fun visit_all(v: Visitor)
5510 do
5511 v.enter_visit(_n_expr)
5512 v.enter_visit(_n_expr2)
5513 end
5514 end
5515 redef class APercentExpr
5516 private init empty_init do end
5517
5518 init init_apercentexpr (
5519 n_expr: nullable AExpr,
5520 n_expr2: nullable AExpr
5521 )
5522 do
5523 empty_init
5524 _n_expr = n_expr.as(not null)
5525 n_expr.parent = self
5526 _n_expr2 = n_expr2.as(not null)
5527 n_expr2.parent = self
5528 end
5529
5530 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5531 do
5532 if _n_expr == old_child then
5533 if new_child != null then
5534 new_child.parent = self
5535 assert new_child isa AExpr
5536 _n_expr = new_child
5537 else
5538 abort
5539 end
5540 return
5541 end
5542 if _n_expr2 == old_child then
5543 if new_child != null then
5544 new_child.parent = self
5545 assert new_child isa AExpr
5546 _n_expr2 = new_child
5547 else
5548 abort
5549 end
5550 return
5551 end
5552 end
5553
5554 redef fun visit_all(v: Visitor)
5555 do
5556 v.enter_visit(_n_expr)
5557 v.enter_visit(_n_expr2)
5558 end
5559 end
5560 redef class AUminusExpr
5561 private init empty_init do end
5562
5563 init init_auminusexpr (
5564 n_minus: nullable TMinus,
5565 n_expr: nullable AExpr
5566 )
5567 do
5568 empty_init
5569 _n_minus = n_minus.as(not null)
5570 n_minus.parent = self
5571 _n_expr = n_expr.as(not null)
5572 n_expr.parent = self
5573 end
5574
5575 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5576 do
5577 if _n_minus == old_child then
5578 if new_child != null then
5579 new_child.parent = self
5580 assert new_child isa TMinus
5581 _n_minus = new_child
5582 else
5583 abort
5584 end
5585 return
5586 end
5587 if _n_expr == old_child then
5588 if new_child != null then
5589 new_child.parent = self
5590 assert new_child isa AExpr
5591 _n_expr = new_child
5592 else
5593 abort
5594 end
5595 return
5596 end
5597 end
5598
5599 redef fun visit_all(v: Visitor)
5600 do
5601 v.enter_visit(_n_minus)
5602 v.enter_visit(_n_expr)
5603 end
5604 end
5605 redef class ANewExpr
5606 private init empty_init do end
5607
5608 init init_anewexpr (
5609 n_kwnew: nullable TKwnew,
5610 n_type: nullable AType,
5611 n_id: nullable TId,
5612 n_args: nullable AExprs
5613 )
5614 do
5615 empty_init
5616 _n_kwnew = n_kwnew.as(not null)
5617 n_kwnew.parent = self
5618 _n_type = n_type.as(not null)
5619 n_type.parent = self
5620 _n_id = n_id
5621 if n_id != null then
5622 n_id.parent = self
5623 end
5624 _n_args = n_args.as(not null)
5625 n_args.parent = self
5626 end
5627
5628 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5629 do
5630 if _n_kwnew == old_child then
5631 if new_child != null then
5632 new_child.parent = self
5633 assert new_child isa TKwnew
5634 _n_kwnew = new_child
5635 else
5636 abort
5637 end
5638 return
5639 end
5640 if _n_type == old_child then
5641 if new_child != null then
5642 new_child.parent = self
5643 assert new_child isa AType
5644 _n_type = new_child
5645 else
5646 abort
5647 end
5648 return
5649 end
5650 if _n_id == old_child then
5651 if new_child != null then
5652 new_child.parent = self
5653 assert new_child isa TId
5654 _n_id = new_child
5655 else
5656 _n_id = null
5657 end
5658 return
5659 end
5660 if _n_args == old_child then
5661 if new_child != null then
5662 new_child.parent = self
5663 assert new_child isa AExprs
5664 _n_args = new_child
5665 else
5666 abort
5667 end
5668 return
5669 end
5670 end
5671
5672 redef fun visit_all(v: Visitor)
5673 do
5674 v.enter_visit(_n_kwnew)
5675 v.enter_visit(_n_type)
5676 if _n_id != null then
5677 v.enter_visit(_n_id.as(not null))
5678 end
5679 v.enter_visit(_n_args)
5680 end
5681 end
5682 redef class AAttrExpr
5683 private init empty_init do end
5684
5685 init init_aattrexpr (
5686 n_expr: nullable AExpr,
5687 n_id: nullable TAttrid
5688 )
5689 do
5690 empty_init
5691 _n_expr = n_expr.as(not null)
5692 n_expr.parent = self
5693 _n_id = n_id.as(not null)
5694 n_id.parent = self
5695 end
5696
5697 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5698 do
5699 if _n_expr == old_child then
5700 if new_child != null then
5701 new_child.parent = self
5702 assert new_child isa AExpr
5703 _n_expr = new_child
5704 else
5705 abort
5706 end
5707 return
5708 end
5709 if _n_id == old_child then
5710 if new_child != null then
5711 new_child.parent = self
5712 assert new_child isa TAttrid
5713 _n_id = new_child
5714 else
5715 abort
5716 end
5717 return
5718 end
5719 end
5720
5721 redef fun visit_all(v: Visitor)
5722 do
5723 v.enter_visit(_n_expr)
5724 v.enter_visit(_n_id)
5725 end
5726 end
5727 redef class AAttrAssignExpr
5728 private init empty_init do end
5729
5730 init init_aattrassignexpr (
5731 n_expr: nullable AExpr,
5732 n_id: nullable TAttrid,
5733 n_assign: nullable TAssign,
5734 n_value: nullable AExpr
5735 )
5736 do
5737 empty_init
5738 _n_expr = n_expr.as(not null)
5739 n_expr.parent = self
5740 _n_id = n_id.as(not null)
5741 n_id.parent = self
5742 _n_assign = n_assign.as(not null)
5743 n_assign.parent = self
5744 _n_value = n_value.as(not null)
5745 n_value.parent = self
5746 end
5747
5748 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5749 do
5750 if _n_expr == old_child then
5751 if new_child != null then
5752 new_child.parent = self
5753 assert new_child isa AExpr
5754 _n_expr = new_child
5755 else
5756 abort
5757 end
5758 return
5759 end
5760 if _n_id == old_child then
5761 if new_child != null then
5762 new_child.parent = self
5763 assert new_child isa TAttrid
5764 _n_id = new_child
5765 else
5766 abort
5767 end
5768 return
5769 end
5770 if _n_assign == old_child then
5771 if new_child != null then
5772 new_child.parent = self
5773 assert new_child isa TAssign
5774 _n_assign = new_child
5775 else
5776 abort
5777 end
5778 return
5779 end
5780 if _n_value == old_child then
5781 if new_child != null then
5782 new_child.parent = self
5783 assert new_child isa AExpr
5784 _n_value = new_child
5785 else
5786 abort
5787 end
5788 return
5789 end
5790 end
5791
5792 redef fun visit_all(v: Visitor)
5793 do
5794 v.enter_visit(_n_expr)
5795 v.enter_visit(_n_id)
5796 v.enter_visit(_n_assign)
5797 v.enter_visit(_n_value)
5798 end
5799 end
5800 redef class AAttrReassignExpr
5801 private init empty_init do end
5802
5803 init init_aattrreassignexpr (
5804 n_expr: nullable AExpr,
5805 n_id: nullable TAttrid,
5806 n_assign_op: nullable AAssignOp,
5807 n_value: nullable AExpr
5808 )
5809 do
5810 empty_init
5811 _n_expr = n_expr.as(not null)
5812 n_expr.parent = self
5813 _n_id = n_id.as(not null)
5814 n_id.parent = self
5815 _n_assign_op = n_assign_op.as(not null)
5816 n_assign_op.parent = self
5817 _n_value = n_value.as(not null)
5818 n_value.parent = self
5819 end
5820
5821 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5822 do
5823 if _n_expr == old_child then
5824 if new_child != null then
5825 new_child.parent = self
5826 assert new_child isa AExpr
5827 _n_expr = new_child
5828 else
5829 abort
5830 end
5831 return
5832 end
5833 if _n_id == old_child then
5834 if new_child != null then
5835 new_child.parent = self
5836 assert new_child isa TAttrid
5837 _n_id = new_child
5838 else
5839 abort
5840 end
5841 return
5842 end
5843 if _n_assign_op == old_child then
5844 if new_child != null then
5845 new_child.parent = self
5846 assert new_child isa AAssignOp
5847 _n_assign_op = new_child
5848 else
5849 abort
5850 end
5851 return
5852 end
5853 if _n_value == old_child then
5854 if new_child != null then
5855 new_child.parent = self
5856 assert new_child isa AExpr
5857 _n_value = new_child
5858 else
5859 abort
5860 end
5861 return
5862 end
5863 end
5864
5865 redef fun visit_all(v: Visitor)
5866 do
5867 v.enter_visit(_n_expr)
5868 v.enter_visit(_n_id)
5869 v.enter_visit(_n_assign_op)
5870 v.enter_visit(_n_value)
5871 end
5872 end
5873 redef class ACallExpr
5874 private init empty_init do end
5875
5876 init init_acallexpr (
5877 n_expr: nullable AExpr,
5878 n_id: nullable TId,
5879 n_args: nullable AExprs,
5880 n_closure_defs: Collection[Object] # Should be Collection[AClosureDef]
5881 )
5882 do
5883 empty_init
5884 _n_expr = n_expr.as(not null)
5885 n_expr.parent = self
5886 _n_id = n_id.as(not null)
5887 n_id.parent = self
5888 _n_args = n_args.as(not null)
5889 n_args.parent = self
5890 for n in n_closure_defs do
5891 assert n isa AClosureDef
5892 _n_closure_defs.add(n)
5893 n.parent = self
5894 end
5895 end
5896
5897 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5898 do
5899 if _n_expr == old_child then
5900 if new_child != null then
5901 new_child.parent = self
5902 assert new_child isa AExpr
5903 _n_expr = new_child
5904 else
5905 abort
5906 end
5907 return
5908 end
5909 if _n_id == old_child then
5910 if new_child != null then
5911 new_child.parent = self
5912 assert new_child isa TId
5913 _n_id = new_child
5914 else
5915 abort
5916 end
5917 return
5918 end
5919 if _n_args == old_child then
5920 if new_child != null then
5921 new_child.parent = self
5922 assert new_child isa AExprs
5923 _n_args = new_child
5924 else
5925 abort
5926 end
5927 return
5928 end
5929 for i in [0.._n_closure_defs.length[ do
5930 if _n_closure_defs[i] == old_child then
5931 if new_child != null then
5932 assert new_child isa AClosureDef
5933 _n_closure_defs[i] = new_child
5934 new_child.parent = self
5935 else
5936 _n_closure_defs.remove_at(i)
5937 end
5938 return
5939 end
5940 end
5941 end
5942
5943 redef fun visit_all(v: Visitor)
5944 do
5945 v.enter_visit(_n_expr)
5946 v.enter_visit(_n_id)
5947 v.enter_visit(_n_args)
5948 for n in _n_closure_defs do
5949 v.enter_visit(n)
5950 end
5951 end
5952 end
5953 redef class ACallAssignExpr
5954 private init empty_init do end
5955
5956 init init_acallassignexpr (
5957 n_expr: nullable AExpr,
5958 n_id: nullable TId,
5959 n_args: nullable AExprs,
5960 n_assign: nullable TAssign,
5961 n_value: nullable AExpr
5962 )
5963 do
5964 empty_init
5965 _n_expr = n_expr.as(not null)
5966 n_expr.parent = self
5967 _n_id = n_id.as(not null)
5968 n_id.parent = self
5969 _n_args = n_args.as(not null)
5970 n_args.parent = self
5971 _n_assign = n_assign.as(not null)
5972 n_assign.parent = self
5973 _n_value = n_value.as(not null)
5974 n_value.parent = self
5975 end
5976
5977 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5978 do
5979 if _n_expr == old_child then
5980 if new_child != null then
5981 new_child.parent = self
5982 assert new_child isa AExpr
5983 _n_expr = new_child
5984 else
5985 abort
5986 end
5987 return
5988 end
5989 if _n_id == old_child then
5990 if new_child != null then
5991 new_child.parent = self
5992 assert new_child isa TId
5993 _n_id = new_child
5994 else
5995 abort
5996 end
5997 return
5998 end
5999 if _n_args == old_child then
6000 if new_child != null then
6001 new_child.parent = self
6002 assert new_child isa AExprs
6003 _n_args = new_child
6004 else
6005 abort
6006 end
6007 return
6008 end
6009 if _n_assign == old_child then
6010 if new_child != null then
6011 new_child.parent = self
6012 assert new_child isa TAssign
6013 _n_assign = new_child
6014 else
6015 abort
6016 end
6017 return
6018 end
6019 if _n_value == old_child then
6020 if new_child != null then
6021 new_child.parent = self
6022 assert new_child isa AExpr
6023 _n_value = new_child
6024 else
6025 abort
6026 end
6027 return
6028 end
6029 end
6030
6031 redef fun visit_all(v: Visitor)
6032 do
6033 v.enter_visit(_n_expr)
6034 v.enter_visit(_n_id)
6035 v.enter_visit(_n_args)
6036 v.enter_visit(_n_assign)
6037 v.enter_visit(_n_value)
6038 end
6039 end
6040 redef class ACallReassignExpr
6041 private init empty_init do end
6042
6043 init init_acallreassignexpr (
6044 n_expr: nullable AExpr,
6045 n_id: nullable TId,
6046 n_args: nullable AExprs,
6047 n_assign_op: nullable AAssignOp,
6048 n_value: nullable AExpr
6049 )
6050 do
6051 empty_init
6052 _n_expr = n_expr.as(not null)
6053 n_expr.parent = self
6054 _n_id = n_id.as(not null)
6055 n_id.parent = self
6056 _n_args = n_args.as(not null)
6057 n_args.parent = self
6058 _n_assign_op = n_assign_op.as(not null)
6059 n_assign_op.parent = self
6060 _n_value = n_value.as(not null)
6061 n_value.parent = self
6062 end
6063
6064 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6065 do
6066 if _n_expr == old_child then
6067 if new_child != null then
6068 new_child.parent = self
6069 assert new_child isa AExpr
6070 _n_expr = new_child
6071 else
6072 abort
6073 end
6074 return
6075 end
6076 if _n_id == old_child then
6077 if new_child != null then
6078 new_child.parent = self
6079 assert new_child isa TId
6080 _n_id = new_child
6081 else
6082 abort
6083 end
6084 return
6085 end
6086 if _n_args == old_child then
6087 if new_child != null then
6088 new_child.parent = self
6089 assert new_child isa AExprs
6090 _n_args = new_child
6091 else
6092 abort
6093 end
6094 return
6095 end
6096 if _n_assign_op == old_child then
6097 if new_child != null then
6098 new_child.parent = self
6099 assert new_child isa AAssignOp
6100 _n_assign_op = new_child
6101 else
6102 abort
6103 end
6104 return
6105 end
6106 if _n_value == old_child then
6107 if new_child != null then
6108 new_child.parent = self
6109 assert new_child isa AExpr
6110 _n_value = new_child
6111 else
6112 abort
6113 end
6114 return
6115 end
6116 end
6117
6118 redef fun visit_all(v: Visitor)
6119 do
6120 v.enter_visit(_n_expr)
6121 v.enter_visit(_n_id)
6122 v.enter_visit(_n_args)
6123 v.enter_visit(_n_assign_op)
6124 v.enter_visit(_n_value)
6125 end
6126 end
6127 redef class ASuperExpr
6128 private init empty_init do end
6129
6130 init init_asuperexpr (
6131 n_qualified: nullable AQualified,
6132 n_kwsuper: nullable TKwsuper,
6133 n_args: nullable AExprs
6134 )
6135 do
6136 empty_init
6137 _n_qualified = n_qualified
6138 if n_qualified != null then
6139 n_qualified.parent = self
6140 end
6141 _n_kwsuper = n_kwsuper.as(not null)
6142 n_kwsuper.parent = self
6143 _n_args = n_args.as(not null)
6144 n_args.parent = self
6145 end
6146
6147 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6148 do
6149 if _n_qualified == old_child then
6150 if new_child != null then
6151 new_child.parent = self
6152 assert new_child isa AQualified
6153 _n_qualified = new_child
6154 else
6155 _n_qualified = null
6156 end
6157 return
6158 end
6159 if _n_kwsuper == old_child then
6160 if new_child != null then
6161 new_child.parent = self
6162 assert new_child isa TKwsuper
6163 _n_kwsuper = new_child
6164 else
6165 abort
6166 end
6167 return
6168 end
6169 if _n_args == old_child then
6170 if new_child != null then
6171 new_child.parent = self
6172 assert new_child isa AExprs
6173 _n_args = new_child
6174 else
6175 abort
6176 end
6177 return
6178 end
6179 end
6180
6181 redef fun visit_all(v: Visitor)
6182 do
6183 if _n_qualified != null then
6184 v.enter_visit(_n_qualified.as(not null))
6185 end
6186 v.enter_visit(_n_kwsuper)
6187 v.enter_visit(_n_args)
6188 end
6189 end
6190 redef class AInitExpr
6191 private init empty_init do end
6192
6193 init init_ainitexpr (
6194 n_expr: nullable AExpr,
6195 n_kwinit: nullable TKwinit,
6196 n_args: nullable AExprs
6197 )
6198 do
6199 empty_init
6200 _n_expr = n_expr.as(not null)
6201 n_expr.parent = self
6202 _n_kwinit = n_kwinit.as(not null)
6203 n_kwinit.parent = self
6204 _n_args = n_args.as(not null)
6205 n_args.parent = self
6206 end
6207
6208 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6209 do
6210 if _n_expr == old_child then
6211 if new_child != null then
6212 new_child.parent = self
6213 assert new_child isa AExpr
6214 _n_expr = new_child
6215 else
6216 abort
6217 end
6218 return
6219 end
6220 if _n_kwinit == old_child then
6221 if new_child != null then
6222 new_child.parent = self
6223 assert new_child isa TKwinit
6224 _n_kwinit = new_child
6225 else
6226 abort
6227 end
6228 return
6229 end
6230 if _n_args == old_child then
6231 if new_child != null then
6232 new_child.parent = self
6233 assert new_child isa AExprs
6234 _n_args = new_child
6235 else
6236 abort
6237 end
6238 return
6239 end
6240 end
6241
6242 redef fun visit_all(v: Visitor)
6243 do
6244 v.enter_visit(_n_expr)
6245 v.enter_visit(_n_kwinit)
6246 v.enter_visit(_n_args)
6247 end
6248 end
6249 redef class ABraExpr
6250 private init empty_init do end
6251
6252 init init_abraexpr (
6253 n_expr: nullable AExpr,
6254 n_args: nullable AExprs,
6255 n_closure_defs: Collection[Object] # Should be Collection[AClosureDef]
6256 )
6257 do
6258 empty_init
6259 _n_expr = n_expr.as(not null)
6260 n_expr.parent = self
6261 _n_args = n_args.as(not null)
6262 n_args.parent = self
6263 for n in n_closure_defs do
6264 assert n isa AClosureDef
6265 _n_closure_defs.add(n)
6266 n.parent = self
6267 end
6268 end
6269
6270 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6271 do
6272 if _n_expr == old_child then
6273 if new_child != null then
6274 new_child.parent = self
6275 assert new_child isa AExpr
6276 _n_expr = new_child
6277 else
6278 abort
6279 end
6280 return
6281 end
6282 if _n_args == old_child then
6283 if new_child != null then
6284 new_child.parent = self
6285 assert new_child isa AExprs
6286 _n_args = new_child
6287 else
6288 abort
6289 end
6290 return
6291 end
6292 for i in [0.._n_closure_defs.length[ do
6293 if _n_closure_defs[i] == old_child then
6294 if new_child != null then
6295 assert new_child isa AClosureDef
6296 _n_closure_defs[i] = new_child
6297 new_child.parent = self
6298 else
6299 _n_closure_defs.remove_at(i)
6300 end
6301 return
6302 end
6303 end
6304 end
6305
6306 redef fun visit_all(v: Visitor)
6307 do
6308 v.enter_visit(_n_expr)
6309 v.enter_visit(_n_args)
6310 for n in _n_closure_defs do
6311 v.enter_visit(n)
6312 end
6313 end
6314 end
6315 redef class ABraAssignExpr
6316 private init empty_init do end
6317
6318 init init_abraassignexpr (
6319 n_expr: nullable AExpr,
6320 n_args: nullable AExprs,
6321 n_assign: nullable TAssign,
6322 n_value: nullable AExpr
6323 )
6324 do
6325 empty_init
6326 _n_expr = n_expr.as(not null)
6327 n_expr.parent = self
6328 _n_args = n_args.as(not null)
6329 n_args.parent = self
6330 _n_assign = n_assign.as(not null)
6331 n_assign.parent = self
6332 _n_value = n_value.as(not null)
6333 n_value.parent = self
6334 end
6335
6336 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6337 do
6338 if _n_expr == old_child then
6339 if new_child != null then
6340 new_child.parent = self
6341 assert new_child isa AExpr
6342 _n_expr = new_child
6343 else
6344 abort
6345 end
6346 return
6347 end
6348 if _n_args == old_child then
6349 if new_child != null then
6350 new_child.parent = self
6351 assert new_child isa AExprs
6352 _n_args = new_child
6353 else
6354 abort
6355 end
6356 return
6357 end
6358 if _n_assign == old_child then
6359 if new_child != null then
6360 new_child.parent = self
6361 assert new_child isa TAssign
6362 _n_assign = new_child
6363 else
6364 abort
6365 end
6366 return
6367 end
6368 if _n_value == old_child then
6369 if new_child != null then
6370 new_child.parent = self
6371 assert new_child isa AExpr
6372 _n_value = new_child
6373 else
6374 abort
6375 end
6376 return
6377 end
6378 end
6379
6380 redef fun visit_all(v: Visitor)
6381 do
6382 v.enter_visit(_n_expr)
6383 v.enter_visit(_n_args)
6384 v.enter_visit(_n_assign)
6385 v.enter_visit(_n_value)
6386 end
6387 end
6388 redef class ABraReassignExpr
6389 private init empty_init do end
6390
6391 init init_abrareassignexpr (
6392 n_expr: nullable AExpr,
6393 n_args: nullable AExprs,
6394 n_assign_op: nullable AAssignOp,
6395 n_value: nullable AExpr
6396 )
6397 do
6398 empty_init
6399 _n_expr = n_expr.as(not null)
6400 n_expr.parent = self
6401 _n_args = n_args.as(not null)
6402 n_args.parent = self
6403 _n_assign_op = n_assign_op.as(not null)
6404 n_assign_op.parent = self
6405 _n_value = n_value.as(not null)
6406 n_value.parent = self
6407 end
6408
6409 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6410 do
6411 if _n_expr == old_child then
6412 if new_child != null then
6413 new_child.parent = self
6414 assert new_child isa AExpr
6415 _n_expr = new_child
6416 else
6417 abort
6418 end
6419 return
6420 end
6421 if _n_args == old_child then
6422 if new_child != null then
6423 new_child.parent = self
6424 assert new_child isa AExprs
6425 _n_args = new_child
6426 else
6427 abort
6428 end
6429 return
6430 end
6431 if _n_assign_op == old_child then
6432 if new_child != null then
6433 new_child.parent = self
6434 assert new_child isa AAssignOp
6435 _n_assign_op = new_child
6436 else
6437 abort
6438 end
6439 return
6440 end
6441 if _n_value == old_child then
6442 if new_child != null then
6443 new_child.parent = self
6444 assert new_child isa AExpr
6445 _n_value = new_child
6446 else
6447 abort
6448 end
6449 return
6450 end
6451 end
6452
6453 redef fun visit_all(v: Visitor)
6454 do
6455 v.enter_visit(_n_expr)
6456 v.enter_visit(_n_args)
6457 v.enter_visit(_n_assign_op)
6458 v.enter_visit(_n_value)
6459 end
6460 end
6461 redef class AClosureCallExpr
6462 private init empty_init do end
6463
6464 init init_aclosurecallexpr (
6465 n_id: nullable TId,
6466 n_args: nullable AExprs,
6467 n_closure_defs: Collection[Object] # Should be Collection[AClosureDef]
6468 )
6469 do
6470 empty_init
6471 _n_id = n_id.as(not null)
6472 n_id.parent = self
6473 _n_args = n_args.as(not null)
6474 n_args.parent = self
6475 for n in n_closure_defs do
6476 assert n isa AClosureDef
6477 _n_closure_defs.add(n)
6478 n.parent = self
6479 end
6480 end
6481
6482 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6483 do
6484 if _n_id == old_child then
6485 if new_child != null then
6486 new_child.parent = self
6487 assert new_child isa TId
6488 _n_id = new_child
6489 else
6490 abort
6491 end
6492 return
6493 end
6494 if _n_args == old_child then
6495 if new_child != null then
6496 new_child.parent = self
6497 assert new_child isa AExprs
6498 _n_args = new_child
6499 else
6500 abort
6501 end
6502 return
6503 end
6504 for i in [0.._n_closure_defs.length[ do
6505 if _n_closure_defs[i] == old_child then
6506 if new_child != null then
6507 assert new_child isa AClosureDef
6508 _n_closure_defs[i] = new_child
6509 new_child.parent = self
6510 else
6511 _n_closure_defs.remove_at(i)
6512 end
6513 return
6514 end
6515 end
6516 end
6517
6518 redef fun visit_all(v: Visitor)
6519 do
6520 v.enter_visit(_n_id)
6521 v.enter_visit(_n_args)
6522 for n in _n_closure_defs do
6523 v.enter_visit(n)
6524 end
6525 end
6526 end
6527 redef class AVarExpr
6528 private init empty_init do end
6529
6530 init init_avarexpr (
6531 n_id: nullable TId
6532 )
6533 do
6534 empty_init
6535 _n_id = n_id.as(not null)
6536 n_id.parent = self
6537 end
6538
6539 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6540 do
6541 if _n_id == old_child then
6542 if new_child != null then
6543 new_child.parent = self
6544 assert new_child isa TId
6545 _n_id = new_child
6546 else
6547 abort
6548 end
6549 return
6550 end
6551 end
6552
6553 redef fun visit_all(v: Visitor)
6554 do
6555 v.enter_visit(_n_id)
6556 end
6557 end
6558 redef class AVarAssignExpr
6559 private init empty_init do end
6560
6561 init init_avarassignexpr (
6562 n_id: nullable TId,
6563 n_assign: nullable TAssign,
6564 n_value: nullable AExpr
6565 )
6566 do
6567 empty_init
6568 _n_id = n_id.as(not null)
6569 n_id.parent = self
6570 _n_assign = n_assign.as(not null)
6571 n_assign.parent = self
6572 _n_value = n_value.as(not null)
6573 n_value.parent = self
6574 end
6575
6576 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6577 do
6578 if _n_id == old_child then
6579 if new_child != null then
6580 new_child.parent = self
6581 assert new_child isa TId
6582 _n_id = new_child
6583 else
6584 abort
6585 end
6586 return
6587 end
6588 if _n_assign == old_child then
6589 if new_child != null then
6590 new_child.parent = self
6591 assert new_child isa TAssign
6592 _n_assign = new_child
6593 else
6594 abort
6595 end
6596 return
6597 end
6598 if _n_value == old_child then
6599 if new_child != null then
6600 new_child.parent = self
6601 assert new_child isa AExpr
6602 _n_value = new_child
6603 else
6604 abort
6605 end
6606 return
6607 end
6608 end
6609
6610 redef fun visit_all(v: Visitor)
6611 do
6612 v.enter_visit(_n_id)
6613 v.enter_visit(_n_assign)
6614 v.enter_visit(_n_value)
6615 end
6616 end
6617 redef class AVarReassignExpr
6618 private init empty_init do end
6619
6620 init init_avarreassignexpr (
6621 n_id: nullable TId,
6622 n_assign_op: nullable AAssignOp,
6623 n_value: nullable AExpr
6624 )
6625 do
6626 empty_init
6627 _n_id = n_id.as(not null)
6628 n_id.parent = self
6629 _n_assign_op = n_assign_op.as(not null)
6630 n_assign_op.parent = self
6631 _n_value = n_value.as(not null)
6632 n_value.parent = self
6633 end
6634
6635 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6636 do
6637 if _n_id == old_child then
6638 if new_child != null then
6639 new_child.parent = self
6640 assert new_child isa TId
6641 _n_id = new_child
6642 else
6643 abort
6644 end
6645 return
6646 end
6647 if _n_assign_op == old_child then
6648 if new_child != null then
6649 new_child.parent = self
6650 assert new_child isa AAssignOp
6651 _n_assign_op = new_child
6652 else
6653 abort
6654 end
6655 return
6656 end
6657 if _n_value == old_child then
6658 if new_child != null then
6659 new_child.parent = self
6660 assert new_child isa AExpr
6661 _n_value = new_child
6662 else
6663 abort
6664 end
6665 return
6666 end
6667 end
6668
6669 redef fun visit_all(v: Visitor)
6670 do
6671 v.enter_visit(_n_id)
6672 v.enter_visit(_n_assign_op)
6673 v.enter_visit(_n_value)
6674 end
6675 end
6676 redef class ARangeExpr
6677 private init empty_init do end
6678
6679 init init_arangeexpr (
6680 n_expr: nullable AExpr,
6681 n_expr2: nullable AExpr,
6682 n_annotations: nullable AAnnotations
6683 )
6684 do
6685 empty_init
6686 _n_expr = n_expr.as(not null)
6687 n_expr.parent = self
6688 _n_expr2 = n_expr2.as(not null)
6689 n_expr2.parent = self
6690 _n_annotations = n_annotations
6691 if n_annotations != null then
6692 n_annotations.parent = self
6693 end
6694 end
6695
6696 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6697 do
6698 if _n_expr == old_child then
6699 if new_child != null then
6700 new_child.parent = self
6701 assert new_child isa AExpr
6702 _n_expr = new_child
6703 else
6704 abort
6705 end
6706 return
6707 end
6708 if _n_expr2 == old_child then
6709 if new_child != null then
6710 new_child.parent = self
6711 assert new_child isa AExpr
6712 _n_expr2 = new_child
6713 else
6714 abort
6715 end
6716 return
6717 end
6718 if _n_annotations == old_child then
6719 if new_child != null then
6720 new_child.parent = self
6721 assert new_child isa AAnnotations
6722 _n_annotations = new_child
6723 else
6724 _n_annotations = null
6725 end
6726 return
6727 end
6728 end
6729
6730 redef fun visit_all(v: Visitor)
6731 do
6732 v.enter_visit(_n_expr)
6733 v.enter_visit(_n_expr2)
6734 if _n_annotations != null then
6735 v.enter_visit(_n_annotations.as(not null))
6736 end
6737 end
6738 end
6739 redef class ACrangeExpr
6740 private init empty_init do end
6741
6742 init init_acrangeexpr (
6743 n_obra: nullable TObra,
6744 n_expr: nullable AExpr,
6745 n_expr2: nullable AExpr,
6746 n_cbra: nullable TCbra,
6747 n_annotations: nullable AAnnotations
6748 )
6749 do
6750 empty_init
6751 _n_obra = n_obra.as(not null)
6752 n_obra.parent = self
6753 _n_expr = n_expr.as(not null)
6754 n_expr.parent = self
6755 _n_expr2 = n_expr2.as(not null)
6756 n_expr2.parent = self
6757 _n_cbra = n_cbra.as(not null)
6758 n_cbra.parent = self
6759 _n_annotations = n_annotations
6760 if n_annotations != null then
6761 n_annotations.parent = self
6762 end
6763 end
6764
6765 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6766 do
6767 if _n_obra == old_child then
6768 if new_child != null then
6769 new_child.parent = self
6770 assert new_child isa TObra
6771 _n_obra = new_child
6772 else
6773 abort
6774 end
6775 return
6776 end
6777 if _n_expr == old_child then
6778 if new_child != null then
6779 new_child.parent = self
6780 assert new_child isa AExpr
6781 _n_expr = new_child
6782 else
6783 abort
6784 end
6785 return
6786 end
6787 if _n_expr2 == old_child then
6788 if new_child != null then
6789 new_child.parent = self
6790 assert new_child isa AExpr
6791 _n_expr2 = new_child
6792 else
6793 abort
6794 end
6795 return
6796 end
6797 if _n_cbra == old_child then
6798 if new_child != null then
6799 new_child.parent = self
6800 assert new_child isa TCbra
6801 _n_cbra = new_child
6802 else
6803 abort
6804 end
6805 return
6806 end
6807 if _n_annotations == old_child then
6808 if new_child != null then
6809 new_child.parent = self
6810 assert new_child isa AAnnotations
6811 _n_annotations = new_child
6812 else
6813 _n_annotations = null
6814 end
6815 return
6816 end
6817 end
6818
6819 redef fun visit_all(v: Visitor)
6820 do
6821 v.enter_visit(_n_obra)
6822 v.enter_visit(_n_expr)
6823 v.enter_visit(_n_expr2)
6824 v.enter_visit(_n_cbra)
6825 if _n_annotations != null then
6826 v.enter_visit(_n_annotations.as(not null))
6827 end
6828 end
6829 end
6830 redef class AOrangeExpr
6831 private init empty_init do end
6832
6833 init init_aorangeexpr (
6834 n_obra: nullable TObra,
6835 n_expr: nullable AExpr,
6836 n_expr2: nullable AExpr,
6837 n_cbra: nullable TObra,
6838 n_annotations: nullable AAnnotations
6839 )
6840 do
6841 empty_init
6842 _n_obra = n_obra.as(not null)
6843 n_obra.parent = self
6844 _n_expr = n_expr.as(not null)
6845 n_expr.parent = self
6846 _n_expr2 = n_expr2.as(not null)
6847 n_expr2.parent = self
6848 _n_cbra = n_cbra.as(not null)
6849 n_cbra.parent = self
6850 _n_annotations = n_annotations
6851 if n_annotations != null then
6852 n_annotations.parent = self
6853 end
6854 end
6855
6856 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6857 do
6858 if _n_obra == old_child then
6859 if new_child != null then
6860 new_child.parent = self
6861 assert new_child isa TObra
6862 _n_obra = new_child
6863 else
6864 abort
6865 end
6866 return
6867 end
6868 if _n_expr == old_child then
6869 if new_child != null then
6870 new_child.parent = self
6871 assert new_child isa AExpr
6872 _n_expr = new_child
6873 else
6874 abort
6875 end
6876 return
6877 end
6878 if _n_expr2 == old_child then
6879 if new_child != null then
6880 new_child.parent = self
6881 assert new_child isa AExpr
6882 _n_expr2 = new_child
6883 else
6884 abort
6885 end
6886 return
6887 end
6888 if _n_cbra == old_child then
6889 if new_child != null then
6890 new_child.parent = self
6891 assert new_child isa TObra
6892 _n_cbra = new_child
6893 else
6894 abort
6895 end
6896 return
6897 end
6898 if _n_annotations == old_child then
6899 if new_child != null then
6900 new_child.parent = self
6901 assert new_child isa AAnnotations
6902 _n_annotations = new_child
6903 else
6904 _n_annotations = null
6905 end
6906 return
6907 end
6908 end
6909
6910 redef fun visit_all(v: Visitor)
6911 do
6912 v.enter_visit(_n_obra)
6913 v.enter_visit(_n_expr)
6914 v.enter_visit(_n_expr2)
6915 v.enter_visit(_n_cbra)
6916 if _n_annotations != null then
6917 v.enter_visit(_n_annotations.as(not null))
6918 end
6919 end
6920 end
6921 redef class AArrayExpr
6922 private init empty_init do end
6923
6924 init init_aarrayexpr (
6925 n_exprs: nullable AExprs,
6926 n_annotations: nullable AAnnotations
6927 )
6928 do
6929 empty_init
6930 _n_exprs = n_exprs.as(not null)
6931 n_exprs.parent = self
6932 _n_annotations = n_annotations
6933 if n_annotations != null then
6934 n_annotations.parent = self
6935 end
6936 end
6937
6938 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6939 do
6940 if _n_exprs == old_child then
6941 if new_child != null then
6942 new_child.parent = self
6943 assert new_child isa AExprs
6944 _n_exprs = new_child
6945 else
6946 abort
6947 end
6948 return
6949 end
6950 if _n_annotations == old_child then
6951 if new_child != null then
6952 new_child.parent = self
6953 assert new_child isa AAnnotations
6954 _n_annotations = new_child
6955 else
6956 _n_annotations = null
6957 end
6958 return
6959 end
6960 end
6961
6962 redef fun visit_all(v: Visitor)
6963 do
6964 v.enter_visit(_n_exprs)
6965 if _n_annotations != null then
6966 v.enter_visit(_n_annotations.as(not null))
6967 end
6968 end
6969 end
6970 redef class ASelfExpr
6971 private init empty_init do end
6972
6973 init init_aselfexpr (
6974 n_kwself: nullable TKwself,
6975 n_annotations: nullable AAnnotations
6976 )
6977 do
6978 empty_init
6979 _n_kwself = n_kwself.as(not null)
6980 n_kwself.parent = self
6981 _n_annotations = n_annotations
6982 if n_annotations != null then
6983 n_annotations.parent = self
6984 end
6985 end
6986
6987 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6988 do
6989 if _n_kwself == old_child then
6990 if new_child != null then
6991 new_child.parent = self
6992 assert new_child isa TKwself
6993 _n_kwself = new_child
6994 else
6995 abort
6996 end
6997 return
6998 end
6999 if _n_annotations == old_child then
7000 if new_child != null then
7001 new_child.parent = self
7002 assert new_child isa AAnnotations
7003 _n_annotations = new_child
7004 else
7005 _n_annotations = null
7006 end
7007 return
7008 end
7009 end
7010
7011 redef fun visit_all(v: Visitor)
7012 do
7013 v.enter_visit(_n_kwself)
7014 if _n_annotations != null then
7015 v.enter_visit(_n_annotations.as(not null))
7016 end
7017 end
7018 end
7019 redef class AImplicitSelfExpr
7020 private init empty_init do end
7021
7022 init init_aimplicitselfexpr
7023 do
7024 empty_init
7025 end
7026
7027 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7028 do
7029 end
7030
7031 redef fun visit_all(v: Visitor)
7032 do
7033 end
7034 end
7035 redef class ATrueExpr
7036 private init empty_init do end
7037
7038 init init_atrueexpr (
7039 n_kwtrue: nullable TKwtrue,
7040 n_annotations: nullable AAnnotations
7041 )
7042 do
7043 empty_init
7044 _n_kwtrue = n_kwtrue.as(not null)
7045 n_kwtrue.parent = self
7046 _n_annotations = n_annotations
7047 if n_annotations != null then
7048 n_annotations.parent = self
7049 end
7050 end
7051
7052 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7053 do
7054 if _n_kwtrue == old_child then
7055 if new_child != null then
7056 new_child.parent = self
7057 assert new_child isa TKwtrue
7058 _n_kwtrue = new_child
7059 else
7060 abort
7061 end
7062 return
7063 end
7064 if _n_annotations == old_child then
7065 if new_child != null then
7066 new_child.parent = self
7067 assert new_child isa AAnnotations
7068 _n_annotations = new_child
7069 else
7070 _n_annotations = null
7071 end
7072 return
7073 end
7074 end
7075
7076 redef fun visit_all(v: Visitor)
7077 do
7078 v.enter_visit(_n_kwtrue)
7079 if _n_annotations != null then
7080 v.enter_visit(_n_annotations.as(not null))
7081 end
7082 end
7083 end
7084 redef class AFalseExpr
7085 private init empty_init do end
7086
7087 init init_afalseexpr (
7088 n_kwfalse: nullable TKwfalse,
7089 n_annotations: nullable AAnnotations
7090 )
7091 do
7092 empty_init
7093 _n_kwfalse = n_kwfalse.as(not null)
7094 n_kwfalse.parent = self
7095 _n_annotations = n_annotations
7096 if n_annotations != null then
7097 n_annotations.parent = self
7098 end
7099 end
7100
7101 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7102 do
7103 if _n_kwfalse == old_child then
7104 if new_child != null then
7105 new_child.parent = self
7106 assert new_child isa TKwfalse
7107 _n_kwfalse = new_child
7108 else
7109 abort
7110 end
7111 return
7112 end
7113 if _n_annotations == old_child then
7114 if new_child != null then
7115 new_child.parent = self
7116 assert new_child isa AAnnotations
7117 _n_annotations = new_child
7118 else
7119 _n_annotations = null
7120 end
7121 return
7122 end
7123 end
7124
7125 redef fun visit_all(v: Visitor)
7126 do
7127 v.enter_visit(_n_kwfalse)
7128 if _n_annotations != null then
7129 v.enter_visit(_n_annotations.as(not null))
7130 end
7131 end
7132 end
7133 redef class ANullExpr
7134 private init empty_init do end
7135
7136 init init_anullexpr (
7137 n_kwnull: nullable TKwnull,
7138 n_annotations: nullable AAnnotations
7139 )
7140 do
7141 empty_init
7142 _n_kwnull = n_kwnull.as(not null)
7143 n_kwnull.parent = self
7144 _n_annotations = n_annotations
7145 if n_annotations != null then
7146 n_annotations.parent = self
7147 end
7148 end
7149
7150 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7151 do
7152 if _n_kwnull == old_child then
7153 if new_child != null then
7154 new_child.parent = self
7155 assert new_child isa TKwnull
7156 _n_kwnull = new_child
7157 else
7158 abort
7159 end
7160 return
7161 end
7162 if _n_annotations == old_child then
7163 if new_child != null then
7164 new_child.parent = self
7165 assert new_child isa AAnnotations
7166 _n_annotations = new_child
7167 else
7168 _n_annotations = null
7169 end
7170 return
7171 end
7172 end
7173
7174 redef fun visit_all(v: Visitor)
7175 do
7176 v.enter_visit(_n_kwnull)
7177 if _n_annotations != null then
7178 v.enter_visit(_n_annotations.as(not null))
7179 end
7180 end
7181 end
7182 redef class AIntExpr
7183 private init empty_init do end
7184
7185 init init_aintexpr (
7186 n_number: nullable TNumber,
7187 n_annotations: nullable AAnnotations
7188 )
7189 do
7190 empty_init
7191 _n_number = n_number.as(not null)
7192 n_number.parent = self
7193 _n_annotations = n_annotations
7194 if n_annotations != null then
7195 n_annotations.parent = self
7196 end
7197 end
7198
7199 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7200 do
7201 if _n_number == old_child then
7202 if new_child != null then
7203 new_child.parent = self
7204 assert new_child isa TNumber
7205 _n_number = new_child
7206 else
7207 abort
7208 end
7209 return
7210 end
7211 if _n_annotations == old_child then
7212 if new_child != null then
7213 new_child.parent = self
7214 assert new_child isa AAnnotations
7215 _n_annotations = new_child
7216 else
7217 _n_annotations = null
7218 end
7219 return
7220 end
7221 end
7222
7223 redef fun visit_all(v: Visitor)
7224 do
7225 v.enter_visit(_n_number)
7226 if _n_annotations != null then
7227 v.enter_visit(_n_annotations.as(not null))
7228 end
7229 end
7230 end
7231 redef class AFloatExpr
7232 private init empty_init do end
7233
7234 init init_afloatexpr (
7235 n_float: nullable TFloat,
7236 n_annotations: nullable AAnnotations
7237 )
7238 do
7239 empty_init
7240 _n_float = n_float.as(not null)
7241 n_float.parent = self
7242 _n_annotations = n_annotations
7243 if n_annotations != null then
7244 n_annotations.parent = self
7245 end
7246 end
7247
7248 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7249 do
7250 if _n_float == old_child then
7251 if new_child != null then
7252 new_child.parent = self
7253 assert new_child isa TFloat
7254 _n_float = new_child
7255 else
7256 abort
7257 end
7258 return
7259 end
7260 if _n_annotations == old_child then
7261 if new_child != null then
7262 new_child.parent = self
7263 assert new_child isa AAnnotations
7264 _n_annotations = new_child
7265 else
7266 _n_annotations = null
7267 end
7268 return
7269 end
7270 end
7271
7272 redef fun visit_all(v: Visitor)
7273 do
7274 v.enter_visit(_n_float)
7275 if _n_annotations != null then
7276 v.enter_visit(_n_annotations.as(not null))
7277 end
7278 end
7279 end
7280 redef class ACharExpr
7281 private init empty_init do end
7282
7283 init init_acharexpr (
7284 n_char: nullable TChar,
7285 n_annotations: nullable AAnnotations
7286 )
7287 do
7288 empty_init
7289 _n_char = n_char.as(not null)
7290 n_char.parent = self
7291 _n_annotations = n_annotations
7292 if n_annotations != null then
7293 n_annotations.parent = self
7294 end
7295 end
7296
7297 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7298 do
7299 if _n_char == old_child then
7300 if new_child != null then
7301 new_child.parent = self
7302 assert new_child isa TChar
7303 _n_char = new_child
7304 else
7305 abort
7306 end
7307 return
7308 end
7309 if _n_annotations == old_child then
7310 if new_child != null then
7311 new_child.parent = self
7312 assert new_child isa AAnnotations
7313 _n_annotations = new_child
7314 else
7315 _n_annotations = null
7316 end
7317 return
7318 end
7319 end
7320
7321 redef fun visit_all(v: Visitor)
7322 do
7323 v.enter_visit(_n_char)
7324 if _n_annotations != null then
7325 v.enter_visit(_n_annotations.as(not null))
7326 end
7327 end
7328 end
7329 redef class AStringExpr
7330 private init empty_init do end
7331
7332 init init_astringexpr (
7333 n_string: nullable TString,
7334 n_annotations: nullable AAnnotations
7335 )
7336 do
7337 empty_init
7338 _n_string = n_string.as(not null)
7339 n_string.parent = self
7340 _n_annotations = n_annotations
7341 if n_annotations != null then
7342 n_annotations.parent = self
7343 end
7344 end
7345
7346 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7347 do
7348 if _n_string == old_child then
7349 if new_child != null then
7350 new_child.parent = self
7351 assert new_child isa TString
7352 _n_string = new_child
7353 else
7354 abort
7355 end
7356 return
7357 end
7358 if _n_annotations == old_child then
7359 if new_child != null then
7360 new_child.parent = self
7361 assert new_child isa AAnnotations
7362 _n_annotations = new_child
7363 else
7364 _n_annotations = null
7365 end
7366 return
7367 end
7368 end
7369
7370 redef fun visit_all(v: Visitor)
7371 do
7372 v.enter_visit(_n_string)
7373 if _n_annotations != null then
7374 v.enter_visit(_n_annotations.as(not null))
7375 end
7376 end
7377 end
7378 redef class AStartStringExpr
7379 private init empty_init do end
7380
7381 init init_astartstringexpr (
7382 n_string: nullable TStartString
7383 )
7384 do
7385 empty_init
7386 _n_string = n_string.as(not null)
7387 n_string.parent = self
7388 end
7389
7390 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7391 do
7392 if _n_string == old_child then
7393 if new_child != null then
7394 new_child.parent = self
7395 assert new_child isa TStartString
7396 _n_string = new_child
7397 else
7398 abort
7399 end
7400 return
7401 end
7402 end
7403
7404 redef fun visit_all(v: Visitor)
7405 do
7406 v.enter_visit(_n_string)
7407 end
7408 end
7409 redef class AMidStringExpr
7410 private init empty_init do end
7411
7412 init init_amidstringexpr (
7413 n_string: nullable TMidString
7414 )
7415 do
7416 empty_init
7417 _n_string = n_string.as(not null)
7418 n_string.parent = self
7419 end
7420
7421 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7422 do
7423 if _n_string == old_child then
7424 if new_child != null then
7425 new_child.parent = self
7426 assert new_child isa TMidString
7427 _n_string = new_child
7428 else
7429 abort
7430 end
7431 return
7432 end
7433 end
7434
7435 redef fun visit_all(v: Visitor)
7436 do
7437 v.enter_visit(_n_string)
7438 end
7439 end
7440 redef class AEndStringExpr
7441 private init empty_init do end
7442
7443 init init_aendstringexpr (
7444 n_string: nullable TEndString
7445 )
7446 do
7447 empty_init
7448 _n_string = n_string.as(not null)
7449 n_string.parent = self
7450 end
7451
7452 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7453 do
7454 if _n_string == old_child then
7455 if new_child != null then
7456 new_child.parent = self
7457 assert new_child isa TEndString
7458 _n_string = new_child
7459 else
7460 abort
7461 end
7462 return
7463 end
7464 end
7465
7466 redef fun visit_all(v: Visitor)
7467 do
7468 v.enter_visit(_n_string)
7469 end
7470 end
7471 redef class ASuperstringExpr
7472 private init empty_init do end
7473
7474 init init_asuperstringexpr (
7475 n_exprs: Collection[Object], # Should be Collection[AExpr]
7476 n_annotations: nullable AAnnotations
7477 )
7478 do
7479 empty_init
7480 for n in n_exprs do
7481 assert n isa AExpr
7482 _n_exprs.add(n)
7483 n.parent = self
7484 end
7485 _n_annotations = n_annotations
7486 if n_annotations != null then
7487 n_annotations.parent = self
7488 end
7489 end
7490
7491 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7492 do
7493 for i in [0.._n_exprs.length[ do
7494 if _n_exprs[i] == old_child then
7495 if new_child != null then
7496 assert new_child isa AExpr
7497 _n_exprs[i] = new_child
7498 new_child.parent = self
7499 else
7500 _n_exprs.remove_at(i)
7501 end
7502 return
7503 end
7504 end
7505 if _n_annotations == old_child then
7506 if new_child != null then
7507 new_child.parent = self
7508 assert new_child isa AAnnotations
7509 _n_annotations = new_child
7510 else
7511 _n_annotations = null
7512 end
7513 return
7514 end
7515 end
7516
7517 redef fun visit_all(v: Visitor)
7518 do
7519 for n in _n_exprs do
7520 v.enter_visit(n)
7521 end
7522 if _n_annotations != null then
7523 v.enter_visit(_n_annotations.as(not null))
7524 end
7525 end
7526 end
7527 redef class AParExpr
7528 private init empty_init do end
7529
7530 init init_aparexpr (
7531 n_opar: nullable TOpar,
7532 n_expr: nullable AExpr,
7533 n_cpar: nullable TCpar,
7534 n_annotations: nullable AAnnotations
7535 )
7536 do
7537 empty_init
7538 _n_opar = n_opar.as(not null)
7539 n_opar.parent = self
7540 _n_expr = n_expr.as(not null)
7541 n_expr.parent = self
7542 _n_cpar = n_cpar.as(not null)
7543 n_cpar.parent = self
7544 _n_annotations = n_annotations
7545 if n_annotations != null then
7546 n_annotations.parent = self
7547 end
7548 end
7549
7550 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7551 do
7552 if _n_opar == old_child then
7553 if new_child != null then
7554 new_child.parent = self
7555 assert new_child isa TOpar
7556 _n_opar = new_child
7557 else
7558 abort
7559 end
7560 return
7561 end
7562 if _n_expr == old_child then
7563 if new_child != null then
7564 new_child.parent = self
7565 assert new_child isa AExpr
7566 _n_expr = new_child
7567 else
7568 abort
7569 end
7570 return
7571 end
7572 if _n_cpar == old_child then
7573 if new_child != null then
7574 new_child.parent = self
7575 assert new_child isa TCpar
7576 _n_cpar = new_child
7577 else
7578 abort
7579 end
7580 return
7581 end
7582 if _n_annotations == old_child then
7583 if new_child != null then
7584 new_child.parent = self
7585 assert new_child isa AAnnotations
7586 _n_annotations = new_child
7587 else
7588 _n_annotations = null
7589 end
7590 return
7591 end
7592 end
7593
7594 redef fun visit_all(v: Visitor)
7595 do
7596 v.enter_visit(_n_opar)
7597 v.enter_visit(_n_expr)
7598 v.enter_visit(_n_cpar)
7599 if _n_annotations != null then
7600 v.enter_visit(_n_annotations.as(not null))
7601 end
7602 end
7603 end
7604 redef class AAsCastExpr
7605 private init empty_init do end
7606
7607 init init_aascastexpr (
7608 n_expr: nullable AExpr,
7609 n_kwas: nullable TKwas,
7610 n_opar: nullable TOpar,
7611 n_type: nullable AType,
7612 n_cpar: nullable TCpar
7613 )
7614 do
7615 empty_init
7616 _n_expr = n_expr.as(not null)
7617 n_expr.parent = self
7618 _n_kwas = n_kwas.as(not null)
7619 n_kwas.parent = self
7620 _n_opar = n_opar.as(not null)
7621 n_opar.parent = self
7622 _n_type = n_type.as(not null)
7623 n_type.parent = self
7624 _n_cpar = n_cpar.as(not null)
7625 n_cpar.parent = self
7626 end
7627
7628 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7629 do
7630 if _n_expr == old_child then
7631 if new_child != null then
7632 new_child.parent = self
7633 assert new_child isa AExpr
7634 _n_expr = new_child
7635 else
7636 abort
7637 end
7638 return
7639 end
7640 if _n_kwas == old_child then
7641 if new_child != null then
7642 new_child.parent = self
7643 assert new_child isa TKwas
7644 _n_kwas = new_child
7645 else
7646 abort
7647 end
7648 return
7649 end
7650 if _n_opar == old_child then
7651 if new_child != null then
7652 new_child.parent = self
7653 assert new_child isa TOpar
7654 _n_opar = new_child
7655 else
7656 abort
7657 end
7658 return
7659 end
7660 if _n_type == old_child then
7661 if new_child != null then
7662 new_child.parent = self
7663 assert new_child isa AType
7664 _n_type = new_child
7665 else
7666 abort
7667 end
7668 return
7669 end
7670 if _n_cpar == old_child then
7671 if new_child != null then
7672 new_child.parent = self
7673 assert new_child isa TCpar
7674 _n_cpar = new_child
7675 else
7676 abort
7677 end
7678 return
7679 end
7680 end
7681
7682 redef fun visit_all(v: Visitor)
7683 do
7684 v.enter_visit(_n_expr)
7685 v.enter_visit(_n_kwas)
7686 v.enter_visit(_n_opar)
7687 v.enter_visit(_n_type)
7688 v.enter_visit(_n_cpar)
7689 end
7690 end
7691 redef class AAsNotnullExpr
7692 private init empty_init do end
7693
7694 init init_aasnotnullexpr (
7695 n_expr: nullable AExpr,
7696 n_kwas: nullable TKwas,
7697 n_opar: nullable TOpar,
7698 n_kwnot: nullable TKwnot,
7699 n_kwnull: nullable TKwnull,
7700 n_cpar: nullable TCpar
7701 )
7702 do
7703 empty_init
7704 _n_expr = n_expr.as(not null)
7705 n_expr.parent = self
7706 _n_kwas = n_kwas.as(not null)
7707 n_kwas.parent = self
7708 _n_opar = n_opar.as(not null)
7709 n_opar.parent = self
7710 _n_kwnot = n_kwnot.as(not null)
7711 n_kwnot.parent = self
7712 _n_kwnull = n_kwnull.as(not null)
7713 n_kwnull.parent = self
7714 _n_cpar = n_cpar.as(not null)
7715 n_cpar.parent = self
7716 end
7717
7718 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7719 do
7720 if _n_expr == old_child then
7721 if new_child != null then
7722 new_child.parent = self
7723 assert new_child isa AExpr
7724 _n_expr = new_child
7725 else
7726 abort
7727 end
7728 return
7729 end
7730 if _n_kwas == old_child then
7731 if new_child != null then
7732 new_child.parent = self
7733 assert new_child isa TKwas
7734 _n_kwas = new_child
7735 else
7736 abort
7737 end
7738 return
7739 end
7740 if _n_opar == old_child then
7741 if new_child != null then
7742 new_child.parent = self
7743 assert new_child isa TOpar
7744 _n_opar = new_child
7745 else
7746 abort
7747 end
7748 return
7749 end
7750 if _n_kwnot == old_child then
7751 if new_child != null then
7752 new_child.parent = self
7753 assert new_child isa TKwnot
7754 _n_kwnot = new_child
7755 else
7756 abort
7757 end
7758 return
7759 end
7760 if _n_kwnull == old_child then
7761 if new_child != null then
7762 new_child.parent = self
7763 assert new_child isa TKwnull
7764 _n_kwnull = new_child
7765 else
7766 abort
7767 end
7768 return
7769 end
7770 if _n_cpar == old_child then
7771 if new_child != null then
7772 new_child.parent = self
7773 assert new_child isa TCpar
7774 _n_cpar = new_child
7775 else
7776 abort
7777 end
7778 return
7779 end
7780 end
7781
7782 redef fun visit_all(v: Visitor)
7783 do
7784 v.enter_visit(_n_expr)
7785 v.enter_visit(_n_kwas)
7786 v.enter_visit(_n_opar)
7787 v.enter_visit(_n_kwnot)
7788 v.enter_visit(_n_kwnull)
7789 v.enter_visit(_n_cpar)
7790 end
7791 end
7792 redef class AIssetAttrExpr
7793 private init empty_init do end
7794
7795 init init_aissetattrexpr (
7796 n_kwisset: nullable TKwisset,
7797 n_expr: nullable AExpr,
7798 n_id: nullable TAttrid
7799 )
7800 do
7801 empty_init
7802 _n_kwisset = n_kwisset.as(not null)
7803 n_kwisset.parent = self
7804 _n_expr = n_expr.as(not null)
7805 n_expr.parent = self
7806 _n_id = n_id.as(not null)
7807 n_id.parent = self
7808 end
7809
7810 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7811 do
7812 if _n_kwisset == old_child then
7813 if new_child != null then
7814 new_child.parent = self
7815 assert new_child isa TKwisset
7816 _n_kwisset = new_child
7817 else
7818 abort
7819 end
7820 return
7821 end
7822 if _n_expr == old_child then
7823 if new_child != null then
7824 new_child.parent = self
7825 assert new_child isa AExpr
7826 _n_expr = new_child
7827 else
7828 abort
7829 end
7830 return
7831 end
7832 if _n_id == old_child then
7833 if new_child != null then
7834 new_child.parent = self
7835 assert new_child isa TAttrid
7836 _n_id = new_child
7837 else
7838 abort
7839 end
7840 return
7841 end
7842 end
7843
7844 redef fun visit_all(v: Visitor)
7845 do
7846 v.enter_visit(_n_kwisset)
7847 v.enter_visit(_n_expr)
7848 v.enter_visit(_n_id)
7849 end
7850 end
7851 redef class ADebugTypeExpr
7852 private init empty_init do end
7853
7854 init init_adebugtypeexpr (
7855 n_kwdebug: nullable TKwdebug,
7856 n_kwtype: nullable TKwtype,
7857 n_expr: nullable AExpr,
7858 n_type: nullable AType
7859 )
7860 do
7861 empty_init
7862 _n_kwdebug = n_kwdebug.as(not null)
7863 n_kwdebug.parent = self
7864 _n_kwtype = n_kwtype.as(not null)
7865 n_kwtype.parent = self
7866 _n_expr = n_expr.as(not null)
7867 n_expr.parent = self
7868 _n_type = n_type.as(not null)
7869 n_type.parent = self
7870 end
7871
7872 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7873 do
7874 if _n_kwdebug == old_child then
7875 if new_child != null then
7876 new_child.parent = self
7877 assert new_child isa TKwdebug
7878 _n_kwdebug = new_child
7879 else
7880 abort
7881 end
7882 return
7883 end
7884 if _n_kwtype == old_child then
7885 if new_child != null then
7886 new_child.parent = self
7887 assert new_child isa TKwtype
7888 _n_kwtype = new_child
7889 else
7890 abort
7891 end
7892 return
7893 end
7894 if _n_expr == old_child then
7895 if new_child != null then
7896 new_child.parent = self
7897 assert new_child isa AExpr
7898 _n_expr = new_child
7899 else
7900 abort
7901 end
7902 return
7903 end
7904 if _n_type == old_child then
7905 if new_child != null then
7906 new_child.parent = self
7907 assert new_child isa AType
7908 _n_type = new_child
7909 else
7910 abort
7911 end
7912 return
7913 end
7914 end
7915
7916 redef fun visit_all(v: Visitor)
7917 do
7918 v.enter_visit(_n_kwdebug)
7919 v.enter_visit(_n_kwtype)
7920 v.enter_visit(_n_expr)
7921 v.enter_visit(_n_type)
7922 end
7923 end
7924 redef class AListExprs
7925 private init empty_init do end
7926
7927 init init_alistexprs (
7928 n_exprs: Collection[Object] # Should be Collection[AExpr]
7929 )
7930 do
7931 empty_init
7932 for n in n_exprs do
7933 assert n isa AExpr
7934 _n_exprs.add(n)
7935 n.parent = self
7936 end
7937 end
7938
7939 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7940 do
7941 for i in [0.._n_exprs.length[ do
7942 if _n_exprs[i] == old_child then
7943 if new_child != null then
7944 assert new_child isa AExpr
7945 _n_exprs[i] = new_child
7946 new_child.parent = self
7947 else
7948 _n_exprs.remove_at(i)
7949 end
7950 return
7951 end
7952 end
7953 end
7954
7955 redef fun visit_all(v: Visitor)
7956 do
7957 for n in _n_exprs do
7958 v.enter_visit(n)
7959 end
7960 end
7961 end
7962 redef class AParExprs
7963 private init empty_init do end
7964
7965 init init_aparexprs (
7966 n_opar: nullable TOpar,
7967 n_exprs: Collection[Object], # Should be Collection[AExpr]
7968 n_cpar: nullable TCpar
7969 )
7970 do
7971 empty_init
7972 _n_opar = n_opar.as(not null)
7973 n_opar.parent = self
7974 for n in n_exprs do
7975 assert n isa AExpr
7976 _n_exprs.add(n)
7977 n.parent = self
7978 end
7979 _n_cpar = n_cpar.as(not null)
7980 n_cpar.parent = self
7981 end
7982
7983 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7984 do
7985 if _n_opar == old_child then
7986 if new_child != null then
7987 new_child.parent = self
7988 assert new_child isa TOpar
7989 _n_opar = new_child
7990 else
7991 abort
7992 end
7993 return
7994 end
7995 for i in [0.._n_exprs.length[ do
7996 if _n_exprs[i] == old_child then
7997 if new_child != null then
7998 assert new_child isa AExpr
7999 _n_exprs[i] = new_child
8000 new_child.parent = self
8001 else
8002 _n_exprs.remove_at(i)
8003 end
8004 return
8005 end
8006 end
8007 if _n_cpar == old_child then
8008 if new_child != null then
8009 new_child.parent = self
8010 assert new_child isa TCpar
8011 _n_cpar = new_child
8012 else
8013 abort
8014 end
8015 return
8016 end
8017 end
8018
8019 redef fun visit_all(v: Visitor)
8020 do
8021 v.enter_visit(_n_opar)
8022 for n in _n_exprs do
8023 v.enter_visit(n)
8024 end
8025 v.enter_visit(_n_cpar)
8026 end
8027 end
8028 redef class ABraExprs
8029 private init empty_init do end
8030
8031 init init_abraexprs (
8032 n_obra: nullable TObra,
8033 n_exprs: Collection[Object], # Should be Collection[AExpr]
8034 n_cbra: nullable TCbra
8035 )
8036 do
8037 empty_init
8038 _n_obra = n_obra.as(not null)
8039 n_obra.parent = self
8040 for n in n_exprs do
8041 assert n isa AExpr
8042 _n_exprs.add(n)
8043 n.parent = self
8044 end
8045 _n_cbra = n_cbra.as(not null)
8046 n_cbra.parent = self
8047 end
8048
8049 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8050 do
8051 if _n_obra == old_child then
8052 if new_child != null then
8053 new_child.parent = self
8054 assert new_child isa TObra
8055 _n_obra = new_child
8056 else
8057 abort
8058 end
8059 return
8060 end
8061 for i in [0.._n_exprs.length[ do
8062 if _n_exprs[i] == old_child then
8063 if new_child != null then
8064 assert new_child isa AExpr
8065 _n_exprs[i] = new_child
8066 new_child.parent = self
8067 else
8068 _n_exprs.remove_at(i)
8069 end
8070 return
8071 end
8072 end
8073 if _n_cbra == old_child then
8074 if new_child != null then
8075 new_child.parent = self
8076 assert new_child isa TCbra
8077 _n_cbra = new_child
8078 else
8079 abort
8080 end
8081 return
8082 end
8083 end
8084
8085 redef fun visit_all(v: Visitor)
8086 do
8087 v.enter_visit(_n_obra)
8088 for n in _n_exprs do
8089 v.enter_visit(n)
8090 end
8091 v.enter_visit(_n_cbra)
8092 end
8093 end
8094 redef class APlusAssignOp
8095 private init empty_init do end
8096
8097 init init_aplusassignop (
8098 n_pluseq: nullable TPluseq
8099 )
8100 do
8101 empty_init
8102 _n_pluseq = n_pluseq.as(not null)
8103 n_pluseq.parent = self
8104 end
8105
8106 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8107 do
8108 if _n_pluseq == old_child then
8109 if new_child != null then
8110 new_child.parent = self
8111 assert new_child isa TPluseq
8112 _n_pluseq = new_child
8113 else
8114 abort
8115 end
8116 return
8117 end
8118 end
8119
8120 redef fun visit_all(v: Visitor)
8121 do
8122 v.enter_visit(_n_pluseq)
8123 end
8124 end
8125 redef class AMinusAssignOp
8126 private init empty_init do end
8127
8128 init init_aminusassignop (
8129 n_minuseq: nullable TMinuseq
8130 )
8131 do
8132 empty_init
8133 _n_minuseq = n_minuseq.as(not null)
8134 n_minuseq.parent = self
8135 end
8136
8137 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8138 do
8139 if _n_minuseq == old_child then
8140 if new_child != null then
8141 new_child.parent = self
8142 assert new_child isa TMinuseq
8143 _n_minuseq = new_child
8144 else
8145 abort
8146 end
8147 return
8148 end
8149 end
8150
8151 redef fun visit_all(v: Visitor)
8152 do
8153 v.enter_visit(_n_minuseq)
8154 end
8155 end
8156 redef class AClosureDef
8157 private init empty_init do end
8158
8159 init init_aclosuredef (
8160 n_bang: nullable TBang,
8161 n_id: nullable AClosureId,
8162 n_ids: Collection[Object], # Should be Collection[TId]
8163 n_kwdo: nullable TKwdo,
8164 n_expr: nullable AExpr,
8165 n_label: nullable ALabel
8166 )
8167 do
8168 empty_init
8169 _n_bang = n_bang.as(not null)
8170 n_bang.parent = self
8171 _n_id = n_id.as(not null)
8172 n_id.parent = self
8173 for n in n_ids do
8174 assert n isa TId
8175 _n_ids.add(n)
8176 n.parent = self
8177 end
8178 _n_kwdo = n_kwdo
8179 if n_kwdo != null then
8180 n_kwdo.parent = self
8181 end
8182 _n_expr = n_expr
8183 if n_expr != null then
8184 n_expr.parent = self
8185 end
8186 _n_label = n_label
8187 if n_label != null then
8188 n_label.parent = self
8189 end
8190 end
8191
8192 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8193 do
8194 if _n_bang == old_child then
8195 if new_child != null then
8196 new_child.parent = self
8197 assert new_child isa TBang
8198 _n_bang = new_child
8199 else
8200 abort
8201 end
8202 return
8203 end
8204 if _n_id == old_child then
8205 if new_child != null then
8206 new_child.parent = self
8207 assert new_child isa AClosureId
8208 _n_id = new_child
8209 else
8210 abort
8211 end
8212 return
8213 end
8214 for i in [0.._n_ids.length[ do
8215 if _n_ids[i] == old_child then
8216 if new_child != null then
8217 assert new_child isa TId
8218 _n_ids[i] = new_child
8219 new_child.parent = self
8220 else
8221 _n_ids.remove_at(i)
8222 end
8223 return
8224 end
8225 end
8226 if _n_kwdo == old_child then
8227 if new_child != null then
8228 new_child.parent = self
8229 assert new_child isa TKwdo
8230 _n_kwdo = new_child
8231 else
8232 _n_kwdo = null
8233 end
8234 return
8235 end
8236 if _n_expr == old_child then
8237 if new_child != null then
8238 new_child.parent = self
8239 assert new_child isa AExpr
8240 _n_expr = new_child
8241 else
8242 _n_expr = null
8243 end
8244 return
8245 end
8246 if _n_label == old_child then
8247 if new_child != null then
8248 new_child.parent = self
8249 assert new_child isa ALabel
8250 _n_label = new_child
8251 else
8252 _n_label = null
8253 end
8254 return
8255 end
8256 end
8257
8258 redef fun visit_all(v: Visitor)
8259 do
8260 v.enter_visit(_n_bang)
8261 v.enter_visit(_n_id)
8262 for n in _n_ids do
8263 v.enter_visit(n)
8264 end
8265 if _n_kwdo != null then
8266 v.enter_visit(_n_kwdo.as(not null))
8267 end
8268 if _n_expr != null then
8269 v.enter_visit(_n_expr.as(not null))
8270 end
8271 if _n_label != null then
8272 v.enter_visit(_n_label.as(not null))
8273 end
8274 end
8275 end
8276 redef class ASimpleClosureId
8277 private init empty_init do end
8278
8279 init init_asimpleclosureid (
8280 n_id: nullable TId
8281 )
8282 do
8283 empty_init
8284 _n_id = n_id.as(not null)
8285 n_id.parent = self
8286 end
8287
8288 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8289 do
8290 if _n_id == old_child then
8291 if new_child != null then
8292 new_child.parent = self
8293 assert new_child isa TId
8294 _n_id = new_child
8295 else
8296 abort
8297 end
8298 return
8299 end
8300 end
8301
8302 redef fun visit_all(v: Visitor)
8303 do
8304 v.enter_visit(_n_id)
8305 end
8306 end
8307 redef class ABreakClosureId
8308 private init empty_init do end
8309
8310 init init_abreakclosureid (
8311 n_kwbreak: nullable TKwbreak
8312 )
8313 do
8314 empty_init
8315 _n_kwbreak = n_kwbreak.as(not null)
8316 n_kwbreak.parent = self
8317 end
8318
8319 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8320 do
8321 if _n_kwbreak == old_child then
8322 if new_child != null then
8323 new_child.parent = self
8324 assert new_child isa TKwbreak
8325 _n_kwbreak = new_child
8326 else
8327 abort
8328 end
8329 return
8330 end
8331 end
8332
8333 redef fun visit_all(v: Visitor)
8334 do
8335 v.enter_visit(_n_kwbreak)
8336 end
8337 end
8338 redef class AModuleName
8339 private init empty_init do end
8340
8341 init init_amodulename (
8342 n_quad: nullable TQuad,
8343 n_path: Collection[Object], # Should be Collection[TId]
8344 n_id: nullable TId
8345 )
8346 do
8347 empty_init
8348 _n_quad = n_quad
8349 if n_quad != null then
8350 n_quad.parent = self
8351 end
8352 for n in n_path do
8353 assert n isa TId
8354 _n_path.add(n)
8355 n.parent = self
8356 end
8357 _n_id = n_id.as(not null)
8358 n_id.parent = self
8359 end
8360
8361 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8362 do
8363 if _n_quad == old_child then
8364 if new_child != null then
8365 new_child.parent = self
8366 assert new_child isa TQuad
8367 _n_quad = new_child
8368 else
8369 _n_quad = null
8370 end
8371 return
8372 end
8373 for i in [0.._n_path.length[ do
8374 if _n_path[i] == old_child then
8375 if new_child != null then
8376 assert new_child isa TId
8377 _n_path[i] = new_child
8378 new_child.parent = self
8379 else
8380 _n_path.remove_at(i)
8381 end
8382 return
8383 end
8384 end
8385 if _n_id == old_child then
8386 if new_child != null then
8387 new_child.parent = self
8388 assert new_child isa TId
8389 _n_id = new_child
8390 else
8391 abort
8392 end
8393 return
8394 end
8395 end
8396
8397 redef fun visit_all(v: Visitor)
8398 do
8399 if _n_quad != null then
8400 v.enter_visit(_n_quad.as(not null))
8401 end
8402 for n in _n_path do
8403 v.enter_visit(n)
8404 end
8405 v.enter_visit(_n_id)
8406 end
8407 end
8408 redef class AExternCalls
8409 private init empty_init do end
8410
8411 init init_aexterncalls (
8412 n_kwimport: nullable TKwimport,
8413 n_extern_calls: Collection[Object] # Should be Collection[AExternCall]
8414 )
8415 do
8416 empty_init
8417 _n_kwimport = n_kwimport.as(not null)
8418 n_kwimport.parent = self
8419 for n in n_extern_calls do
8420 assert n isa AExternCall
8421 _n_extern_calls.add(n)
8422 n.parent = self
8423 end
8424 end
8425
8426 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8427 do
8428 if _n_kwimport == old_child then
8429 if new_child != null then
8430 new_child.parent = self
8431 assert new_child isa TKwimport
8432 _n_kwimport = new_child
8433 else
8434 abort
8435 end
8436 return
8437 end
8438 for i in [0.._n_extern_calls.length[ do
8439 if _n_extern_calls[i] == old_child then
8440 if new_child != null then
8441 assert new_child isa AExternCall
8442 _n_extern_calls[i] = new_child
8443 new_child.parent = self
8444 else
8445 _n_extern_calls.remove_at(i)
8446 end
8447 return
8448 end
8449 end
8450 end
8451
8452 redef fun visit_all(v: Visitor)
8453 do
8454 v.enter_visit(_n_kwimport)
8455 for n in _n_extern_calls do
8456 v.enter_visit(n)
8457 end
8458 end
8459 end
8460 redef class AExternCall
8461 private init empty_init do end
8462
8463 init init_aexterncall
8464 do
8465 empty_init
8466 end
8467
8468 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8469 do
8470 end
8471
8472 redef fun visit_all(v: Visitor)
8473 do
8474 end
8475 end
8476 redef class ASuperExternCall
8477 private init empty_init do end
8478
8479 init init_asuperexterncall (
8480 n_kwsuper: nullable TKwsuper
8481 )
8482 do
8483 empty_init
8484 _n_kwsuper = n_kwsuper.as(not null)
8485 n_kwsuper.parent = self
8486 end
8487
8488 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8489 do
8490 if _n_kwsuper == old_child then
8491 if new_child != null then
8492 new_child.parent = self
8493 assert new_child isa TKwsuper
8494 _n_kwsuper = new_child
8495 else
8496 abort
8497 end
8498 return
8499 end
8500 end
8501
8502 redef fun visit_all(v: Visitor)
8503 do
8504 v.enter_visit(_n_kwsuper)
8505 end
8506 end
8507 redef class ALocalPropExternCall
8508 private init empty_init do end
8509
8510 init init_alocalpropexterncall (
8511 n_methid: nullable AMethid
8512 )
8513 do
8514 empty_init
8515 _n_methid = n_methid.as(not null)
8516 n_methid.parent = self
8517 end
8518
8519 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8520 do
8521 if _n_methid == old_child then
8522 if new_child != null then
8523 new_child.parent = self
8524 assert new_child isa AMethid
8525 _n_methid = new_child
8526 else
8527 abort
8528 end
8529 return
8530 end
8531 end
8532
8533 redef fun visit_all(v: Visitor)
8534 do
8535 v.enter_visit(_n_methid)
8536 end
8537 end
8538 redef class AFullPropExternCall
8539 private init empty_init do end
8540
8541 init init_afullpropexterncall (
8542 n_classid: nullable TClassid,
8543 n_quad: nullable TQuad,
8544 n_methid: nullable AMethid
8545 )
8546 do
8547 empty_init
8548 _n_classid = n_classid.as(not null)
8549 n_classid.parent = self
8550 _n_quad = n_quad
8551 if n_quad != null then
8552 n_quad.parent = self
8553 end
8554 _n_methid = n_methid.as(not null)
8555 n_methid.parent = self
8556 end
8557
8558 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8559 do
8560 if _n_classid == old_child then
8561 if new_child != null then
8562 new_child.parent = self
8563 assert new_child isa TClassid
8564 _n_classid = new_child
8565 else
8566 abort
8567 end
8568 return
8569 end
8570 if _n_quad == old_child then
8571 if new_child != null then
8572 new_child.parent = self
8573 assert new_child isa TQuad
8574 _n_quad = new_child
8575 else
8576 _n_quad = null
8577 end
8578 return
8579 end
8580 if _n_methid == old_child then
8581 if new_child != null then
8582 new_child.parent = self
8583 assert new_child isa AMethid
8584 _n_methid = new_child
8585 else
8586 abort
8587 end
8588 return
8589 end
8590 end
8591
8592 redef fun visit_all(v: Visitor)
8593 do
8594 v.enter_visit(_n_classid)
8595 if _n_quad != null then
8596 v.enter_visit(_n_quad.as(not null))
8597 end
8598 v.enter_visit(_n_methid)
8599 end
8600 end
8601 redef class AInitPropExternCall
8602 private init empty_init do end
8603
8604 init init_ainitpropexterncall (
8605 n_classid: nullable TClassid
8606 )
8607 do
8608 empty_init
8609 _n_classid = n_classid.as(not null)
8610 n_classid.parent = self
8611 end
8612
8613 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8614 do
8615 if _n_classid == old_child then
8616 if new_child != null then
8617 new_child.parent = self
8618 assert new_child isa TClassid
8619 _n_classid = new_child
8620 else
8621 abort
8622 end
8623 return
8624 end
8625 end
8626
8627 redef fun visit_all(v: Visitor)
8628 do
8629 v.enter_visit(_n_classid)
8630 end
8631 end
8632 redef class ACastAsExternCall
8633 private init empty_init do end
8634
8635 init init_acastasexterncall (
8636 n_from_type: nullable AType,
8637 n_kwas: nullable TKwas,
8638 n_to_type: nullable AType
8639 )
8640 do
8641 empty_init
8642 _n_from_type = n_from_type.as(not null)
8643 n_from_type.parent = self
8644 _n_kwas = n_kwas.as(not null)
8645 n_kwas.parent = self
8646 _n_to_type = n_to_type.as(not null)
8647 n_to_type.parent = self
8648 end
8649
8650 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8651 do
8652 if _n_from_type == old_child then
8653 if new_child != null then
8654 new_child.parent = self
8655 assert new_child isa AType
8656 _n_from_type = new_child
8657 else
8658 abort
8659 end
8660 return
8661 end
8662 if _n_kwas == old_child then
8663 if new_child != null then
8664 new_child.parent = self
8665 assert new_child isa TKwas
8666 _n_kwas = new_child
8667 else
8668 abort
8669 end
8670 return
8671 end
8672 if _n_to_type == old_child then
8673 if new_child != null then
8674 new_child.parent = self
8675 assert new_child isa AType
8676 _n_to_type = new_child
8677 else
8678 abort
8679 end
8680 return
8681 end
8682 end
8683
8684 redef fun visit_all(v: Visitor)
8685 do
8686 v.enter_visit(_n_from_type)
8687 v.enter_visit(_n_kwas)
8688 v.enter_visit(_n_to_type)
8689 end
8690 end
8691 redef class AAsNullableExternCall
8692 private init empty_init do end
8693
8694 init init_aasnullableexterncall (
8695 n_type: nullable AType,
8696 n_kwas: nullable TKwas,
8697 n_kwnullable: nullable TKwnullable
8698 )
8699 do
8700 empty_init
8701 _n_type = n_type.as(not null)
8702 n_type.parent = self
8703 _n_kwas = n_kwas.as(not null)
8704 n_kwas.parent = self
8705 _n_kwnullable = n_kwnullable.as(not null)
8706 n_kwnullable.parent = self
8707 end
8708
8709 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8710 do
8711 if _n_type == old_child then
8712 if new_child != null then
8713 new_child.parent = self
8714 assert new_child isa AType
8715 _n_type = new_child
8716 else
8717 abort
8718 end
8719 return
8720 end
8721 if _n_kwas == old_child then
8722 if new_child != null then
8723 new_child.parent = self
8724 assert new_child isa TKwas
8725 _n_kwas = new_child
8726 else
8727 abort
8728 end
8729 return
8730 end
8731 if _n_kwnullable == old_child then
8732 if new_child != null then
8733 new_child.parent = self
8734 assert new_child isa TKwnullable
8735 _n_kwnullable = new_child
8736 else
8737 abort
8738 end
8739 return
8740 end
8741 end
8742
8743 redef fun visit_all(v: Visitor)
8744 do
8745 v.enter_visit(_n_type)
8746 v.enter_visit(_n_kwas)
8747 v.enter_visit(_n_kwnullable)
8748 end
8749 end
8750 redef class AAsNotNullableExternCall
8751 private init empty_init do end
8752
8753 init init_aasnotnullableexterncall (
8754 n_type: nullable AType,
8755 n_kwas: nullable TKwas,
8756 n_kwnot: nullable TKwnot,
8757 n_kwnullable: nullable TKwnullable
8758 )
8759 do
8760 empty_init
8761 _n_type = n_type.as(not null)
8762 n_type.parent = self
8763 _n_kwas = n_kwas.as(not null)
8764 n_kwas.parent = self
8765 _n_kwnot = n_kwnot.as(not null)
8766 n_kwnot.parent = self
8767 _n_kwnullable = n_kwnullable.as(not null)
8768 n_kwnullable.parent = self
8769 end
8770
8771 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8772 do
8773 if _n_type == old_child then
8774 if new_child != null then
8775 new_child.parent = self
8776 assert new_child isa AType
8777 _n_type = new_child
8778 else
8779 abort
8780 end
8781 return
8782 end
8783 if _n_kwas == old_child then
8784 if new_child != null then
8785 new_child.parent = self
8786 assert new_child isa TKwas
8787 _n_kwas = new_child
8788 else
8789 abort
8790 end
8791 return
8792 end
8793 if _n_kwnot == old_child then
8794 if new_child != null then
8795 new_child.parent = self
8796 assert new_child isa TKwnot
8797 _n_kwnot = new_child
8798 else
8799 abort
8800 end
8801 return
8802 end
8803 if _n_kwnullable == old_child then
8804 if new_child != null then
8805 new_child.parent = self
8806 assert new_child isa TKwnullable
8807 _n_kwnullable = new_child
8808 else
8809 abort
8810 end
8811 return
8812 end
8813 end
8814
8815 redef fun visit_all(v: Visitor)
8816 do
8817 v.enter_visit(_n_type)
8818 v.enter_visit(_n_kwas)
8819 v.enter_visit(_n_kwnot)
8820 v.enter_visit(_n_kwnullable)
8821 end
8822 end
8823 redef class AInLanguage
8824 private init empty_init do end
8825
8826 init init_ainlanguage (
8827 n_kwin: nullable TKwin,
8828 n_string: nullable TString
8829 )
8830 do
8831 empty_init
8832 _n_kwin = n_kwin.as(not null)
8833 n_kwin.parent = self
8834 _n_string = n_string.as(not null)
8835 n_string.parent = self
8836 end
8837
8838 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8839 do
8840 if _n_kwin == old_child then
8841 if new_child != null then
8842 new_child.parent = self
8843 assert new_child isa TKwin
8844 _n_kwin = new_child
8845 else
8846 abort
8847 end
8848 return
8849 end
8850 if _n_string == old_child then
8851 if new_child != null then
8852 new_child.parent = self
8853 assert new_child isa TString
8854 _n_string = new_child
8855 else
8856 abort
8857 end
8858 return
8859 end
8860 end
8861
8862 redef fun visit_all(v: Visitor)
8863 do
8864 v.enter_visit(_n_kwin)
8865 v.enter_visit(_n_string)
8866 end
8867 end
8868 redef class AExternCodeBlock
8869 private init empty_init do end
8870
8871 init init_aexterncodeblock (
8872 n_in_language: nullable AInLanguage,
8873 n_extern_code_segment: nullable TExternCodeSegment
8874 )
8875 do
8876 empty_init
8877 _n_in_language = n_in_language
8878 if n_in_language != null then
8879 n_in_language.parent = self
8880 end
8881 _n_extern_code_segment = n_extern_code_segment.as(not null)
8882 n_extern_code_segment.parent = self
8883 end
8884
8885 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8886 do
8887 if _n_in_language == old_child then
8888 if new_child != null then
8889 new_child.parent = self
8890 assert new_child isa AInLanguage
8891 _n_in_language = new_child
8892 else
8893 _n_in_language = null
8894 end
8895 return
8896 end
8897 if _n_extern_code_segment == old_child then
8898 if new_child != null then
8899 new_child.parent = self
8900 assert new_child isa TExternCodeSegment
8901 _n_extern_code_segment = new_child
8902 else
8903 abort
8904 end
8905 return
8906 end
8907 end
8908
8909 redef fun visit_all(v: Visitor)
8910 do
8911 if _n_in_language != null then
8912 v.enter_visit(_n_in_language.as(not null))
8913 end
8914 v.enter_visit(_n_extern_code_segment)
8915 end
8916 end
8917 redef class AQualified
8918 private init empty_init do end
8919
8920 init init_aqualified (
8921 n_id: Collection[Object], # Should be Collection[TId]
8922 n_classid: nullable TClassid
8923 )
8924 do
8925 empty_init
8926 for n in n_id do
8927 assert n isa TId
8928 _n_id.add(n)
8929 n.parent = self
8930 end
8931 _n_classid = n_classid
8932 if n_classid != null then
8933 n_classid.parent = self
8934 end
8935 end
8936
8937 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8938 do
8939 for i in [0.._n_id.length[ do
8940 if _n_id[i] == old_child then
8941 if new_child != null then
8942 assert new_child isa TId
8943 _n_id[i] = new_child
8944 new_child.parent = self
8945 else
8946 _n_id.remove_at(i)
8947 end
8948 return
8949 end
8950 end
8951 if _n_classid == old_child then
8952 if new_child != null then
8953 new_child.parent = self
8954 assert new_child isa TClassid
8955 _n_classid = new_child
8956 else
8957 _n_classid = null
8958 end
8959 return
8960 end
8961 end
8962
8963 redef fun visit_all(v: Visitor)
8964 do
8965 for n in _n_id do
8966 v.enter_visit(n)
8967 end
8968 if _n_classid != null then
8969 v.enter_visit(_n_classid.as(not null))
8970 end
8971 end
8972 end
8973 redef class ADoc
8974 private init empty_init do end
8975
8976 init init_adoc (
8977 n_comment: Collection[Object] # Should be Collection[TComment]
8978 )
8979 do
8980 empty_init
8981 for n in n_comment do
8982 assert n isa TComment
8983 _n_comment.add(n)
8984 n.parent = self
8985 end
8986 end
8987
8988 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8989 do
8990 for i in [0.._n_comment.length[ do
8991 if _n_comment[i] == old_child then
8992 if new_child != null then
8993 assert new_child isa TComment
8994 _n_comment[i] = new_child
8995 new_child.parent = self
8996 else
8997 _n_comment.remove_at(i)
8998 end
8999 return
9000 end
9001 end
9002 end
9003
9004 redef fun visit_all(v: Visitor)
9005 do
9006 for n in _n_comment do
9007 v.enter_visit(n)
9008 end
9009 end
9010 end
9011 redef class AAnnotations
9012 private init empty_init do end
9013
9014 init init_aannotations (
9015 n_at: nullable TAt,
9016 n_opar: nullable TOpar,
9017 n_items: Collection[Object], # Should be Collection[AAnnotation]
9018 n_cpar: nullable TCpar
9019 )
9020 do
9021 empty_init
9022 _n_at = n_at
9023 if n_at != null then
9024 n_at.parent = self
9025 end
9026 _n_opar = n_opar
9027 if n_opar != null then
9028 n_opar.parent = self
9029 end
9030 for n in n_items do
9031 assert n isa AAnnotation
9032 _n_items.add(n)
9033 n.parent = self
9034 end
9035 _n_cpar = n_cpar
9036 if n_cpar != null then
9037 n_cpar.parent = self
9038 end
9039 end
9040
9041 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9042 do
9043 if _n_at == old_child then
9044 if new_child != null then
9045 new_child.parent = self
9046 assert new_child isa TAt
9047 _n_at = new_child
9048 else
9049 _n_at = null
9050 end
9051 return
9052 end
9053 if _n_opar == old_child then
9054 if new_child != null then
9055 new_child.parent = self
9056 assert new_child isa TOpar
9057 _n_opar = new_child
9058 else
9059 _n_opar = null
9060 end
9061 return
9062 end
9063 for i in [0.._n_items.length[ do
9064 if _n_items[i] == old_child then
9065 if new_child != null then
9066 assert new_child isa AAnnotation
9067 _n_items[i] = new_child
9068 new_child.parent = self
9069 else
9070 _n_items.remove_at(i)
9071 end
9072 return
9073 end
9074 end
9075 if _n_cpar == old_child then
9076 if new_child != null then
9077 new_child.parent = self
9078 assert new_child isa TCpar
9079 _n_cpar = new_child
9080 else
9081 _n_cpar = null
9082 end
9083 return
9084 end
9085 end
9086
9087 redef fun visit_all(v: Visitor)
9088 do
9089 if _n_at != null then
9090 v.enter_visit(_n_at.as(not null))
9091 end
9092 if _n_opar != null then
9093 v.enter_visit(_n_opar.as(not null))
9094 end
9095 for n in _n_items do
9096 v.enter_visit(n)
9097 end
9098 if _n_cpar != null then
9099 v.enter_visit(_n_cpar.as(not null))
9100 end
9101 end
9102 end
9103 redef class AAnnotation
9104 private init empty_init do end
9105
9106 init init_aannotation (
9107 n_atid: nullable AAtid,
9108 n_opar: nullable TOpar,
9109 n_args: Collection[Object], # Should be Collection[AAtArg]
9110 n_cpar: nullable TCpar,
9111 n_annotations: nullable AAnnotations
9112 )
9113 do
9114 empty_init
9115 _n_atid = n_atid.as(not null)
9116 n_atid.parent = self
9117 _n_opar = n_opar
9118 if n_opar != null then
9119 n_opar.parent = self
9120 end
9121 for n in n_args do
9122 assert n isa AAtArg
9123 _n_args.add(n)
9124 n.parent = self
9125 end
9126 _n_cpar = n_cpar
9127 if n_cpar != null then
9128 n_cpar.parent = self
9129 end
9130 _n_annotations = n_annotations
9131 if n_annotations != null then
9132 n_annotations.parent = self
9133 end
9134 end
9135
9136 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9137 do
9138 if _n_atid == old_child then
9139 if new_child != null then
9140 new_child.parent = self
9141 assert new_child isa AAtid
9142 _n_atid = new_child
9143 else
9144 abort
9145 end
9146 return
9147 end
9148 if _n_opar == old_child then
9149 if new_child != null then
9150 new_child.parent = self
9151 assert new_child isa TOpar
9152 _n_opar = new_child
9153 else
9154 _n_opar = null
9155 end
9156 return
9157 end
9158 for i in [0.._n_args.length[ do
9159 if _n_args[i] == old_child then
9160 if new_child != null then
9161 assert new_child isa AAtArg
9162 _n_args[i] = new_child
9163 new_child.parent = self
9164 else
9165 _n_args.remove_at(i)
9166 end
9167 return
9168 end
9169 end
9170 if _n_cpar == old_child then
9171 if new_child != null then
9172 new_child.parent = self
9173 assert new_child isa TCpar
9174 _n_cpar = new_child
9175 else
9176 _n_cpar = null
9177 end
9178 return
9179 end
9180 if _n_annotations == old_child then
9181 if new_child != null then
9182 new_child.parent = self
9183 assert new_child isa AAnnotations
9184 _n_annotations = new_child
9185 else
9186 _n_annotations = null
9187 end
9188 return
9189 end
9190 end
9191
9192 redef fun visit_all(v: Visitor)
9193 do
9194 v.enter_visit(_n_atid)
9195 if _n_opar != null then
9196 v.enter_visit(_n_opar.as(not null))
9197 end
9198 for n in _n_args do
9199 v.enter_visit(n)
9200 end
9201 if _n_cpar != null then
9202 v.enter_visit(_n_cpar.as(not null))
9203 end
9204 if _n_annotations != null then
9205 v.enter_visit(_n_annotations.as(not null))
9206 end
9207 end
9208 end
9209 redef class ATypeAtArg
9210 private init empty_init do end
9211
9212 init init_atypeatarg (
9213 n_type: nullable AType
9214 )
9215 do
9216 empty_init
9217 _n_type = n_type.as(not null)
9218 n_type.parent = self
9219 end
9220
9221 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9222 do
9223 if _n_type == old_child then
9224 if new_child != null then
9225 new_child.parent = self
9226 assert new_child isa AType
9227 _n_type = new_child
9228 else
9229 abort
9230 end
9231 return
9232 end
9233 end
9234
9235 redef fun visit_all(v: Visitor)
9236 do
9237 v.enter_visit(_n_type)
9238 end
9239 end
9240 redef class AExprAtArg
9241 private init empty_init do end
9242
9243 init init_aexpratarg (
9244 n_expr: nullable AExpr
9245 )
9246 do
9247 empty_init
9248 _n_expr = n_expr.as(not null)
9249 n_expr.parent = self
9250 end
9251
9252 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9253 do
9254 if _n_expr == old_child then
9255 if new_child != null then
9256 new_child.parent = self
9257 assert new_child isa AExpr
9258 _n_expr = new_child
9259 else
9260 abort
9261 end
9262 return
9263 end
9264 end
9265
9266 redef fun visit_all(v: Visitor)
9267 do
9268 v.enter_visit(_n_expr)
9269 end
9270 end
9271 redef class AAtAtArg
9272 private init empty_init do end
9273
9274 init init_aatatarg (
9275 n_annotations: nullable AAnnotations
9276 )
9277 do
9278 empty_init
9279 _n_annotations = n_annotations.as(not null)
9280 n_annotations.parent = self
9281 end
9282
9283 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9284 do
9285 if _n_annotations == old_child then
9286 if new_child != null then
9287 new_child.parent = self
9288 assert new_child isa AAnnotations
9289 _n_annotations = new_child
9290 else
9291 abort
9292 end
9293 return
9294 end
9295 end
9296
9297 redef fun visit_all(v: Visitor)
9298 do
9299 v.enter_visit(_n_annotations)
9300 end
9301 end
9302 redef class AIdAtid
9303 private init empty_init do end
9304
9305 init init_aidatid (
9306 n_id: nullable TId
9307 )
9308 do
9309 empty_init
9310 _n_id = n_id.as(not null)
9311 n_id.parent = self
9312 end
9313
9314 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9315 do
9316 if _n_id == old_child then
9317 if new_child != null then
9318 new_child.parent = self
9319 assert new_child isa TId
9320 _n_id = new_child
9321 else
9322 abort
9323 end
9324 return
9325 end
9326 end
9327
9328 redef fun visit_all(v: Visitor)
9329 do
9330 v.enter_visit(_n_id)
9331 end
9332 end
9333 redef class AKwexternAtid
9334 private init empty_init do end
9335
9336 init init_akwexternatid (
9337 n_id: nullable TKwextern
9338 )
9339 do
9340 empty_init
9341 _n_id = n_id.as(not null)
9342 n_id.parent = self
9343 end
9344
9345 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9346 do
9347 if _n_id == old_child then
9348 if new_child != null then
9349 new_child.parent = self
9350 assert new_child isa TKwextern
9351 _n_id = new_child
9352 else
9353 abort
9354 end
9355 return
9356 end
9357 end
9358
9359 redef fun visit_all(v: Visitor)
9360 do
9361 v.enter_visit(_n_id)
9362 end
9363 end
9364 redef class AKwinternAtid
9365 private init empty_init do end
9366
9367 init init_akwinternatid (
9368 n_id: nullable TKwintern
9369 )
9370 do
9371 empty_init
9372 _n_id = n_id.as(not null)
9373 n_id.parent = self
9374 end
9375
9376 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9377 do
9378 if _n_id == old_child then
9379 if new_child != null then
9380 new_child.parent = self
9381 assert new_child isa TKwintern
9382 _n_id = new_child
9383 else
9384 abort
9385 end
9386 return
9387 end
9388 end
9389
9390 redef fun visit_all(v: Visitor)
9391 do
9392 v.enter_visit(_n_id)
9393 end
9394 end
9395 redef class AKwreadableAtid
9396 private init empty_init do end
9397
9398 init init_akwreadableatid (
9399 n_id: nullable TKwreadable
9400 )
9401 do
9402 empty_init
9403 _n_id = n_id.as(not null)
9404 n_id.parent = self
9405 end
9406
9407 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9408 do
9409 if _n_id == old_child then
9410 if new_child != null then
9411 new_child.parent = self
9412 assert new_child isa TKwreadable
9413 _n_id = new_child
9414 else
9415 abort
9416 end
9417 return
9418 end
9419 end
9420
9421 redef fun visit_all(v: Visitor)
9422 do
9423 v.enter_visit(_n_id)
9424 end
9425 end
9426 redef class AKwwritableAtid
9427 private init empty_init do end
9428
9429 init init_akwwritableatid (
9430 n_id: nullable TKwwritable
9431 )
9432 do
9433 empty_init
9434 _n_id = n_id.as(not null)
9435 n_id.parent = self
9436 end
9437
9438 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9439 do
9440 if _n_id == old_child then
9441 if new_child != null then
9442 new_child.parent = self
9443 assert new_child isa TKwwritable
9444 _n_id = new_child
9445 else
9446 abort
9447 end
9448 return
9449 end
9450 end
9451
9452 redef fun visit_all(v: Visitor)
9453 do
9454 v.enter_visit(_n_id)
9455 end
9456 end
9457 redef class AKwimportAtid
9458 private init empty_init do end
9459
9460 init init_akwimportatid (
9461 n_id: nullable TKwimport
9462 )
9463 do
9464 empty_init
9465 _n_id = n_id.as(not null)
9466 n_id.parent = self
9467 end
9468
9469 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9470 do
9471 if _n_id == old_child then
9472 if new_child != null then
9473 new_child.parent = self
9474 assert new_child isa TKwimport
9475 _n_id = new_child
9476 else
9477 abort
9478 end
9479 return
9480 end
9481 end
9482
9483 redef fun visit_all(v: Visitor)
9484 do
9485 v.enter_visit(_n_id)
9486 end
9487 end
9488
9489 redef class Start
9490 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
9491 do
9492 if _n_base == old_child then
9493 if new_child == null then
9494 else
9495 new_child.parent = self
9496 assert new_child isa AModule
9497 _n_base = new_child
9498 end
9499 old_child.parent = null
9500 return
9501 end
9502 end
9503
9504 redef fun visit_all(v: Visitor)
9505 do
9506 if _n_base != null then
9507 v.enter_visit(_n_base.as(not null))
9508 end
9509 v.enter_visit(_n_eof)
9510 end
9511 end