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