parser: integrate the token 'end' in the AST
[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 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_params: Collection[Object], # Should be Collection[AParam]
2925 n_type: nullable AType,
2926 n_closure_decls: Collection[Object] # Should be Collection[AClosureDecl]
2927 )
2928 do
2929 empty_init
2930 for n in n_params do
2931 assert n isa AParam
2932 _n_params.add(n)
2933 n.parent = self
2934 end
2935 _n_type = n_type
2936 if n_type != null then
2937 n_type.parent = self
2938 end
2939 for n in n_closure_decls do
2940 assert n isa AClosureDecl
2941 _n_closure_decls.add(n)
2942 n.parent = self
2943 end
2944 end
2945
2946 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
2947 do
2948 for i in [0.._n_params.length[ do
2949 if _n_params[i] == old_child then
2950 if new_child != null then
2951 assert new_child isa AParam
2952 _n_params[i] = new_child
2953 new_child.parent = self
2954 else
2955 _n_params.remove_at(i)
2956 end
2957 return
2958 end
2959 end
2960 if _n_type == old_child then
2961 if new_child != null then
2962 new_child.parent = self
2963 assert new_child isa AType
2964 _n_type = new_child
2965 else
2966 _n_type = null
2967 end
2968 return
2969 end
2970 for i in [0.._n_closure_decls.length[ do
2971 if _n_closure_decls[i] == old_child then
2972 if new_child != null then
2973 assert new_child isa AClosureDecl
2974 _n_closure_decls[i] = new_child
2975 new_child.parent = self
2976 else
2977 _n_closure_decls.remove_at(i)
2978 end
2979 return
2980 end
2981 end
2982 end
2983
2984 redef fun visit_all(v: Visitor)
2985 do
2986 for n in _n_params do
2987 v.enter_visit(n)
2988 end
2989 if _n_type != null then
2990 v.enter_visit(_n_type.as(not null))
2991 end
2992 for n in _n_closure_decls do
2993 v.enter_visit(n)
2994 end
2995 end
2996 end
2997 redef class AParam
2998 private init empty_init do end
2999
3000 init init_aparam (
3001 n_id: nullable TId,
3002 n_type: nullable AType,
3003 n_dotdotdot: nullable TDotdotdot
3004 )
3005 do
3006 empty_init
3007 _n_id = n_id.as(not null)
3008 n_id.parent = self
3009 _n_type = n_type
3010 if n_type != null then
3011 n_type.parent = self
3012 end
3013 _n_dotdotdot = n_dotdotdot
3014 if n_dotdotdot != null then
3015 n_dotdotdot.parent = self
3016 end
3017 end
3018
3019 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3020 do
3021 if _n_id == old_child then
3022 if new_child != null then
3023 new_child.parent = self
3024 assert new_child isa TId
3025 _n_id = new_child
3026 else
3027 abort
3028 end
3029 return
3030 end
3031 if _n_type == old_child then
3032 if new_child != null then
3033 new_child.parent = self
3034 assert new_child isa AType
3035 _n_type = new_child
3036 else
3037 _n_type = null
3038 end
3039 return
3040 end
3041 if _n_dotdotdot == old_child then
3042 if new_child != null then
3043 new_child.parent = self
3044 assert new_child isa TDotdotdot
3045 _n_dotdotdot = new_child
3046 else
3047 _n_dotdotdot = null
3048 end
3049 return
3050 end
3051 end
3052
3053 redef fun visit_all(v: Visitor)
3054 do
3055 v.enter_visit(_n_id)
3056 if _n_type != null then
3057 v.enter_visit(_n_type.as(not null))
3058 end
3059 if _n_dotdotdot != null then
3060 v.enter_visit(_n_dotdotdot.as(not null))
3061 end
3062 end
3063 end
3064 redef class AClosureDecl
3065 private init empty_init do end
3066
3067 init init_aclosuredecl (
3068 n_kwbreak: nullable TKwbreak,
3069 n_bang: nullable TBang,
3070 n_id: nullable TId,
3071 n_signature: nullable ASignature,
3072 n_expr: nullable AExpr
3073 )
3074 do
3075 empty_init
3076 _n_kwbreak = n_kwbreak
3077 if n_kwbreak != null then
3078 n_kwbreak.parent = self
3079 end
3080 _n_bang = n_bang.as(not null)
3081 n_bang.parent = self
3082 _n_id = n_id.as(not null)
3083 n_id.parent = self
3084 _n_signature = n_signature.as(not null)
3085 n_signature.parent = self
3086 _n_expr = n_expr
3087 if n_expr != null then
3088 n_expr.parent = self
3089 end
3090 end
3091
3092 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3093 do
3094 if _n_kwbreak == old_child then
3095 if new_child != null then
3096 new_child.parent = self
3097 assert new_child isa TKwbreak
3098 _n_kwbreak = new_child
3099 else
3100 _n_kwbreak = null
3101 end
3102 return
3103 end
3104 if _n_bang == old_child then
3105 if new_child != null then
3106 new_child.parent = self
3107 assert new_child isa TBang
3108 _n_bang = new_child
3109 else
3110 abort
3111 end
3112 return
3113 end
3114 if _n_id == old_child then
3115 if new_child != null then
3116 new_child.parent = self
3117 assert new_child isa TId
3118 _n_id = new_child
3119 else
3120 abort
3121 end
3122 return
3123 end
3124 if _n_signature == old_child then
3125 if new_child != null then
3126 new_child.parent = self
3127 assert new_child isa ASignature
3128 _n_signature = new_child
3129 else
3130 abort
3131 end
3132 return
3133 end
3134 if _n_expr == old_child then
3135 if new_child != null then
3136 new_child.parent = self
3137 assert new_child isa AExpr
3138 _n_expr = new_child
3139 else
3140 _n_expr = null
3141 end
3142 return
3143 end
3144 end
3145
3146 redef fun visit_all(v: Visitor)
3147 do
3148 if _n_kwbreak != null then
3149 v.enter_visit(_n_kwbreak.as(not null))
3150 end
3151 v.enter_visit(_n_bang)
3152 v.enter_visit(_n_id)
3153 v.enter_visit(_n_signature)
3154 if _n_expr != null then
3155 v.enter_visit(_n_expr.as(not null))
3156 end
3157 end
3158 end
3159 redef class AType
3160 private init empty_init do end
3161
3162 init init_atype (
3163 n_kwnullable: nullable TKwnullable,
3164 n_id: nullable TClassid,
3165 n_types: Collection[Object] # Should be Collection[AType]
3166 )
3167 do
3168 empty_init
3169 _n_kwnullable = n_kwnullable
3170 if n_kwnullable != null then
3171 n_kwnullable.parent = self
3172 end
3173 _n_id = n_id.as(not null)
3174 n_id.parent = self
3175 for n in n_types do
3176 assert n isa AType
3177 _n_types.add(n)
3178 n.parent = self
3179 end
3180 end
3181
3182 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3183 do
3184 if _n_kwnullable == old_child then
3185 if new_child != null then
3186 new_child.parent = self
3187 assert new_child isa TKwnullable
3188 _n_kwnullable = new_child
3189 else
3190 _n_kwnullable = null
3191 end
3192 return
3193 end
3194 if _n_id == old_child then
3195 if new_child != null then
3196 new_child.parent = self
3197 assert new_child isa TClassid
3198 _n_id = new_child
3199 else
3200 abort
3201 end
3202 return
3203 end
3204 for i in [0.._n_types.length[ do
3205 if _n_types[i] == old_child then
3206 if new_child != null then
3207 assert new_child isa AType
3208 _n_types[i] = new_child
3209 new_child.parent = self
3210 else
3211 _n_types.remove_at(i)
3212 end
3213 return
3214 end
3215 end
3216 end
3217
3218 redef fun visit_all(v: Visitor)
3219 do
3220 if _n_kwnullable != null then
3221 v.enter_visit(_n_kwnullable.as(not null))
3222 end
3223 v.enter_visit(_n_id)
3224 for n in _n_types do
3225 v.enter_visit(n)
3226 end
3227 end
3228 end
3229 redef class ALabel
3230 private init empty_init do end
3231
3232 init init_alabel (
3233 n_kwlabel: nullable TKwlabel,
3234 n_id: nullable TId
3235 )
3236 do
3237 empty_init
3238 _n_kwlabel = n_kwlabel.as(not null)
3239 n_kwlabel.parent = self
3240 _n_id = n_id.as(not null)
3241 n_id.parent = self
3242 end
3243
3244 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3245 do
3246 if _n_kwlabel == old_child then
3247 if new_child != null then
3248 new_child.parent = self
3249 assert new_child isa TKwlabel
3250 _n_kwlabel = new_child
3251 else
3252 abort
3253 end
3254 return
3255 end
3256 if _n_id == old_child then
3257 if new_child != null then
3258 new_child.parent = self
3259 assert new_child isa TId
3260 _n_id = new_child
3261 else
3262 abort
3263 end
3264 return
3265 end
3266 end
3267
3268 redef fun visit_all(v: Visitor)
3269 do
3270 v.enter_visit(_n_kwlabel)
3271 v.enter_visit(_n_id)
3272 end
3273 end
3274 redef class ABlockExpr
3275 private init empty_init do end
3276
3277 init init_ablockexpr (
3278 n_expr: Collection[Object], # Should be Collection[AExpr]
3279 n_kwend: nullable TKwend
3280 )
3281 do
3282 empty_init
3283 for n in n_expr do
3284 assert n isa AExpr
3285 _n_expr.add(n)
3286 n.parent = self
3287 end
3288 _n_kwend = n_kwend
3289 if n_kwend != null then
3290 n_kwend.parent = self
3291 end
3292 end
3293
3294 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3295 do
3296 for i in [0.._n_expr.length[ do
3297 if _n_expr[i] == old_child then
3298 if new_child != null then
3299 assert new_child isa AExpr
3300 _n_expr[i] = new_child
3301 new_child.parent = self
3302 else
3303 _n_expr.remove_at(i)
3304 end
3305 return
3306 end
3307 end
3308 if _n_kwend == old_child then
3309 if new_child != null then
3310 new_child.parent = self
3311 assert new_child isa TKwend
3312 _n_kwend = new_child
3313 else
3314 _n_kwend = null
3315 end
3316 return
3317 end
3318 end
3319
3320 redef fun visit_all(v: Visitor)
3321 do
3322 for n in _n_expr do
3323 v.enter_visit(n)
3324 end
3325 if _n_kwend != null then
3326 v.enter_visit(_n_kwend.as(not null))
3327 end
3328 end
3329 end
3330 redef class AVardeclExpr
3331 private init empty_init do end
3332
3333 init init_avardeclexpr (
3334 n_kwvar: nullable TKwvar,
3335 n_id: nullable TId,
3336 n_type: nullable AType,
3337 n_assign: nullable TAssign,
3338 n_expr: nullable AExpr
3339 )
3340 do
3341 empty_init
3342 _n_kwvar = n_kwvar.as(not null)
3343 n_kwvar.parent = self
3344 _n_id = n_id.as(not null)
3345 n_id.parent = self
3346 _n_type = n_type
3347 if n_type != null then
3348 n_type.parent = self
3349 end
3350 _n_assign = n_assign
3351 if n_assign != null then
3352 n_assign.parent = self
3353 end
3354 _n_expr = n_expr
3355 if n_expr != null then
3356 n_expr.parent = self
3357 end
3358 end
3359
3360 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3361 do
3362 if _n_kwvar == old_child then
3363 if new_child != null then
3364 new_child.parent = self
3365 assert new_child isa TKwvar
3366 _n_kwvar = new_child
3367 else
3368 abort
3369 end
3370 return
3371 end
3372 if _n_id == old_child then
3373 if new_child != null then
3374 new_child.parent = self
3375 assert new_child isa TId
3376 _n_id = new_child
3377 else
3378 abort
3379 end
3380 return
3381 end
3382 if _n_type == old_child then
3383 if new_child != null then
3384 new_child.parent = self
3385 assert new_child isa AType
3386 _n_type = new_child
3387 else
3388 _n_type = null
3389 end
3390 return
3391 end
3392 if _n_assign == old_child then
3393 if new_child != null then
3394 new_child.parent = self
3395 assert new_child isa TAssign
3396 _n_assign = new_child
3397 else
3398 _n_assign = null
3399 end
3400 return
3401 end
3402 if _n_expr == old_child then
3403 if new_child != null then
3404 new_child.parent = self
3405 assert new_child isa AExpr
3406 _n_expr = new_child
3407 else
3408 _n_expr = null
3409 end
3410 return
3411 end
3412 end
3413
3414 redef fun visit_all(v: Visitor)
3415 do
3416 v.enter_visit(_n_kwvar)
3417 v.enter_visit(_n_id)
3418 if _n_type != null then
3419 v.enter_visit(_n_type.as(not null))
3420 end
3421 if _n_assign != null then
3422 v.enter_visit(_n_assign.as(not null))
3423 end
3424 if _n_expr != null then
3425 v.enter_visit(_n_expr.as(not null))
3426 end
3427 end
3428 end
3429 redef class AReturnExpr
3430 private init empty_init do end
3431
3432 init init_areturnexpr (
3433 n_kwreturn: nullable TKwreturn,
3434 n_expr: nullable AExpr
3435 )
3436 do
3437 empty_init
3438 _n_kwreturn = n_kwreturn
3439 if n_kwreturn != null then
3440 n_kwreturn.parent = self
3441 end
3442 _n_expr = n_expr
3443 if n_expr != null then
3444 n_expr.parent = self
3445 end
3446 end
3447
3448 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3449 do
3450 if _n_kwreturn == old_child then
3451 if new_child != null then
3452 new_child.parent = self
3453 assert new_child isa TKwreturn
3454 _n_kwreturn = new_child
3455 else
3456 _n_kwreturn = null
3457 end
3458 return
3459 end
3460 if _n_expr == old_child then
3461 if new_child != null then
3462 new_child.parent = self
3463 assert new_child isa AExpr
3464 _n_expr = new_child
3465 else
3466 _n_expr = null
3467 end
3468 return
3469 end
3470 end
3471
3472 redef fun visit_all(v: Visitor)
3473 do
3474 if _n_kwreturn != null then
3475 v.enter_visit(_n_kwreturn.as(not null))
3476 end
3477 if _n_expr != null then
3478 v.enter_visit(_n_expr.as(not null))
3479 end
3480 end
3481 end
3482 redef class ABreakExpr
3483 private init empty_init do end
3484
3485 init init_abreakexpr (
3486 n_kwbreak: nullable TKwbreak,
3487 n_label: nullable ALabel,
3488 n_expr: nullable AExpr
3489 )
3490 do
3491 empty_init
3492 _n_kwbreak = n_kwbreak.as(not null)
3493 n_kwbreak.parent = self
3494 _n_label = n_label
3495 if n_label != null then
3496 n_label.parent = self
3497 end
3498 _n_expr = n_expr
3499 if n_expr != null then
3500 n_expr.parent = self
3501 end
3502 end
3503
3504 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3505 do
3506 if _n_kwbreak == old_child then
3507 if new_child != null then
3508 new_child.parent = self
3509 assert new_child isa TKwbreak
3510 _n_kwbreak = new_child
3511 else
3512 abort
3513 end
3514 return
3515 end
3516 if _n_label == old_child then
3517 if new_child != null then
3518 new_child.parent = self
3519 assert new_child isa ALabel
3520 _n_label = new_child
3521 else
3522 _n_label = null
3523 end
3524 return
3525 end
3526 if _n_expr == old_child then
3527 if new_child != null then
3528 new_child.parent = self
3529 assert new_child isa AExpr
3530 _n_expr = new_child
3531 else
3532 _n_expr = null
3533 end
3534 return
3535 end
3536 end
3537
3538 redef fun visit_all(v: Visitor)
3539 do
3540 v.enter_visit(_n_kwbreak)
3541 if _n_label != null then
3542 v.enter_visit(_n_label.as(not null))
3543 end
3544 if _n_expr != null then
3545 v.enter_visit(_n_expr.as(not null))
3546 end
3547 end
3548 end
3549 redef class AAbortExpr
3550 private init empty_init do end
3551
3552 init init_aabortexpr (
3553 n_kwabort: nullable TKwabort
3554 )
3555 do
3556 empty_init
3557 _n_kwabort = n_kwabort.as(not null)
3558 n_kwabort.parent = self
3559 end
3560
3561 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3562 do
3563 if _n_kwabort == old_child then
3564 if new_child != null then
3565 new_child.parent = self
3566 assert new_child isa TKwabort
3567 _n_kwabort = new_child
3568 else
3569 abort
3570 end
3571 return
3572 end
3573 end
3574
3575 redef fun visit_all(v: Visitor)
3576 do
3577 v.enter_visit(_n_kwabort)
3578 end
3579 end
3580 redef class AContinueExpr
3581 private init empty_init do end
3582
3583 init init_acontinueexpr (
3584 n_kwcontinue: nullable TKwcontinue,
3585 n_label: nullable ALabel,
3586 n_expr: nullable AExpr
3587 )
3588 do
3589 empty_init
3590 _n_kwcontinue = n_kwcontinue
3591 if n_kwcontinue != null then
3592 n_kwcontinue.parent = self
3593 end
3594 _n_label = n_label
3595 if n_label != null then
3596 n_label.parent = self
3597 end
3598 _n_expr = n_expr
3599 if n_expr != null then
3600 n_expr.parent = self
3601 end
3602 end
3603
3604 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3605 do
3606 if _n_kwcontinue == old_child then
3607 if new_child != null then
3608 new_child.parent = self
3609 assert new_child isa TKwcontinue
3610 _n_kwcontinue = new_child
3611 else
3612 _n_kwcontinue = null
3613 end
3614 return
3615 end
3616 if _n_label == old_child then
3617 if new_child != null then
3618 new_child.parent = self
3619 assert new_child isa ALabel
3620 _n_label = new_child
3621 else
3622 _n_label = null
3623 end
3624 return
3625 end
3626 if _n_expr == old_child then
3627 if new_child != null then
3628 new_child.parent = self
3629 assert new_child isa AExpr
3630 _n_expr = new_child
3631 else
3632 _n_expr = null
3633 end
3634 return
3635 end
3636 end
3637
3638 redef fun visit_all(v: Visitor)
3639 do
3640 if _n_kwcontinue != null then
3641 v.enter_visit(_n_kwcontinue.as(not null))
3642 end
3643 if _n_label != null then
3644 v.enter_visit(_n_label.as(not null))
3645 end
3646 if _n_expr != null then
3647 v.enter_visit(_n_expr.as(not null))
3648 end
3649 end
3650 end
3651 redef class ADoExpr
3652 private init empty_init do end
3653
3654 init init_adoexpr (
3655 n_kwdo: nullable TKwdo,
3656 n_block: nullable AExpr,
3657 n_label: nullable ALabel
3658 )
3659 do
3660 empty_init
3661 _n_kwdo = n_kwdo.as(not null)
3662 n_kwdo.parent = self
3663 _n_block = n_block
3664 if n_block != null then
3665 n_block.parent = self
3666 end
3667 _n_label = n_label
3668 if n_label != null then
3669 n_label.parent = self
3670 end
3671 end
3672
3673 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3674 do
3675 if _n_kwdo == old_child then
3676 if new_child != null then
3677 new_child.parent = self
3678 assert new_child isa TKwdo
3679 _n_kwdo = new_child
3680 else
3681 abort
3682 end
3683 return
3684 end
3685 if _n_block == old_child then
3686 if new_child != null then
3687 new_child.parent = self
3688 assert new_child isa AExpr
3689 _n_block = new_child
3690 else
3691 _n_block = null
3692 end
3693 return
3694 end
3695 if _n_label == old_child then
3696 if new_child != null then
3697 new_child.parent = self
3698 assert new_child isa ALabel
3699 _n_label = new_child
3700 else
3701 _n_label = null
3702 end
3703 return
3704 end
3705 end
3706
3707 redef fun visit_all(v: Visitor)
3708 do
3709 v.enter_visit(_n_kwdo)
3710 if _n_block != null then
3711 v.enter_visit(_n_block.as(not null))
3712 end
3713 if _n_label != null then
3714 v.enter_visit(_n_label.as(not null))
3715 end
3716 end
3717 end
3718 redef class AIfExpr
3719 private init empty_init do end
3720
3721 init init_aifexpr (
3722 n_kwif: nullable TKwif,
3723 n_expr: nullable AExpr,
3724 n_then: nullable AExpr,
3725 n_else: nullable AExpr
3726 )
3727 do
3728 empty_init
3729 _n_kwif = n_kwif.as(not null)
3730 n_kwif.parent = self
3731 _n_expr = n_expr.as(not null)
3732 n_expr.parent = self
3733 _n_then = n_then
3734 if n_then != null then
3735 n_then.parent = self
3736 end
3737 _n_else = n_else
3738 if n_else != null then
3739 n_else.parent = self
3740 end
3741 end
3742
3743 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3744 do
3745 if _n_kwif == old_child then
3746 if new_child != null then
3747 new_child.parent = self
3748 assert new_child isa TKwif
3749 _n_kwif = new_child
3750 else
3751 abort
3752 end
3753 return
3754 end
3755 if _n_expr == old_child then
3756 if new_child != null then
3757 new_child.parent = self
3758 assert new_child isa AExpr
3759 _n_expr = new_child
3760 else
3761 abort
3762 end
3763 return
3764 end
3765 if _n_then == old_child then
3766 if new_child != null then
3767 new_child.parent = self
3768 assert new_child isa AExpr
3769 _n_then = new_child
3770 else
3771 _n_then = null
3772 end
3773 return
3774 end
3775 if _n_else == old_child then
3776 if new_child != null then
3777 new_child.parent = self
3778 assert new_child isa AExpr
3779 _n_else = new_child
3780 else
3781 _n_else = null
3782 end
3783 return
3784 end
3785 end
3786
3787 redef fun visit_all(v: Visitor)
3788 do
3789 v.enter_visit(_n_kwif)
3790 v.enter_visit(_n_expr)
3791 if _n_then != null then
3792 v.enter_visit(_n_then.as(not null))
3793 end
3794 if _n_else != null then
3795 v.enter_visit(_n_else.as(not null))
3796 end
3797 end
3798 end
3799 redef class AIfexprExpr
3800 private init empty_init do end
3801
3802 init init_aifexprexpr (
3803 n_kwif: nullable TKwif,
3804 n_expr: nullable AExpr,
3805 n_kwthen: nullable TKwthen,
3806 n_then: nullable AExpr,
3807 n_kwelse: nullable TKwelse,
3808 n_else: nullable AExpr
3809 )
3810 do
3811 empty_init
3812 _n_kwif = n_kwif.as(not null)
3813 n_kwif.parent = self
3814 _n_expr = n_expr.as(not null)
3815 n_expr.parent = self
3816 _n_kwthen = n_kwthen.as(not null)
3817 n_kwthen.parent = self
3818 _n_then = n_then.as(not null)
3819 n_then.parent = self
3820 _n_kwelse = n_kwelse.as(not null)
3821 n_kwelse.parent = self
3822 _n_else = n_else.as(not null)
3823 n_else.parent = self
3824 end
3825
3826 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3827 do
3828 if _n_kwif == old_child then
3829 if new_child != null then
3830 new_child.parent = self
3831 assert new_child isa TKwif
3832 _n_kwif = new_child
3833 else
3834 abort
3835 end
3836 return
3837 end
3838 if _n_expr == old_child then
3839 if new_child != null then
3840 new_child.parent = self
3841 assert new_child isa AExpr
3842 _n_expr = new_child
3843 else
3844 abort
3845 end
3846 return
3847 end
3848 if _n_kwthen == old_child then
3849 if new_child != null then
3850 new_child.parent = self
3851 assert new_child isa TKwthen
3852 _n_kwthen = new_child
3853 else
3854 abort
3855 end
3856 return
3857 end
3858 if _n_then == old_child then
3859 if new_child != null then
3860 new_child.parent = self
3861 assert new_child isa AExpr
3862 _n_then = new_child
3863 else
3864 abort
3865 end
3866 return
3867 end
3868 if _n_kwelse == old_child then
3869 if new_child != null then
3870 new_child.parent = self
3871 assert new_child isa TKwelse
3872 _n_kwelse = new_child
3873 else
3874 abort
3875 end
3876 return
3877 end
3878 if _n_else == old_child then
3879 if new_child != null then
3880 new_child.parent = self
3881 assert new_child isa AExpr
3882 _n_else = new_child
3883 else
3884 abort
3885 end
3886 return
3887 end
3888 end
3889
3890 redef fun visit_all(v: Visitor)
3891 do
3892 v.enter_visit(_n_kwif)
3893 v.enter_visit(_n_expr)
3894 v.enter_visit(_n_kwthen)
3895 v.enter_visit(_n_then)
3896 v.enter_visit(_n_kwelse)
3897 v.enter_visit(_n_else)
3898 end
3899 end
3900 redef class AWhileExpr
3901 private init empty_init do end
3902
3903 init init_awhileexpr (
3904 n_kwwhile: nullable TKwwhile,
3905 n_expr: nullable AExpr,
3906 n_kwdo: nullable TKwdo,
3907 n_block: nullable AExpr,
3908 n_label: nullable ALabel
3909 )
3910 do
3911 empty_init
3912 _n_kwwhile = n_kwwhile.as(not null)
3913 n_kwwhile.parent = self
3914 _n_expr = n_expr.as(not null)
3915 n_expr.parent = self
3916 _n_kwdo = n_kwdo.as(not null)
3917 n_kwdo.parent = self
3918 _n_block = n_block
3919 if n_block != null then
3920 n_block.parent = self
3921 end
3922 _n_label = n_label
3923 if n_label != null then
3924 n_label.parent = self
3925 end
3926 end
3927
3928 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
3929 do
3930 if _n_kwwhile == old_child then
3931 if new_child != null then
3932 new_child.parent = self
3933 assert new_child isa TKwwhile
3934 _n_kwwhile = new_child
3935 else
3936 abort
3937 end
3938 return
3939 end
3940 if _n_expr == old_child then
3941 if new_child != null then
3942 new_child.parent = self
3943 assert new_child isa AExpr
3944 _n_expr = new_child
3945 else
3946 abort
3947 end
3948 return
3949 end
3950 if _n_kwdo == old_child then
3951 if new_child != null then
3952 new_child.parent = self
3953 assert new_child isa TKwdo
3954 _n_kwdo = new_child
3955 else
3956 abort
3957 end
3958 return
3959 end
3960 if _n_block == old_child then
3961 if new_child != null then
3962 new_child.parent = self
3963 assert new_child isa AExpr
3964 _n_block = new_child
3965 else
3966 _n_block = null
3967 end
3968 return
3969 end
3970 if _n_label == old_child then
3971 if new_child != null then
3972 new_child.parent = self
3973 assert new_child isa ALabel
3974 _n_label = new_child
3975 else
3976 _n_label = null
3977 end
3978 return
3979 end
3980 end
3981
3982 redef fun visit_all(v: Visitor)
3983 do
3984 v.enter_visit(_n_kwwhile)
3985 v.enter_visit(_n_expr)
3986 v.enter_visit(_n_kwdo)
3987 if _n_block != null then
3988 v.enter_visit(_n_block.as(not null))
3989 end
3990 if _n_label != null then
3991 v.enter_visit(_n_label.as(not null))
3992 end
3993 end
3994 end
3995 redef class ALoopExpr
3996 private init empty_init do end
3997
3998 init init_aloopexpr (
3999 n_kwloop: nullable TKwloop,
4000 n_block: nullable AExpr,
4001 n_label: nullable ALabel
4002 )
4003 do
4004 empty_init
4005 _n_kwloop = n_kwloop.as(not null)
4006 n_kwloop.parent = self
4007 _n_block = n_block
4008 if n_block != null then
4009 n_block.parent = self
4010 end
4011 _n_label = n_label
4012 if n_label != null then
4013 n_label.parent = self
4014 end
4015 end
4016
4017 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4018 do
4019 if _n_kwloop == old_child then
4020 if new_child != null then
4021 new_child.parent = self
4022 assert new_child isa TKwloop
4023 _n_kwloop = new_child
4024 else
4025 abort
4026 end
4027 return
4028 end
4029 if _n_block == old_child then
4030 if new_child != null then
4031 new_child.parent = self
4032 assert new_child isa AExpr
4033 _n_block = new_child
4034 else
4035 _n_block = null
4036 end
4037 return
4038 end
4039 if _n_label == old_child then
4040 if new_child != null then
4041 new_child.parent = self
4042 assert new_child isa ALabel
4043 _n_label = new_child
4044 else
4045 _n_label = null
4046 end
4047 return
4048 end
4049 end
4050
4051 redef fun visit_all(v: Visitor)
4052 do
4053 v.enter_visit(_n_kwloop)
4054 if _n_block != null then
4055 v.enter_visit(_n_block.as(not null))
4056 end
4057 if _n_label != null then
4058 v.enter_visit(_n_label.as(not null))
4059 end
4060 end
4061 end
4062 redef class AForExpr
4063 private init empty_init do end
4064
4065 init init_aforexpr (
4066 n_kwfor: nullable TKwfor,
4067 n_ids: Collection[Object], # Should be Collection[TId]
4068 n_expr: nullable AExpr,
4069 n_kwdo: nullable TKwdo,
4070 n_block: nullable AExpr,
4071 n_label: nullable ALabel
4072 )
4073 do
4074 empty_init
4075 _n_kwfor = n_kwfor.as(not null)
4076 n_kwfor.parent = self
4077 for n in n_ids do
4078 assert n isa TId
4079 _n_ids.add(n)
4080 n.parent = self
4081 end
4082 _n_expr = n_expr.as(not null)
4083 n_expr.parent = self
4084 _n_kwdo = n_kwdo.as(not null)
4085 n_kwdo.parent = self
4086 _n_block = n_block
4087 if n_block != null then
4088 n_block.parent = self
4089 end
4090 _n_label = n_label
4091 if n_label != null then
4092 n_label.parent = self
4093 end
4094 end
4095
4096 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4097 do
4098 if _n_kwfor == old_child then
4099 if new_child != null then
4100 new_child.parent = self
4101 assert new_child isa TKwfor
4102 _n_kwfor = new_child
4103 else
4104 abort
4105 end
4106 return
4107 end
4108 for i in [0.._n_ids.length[ do
4109 if _n_ids[i] == old_child then
4110 if new_child != null then
4111 assert new_child isa TId
4112 _n_ids[i] = new_child
4113 new_child.parent = self
4114 else
4115 _n_ids.remove_at(i)
4116 end
4117 return
4118 end
4119 end
4120 if _n_expr == old_child then
4121 if new_child != null then
4122 new_child.parent = self
4123 assert new_child isa AExpr
4124 _n_expr = new_child
4125 else
4126 abort
4127 end
4128 return
4129 end
4130 if _n_kwdo == old_child then
4131 if new_child != null then
4132 new_child.parent = self
4133 assert new_child isa TKwdo
4134 _n_kwdo = new_child
4135 else
4136 abort
4137 end
4138 return
4139 end
4140 if _n_block == old_child then
4141 if new_child != null then
4142 new_child.parent = self
4143 assert new_child isa AExpr
4144 _n_block = new_child
4145 else
4146 _n_block = null
4147 end
4148 return
4149 end
4150 if _n_label == old_child then
4151 if new_child != null then
4152 new_child.parent = self
4153 assert new_child isa ALabel
4154 _n_label = new_child
4155 else
4156 _n_label = null
4157 end
4158 return
4159 end
4160 end
4161
4162 redef fun visit_all(v: Visitor)
4163 do
4164 v.enter_visit(_n_kwfor)
4165 for n in _n_ids do
4166 v.enter_visit(n)
4167 end
4168 v.enter_visit(_n_expr)
4169 v.enter_visit(_n_kwdo)
4170 if _n_block != null then
4171 v.enter_visit(_n_block.as(not null))
4172 end
4173 if _n_label != null then
4174 v.enter_visit(_n_label.as(not null))
4175 end
4176 end
4177 end
4178 redef class AAssertExpr
4179 private init empty_init do end
4180
4181 init init_aassertexpr (
4182 n_kwassert: nullable TKwassert,
4183 n_id: nullable TId,
4184 n_expr: nullable AExpr,
4185 n_else: nullable AExpr
4186 )
4187 do
4188 empty_init
4189 _n_kwassert = n_kwassert.as(not null)
4190 n_kwassert.parent = self
4191 _n_id = n_id
4192 if n_id != null then
4193 n_id.parent = self
4194 end
4195 _n_expr = n_expr.as(not null)
4196 n_expr.parent = self
4197 _n_else = n_else
4198 if n_else != null then
4199 n_else.parent = self
4200 end
4201 end
4202
4203 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4204 do
4205 if _n_kwassert == old_child then
4206 if new_child != null then
4207 new_child.parent = self
4208 assert new_child isa TKwassert
4209 _n_kwassert = new_child
4210 else
4211 abort
4212 end
4213 return
4214 end
4215 if _n_id == old_child then
4216 if new_child != null then
4217 new_child.parent = self
4218 assert new_child isa TId
4219 _n_id = new_child
4220 else
4221 _n_id = null
4222 end
4223 return
4224 end
4225 if _n_expr == old_child then
4226 if new_child != null then
4227 new_child.parent = self
4228 assert new_child isa AExpr
4229 _n_expr = new_child
4230 else
4231 abort
4232 end
4233 return
4234 end
4235 if _n_else == old_child then
4236 if new_child != null then
4237 new_child.parent = self
4238 assert new_child isa AExpr
4239 _n_else = new_child
4240 else
4241 _n_else = null
4242 end
4243 return
4244 end
4245 end
4246
4247 redef fun visit_all(v: Visitor)
4248 do
4249 v.enter_visit(_n_kwassert)
4250 if _n_id != null then
4251 v.enter_visit(_n_id.as(not null))
4252 end
4253 v.enter_visit(_n_expr)
4254 if _n_else != null then
4255 v.enter_visit(_n_else.as(not null))
4256 end
4257 end
4258 end
4259 redef class AOnceExpr
4260 private init empty_init do end
4261
4262 init init_aonceexpr (
4263 n_kwonce: nullable TKwonce,
4264 n_expr: nullable AExpr
4265 )
4266 do
4267 empty_init
4268 _n_kwonce = n_kwonce.as(not null)
4269 n_kwonce.parent = self
4270 _n_expr = n_expr.as(not null)
4271 n_expr.parent = self
4272 end
4273
4274 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4275 do
4276 if _n_kwonce == old_child then
4277 if new_child != null then
4278 new_child.parent = self
4279 assert new_child isa TKwonce
4280 _n_kwonce = new_child
4281 else
4282 abort
4283 end
4284 return
4285 end
4286 if _n_expr == old_child then
4287 if new_child != null then
4288 new_child.parent = self
4289 assert new_child isa AExpr
4290 _n_expr = new_child
4291 else
4292 abort
4293 end
4294 return
4295 end
4296 end
4297
4298 redef fun visit_all(v: Visitor)
4299 do
4300 v.enter_visit(_n_kwonce)
4301 v.enter_visit(_n_expr)
4302 end
4303 end
4304 redef class ASendExpr
4305 private init empty_init do end
4306
4307 init init_asendexpr (
4308 n_expr: nullable AExpr
4309 )
4310 do
4311 empty_init
4312 _n_expr = n_expr.as(not null)
4313 n_expr.parent = self
4314 end
4315
4316 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4317 do
4318 if _n_expr == old_child then
4319 if new_child != null then
4320 new_child.parent = self
4321 assert new_child isa AExpr
4322 _n_expr = new_child
4323 else
4324 abort
4325 end
4326 return
4327 end
4328 end
4329
4330 redef fun visit_all(v: Visitor)
4331 do
4332 v.enter_visit(_n_expr)
4333 end
4334 end
4335 redef class ABinopExpr
4336 private init empty_init do end
4337
4338 init init_abinopexpr (
4339 n_expr: nullable AExpr,
4340 n_expr2: nullable AExpr
4341 )
4342 do
4343 empty_init
4344 _n_expr = n_expr.as(not null)
4345 n_expr.parent = self
4346 _n_expr2 = n_expr2.as(not null)
4347 n_expr2.parent = self
4348 end
4349
4350 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4351 do
4352 if _n_expr == old_child then
4353 if new_child != null then
4354 new_child.parent = self
4355 assert new_child isa AExpr
4356 _n_expr = new_child
4357 else
4358 abort
4359 end
4360 return
4361 end
4362 if _n_expr2 == old_child then
4363 if new_child != null then
4364 new_child.parent = self
4365 assert new_child isa AExpr
4366 _n_expr2 = new_child
4367 else
4368 abort
4369 end
4370 return
4371 end
4372 end
4373
4374 redef fun visit_all(v: Visitor)
4375 do
4376 v.enter_visit(_n_expr)
4377 v.enter_visit(_n_expr2)
4378 end
4379 end
4380 redef class AOrExpr
4381 private init empty_init do end
4382
4383 init init_aorexpr (
4384 n_expr: nullable AExpr,
4385 n_expr2: nullable AExpr
4386 )
4387 do
4388 empty_init
4389 _n_expr = n_expr.as(not null)
4390 n_expr.parent = self
4391 _n_expr2 = n_expr2.as(not null)
4392 n_expr2.parent = self
4393 end
4394
4395 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4396 do
4397 if _n_expr == old_child then
4398 if new_child != null then
4399 new_child.parent = self
4400 assert new_child isa AExpr
4401 _n_expr = new_child
4402 else
4403 abort
4404 end
4405 return
4406 end
4407 if _n_expr2 == old_child then
4408 if new_child != null then
4409 new_child.parent = self
4410 assert new_child isa AExpr
4411 _n_expr2 = new_child
4412 else
4413 abort
4414 end
4415 return
4416 end
4417 end
4418
4419 redef fun visit_all(v: Visitor)
4420 do
4421 v.enter_visit(_n_expr)
4422 v.enter_visit(_n_expr2)
4423 end
4424 end
4425 redef class AAndExpr
4426 private init empty_init do end
4427
4428 init init_aandexpr (
4429 n_expr: nullable AExpr,
4430 n_expr2: nullable AExpr
4431 )
4432 do
4433 empty_init
4434 _n_expr = n_expr.as(not null)
4435 n_expr.parent = self
4436 _n_expr2 = n_expr2.as(not null)
4437 n_expr2.parent = self
4438 end
4439
4440 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4441 do
4442 if _n_expr == old_child then
4443 if new_child != null then
4444 new_child.parent = self
4445 assert new_child isa AExpr
4446 _n_expr = new_child
4447 else
4448 abort
4449 end
4450 return
4451 end
4452 if _n_expr2 == old_child then
4453 if new_child != null then
4454 new_child.parent = self
4455 assert new_child isa AExpr
4456 _n_expr2 = new_child
4457 else
4458 abort
4459 end
4460 return
4461 end
4462 end
4463
4464 redef fun visit_all(v: Visitor)
4465 do
4466 v.enter_visit(_n_expr)
4467 v.enter_visit(_n_expr2)
4468 end
4469 end
4470 redef class AOrElseExpr
4471 private init empty_init do end
4472
4473 init init_aorelseexpr (
4474 n_expr: nullable AExpr,
4475 n_expr2: nullable AExpr
4476 )
4477 do
4478 empty_init
4479 _n_expr = n_expr.as(not null)
4480 n_expr.parent = self
4481 _n_expr2 = n_expr2.as(not null)
4482 n_expr2.parent = self
4483 end
4484
4485 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4486 do
4487 if _n_expr == old_child then
4488 if new_child != null then
4489 new_child.parent = self
4490 assert new_child isa AExpr
4491 _n_expr = new_child
4492 else
4493 abort
4494 end
4495 return
4496 end
4497 if _n_expr2 == old_child then
4498 if new_child != null then
4499 new_child.parent = self
4500 assert new_child isa AExpr
4501 _n_expr2 = new_child
4502 else
4503 abort
4504 end
4505 return
4506 end
4507 end
4508
4509 redef fun visit_all(v: Visitor)
4510 do
4511 v.enter_visit(_n_expr)
4512 v.enter_visit(_n_expr2)
4513 end
4514 end
4515 redef class ANotExpr
4516 private init empty_init do end
4517
4518 init init_anotexpr (
4519 n_kwnot: nullable TKwnot,
4520 n_expr: nullable AExpr
4521 )
4522 do
4523 empty_init
4524 _n_kwnot = n_kwnot.as(not null)
4525 n_kwnot.parent = self
4526 _n_expr = n_expr.as(not null)
4527 n_expr.parent = self
4528 end
4529
4530 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4531 do
4532 if _n_kwnot == old_child then
4533 if new_child != null then
4534 new_child.parent = self
4535 assert new_child isa TKwnot
4536 _n_kwnot = new_child
4537 else
4538 abort
4539 end
4540 return
4541 end
4542 if _n_expr == old_child then
4543 if new_child != null then
4544 new_child.parent = self
4545 assert new_child isa AExpr
4546 _n_expr = new_child
4547 else
4548 abort
4549 end
4550 return
4551 end
4552 end
4553
4554 redef fun visit_all(v: Visitor)
4555 do
4556 v.enter_visit(_n_kwnot)
4557 v.enter_visit(_n_expr)
4558 end
4559 end
4560 redef class AEqExpr
4561 private init empty_init do end
4562
4563 init init_aeqexpr (
4564 n_expr: nullable AExpr,
4565 n_expr2: nullable AExpr
4566 )
4567 do
4568 empty_init
4569 _n_expr = n_expr.as(not null)
4570 n_expr.parent = self
4571 _n_expr2 = n_expr2.as(not null)
4572 n_expr2.parent = self
4573 end
4574
4575 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4576 do
4577 if _n_expr == old_child then
4578 if new_child != null then
4579 new_child.parent = self
4580 assert new_child isa AExpr
4581 _n_expr = new_child
4582 else
4583 abort
4584 end
4585 return
4586 end
4587 if _n_expr2 == old_child then
4588 if new_child != null then
4589 new_child.parent = self
4590 assert new_child isa AExpr
4591 _n_expr2 = new_child
4592 else
4593 abort
4594 end
4595 return
4596 end
4597 end
4598
4599 redef fun visit_all(v: Visitor)
4600 do
4601 v.enter_visit(_n_expr)
4602 v.enter_visit(_n_expr2)
4603 end
4604 end
4605 redef class AEeExpr
4606 private init empty_init do end
4607
4608 init init_aeeexpr (
4609 n_expr: nullable AExpr,
4610 n_expr2: nullable AExpr
4611 )
4612 do
4613 empty_init
4614 _n_expr = n_expr.as(not null)
4615 n_expr.parent = self
4616 _n_expr2 = n_expr2.as(not null)
4617 n_expr2.parent = self
4618 end
4619
4620 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4621 do
4622 if _n_expr == old_child then
4623 if new_child != null then
4624 new_child.parent = self
4625 assert new_child isa AExpr
4626 _n_expr = new_child
4627 else
4628 abort
4629 end
4630 return
4631 end
4632 if _n_expr2 == old_child then
4633 if new_child != null then
4634 new_child.parent = self
4635 assert new_child isa AExpr
4636 _n_expr2 = new_child
4637 else
4638 abort
4639 end
4640 return
4641 end
4642 end
4643
4644 redef fun visit_all(v: Visitor)
4645 do
4646 v.enter_visit(_n_expr)
4647 v.enter_visit(_n_expr2)
4648 end
4649 end
4650 redef class ANeExpr
4651 private init empty_init do end
4652
4653 init init_aneexpr (
4654 n_expr: nullable AExpr,
4655 n_expr2: nullable AExpr
4656 )
4657 do
4658 empty_init
4659 _n_expr = n_expr.as(not null)
4660 n_expr.parent = self
4661 _n_expr2 = n_expr2.as(not null)
4662 n_expr2.parent = self
4663 end
4664
4665 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4666 do
4667 if _n_expr == old_child then
4668 if new_child != null then
4669 new_child.parent = self
4670 assert new_child isa AExpr
4671 _n_expr = new_child
4672 else
4673 abort
4674 end
4675 return
4676 end
4677 if _n_expr2 == old_child then
4678 if new_child != null then
4679 new_child.parent = self
4680 assert new_child isa AExpr
4681 _n_expr2 = new_child
4682 else
4683 abort
4684 end
4685 return
4686 end
4687 end
4688
4689 redef fun visit_all(v: Visitor)
4690 do
4691 v.enter_visit(_n_expr)
4692 v.enter_visit(_n_expr2)
4693 end
4694 end
4695 redef class ALtExpr
4696 private init empty_init do end
4697
4698 init init_altexpr (
4699 n_expr: nullable AExpr,
4700 n_expr2: nullable AExpr
4701 )
4702 do
4703 empty_init
4704 _n_expr = n_expr.as(not null)
4705 n_expr.parent = self
4706 _n_expr2 = n_expr2.as(not null)
4707 n_expr2.parent = self
4708 end
4709
4710 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4711 do
4712 if _n_expr == old_child then
4713 if new_child != null then
4714 new_child.parent = self
4715 assert new_child isa AExpr
4716 _n_expr = new_child
4717 else
4718 abort
4719 end
4720 return
4721 end
4722 if _n_expr2 == old_child then
4723 if new_child != null then
4724 new_child.parent = self
4725 assert new_child isa AExpr
4726 _n_expr2 = new_child
4727 else
4728 abort
4729 end
4730 return
4731 end
4732 end
4733
4734 redef fun visit_all(v: Visitor)
4735 do
4736 v.enter_visit(_n_expr)
4737 v.enter_visit(_n_expr2)
4738 end
4739 end
4740 redef class ALeExpr
4741 private init empty_init do end
4742
4743 init init_aleexpr (
4744 n_expr: nullable AExpr,
4745 n_expr2: nullable AExpr
4746 )
4747 do
4748 empty_init
4749 _n_expr = n_expr.as(not null)
4750 n_expr.parent = self
4751 _n_expr2 = n_expr2.as(not null)
4752 n_expr2.parent = self
4753 end
4754
4755 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4756 do
4757 if _n_expr == old_child then
4758 if new_child != null then
4759 new_child.parent = self
4760 assert new_child isa AExpr
4761 _n_expr = new_child
4762 else
4763 abort
4764 end
4765 return
4766 end
4767 if _n_expr2 == old_child then
4768 if new_child != null then
4769 new_child.parent = self
4770 assert new_child isa AExpr
4771 _n_expr2 = new_child
4772 else
4773 abort
4774 end
4775 return
4776 end
4777 end
4778
4779 redef fun visit_all(v: Visitor)
4780 do
4781 v.enter_visit(_n_expr)
4782 v.enter_visit(_n_expr2)
4783 end
4784 end
4785 redef class ALlExpr
4786 private init empty_init do end
4787
4788 init init_allexpr (
4789 n_expr: nullable AExpr,
4790 n_expr2: nullable AExpr
4791 )
4792 do
4793 empty_init
4794 _n_expr = n_expr.as(not null)
4795 n_expr.parent = self
4796 _n_expr2 = n_expr2.as(not null)
4797 n_expr2.parent = self
4798 end
4799
4800 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4801 do
4802 if _n_expr == old_child then
4803 if new_child != null then
4804 new_child.parent = self
4805 assert new_child isa AExpr
4806 _n_expr = new_child
4807 else
4808 abort
4809 end
4810 return
4811 end
4812 if _n_expr2 == old_child then
4813 if new_child != null then
4814 new_child.parent = self
4815 assert new_child isa AExpr
4816 _n_expr2 = new_child
4817 else
4818 abort
4819 end
4820 return
4821 end
4822 end
4823
4824 redef fun visit_all(v: Visitor)
4825 do
4826 v.enter_visit(_n_expr)
4827 v.enter_visit(_n_expr2)
4828 end
4829 end
4830 redef class AGtExpr
4831 private init empty_init do end
4832
4833 init init_agtexpr (
4834 n_expr: nullable AExpr,
4835 n_expr2: nullable AExpr
4836 )
4837 do
4838 empty_init
4839 _n_expr = n_expr.as(not null)
4840 n_expr.parent = self
4841 _n_expr2 = n_expr2.as(not null)
4842 n_expr2.parent = self
4843 end
4844
4845 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4846 do
4847 if _n_expr == old_child then
4848 if new_child != null then
4849 new_child.parent = self
4850 assert new_child isa AExpr
4851 _n_expr = new_child
4852 else
4853 abort
4854 end
4855 return
4856 end
4857 if _n_expr2 == old_child then
4858 if new_child != null then
4859 new_child.parent = self
4860 assert new_child isa AExpr
4861 _n_expr2 = new_child
4862 else
4863 abort
4864 end
4865 return
4866 end
4867 end
4868
4869 redef fun visit_all(v: Visitor)
4870 do
4871 v.enter_visit(_n_expr)
4872 v.enter_visit(_n_expr2)
4873 end
4874 end
4875 redef class AGeExpr
4876 private init empty_init do end
4877
4878 init init_ageexpr (
4879 n_expr: nullable AExpr,
4880 n_expr2: nullable AExpr
4881 )
4882 do
4883 empty_init
4884 _n_expr = n_expr.as(not null)
4885 n_expr.parent = self
4886 _n_expr2 = n_expr2.as(not null)
4887 n_expr2.parent = self
4888 end
4889
4890 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4891 do
4892 if _n_expr == old_child then
4893 if new_child != null then
4894 new_child.parent = self
4895 assert new_child isa AExpr
4896 _n_expr = new_child
4897 else
4898 abort
4899 end
4900 return
4901 end
4902 if _n_expr2 == old_child then
4903 if new_child != null then
4904 new_child.parent = self
4905 assert new_child isa AExpr
4906 _n_expr2 = new_child
4907 else
4908 abort
4909 end
4910 return
4911 end
4912 end
4913
4914 redef fun visit_all(v: Visitor)
4915 do
4916 v.enter_visit(_n_expr)
4917 v.enter_visit(_n_expr2)
4918 end
4919 end
4920 redef class AGgExpr
4921 private init empty_init do end
4922
4923 init init_aggexpr (
4924 n_expr: nullable AExpr,
4925 n_expr2: nullable AExpr
4926 )
4927 do
4928 empty_init
4929 _n_expr = n_expr.as(not null)
4930 n_expr.parent = self
4931 _n_expr2 = n_expr2.as(not null)
4932 n_expr2.parent = self
4933 end
4934
4935 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4936 do
4937 if _n_expr == old_child then
4938 if new_child != null then
4939 new_child.parent = self
4940 assert new_child isa AExpr
4941 _n_expr = new_child
4942 else
4943 abort
4944 end
4945 return
4946 end
4947 if _n_expr2 == old_child then
4948 if new_child != null then
4949 new_child.parent = self
4950 assert new_child isa AExpr
4951 _n_expr2 = new_child
4952 else
4953 abort
4954 end
4955 return
4956 end
4957 end
4958
4959 redef fun visit_all(v: Visitor)
4960 do
4961 v.enter_visit(_n_expr)
4962 v.enter_visit(_n_expr2)
4963 end
4964 end
4965 redef class AIsaExpr
4966 private init empty_init do end
4967
4968 init init_aisaexpr (
4969 n_expr: nullable AExpr,
4970 n_type: nullable AType
4971 )
4972 do
4973 empty_init
4974 _n_expr = n_expr.as(not null)
4975 n_expr.parent = self
4976 _n_type = n_type.as(not null)
4977 n_type.parent = self
4978 end
4979
4980 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
4981 do
4982 if _n_expr == old_child then
4983 if new_child != null then
4984 new_child.parent = self
4985 assert new_child isa AExpr
4986 _n_expr = new_child
4987 else
4988 abort
4989 end
4990 return
4991 end
4992 if _n_type == old_child then
4993 if new_child != null then
4994 new_child.parent = self
4995 assert new_child isa AType
4996 _n_type = new_child
4997 else
4998 abort
4999 end
5000 return
5001 end
5002 end
5003
5004 redef fun visit_all(v: Visitor)
5005 do
5006 v.enter_visit(_n_expr)
5007 v.enter_visit(_n_type)
5008 end
5009 end
5010 redef class APlusExpr
5011 private init empty_init do end
5012
5013 init init_aplusexpr (
5014 n_expr: nullable AExpr,
5015 n_expr2: nullable AExpr
5016 )
5017 do
5018 empty_init
5019 _n_expr = n_expr.as(not null)
5020 n_expr.parent = self
5021 _n_expr2 = n_expr2.as(not null)
5022 n_expr2.parent = self
5023 end
5024
5025 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5026 do
5027 if _n_expr == old_child then
5028 if new_child != null then
5029 new_child.parent = self
5030 assert new_child isa AExpr
5031 _n_expr = new_child
5032 else
5033 abort
5034 end
5035 return
5036 end
5037 if _n_expr2 == old_child then
5038 if new_child != null then
5039 new_child.parent = self
5040 assert new_child isa AExpr
5041 _n_expr2 = new_child
5042 else
5043 abort
5044 end
5045 return
5046 end
5047 end
5048
5049 redef fun visit_all(v: Visitor)
5050 do
5051 v.enter_visit(_n_expr)
5052 v.enter_visit(_n_expr2)
5053 end
5054 end
5055 redef class AMinusExpr
5056 private init empty_init do end
5057
5058 init init_aminusexpr (
5059 n_expr: nullable AExpr,
5060 n_expr2: nullable AExpr
5061 )
5062 do
5063 empty_init
5064 _n_expr = n_expr.as(not null)
5065 n_expr.parent = self
5066 _n_expr2 = n_expr2.as(not null)
5067 n_expr2.parent = self
5068 end
5069
5070 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5071 do
5072 if _n_expr == old_child then
5073 if new_child != null then
5074 new_child.parent = self
5075 assert new_child isa AExpr
5076 _n_expr = new_child
5077 else
5078 abort
5079 end
5080 return
5081 end
5082 if _n_expr2 == old_child then
5083 if new_child != null then
5084 new_child.parent = self
5085 assert new_child isa AExpr
5086 _n_expr2 = new_child
5087 else
5088 abort
5089 end
5090 return
5091 end
5092 end
5093
5094 redef fun visit_all(v: Visitor)
5095 do
5096 v.enter_visit(_n_expr)
5097 v.enter_visit(_n_expr2)
5098 end
5099 end
5100 redef class AStarshipExpr
5101 private init empty_init do end
5102
5103 init init_astarshipexpr (
5104 n_expr: nullable AExpr,
5105 n_expr2: nullable AExpr
5106 )
5107 do
5108 empty_init
5109 _n_expr = n_expr.as(not null)
5110 n_expr.parent = self
5111 _n_expr2 = n_expr2.as(not null)
5112 n_expr2.parent = self
5113 end
5114
5115 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5116 do
5117 if _n_expr == old_child then
5118 if new_child != null then
5119 new_child.parent = self
5120 assert new_child isa AExpr
5121 _n_expr = new_child
5122 else
5123 abort
5124 end
5125 return
5126 end
5127 if _n_expr2 == old_child then
5128 if new_child != null then
5129 new_child.parent = self
5130 assert new_child isa AExpr
5131 _n_expr2 = new_child
5132 else
5133 abort
5134 end
5135 return
5136 end
5137 end
5138
5139 redef fun visit_all(v: Visitor)
5140 do
5141 v.enter_visit(_n_expr)
5142 v.enter_visit(_n_expr2)
5143 end
5144 end
5145 redef class AStarExpr
5146 private init empty_init do end
5147
5148 init init_astarexpr (
5149 n_expr: nullable AExpr,
5150 n_expr2: nullable AExpr
5151 )
5152 do
5153 empty_init
5154 _n_expr = n_expr.as(not null)
5155 n_expr.parent = self
5156 _n_expr2 = n_expr2.as(not null)
5157 n_expr2.parent = self
5158 end
5159
5160 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5161 do
5162 if _n_expr == old_child then
5163 if new_child != null then
5164 new_child.parent = self
5165 assert new_child isa AExpr
5166 _n_expr = new_child
5167 else
5168 abort
5169 end
5170 return
5171 end
5172 if _n_expr2 == old_child then
5173 if new_child != null then
5174 new_child.parent = self
5175 assert new_child isa AExpr
5176 _n_expr2 = new_child
5177 else
5178 abort
5179 end
5180 return
5181 end
5182 end
5183
5184 redef fun visit_all(v: Visitor)
5185 do
5186 v.enter_visit(_n_expr)
5187 v.enter_visit(_n_expr2)
5188 end
5189 end
5190 redef class ASlashExpr
5191 private init empty_init do end
5192
5193 init init_aslashexpr (
5194 n_expr: nullable AExpr,
5195 n_expr2: nullable AExpr
5196 )
5197 do
5198 empty_init
5199 _n_expr = n_expr.as(not null)
5200 n_expr.parent = self
5201 _n_expr2 = n_expr2.as(not null)
5202 n_expr2.parent = self
5203 end
5204
5205 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5206 do
5207 if _n_expr == old_child then
5208 if new_child != null then
5209 new_child.parent = self
5210 assert new_child isa AExpr
5211 _n_expr = new_child
5212 else
5213 abort
5214 end
5215 return
5216 end
5217 if _n_expr2 == old_child then
5218 if new_child != null then
5219 new_child.parent = self
5220 assert new_child isa AExpr
5221 _n_expr2 = new_child
5222 else
5223 abort
5224 end
5225 return
5226 end
5227 end
5228
5229 redef fun visit_all(v: Visitor)
5230 do
5231 v.enter_visit(_n_expr)
5232 v.enter_visit(_n_expr2)
5233 end
5234 end
5235 redef class APercentExpr
5236 private init empty_init do end
5237
5238 init init_apercentexpr (
5239 n_expr: nullable AExpr,
5240 n_expr2: nullable AExpr
5241 )
5242 do
5243 empty_init
5244 _n_expr = n_expr.as(not null)
5245 n_expr.parent = self
5246 _n_expr2 = n_expr2.as(not null)
5247 n_expr2.parent = self
5248 end
5249
5250 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5251 do
5252 if _n_expr == old_child then
5253 if new_child != null then
5254 new_child.parent = self
5255 assert new_child isa AExpr
5256 _n_expr = new_child
5257 else
5258 abort
5259 end
5260 return
5261 end
5262 if _n_expr2 == old_child then
5263 if new_child != null then
5264 new_child.parent = self
5265 assert new_child isa AExpr
5266 _n_expr2 = new_child
5267 else
5268 abort
5269 end
5270 return
5271 end
5272 end
5273
5274 redef fun visit_all(v: Visitor)
5275 do
5276 v.enter_visit(_n_expr)
5277 v.enter_visit(_n_expr2)
5278 end
5279 end
5280 redef class AUminusExpr
5281 private init empty_init do end
5282
5283 init init_auminusexpr (
5284 n_minus: nullable TMinus,
5285 n_expr: nullable AExpr
5286 )
5287 do
5288 empty_init
5289 _n_minus = n_minus.as(not null)
5290 n_minus.parent = self
5291 _n_expr = n_expr.as(not null)
5292 n_expr.parent = self
5293 end
5294
5295 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5296 do
5297 if _n_minus == old_child then
5298 if new_child != null then
5299 new_child.parent = self
5300 assert new_child isa TMinus
5301 _n_minus = new_child
5302 else
5303 abort
5304 end
5305 return
5306 end
5307 if _n_expr == old_child then
5308 if new_child != null then
5309 new_child.parent = self
5310 assert new_child isa AExpr
5311 _n_expr = new_child
5312 else
5313 abort
5314 end
5315 return
5316 end
5317 end
5318
5319 redef fun visit_all(v: Visitor)
5320 do
5321 v.enter_visit(_n_minus)
5322 v.enter_visit(_n_expr)
5323 end
5324 end
5325 redef class ANewExpr
5326 private init empty_init do end
5327
5328 init init_anewexpr (
5329 n_kwnew: nullable TKwnew,
5330 n_type: nullable AType,
5331 n_id: nullable TId,
5332 n_args: Collection[Object] # Should be Collection[AExpr]
5333 )
5334 do
5335 empty_init
5336 _n_kwnew = n_kwnew.as(not null)
5337 n_kwnew.parent = self
5338 _n_type = n_type.as(not null)
5339 n_type.parent = self
5340 _n_id = n_id
5341 if n_id != null then
5342 n_id.parent = self
5343 end
5344 for n in n_args do
5345 assert n isa AExpr
5346 _n_args.add(n)
5347 n.parent = self
5348 end
5349 end
5350
5351 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5352 do
5353 if _n_kwnew == old_child then
5354 if new_child != null then
5355 new_child.parent = self
5356 assert new_child isa TKwnew
5357 _n_kwnew = new_child
5358 else
5359 abort
5360 end
5361 return
5362 end
5363 if _n_type == old_child then
5364 if new_child != null then
5365 new_child.parent = self
5366 assert new_child isa AType
5367 _n_type = new_child
5368 else
5369 abort
5370 end
5371 return
5372 end
5373 if _n_id == old_child then
5374 if new_child != null then
5375 new_child.parent = self
5376 assert new_child isa TId
5377 _n_id = new_child
5378 else
5379 _n_id = null
5380 end
5381 return
5382 end
5383 for i in [0.._n_args.length[ do
5384 if _n_args[i] == old_child then
5385 if new_child != null then
5386 assert new_child isa AExpr
5387 _n_args[i] = new_child
5388 new_child.parent = self
5389 else
5390 _n_args.remove_at(i)
5391 end
5392 return
5393 end
5394 end
5395 end
5396
5397 redef fun visit_all(v: Visitor)
5398 do
5399 v.enter_visit(_n_kwnew)
5400 v.enter_visit(_n_type)
5401 if _n_id != null then
5402 v.enter_visit(_n_id.as(not null))
5403 end
5404 for n in _n_args do
5405 v.enter_visit(n)
5406 end
5407 end
5408 end
5409 redef class AAttrExpr
5410 private init empty_init do end
5411
5412 init init_aattrexpr (
5413 n_expr: nullable AExpr,
5414 n_id: nullable TAttrid
5415 )
5416 do
5417 empty_init
5418 _n_expr = n_expr.as(not null)
5419 n_expr.parent = self
5420 _n_id = n_id.as(not null)
5421 n_id.parent = self
5422 end
5423
5424 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5425 do
5426 if _n_expr == old_child then
5427 if new_child != null then
5428 new_child.parent = self
5429 assert new_child isa AExpr
5430 _n_expr = new_child
5431 else
5432 abort
5433 end
5434 return
5435 end
5436 if _n_id == old_child then
5437 if new_child != null then
5438 new_child.parent = self
5439 assert new_child isa TAttrid
5440 _n_id = new_child
5441 else
5442 abort
5443 end
5444 return
5445 end
5446 end
5447
5448 redef fun visit_all(v: Visitor)
5449 do
5450 v.enter_visit(_n_expr)
5451 v.enter_visit(_n_id)
5452 end
5453 end
5454 redef class AAttrAssignExpr
5455 private init empty_init do end
5456
5457 init init_aattrassignexpr (
5458 n_expr: nullable AExpr,
5459 n_id: nullable TAttrid,
5460 n_assign: nullable TAssign,
5461 n_value: nullable AExpr
5462 )
5463 do
5464 empty_init
5465 _n_expr = n_expr.as(not null)
5466 n_expr.parent = self
5467 _n_id = n_id.as(not null)
5468 n_id.parent = self
5469 _n_assign = n_assign.as(not null)
5470 n_assign.parent = self
5471 _n_value = n_value.as(not null)
5472 n_value.parent = self
5473 end
5474
5475 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5476 do
5477 if _n_expr == old_child then
5478 if new_child != null then
5479 new_child.parent = self
5480 assert new_child isa AExpr
5481 _n_expr = new_child
5482 else
5483 abort
5484 end
5485 return
5486 end
5487 if _n_id == old_child then
5488 if new_child != null then
5489 new_child.parent = self
5490 assert new_child isa TAttrid
5491 _n_id = new_child
5492 else
5493 abort
5494 end
5495 return
5496 end
5497 if _n_assign == old_child then
5498 if new_child != null then
5499 new_child.parent = self
5500 assert new_child isa TAssign
5501 _n_assign = new_child
5502 else
5503 abort
5504 end
5505 return
5506 end
5507 if _n_value == old_child then
5508 if new_child != null then
5509 new_child.parent = self
5510 assert new_child isa AExpr
5511 _n_value = new_child
5512 else
5513 abort
5514 end
5515 return
5516 end
5517 end
5518
5519 redef fun visit_all(v: Visitor)
5520 do
5521 v.enter_visit(_n_expr)
5522 v.enter_visit(_n_id)
5523 v.enter_visit(_n_assign)
5524 v.enter_visit(_n_value)
5525 end
5526 end
5527 redef class AAttrReassignExpr
5528 private init empty_init do end
5529
5530 init init_aattrreassignexpr (
5531 n_expr: nullable AExpr,
5532 n_id: nullable TAttrid,
5533 n_assign_op: nullable AAssignOp,
5534 n_value: nullable AExpr
5535 )
5536 do
5537 empty_init
5538 _n_expr = n_expr.as(not null)
5539 n_expr.parent = self
5540 _n_id = n_id.as(not null)
5541 n_id.parent = self
5542 _n_assign_op = n_assign_op.as(not null)
5543 n_assign_op.parent = self
5544 _n_value = n_value.as(not null)
5545 n_value.parent = self
5546 end
5547
5548 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5549 do
5550 if _n_expr == old_child then
5551 if new_child != null then
5552 new_child.parent = self
5553 assert new_child isa AExpr
5554 _n_expr = new_child
5555 else
5556 abort
5557 end
5558 return
5559 end
5560 if _n_id == old_child then
5561 if new_child != null then
5562 new_child.parent = self
5563 assert new_child isa TAttrid
5564 _n_id = new_child
5565 else
5566 abort
5567 end
5568 return
5569 end
5570 if _n_assign_op == old_child then
5571 if new_child != null then
5572 new_child.parent = self
5573 assert new_child isa AAssignOp
5574 _n_assign_op = new_child
5575 else
5576 abort
5577 end
5578 return
5579 end
5580 if _n_value == old_child then
5581 if new_child != null then
5582 new_child.parent = self
5583 assert new_child isa AExpr
5584 _n_value = new_child
5585 else
5586 abort
5587 end
5588 return
5589 end
5590 end
5591
5592 redef fun visit_all(v: Visitor)
5593 do
5594 v.enter_visit(_n_expr)
5595 v.enter_visit(_n_id)
5596 v.enter_visit(_n_assign_op)
5597 v.enter_visit(_n_value)
5598 end
5599 end
5600 redef class ACallExpr
5601 private init empty_init do end
5602
5603 init init_acallexpr (
5604 n_expr: nullable AExpr,
5605 n_id: nullable TId,
5606 n_args: Collection[Object], # Should be Collection[AExpr]
5607 n_closure_defs: Collection[Object] # Should be Collection[AClosureDef]
5608 )
5609 do
5610 empty_init
5611 _n_expr = n_expr.as(not null)
5612 n_expr.parent = self
5613 _n_id = n_id.as(not null)
5614 n_id.parent = self
5615 for n in n_args do
5616 assert n isa AExpr
5617 _n_args.add(n)
5618 n.parent = self
5619 end
5620 for n in n_closure_defs do
5621 assert n isa AClosureDef
5622 _n_closure_defs.add(n)
5623 n.parent = self
5624 end
5625 end
5626
5627 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5628 do
5629 if _n_expr == old_child then
5630 if new_child != null then
5631 new_child.parent = self
5632 assert new_child isa AExpr
5633 _n_expr = new_child
5634 else
5635 abort
5636 end
5637 return
5638 end
5639 if _n_id == old_child then
5640 if new_child != null then
5641 new_child.parent = self
5642 assert new_child isa TId
5643 _n_id = new_child
5644 else
5645 abort
5646 end
5647 return
5648 end
5649 for i in [0.._n_args.length[ do
5650 if _n_args[i] == old_child then
5651 if new_child != null then
5652 assert new_child isa AExpr
5653 _n_args[i] = new_child
5654 new_child.parent = self
5655 else
5656 _n_args.remove_at(i)
5657 end
5658 return
5659 end
5660 end
5661 for i in [0.._n_closure_defs.length[ do
5662 if _n_closure_defs[i] == old_child then
5663 if new_child != null then
5664 assert new_child isa AClosureDef
5665 _n_closure_defs[i] = new_child
5666 new_child.parent = self
5667 else
5668 _n_closure_defs.remove_at(i)
5669 end
5670 return
5671 end
5672 end
5673 end
5674
5675 redef fun visit_all(v: Visitor)
5676 do
5677 v.enter_visit(_n_expr)
5678 v.enter_visit(_n_id)
5679 for n in _n_args do
5680 v.enter_visit(n)
5681 end
5682 for n in _n_closure_defs do
5683 v.enter_visit(n)
5684 end
5685 end
5686 end
5687 redef class ACallAssignExpr
5688 private init empty_init do end
5689
5690 init init_acallassignexpr (
5691 n_expr: nullable AExpr,
5692 n_id: nullable TId,
5693 n_args: Collection[Object], # Should be Collection[AExpr]
5694 n_assign: nullable TAssign,
5695 n_value: nullable AExpr
5696 )
5697 do
5698 empty_init
5699 _n_expr = n_expr.as(not null)
5700 n_expr.parent = self
5701 _n_id = n_id.as(not null)
5702 n_id.parent = self
5703 for n in n_args do
5704 assert n isa AExpr
5705 _n_args.add(n)
5706 n.parent = self
5707 end
5708 _n_assign = n_assign.as(not null)
5709 n_assign.parent = self
5710 _n_value = n_value.as(not null)
5711 n_value.parent = self
5712 end
5713
5714 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5715 do
5716 if _n_expr == old_child then
5717 if new_child != null then
5718 new_child.parent = self
5719 assert new_child isa AExpr
5720 _n_expr = new_child
5721 else
5722 abort
5723 end
5724 return
5725 end
5726 if _n_id == old_child then
5727 if new_child != null then
5728 new_child.parent = self
5729 assert new_child isa TId
5730 _n_id = new_child
5731 else
5732 abort
5733 end
5734 return
5735 end
5736 for i in [0.._n_args.length[ do
5737 if _n_args[i] == old_child then
5738 if new_child != null then
5739 assert new_child isa AExpr
5740 _n_args[i] = new_child
5741 new_child.parent = self
5742 else
5743 _n_args.remove_at(i)
5744 end
5745 return
5746 end
5747 end
5748 if _n_assign == old_child then
5749 if new_child != null then
5750 new_child.parent = self
5751 assert new_child isa TAssign
5752 _n_assign = new_child
5753 else
5754 abort
5755 end
5756 return
5757 end
5758 if _n_value == old_child then
5759 if new_child != null then
5760 new_child.parent = self
5761 assert new_child isa AExpr
5762 _n_value = new_child
5763 else
5764 abort
5765 end
5766 return
5767 end
5768 end
5769
5770 redef fun visit_all(v: Visitor)
5771 do
5772 v.enter_visit(_n_expr)
5773 v.enter_visit(_n_id)
5774 for n in _n_args do
5775 v.enter_visit(n)
5776 end
5777 v.enter_visit(_n_assign)
5778 v.enter_visit(_n_value)
5779 end
5780 end
5781 redef class ACallReassignExpr
5782 private init empty_init do end
5783
5784 init init_acallreassignexpr (
5785 n_expr: nullable AExpr,
5786 n_id: nullable TId,
5787 n_args: Collection[Object], # Should be Collection[AExpr]
5788 n_assign_op: nullable AAssignOp,
5789 n_value: nullable AExpr
5790 )
5791 do
5792 empty_init
5793 _n_expr = n_expr.as(not null)
5794 n_expr.parent = self
5795 _n_id = n_id.as(not null)
5796 n_id.parent = self
5797 for n in n_args do
5798 assert n isa AExpr
5799 _n_args.add(n)
5800 n.parent = self
5801 end
5802 _n_assign_op = n_assign_op.as(not null)
5803 n_assign_op.parent = self
5804 _n_value = n_value.as(not null)
5805 n_value.parent = self
5806 end
5807
5808 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5809 do
5810 if _n_expr == old_child then
5811 if new_child != null then
5812 new_child.parent = self
5813 assert new_child isa AExpr
5814 _n_expr = new_child
5815 else
5816 abort
5817 end
5818 return
5819 end
5820 if _n_id == old_child then
5821 if new_child != null then
5822 new_child.parent = self
5823 assert new_child isa TId
5824 _n_id = new_child
5825 else
5826 abort
5827 end
5828 return
5829 end
5830 for i in [0.._n_args.length[ do
5831 if _n_args[i] == old_child then
5832 if new_child != null then
5833 assert new_child isa AExpr
5834 _n_args[i] = new_child
5835 new_child.parent = self
5836 else
5837 _n_args.remove_at(i)
5838 end
5839 return
5840 end
5841 end
5842 if _n_assign_op == old_child then
5843 if new_child != null then
5844 new_child.parent = self
5845 assert new_child isa AAssignOp
5846 _n_assign_op = new_child
5847 else
5848 abort
5849 end
5850 return
5851 end
5852 if _n_value == old_child then
5853 if new_child != null then
5854 new_child.parent = self
5855 assert new_child isa AExpr
5856 _n_value = new_child
5857 else
5858 abort
5859 end
5860 return
5861 end
5862 end
5863
5864 redef fun visit_all(v: Visitor)
5865 do
5866 v.enter_visit(_n_expr)
5867 v.enter_visit(_n_id)
5868 for n in _n_args do
5869 v.enter_visit(n)
5870 end
5871 v.enter_visit(_n_assign_op)
5872 v.enter_visit(_n_value)
5873 end
5874 end
5875 redef class ASuperExpr
5876 private init empty_init do end
5877
5878 init init_asuperexpr (
5879 n_qualified: nullable AQualified,
5880 n_kwsuper: nullable TKwsuper,
5881 n_args: Collection[Object] # Should be Collection[AExpr]
5882 )
5883 do
5884 empty_init
5885 _n_qualified = n_qualified
5886 if n_qualified != null then
5887 n_qualified.parent = self
5888 end
5889 _n_kwsuper = n_kwsuper.as(not null)
5890 n_kwsuper.parent = self
5891 for n in n_args do
5892 assert n isa AExpr
5893 _n_args.add(n)
5894 n.parent = self
5895 end
5896 end
5897
5898 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5899 do
5900 if _n_qualified == old_child then
5901 if new_child != null then
5902 new_child.parent = self
5903 assert new_child isa AQualified
5904 _n_qualified = new_child
5905 else
5906 _n_qualified = null
5907 end
5908 return
5909 end
5910 if _n_kwsuper == old_child then
5911 if new_child != null then
5912 new_child.parent = self
5913 assert new_child isa TKwsuper
5914 _n_kwsuper = new_child
5915 else
5916 abort
5917 end
5918 return
5919 end
5920 for i in [0.._n_args.length[ do
5921 if _n_args[i] == old_child then
5922 if new_child != null then
5923 assert new_child isa AExpr
5924 _n_args[i] = new_child
5925 new_child.parent = self
5926 else
5927 _n_args.remove_at(i)
5928 end
5929 return
5930 end
5931 end
5932 end
5933
5934 redef fun visit_all(v: Visitor)
5935 do
5936 if _n_qualified != null then
5937 v.enter_visit(_n_qualified.as(not null))
5938 end
5939 v.enter_visit(_n_kwsuper)
5940 for n in _n_args do
5941 v.enter_visit(n)
5942 end
5943 end
5944 end
5945 redef class AInitExpr
5946 private init empty_init do end
5947
5948 init init_ainitexpr (
5949 n_expr: nullable AExpr,
5950 n_kwinit: nullable TKwinit,
5951 n_args: Collection[Object] # Should be Collection[AExpr]
5952 )
5953 do
5954 empty_init
5955 _n_expr = n_expr.as(not null)
5956 n_expr.parent = self
5957 _n_kwinit = n_kwinit.as(not null)
5958 n_kwinit.parent = self
5959 for n in n_args do
5960 assert n isa AExpr
5961 _n_args.add(n)
5962 n.parent = self
5963 end
5964 end
5965
5966 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
5967 do
5968 if _n_expr == old_child then
5969 if new_child != null then
5970 new_child.parent = self
5971 assert new_child isa AExpr
5972 _n_expr = new_child
5973 else
5974 abort
5975 end
5976 return
5977 end
5978 if _n_kwinit == old_child then
5979 if new_child != null then
5980 new_child.parent = self
5981 assert new_child isa TKwinit
5982 _n_kwinit = new_child
5983 else
5984 abort
5985 end
5986 return
5987 end
5988 for i in [0.._n_args.length[ do
5989 if _n_args[i] == old_child then
5990 if new_child != null then
5991 assert new_child isa AExpr
5992 _n_args[i] = new_child
5993 new_child.parent = self
5994 else
5995 _n_args.remove_at(i)
5996 end
5997 return
5998 end
5999 end
6000 end
6001
6002 redef fun visit_all(v: Visitor)
6003 do
6004 v.enter_visit(_n_expr)
6005 v.enter_visit(_n_kwinit)
6006 for n in _n_args do
6007 v.enter_visit(n)
6008 end
6009 end
6010 end
6011 redef class ABraExpr
6012 private init empty_init do end
6013
6014 init init_abraexpr (
6015 n_expr: nullable AExpr,
6016 n_args: Collection[Object], # Should be Collection[AExpr]
6017 n_closure_defs: Collection[Object] # Should be Collection[AClosureDef]
6018 )
6019 do
6020 empty_init
6021 _n_expr = n_expr.as(not null)
6022 n_expr.parent = self
6023 for n in n_args do
6024 assert n isa AExpr
6025 _n_args.add(n)
6026 n.parent = self
6027 end
6028 for n in n_closure_defs do
6029 assert n isa AClosureDef
6030 _n_closure_defs.add(n)
6031 n.parent = self
6032 end
6033 end
6034
6035 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6036 do
6037 if _n_expr == old_child then
6038 if new_child != null then
6039 new_child.parent = self
6040 assert new_child isa AExpr
6041 _n_expr = new_child
6042 else
6043 abort
6044 end
6045 return
6046 end
6047 for i in [0.._n_args.length[ do
6048 if _n_args[i] == old_child then
6049 if new_child != null then
6050 assert new_child isa AExpr
6051 _n_args[i] = new_child
6052 new_child.parent = self
6053 else
6054 _n_args.remove_at(i)
6055 end
6056 return
6057 end
6058 end
6059 for i in [0.._n_closure_defs.length[ do
6060 if _n_closure_defs[i] == old_child then
6061 if new_child != null then
6062 assert new_child isa AClosureDef
6063 _n_closure_defs[i] = new_child
6064 new_child.parent = self
6065 else
6066 _n_closure_defs.remove_at(i)
6067 end
6068 return
6069 end
6070 end
6071 end
6072
6073 redef fun visit_all(v: Visitor)
6074 do
6075 v.enter_visit(_n_expr)
6076 for n in _n_args do
6077 v.enter_visit(n)
6078 end
6079 for n in _n_closure_defs do
6080 v.enter_visit(n)
6081 end
6082 end
6083 end
6084 redef class ABraAssignExpr
6085 private init empty_init do end
6086
6087 init init_abraassignexpr (
6088 n_expr: nullable AExpr,
6089 n_args: Collection[Object], # Should be Collection[AExpr]
6090 n_assign: nullable TAssign,
6091 n_value: nullable AExpr
6092 )
6093 do
6094 empty_init
6095 _n_expr = n_expr.as(not null)
6096 n_expr.parent = self
6097 for n in n_args do
6098 assert n isa AExpr
6099 _n_args.add(n)
6100 n.parent = self
6101 end
6102 _n_assign = n_assign.as(not null)
6103 n_assign.parent = self
6104 _n_value = n_value.as(not null)
6105 n_value.parent = self
6106 end
6107
6108 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6109 do
6110 if _n_expr == old_child then
6111 if new_child != null then
6112 new_child.parent = self
6113 assert new_child isa AExpr
6114 _n_expr = new_child
6115 else
6116 abort
6117 end
6118 return
6119 end
6120 for i in [0.._n_args.length[ do
6121 if _n_args[i] == old_child then
6122 if new_child != null then
6123 assert new_child isa AExpr
6124 _n_args[i] = new_child
6125 new_child.parent = self
6126 else
6127 _n_args.remove_at(i)
6128 end
6129 return
6130 end
6131 end
6132 if _n_assign == old_child then
6133 if new_child != null then
6134 new_child.parent = self
6135 assert new_child isa TAssign
6136 _n_assign = new_child
6137 else
6138 abort
6139 end
6140 return
6141 end
6142 if _n_value == old_child then
6143 if new_child != null then
6144 new_child.parent = self
6145 assert new_child isa AExpr
6146 _n_value = new_child
6147 else
6148 abort
6149 end
6150 return
6151 end
6152 end
6153
6154 redef fun visit_all(v: Visitor)
6155 do
6156 v.enter_visit(_n_expr)
6157 for n in _n_args do
6158 v.enter_visit(n)
6159 end
6160 v.enter_visit(_n_assign)
6161 v.enter_visit(_n_value)
6162 end
6163 end
6164 redef class ABraReassignExpr
6165 private init empty_init do end
6166
6167 init init_abrareassignexpr (
6168 n_expr: nullable AExpr,
6169 n_args: Collection[Object], # Should be Collection[AExpr]
6170 n_assign_op: nullable AAssignOp,
6171 n_value: nullable AExpr
6172 )
6173 do
6174 empty_init
6175 _n_expr = n_expr.as(not null)
6176 n_expr.parent = self
6177 for n in n_args do
6178 assert n isa AExpr
6179 _n_args.add(n)
6180 n.parent = self
6181 end
6182 _n_assign_op = n_assign_op.as(not null)
6183 n_assign_op.parent = self
6184 _n_value = n_value.as(not null)
6185 n_value.parent = self
6186 end
6187
6188 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6189 do
6190 if _n_expr == old_child then
6191 if new_child != null then
6192 new_child.parent = self
6193 assert new_child isa AExpr
6194 _n_expr = new_child
6195 else
6196 abort
6197 end
6198 return
6199 end
6200 for i in [0.._n_args.length[ do
6201 if _n_args[i] == old_child then
6202 if new_child != null then
6203 assert new_child isa AExpr
6204 _n_args[i] = new_child
6205 new_child.parent = self
6206 else
6207 _n_args.remove_at(i)
6208 end
6209 return
6210 end
6211 end
6212 if _n_assign_op == old_child then
6213 if new_child != null then
6214 new_child.parent = self
6215 assert new_child isa AAssignOp
6216 _n_assign_op = new_child
6217 else
6218 abort
6219 end
6220 return
6221 end
6222 if _n_value == old_child then
6223 if new_child != null then
6224 new_child.parent = self
6225 assert new_child isa AExpr
6226 _n_value = new_child
6227 else
6228 abort
6229 end
6230 return
6231 end
6232 end
6233
6234 redef fun visit_all(v: Visitor)
6235 do
6236 v.enter_visit(_n_expr)
6237 for n in _n_args do
6238 v.enter_visit(n)
6239 end
6240 v.enter_visit(_n_assign_op)
6241 v.enter_visit(_n_value)
6242 end
6243 end
6244 redef class AClosureCallExpr
6245 private init empty_init do end
6246
6247 init init_aclosurecallexpr (
6248 n_id: nullable TId,
6249 n_args: Collection[Object], # Should be Collection[AExpr]
6250 n_closure_defs: Collection[Object] # Should be Collection[AClosureDef]
6251 )
6252 do
6253 empty_init
6254 _n_id = n_id.as(not null)
6255 n_id.parent = self
6256 for n in n_args do
6257 assert n isa AExpr
6258 _n_args.add(n)
6259 n.parent = self
6260 end
6261 for n in n_closure_defs do
6262 assert n isa AClosureDef
6263 _n_closure_defs.add(n)
6264 n.parent = self
6265 end
6266 end
6267
6268 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6269 do
6270 if _n_id == old_child then
6271 if new_child != null then
6272 new_child.parent = self
6273 assert new_child isa TId
6274 _n_id = new_child
6275 else
6276 abort
6277 end
6278 return
6279 end
6280 for i in [0.._n_args.length[ do
6281 if _n_args[i] == old_child then
6282 if new_child != null then
6283 assert new_child isa AExpr
6284 _n_args[i] = new_child
6285 new_child.parent = self
6286 else
6287 _n_args.remove_at(i)
6288 end
6289 return
6290 end
6291 end
6292 for i in [0.._n_closure_defs.length[ do
6293 if _n_closure_defs[i] == old_child then
6294 if new_child != null then
6295 assert new_child isa AClosureDef
6296 _n_closure_defs[i] = new_child
6297 new_child.parent = self
6298 else
6299 _n_closure_defs.remove_at(i)
6300 end
6301 return
6302 end
6303 end
6304 end
6305
6306 redef fun visit_all(v: Visitor)
6307 do
6308 v.enter_visit(_n_id)
6309 for n in _n_args do
6310 v.enter_visit(n)
6311 end
6312 for n in _n_closure_defs do
6313 v.enter_visit(n)
6314 end
6315 end
6316 end
6317 redef class AVarExpr
6318 private init empty_init do end
6319
6320 init init_avarexpr (
6321 n_id: nullable TId
6322 )
6323 do
6324 empty_init
6325 _n_id = n_id.as(not null)
6326 n_id.parent = self
6327 end
6328
6329 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6330 do
6331 if _n_id == old_child then
6332 if new_child != null then
6333 new_child.parent = self
6334 assert new_child isa TId
6335 _n_id = new_child
6336 else
6337 abort
6338 end
6339 return
6340 end
6341 end
6342
6343 redef fun visit_all(v: Visitor)
6344 do
6345 v.enter_visit(_n_id)
6346 end
6347 end
6348 redef class AVarAssignExpr
6349 private init empty_init do end
6350
6351 init init_avarassignexpr (
6352 n_id: nullable TId,
6353 n_assign: nullable TAssign,
6354 n_value: nullable AExpr
6355 )
6356 do
6357 empty_init
6358 _n_id = n_id.as(not null)
6359 n_id.parent = self
6360 _n_assign = n_assign.as(not null)
6361 n_assign.parent = self
6362 _n_value = n_value.as(not null)
6363 n_value.parent = self
6364 end
6365
6366 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6367 do
6368 if _n_id == old_child then
6369 if new_child != null then
6370 new_child.parent = self
6371 assert new_child isa TId
6372 _n_id = new_child
6373 else
6374 abort
6375 end
6376 return
6377 end
6378 if _n_assign == old_child then
6379 if new_child != null then
6380 new_child.parent = self
6381 assert new_child isa TAssign
6382 _n_assign = new_child
6383 else
6384 abort
6385 end
6386 return
6387 end
6388 if _n_value == old_child then
6389 if new_child != null then
6390 new_child.parent = self
6391 assert new_child isa AExpr
6392 _n_value = new_child
6393 else
6394 abort
6395 end
6396 return
6397 end
6398 end
6399
6400 redef fun visit_all(v: Visitor)
6401 do
6402 v.enter_visit(_n_id)
6403 v.enter_visit(_n_assign)
6404 v.enter_visit(_n_value)
6405 end
6406 end
6407 redef class AVarReassignExpr
6408 private init empty_init do end
6409
6410 init init_avarreassignexpr (
6411 n_id: nullable TId,
6412 n_assign_op: nullable AAssignOp,
6413 n_value: nullable AExpr
6414 )
6415 do
6416 empty_init
6417 _n_id = n_id.as(not null)
6418 n_id.parent = self
6419 _n_assign_op = n_assign_op.as(not null)
6420 n_assign_op.parent = self
6421 _n_value = n_value.as(not null)
6422 n_value.parent = self
6423 end
6424
6425 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6426 do
6427 if _n_id == old_child then
6428 if new_child != null then
6429 new_child.parent = self
6430 assert new_child isa TId
6431 _n_id = new_child
6432 else
6433 abort
6434 end
6435 return
6436 end
6437 if _n_assign_op == old_child then
6438 if new_child != null then
6439 new_child.parent = self
6440 assert new_child isa AAssignOp
6441 _n_assign_op = new_child
6442 else
6443 abort
6444 end
6445 return
6446 end
6447 if _n_value == old_child then
6448 if new_child != null then
6449 new_child.parent = self
6450 assert new_child isa AExpr
6451 _n_value = new_child
6452 else
6453 abort
6454 end
6455 return
6456 end
6457 end
6458
6459 redef fun visit_all(v: Visitor)
6460 do
6461 v.enter_visit(_n_id)
6462 v.enter_visit(_n_assign_op)
6463 v.enter_visit(_n_value)
6464 end
6465 end
6466 redef class ARangeExpr
6467 private init empty_init do end
6468
6469 init init_arangeexpr (
6470 n_expr: nullable AExpr,
6471 n_expr2: nullable AExpr
6472 )
6473 do
6474 empty_init
6475 _n_expr = n_expr.as(not null)
6476 n_expr.parent = self
6477 _n_expr2 = n_expr2.as(not null)
6478 n_expr2.parent = self
6479 end
6480
6481 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6482 do
6483 if _n_expr == old_child then
6484 if new_child != null then
6485 new_child.parent = self
6486 assert new_child isa AExpr
6487 _n_expr = new_child
6488 else
6489 abort
6490 end
6491 return
6492 end
6493 if _n_expr2 == old_child then
6494 if new_child != null then
6495 new_child.parent = self
6496 assert new_child isa AExpr
6497 _n_expr2 = new_child
6498 else
6499 abort
6500 end
6501 return
6502 end
6503 end
6504
6505 redef fun visit_all(v: Visitor)
6506 do
6507 v.enter_visit(_n_expr)
6508 v.enter_visit(_n_expr2)
6509 end
6510 end
6511 redef class ACrangeExpr
6512 private init empty_init do end
6513
6514 init init_acrangeexpr (
6515 n_expr: nullable AExpr,
6516 n_expr2: nullable AExpr
6517 )
6518 do
6519 empty_init
6520 _n_expr = n_expr.as(not null)
6521 n_expr.parent = self
6522 _n_expr2 = n_expr2.as(not null)
6523 n_expr2.parent = self
6524 end
6525
6526 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6527 do
6528 if _n_expr == old_child then
6529 if new_child != null then
6530 new_child.parent = self
6531 assert new_child isa AExpr
6532 _n_expr = new_child
6533 else
6534 abort
6535 end
6536 return
6537 end
6538 if _n_expr2 == old_child then
6539 if new_child != null then
6540 new_child.parent = self
6541 assert new_child isa AExpr
6542 _n_expr2 = new_child
6543 else
6544 abort
6545 end
6546 return
6547 end
6548 end
6549
6550 redef fun visit_all(v: Visitor)
6551 do
6552 v.enter_visit(_n_expr)
6553 v.enter_visit(_n_expr2)
6554 end
6555 end
6556 redef class AOrangeExpr
6557 private init empty_init do end
6558
6559 init init_aorangeexpr (
6560 n_expr: nullable AExpr,
6561 n_expr2: nullable AExpr
6562 )
6563 do
6564 empty_init
6565 _n_expr = n_expr.as(not null)
6566 n_expr.parent = self
6567 _n_expr2 = n_expr2.as(not null)
6568 n_expr2.parent = self
6569 end
6570
6571 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6572 do
6573 if _n_expr == old_child then
6574 if new_child != null then
6575 new_child.parent = self
6576 assert new_child isa AExpr
6577 _n_expr = new_child
6578 else
6579 abort
6580 end
6581 return
6582 end
6583 if _n_expr2 == old_child then
6584 if new_child != null then
6585 new_child.parent = self
6586 assert new_child isa AExpr
6587 _n_expr2 = new_child
6588 else
6589 abort
6590 end
6591 return
6592 end
6593 end
6594
6595 redef fun visit_all(v: Visitor)
6596 do
6597 v.enter_visit(_n_expr)
6598 v.enter_visit(_n_expr2)
6599 end
6600 end
6601 redef class AArrayExpr
6602 private init empty_init do end
6603
6604 init init_aarrayexpr (
6605 n_exprs: Collection[Object] # Should be Collection[AExpr]
6606 )
6607 do
6608 empty_init
6609 for n in n_exprs do
6610 assert n isa AExpr
6611 _n_exprs.add(n)
6612 n.parent = self
6613 end
6614 end
6615
6616 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6617 do
6618 for i in [0.._n_exprs.length[ do
6619 if _n_exprs[i] == old_child then
6620 if new_child != null then
6621 assert new_child isa AExpr
6622 _n_exprs[i] = new_child
6623 new_child.parent = self
6624 else
6625 _n_exprs.remove_at(i)
6626 end
6627 return
6628 end
6629 end
6630 end
6631
6632 redef fun visit_all(v: Visitor)
6633 do
6634 for n in _n_exprs do
6635 v.enter_visit(n)
6636 end
6637 end
6638 end
6639 redef class ASelfExpr
6640 private init empty_init do end
6641
6642 init init_aselfexpr (
6643 n_kwself: nullable TKwself
6644 )
6645 do
6646 empty_init
6647 _n_kwself = n_kwself.as(not null)
6648 n_kwself.parent = self
6649 end
6650
6651 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6652 do
6653 if _n_kwself == old_child then
6654 if new_child != null then
6655 new_child.parent = self
6656 assert new_child isa TKwself
6657 _n_kwself = new_child
6658 else
6659 abort
6660 end
6661 return
6662 end
6663 end
6664
6665 redef fun visit_all(v: Visitor)
6666 do
6667 v.enter_visit(_n_kwself)
6668 end
6669 end
6670 redef class AImplicitSelfExpr
6671 private init empty_init do end
6672
6673 init init_aimplicitselfexpr
6674 do
6675 empty_init
6676 end
6677
6678 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6679 do
6680 end
6681
6682 redef fun visit_all(v: Visitor)
6683 do
6684 end
6685 end
6686 redef class ATrueExpr
6687 private init empty_init do end
6688
6689 init init_atrueexpr (
6690 n_kwtrue: nullable TKwtrue
6691 )
6692 do
6693 empty_init
6694 _n_kwtrue = n_kwtrue.as(not null)
6695 n_kwtrue.parent = self
6696 end
6697
6698 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6699 do
6700 if _n_kwtrue == old_child then
6701 if new_child != null then
6702 new_child.parent = self
6703 assert new_child isa TKwtrue
6704 _n_kwtrue = new_child
6705 else
6706 abort
6707 end
6708 return
6709 end
6710 end
6711
6712 redef fun visit_all(v: Visitor)
6713 do
6714 v.enter_visit(_n_kwtrue)
6715 end
6716 end
6717 redef class AFalseExpr
6718 private init empty_init do end
6719
6720 init init_afalseexpr (
6721 n_kwfalse: nullable TKwfalse
6722 )
6723 do
6724 empty_init
6725 _n_kwfalse = n_kwfalse.as(not null)
6726 n_kwfalse.parent = self
6727 end
6728
6729 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6730 do
6731 if _n_kwfalse == old_child then
6732 if new_child != null then
6733 new_child.parent = self
6734 assert new_child isa TKwfalse
6735 _n_kwfalse = new_child
6736 else
6737 abort
6738 end
6739 return
6740 end
6741 end
6742
6743 redef fun visit_all(v: Visitor)
6744 do
6745 v.enter_visit(_n_kwfalse)
6746 end
6747 end
6748 redef class ANullExpr
6749 private init empty_init do end
6750
6751 init init_anullexpr (
6752 n_kwnull: nullable TKwnull
6753 )
6754 do
6755 empty_init
6756 _n_kwnull = n_kwnull.as(not null)
6757 n_kwnull.parent = self
6758 end
6759
6760 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6761 do
6762 if _n_kwnull == old_child then
6763 if new_child != null then
6764 new_child.parent = self
6765 assert new_child isa TKwnull
6766 _n_kwnull = new_child
6767 else
6768 abort
6769 end
6770 return
6771 end
6772 end
6773
6774 redef fun visit_all(v: Visitor)
6775 do
6776 v.enter_visit(_n_kwnull)
6777 end
6778 end
6779 redef class AIntExpr
6780 private init empty_init do end
6781
6782 init init_aintexpr (
6783 n_number: nullable TNumber
6784 )
6785 do
6786 empty_init
6787 _n_number = n_number.as(not null)
6788 n_number.parent = self
6789 end
6790
6791 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6792 do
6793 if _n_number == old_child then
6794 if new_child != null then
6795 new_child.parent = self
6796 assert new_child isa TNumber
6797 _n_number = new_child
6798 else
6799 abort
6800 end
6801 return
6802 end
6803 end
6804
6805 redef fun visit_all(v: Visitor)
6806 do
6807 v.enter_visit(_n_number)
6808 end
6809 end
6810 redef class AFloatExpr
6811 private init empty_init do end
6812
6813 init init_afloatexpr (
6814 n_float: nullable TFloat
6815 )
6816 do
6817 empty_init
6818 _n_float = n_float.as(not null)
6819 n_float.parent = self
6820 end
6821
6822 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6823 do
6824 if _n_float == old_child then
6825 if new_child != null then
6826 new_child.parent = self
6827 assert new_child isa TFloat
6828 _n_float = new_child
6829 else
6830 abort
6831 end
6832 return
6833 end
6834 end
6835
6836 redef fun visit_all(v: Visitor)
6837 do
6838 v.enter_visit(_n_float)
6839 end
6840 end
6841 redef class ACharExpr
6842 private init empty_init do end
6843
6844 init init_acharexpr (
6845 n_char: nullable TChar
6846 )
6847 do
6848 empty_init
6849 _n_char = n_char.as(not null)
6850 n_char.parent = self
6851 end
6852
6853 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6854 do
6855 if _n_char == old_child then
6856 if new_child != null then
6857 new_child.parent = self
6858 assert new_child isa TChar
6859 _n_char = new_child
6860 else
6861 abort
6862 end
6863 return
6864 end
6865 end
6866
6867 redef fun visit_all(v: Visitor)
6868 do
6869 v.enter_visit(_n_char)
6870 end
6871 end
6872 redef class AStringExpr
6873 private init empty_init do end
6874
6875 init init_astringexpr (
6876 n_string: nullable TString
6877 )
6878 do
6879 empty_init
6880 _n_string = n_string.as(not null)
6881 n_string.parent = self
6882 end
6883
6884 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6885 do
6886 if _n_string == old_child then
6887 if new_child != null then
6888 new_child.parent = self
6889 assert new_child isa TString
6890 _n_string = new_child
6891 else
6892 abort
6893 end
6894 return
6895 end
6896 end
6897
6898 redef fun visit_all(v: Visitor)
6899 do
6900 v.enter_visit(_n_string)
6901 end
6902 end
6903 redef class AStartStringExpr
6904 private init empty_init do end
6905
6906 init init_astartstringexpr (
6907 n_string: nullable TStartString
6908 )
6909 do
6910 empty_init
6911 _n_string = n_string.as(not null)
6912 n_string.parent = self
6913 end
6914
6915 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6916 do
6917 if _n_string == old_child then
6918 if new_child != null then
6919 new_child.parent = self
6920 assert new_child isa TStartString
6921 _n_string = new_child
6922 else
6923 abort
6924 end
6925 return
6926 end
6927 end
6928
6929 redef fun visit_all(v: Visitor)
6930 do
6931 v.enter_visit(_n_string)
6932 end
6933 end
6934 redef class AMidStringExpr
6935 private init empty_init do end
6936
6937 init init_amidstringexpr (
6938 n_string: nullable TMidString
6939 )
6940 do
6941 empty_init
6942 _n_string = n_string.as(not null)
6943 n_string.parent = self
6944 end
6945
6946 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6947 do
6948 if _n_string == old_child then
6949 if new_child != null then
6950 new_child.parent = self
6951 assert new_child isa TMidString
6952 _n_string = new_child
6953 else
6954 abort
6955 end
6956 return
6957 end
6958 end
6959
6960 redef fun visit_all(v: Visitor)
6961 do
6962 v.enter_visit(_n_string)
6963 end
6964 end
6965 redef class AEndStringExpr
6966 private init empty_init do end
6967
6968 init init_aendstringexpr (
6969 n_string: nullable TEndString
6970 )
6971 do
6972 empty_init
6973 _n_string = n_string.as(not null)
6974 n_string.parent = self
6975 end
6976
6977 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
6978 do
6979 if _n_string == old_child then
6980 if new_child != null then
6981 new_child.parent = self
6982 assert new_child isa TEndString
6983 _n_string = new_child
6984 else
6985 abort
6986 end
6987 return
6988 end
6989 end
6990
6991 redef fun visit_all(v: Visitor)
6992 do
6993 v.enter_visit(_n_string)
6994 end
6995 end
6996 redef class ASuperstringExpr
6997 private init empty_init do end
6998
6999 init init_asuperstringexpr (
7000 n_exprs: Collection[Object] # Should be Collection[AExpr]
7001 )
7002 do
7003 empty_init
7004 for n in n_exprs do
7005 assert n isa AExpr
7006 _n_exprs.add(n)
7007 n.parent = self
7008 end
7009 end
7010
7011 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7012 do
7013 for i in [0.._n_exprs.length[ do
7014 if _n_exprs[i] == old_child then
7015 if new_child != null then
7016 assert new_child isa AExpr
7017 _n_exprs[i] = new_child
7018 new_child.parent = self
7019 else
7020 _n_exprs.remove_at(i)
7021 end
7022 return
7023 end
7024 end
7025 end
7026
7027 redef fun visit_all(v: Visitor)
7028 do
7029 for n in _n_exprs do
7030 v.enter_visit(n)
7031 end
7032 end
7033 end
7034 redef class AParExpr
7035 private init empty_init do end
7036
7037 init init_aparexpr (
7038 n_expr: nullable AExpr
7039 )
7040 do
7041 empty_init
7042 _n_expr = n_expr.as(not null)
7043 n_expr.parent = self
7044 end
7045
7046 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7047 do
7048 if _n_expr == old_child then
7049 if new_child != null then
7050 new_child.parent = self
7051 assert new_child isa AExpr
7052 _n_expr = new_child
7053 else
7054 abort
7055 end
7056 return
7057 end
7058 end
7059
7060 redef fun visit_all(v: Visitor)
7061 do
7062 v.enter_visit(_n_expr)
7063 end
7064 end
7065 redef class AAsCastExpr
7066 private init empty_init do end
7067
7068 init init_aascastexpr (
7069 n_expr: nullable AExpr,
7070 n_kwas: nullable TKwas,
7071 n_type: nullable AType
7072 )
7073 do
7074 empty_init
7075 _n_expr = n_expr.as(not null)
7076 n_expr.parent = self
7077 _n_kwas = n_kwas.as(not null)
7078 n_kwas.parent = self
7079 _n_type = n_type.as(not null)
7080 n_type.parent = self
7081 end
7082
7083 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7084 do
7085 if _n_expr == old_child then
7086 if new_child != null then
7087 new_child.parent = self
7088 assert new_child isa AExpr
7089 _n_expr = new_child
7090 else
7091 abort
7092 end
7093 return
7094 end
7095 if _n_kwas == old_child then
7096 if new_child != null then
7097 new_child.parent = self
7098 assert new_child isa TKwas
7099 _n_kwas = new_child
7100 else
7101 abort
7102 end
7103 return
7104 end
7105 if _n_type == old_child then
7106 if new_child != null then
7107 new_child.parent = self
7108 assert new_child isa AType
7109 _n_type = new_child
7110 else
7111 abort
7112 end
7113 return
7114 end
7115 end
7116
7117 redef fun visit_all(v: Visitor)
7118 do
7119 v.enter_visit(_n_expr)
7120 v.enter_visit(_n_kwas)
7121 v.enter_visit(_n_type)
7122 end
7123 end
7124 redef class AAsNotnullExpr
7125 private init empty_init do end
7126
7127 init init_aasnotnullexpr (
7128 n_expr: nullable AExpr,
7129 n_kwas: nullable TKwas,
7130 n_kwnot: nullable TKwnot,
7131 n_kwnull: nullable TKwnull
7132 )
7133 do
7134 empty_init
7135 _n_expr = n_expr.as(not null)
7136 n_expr.parent = self
7137 _n_kwas = n_kwas.as(not null)
7138 n_kwas.parent = self
7139 _n_kwnot = n_kwnot.as(not null)
7140 n_kwnot.parent = self
7141 _n_kwnull = n_kwnull.as(not null)
7142 n_kwnull.parent = self
7143 end
7144
7145 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7146 do
7147 if _n_expr == old_child then
7148 if new_child != null then
7149 new_child.parent = self
7150 assert new_child isa AExpr
7151 _n_expr = new_child
7152 else
7153 abort
7154 end
7155 return
7156 end
7157 if _n_kwas == old_child then
7158 if new_child != null then
7159 new_child.parent = self
7160 assert new_child isa TKwas
7161 _n_kwas = new_child
7162 else
7163 abort
7164 end
7165 return
7166 end
7167 if _n_kwnot == old_child then
7168 if new_child != null then
7169 new_child.parent = self
7170 assert new_child isa TKwnot
7171 _n_kwnot = new_child
7172 else
7173 abort
7174 end
7175 return
7176 end
7177 if _n_kwnull == old_child then
7178 if new_child != null then
7179 new_child.parent = self
7180 assert new_child isa TKwnull
7181 _n_kwnull = new_child
7182 else
7183 abort
7184 end
7185 return
7186 end
7187 end
7188
7189 redef fun visit_all(v: Visitor)
7190 do
7191 v.enter_visit(_n_expr)
7192 v.enter_visit(_n_kwas)
7193 v.enter_visit(_n_kwnot)
7194 v.enter_visit(_n_kwnull)
7195 end
7196 end
7197 redef class AIssetAttrExpr
7198 private init empty_init do end
7199
7200 init init_aissetattrexpr (
7201 n_kwisset: nullable TKwisset,
7202 n_expr: nullable AExpr,
7203 n_id: nullable TAttrid
7204 )
7205 do
7206 empty_init
7207 _n_kwisset = n_kwisset.as(not null)
7208 n_kwisset.parent = self
7209 _n_expr = n_expr.as(not null)
7210 n_expr.parent = self
7211 _n_id = n_id.as(not null)
7212 n_id.parent = self
7213 end
7214
7215 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7216 do
7217 if _n_kwisset == old_child then
7218 if new_child != null then
7219 new_child.parent = self
7220 assert new_child isa TKwisset
7221 _n_kwisset = new_child
7222 else
7223 abort
7224 end
7225 return
7226 end
7227 if _n_expr == old_child then
7228 if new_child != null then
7229 new_child.parent = self
7230 assert new_child isa AExpr
7231 _n_expr = new_child
7232 else
7233 abort
7234 end
7235 return
7236 end
7237 if _n_id == old_child then
7238 if new_child != null then
7239 new_child.parent = self
7240 assert new_child isa TAttrid
7241 _n_id = new_child
7242 else
7243 abort
7244 end
7245 return
7246 end
7247 end
7248
7249 redef fun visit_all(v: Visitor)
7250 do
7251 v.enter_visit(_n_kwisset)
7252 v.enter_visit(_n_expr)
7253 v.enter_visit(_n_id)
7254 end
7255 end
7256 redef class APlusAssignOp
7257 private init empty_init do end
7258
7259 init init_aplusassignop (
7260 n_pluseq: nullable TPluseq
7261 )
7262 do
7263 empty_init
7264 _n_pluseq = n_pluseq.as(not null)
7265 n_pluseq.parent = self
7266 end
7267
7268 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7269 do
7270 if _n_pluseq == old_child then
7271 if new_child != null then
7272 new_child.parent = self
7273 assert new_child isa TPluseq
7274 _n_pluseq = new_child
7275 else
7276 abort
7277 end
7278 return
7279 end
7280 end
7281
7282 redef fun visit_all(v: Visitor)
7283 do
7284 v.enter_visit(_n_pluseq)
7285 end
7286 end
7287 redef class AMinusAssignOp
7288 private init empty_init do end
7289
7290 init init_aminusassignop (
7291 n_minuseq: nullable TMinuseq
7292 )
7293 do
7294 empty_init
7295 _n_minuseq = n_minuseq.as(not null)
7296 n_minuseq.parent = self
7297 end
7298
7299 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7300 do
7301 if _n_minuseq == old_child then
7302 if new_child != null then
7303 new_child.parent = self
7304 assert new_child isa TMinuseq
7305 _n_minuseq = new_child
7306 else
7307 abort
7308 end
7309 return
7310 end
7311 end
7312
7313 redef fun visit_all(v: Visitor)
7314 do
7315 v.enter_visit(_n_minuseq)
7316 end
7317 end
7318 redef class AClosureDef
7319 private init empty_init do end
7320
7321 init init_aclosuredef (
7322 n_bang: nullable TBang,
7323 n_id: nullable AClosureId,
7324 n_ids: Collection[Object], # Should be Collection[TId]
7325 n_kwdo: nullable TKwdo,
7326 n_expr: nullable AExpr,
7327 n_label: nullable ALabel
7328 )
7329 do
7330 empty_init
7331 _n_bang = n_bang.as(not null)
7332 n_bang.parent = self
7333 _n_id = n_id.as(not null)
7334 n_id.parent = self
7335 for n in n_ids do
7336 assert n isa TId
7337 _n_ids.add(n)
7338 n.parent = self
7339 end
7340 _n_kwdo = n_kwdo
7341 if n_kwdo != null then
7342 n_kwdo.parent = self
7343 end
7344 _n_expr = n_expr
7345 if n_expr != null then
7346 n_expr.parent = self
7347 end
7348 _n_label = n_label
7349 if n_label != null then
7350 n_label.parent = self
7351 end
7352 end
7353
7354 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7355 do
7356 if _n_bang == old_child then
7357 if new_child != null then
7358 new_child.parent = self
7359 assert new_child isa TBang
7360 _n_bang = new_child
7361 else
7362 abort
7363 end
7364 return
7365 end
7366 if _n_id == old_child then
7367 if new_child != null then
7368 new_child.parent = self
7369 assert new_child isa AClosureId
7370 _n_id = new_child
7371 else
7372 abort
7373 end
7374 return
7375 end
7376 for i in [0.._n_ids.length[ do
7377 if _n_ids[i] == old_child then
7378 if new_child != null then
7379 assert new_child isa TId
7380 _n_ids[i] = new_child
7381 new_child.parent = self
7382 else
7383 _n_ids.remove_at(i)
7384 end
7385 return
7386 end
7387 end
7388 if _n_kwdo == old_child then
7389 if new_child != null then
7390 new_child.parent = self
7391 assert new_child isa TKwdo
7392 _n_kwdo = new_child
7393 else
7394 _n_kwdo = null
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 _n_expr = null
7405 end
7406 return
7407 end
7408 if _n_label == old_child then
7409 if new_child != null then
7410 new_child.parent = self
7411 assert new_child isa ALabel
7412 _n_label = new_child
7413 else
7414 _n_label = null
7415 end
7416 return
7417 end
7418 end
7419
7420 redef fun visit_all(v: Visitor)
7421 do
7422 v.enter_visit(_n_bang)
7423 v.enter_visit(_n_id)
7424 for n in _n_ids do
7425 v.enter_visit(n)
7426 end
7427 if _n_kwdo != null then
7428 v.enter_visit(_n_kwdo.as(not null))
7429 end
7430 if _n_expr != null then
7431 v.enter_visit(_n_expr.as(not null))
7432 end
7433 if _n_label != null then
7434 v.enter_visit(_n_label.as(not null))
7435 end
7436 end
7437 end
7438 redef class ASimpleClosureId
7439 private init empty_init do end
7440
7441 init init_asimpleclosureid (
7442 n_id: nullable TId
7443 )
7444 do
7445 empty_init
7446 _n_id = n_id.as(not null)
7447 n_id.parent = self
7448 end
7449
7450 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7451 do
7452 if _n_id == old_child then
7453 if new_child != null then
7454 new_child.parent = self
7455 assert new_child isa TId
7456 _n_id = new_child
7457 else
7458 abort
7459 end
7460 return
7461 end
7462 end
7463
7464 redef fun visit_all(v: Visitor)
7465 do
7466 v.enter_visit(_n_id)
7467 end
7468 end
7469 redef class ABreakClosureId
7470 private init empty_init do end
7471
7472 init init_abreakclosureid (
7473 n_kwbreak: nullable TKwbreak
7474 )
7475 do
7476 empty_init
7477 _n_kwbreak = n_kwbreak.as(not null)
7478 n_kwbreak.parent = self
7479 end
7480
7481 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7482 do
7483 if _n_kwbreak == old_child then
7484 if new_child != null then
7485 new_child.parent = self
7486 assert new_child isa TKwbreak
7487 _n_kwbreak = new_child
7488 else
7489 abort
7490 end
7491 return
7492 end
7493 end
7494
7495 redef fun visit_all(v: Visitor)
7496 do
7497 v.enter_visit(_n_kwbreak)
7498 end
7499 end
7500 redef class AModuleName
7501 private init empty_init do end
7502
7503 init init_amodulename (
7504 n_quad: nullable TQuad,
7505 n_path: Collection[Object], # Should be Collection[TId]
7506 n_id: nullable TId
7507 )
7508 do
7509 empty_init
7510 _n_quad = n_quad
7511 if n_quad != null then
7512 n_quad.parent = self
7513 end
7514 for n in n_path do
7515 assert n isa TId
7516 _n_path.add(n)
7517 n.parent = self
7518 end
7519 _n_id = n_id.as(not null)
7520 n_id.parent = self
7521 end
7522
7523 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7524 do
7525 if _n_quad == old_child then
7526 if new_child != null then
7527 new_child.parent = self
7528 assert new_child isa TQuad
7529 _n_quad = new_child
7530 else
7531 _n_quad = null
7532 end
7533 return
7534 end
7535 for i in [0.._n_path.length[ do
7536 if _n_path[i] == old_child then
7537 if new_child != null then
7538 assert new_child isa TId
7539 _n_path[i] = new_child
7540 new_child.parent = self
7541 else
7542 _n_path.remove_at(i)
7543 end
7544 return
7545 end
7546 end
7547 if _n_id == old_child then
7548 if new_child != null then
7549 new_child.parent = self
7550 assert new_child isa TId
7551 _n_id = new_child
7552 else
7553 abort
7554 end
7555 return
7556 end
7557 end
7558
7559 redef fun visit_all(v: Visitor)
7560 do
7561 if _n_quad != null then
7562 v.enter_visit(_n_quad.as(not null))
7563 end
7564 for n in _n_path do
7565 v.enter_visit(n)
7566 end
7567 v.enter_visit(_n_id)
7568 end
7569 end
7570 redef class AExternCalls
7571 private init empty_init do end
7572
7573 init init_aexterncalls (
7574 n_kwimport: nullable TKwimport,
7575 n_extern_calls: Collection[Object] # Should be Collection[AExternCall]
7576 )
7577 do
7578 empty_init
7579 _n_kwimport = n_kwimport.as(not null)
7580 n_kwimport.parent = self
7581 for n in n_extern_calls do
7582 assert n isa AExternCall
7583 _n_extern_calls.add(n)
7584 n.parent = self
7585 end
7586 end
7587
7588 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7589 do
7590 if _n_kwimport == old_child then
7591 if new_child != null then
7592 new_child.parent = self
7593 assert new_child isa TKwimport
7594 _n_kwimport = new_child
7595 else
7596 abort
7597 end
7598 return
7599 end
7600 for i in [0.._n_extern_calls.length[ do
7601 if _n_extern_calls[i] == old_child then
7602 if new_child != null then
7603 assert new_child isa AExternCall
7604 _n_extern_calls[i] = new_child
7605 new_child.parent = self
7606 else
7607 _n_extern_calls.remove_at(i)
7608 end
7609 return
7610 end
7611 end
7612 end
7613
7614 redef fun visit_all(v: Visitor)
7615 do
7616 v.enter_visit(_n_kwimport)
7617 for n in _n_extern_calls do
7618 v.enter_visit(n)
7619 end
7620 end
7621 end
7622 redef class AExternCall
7623 private init empty_init do end
7624
7625 init init_aexterncall
7626 do
7627 empty_init
7628 end
7629
7630 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7631 do
7632 end
7633
7634 redef fun visit_all(v: Visitor)
7635 do
7636 end
7637 end
7638 redef class ASuperExternCall
7639 private init empty_init do end
7640
7641 init init_asuperexterncall (
7642 n_kwsuper: nullable TKwsuper
7643 )
7644 do
7645 empty_init
7646 _n_kwsuper = n_kwsuper.as(not null)
7647 n_kwsuper.parent = self
7648 end
7649
7650 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7651 do
7652 if _n_kwsuper == old_child then
7653 if new_child != null then
7654 new_child.parent = self
7655 assert new_child isa TKwsuper
7656 _n_kwsuper = new_child
7657 else
7658 abort
7659 end
7660 return
7661 end
7662 end
7663
7664 redef fun visit_all(v: Visitor)
7665 do
7666 v.enter_visit(_n_kwsuper)
7667 end
7668 end
7669 redef class ALocalPropExternCall
7670 private init empty_init do end
7671
7672 init init_alocalpropexterncall (
7673 n_methid: nullable AMethid
7674 )
7675 do
7676 empty_init
7677 _n_methid = n_methid.as(not null)
7678 n_methid.parent = self
7679 end
7680
7681 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7682 do
7683 if _n_methid == old_child then
7684 if new_child != null then
7685 new_child.parent = self
7686 assert new_child isa AMethid
7687 _n_methid = new_child
7688 else
7689 abort
7690 end
7691 return
7692 end
7693 end
7694
7695 redef fun visit_all(v: Visitor)
7696 do
7697 v.enter_visit(_n_methid)
7698 end
7699 end
7700 redef class AFullPropExternCall
7701 private init empty_init do end
7702
7703 init init_afullpropexterncall (
7704 n_classid: nullable TClassid,
7705 n_quad: nullable TQuad,
7706 n_methid: nullable AMethid
7707 )
7708 do
7709 empty_init
7710 _n_classid = n_classid.as(not null)
7711 n_classid.parent = self
7712 _n_quad = n_quad
7713 if n_quad != null then
7714 n_quad.parent = self
7715 end
7716 _n_methid = n_methid.as(not null)
7717 n_methid.parent = self
7718 end
7719
7720 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7721 do
7722 if _n_classid == old_child then
7723 if new_child != null then
7724 new_child.parent = self
7725 assert new_child isa TClassid
7726 _n_classid = new_child
7727 else
7728 abort
7729 end
7730 return
7731 end
7732 if _n_quad == old_child then
7733 if new_child != null then
7734 new_child.parent = self
7735 assert new_child isa TQuad
7736 _n_quad = new_child
7737 else
7738 _n_quad = null
7739 end
7740 return
7741 end
7742 if _n_methid == old_child then
7743 if new_child != null then
7744 new_child.parent = self
7745 assert new_child isa AMethid
7746 _n_methid = new_child
7747 else
7748 abort
7749 end
7750 return
7751 end
7752 end
7753
7754 redef fun visit_all(v: Visitor)
7755 do
7756 v.enter_visit(_n_classid)
7757 if _n_quad != null then
7758 v.enter_visit(_n_quad.as(not null))
7759 end
7760 v.enter_visit(_n_methid)
7761 end
7762 end
7763 redef class AInitPropExternCall
7764 private init empty_init do end
7765
7766 init init_ainitpropexterncall (
7767 n_classid: nullable TClassid
7768 )
7769 do
7770 empty_init
7771 _n_classid = n_classid.as(not null)
7772 n_classid.parent = self
7773 end
7774
7775 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7776 do
7777 if _n_classid == old_child then
7778 if new_child != null then
7779 new_child.parent = self
7780 assert new_child isa TClassid
7781 _n_classid = new_child
7782 else
7783 abort
7784 end
7785 return
7786 end
7787 end
7788
7789 redef fun visit_all(v: Visitor)
7790 do
7791 v.enter_visit(_n_classid)
7792 end
7793 end
7794 redef class ACastAsExternCall
7795 private init empty_init do end
7796
7797 init init_acastasexterncall (
7798 n_from_type: nullable AType,
7799 n_kwas: nullable TKwas,
7800 n_to_type: nullable AType
7801 )
7802 do
7803 empty_init
7804 _n_from_type = n_from_type.as(not null)
7805 n_from_type.parent = self
7806 _n_kwas = n_kwas.as(not null)
7807 n_kwas.parent = self
7808 _n_to_type = n_to_type.as(not null)
7809 n_to_type.parent = self
7810 end
7811
7812 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7813 do
7814 if _n_from_type == old_child then
7815 if new_child != null then
7816 new_child.parent = self
7817 assert new_child isa AType
7818 _n_from_type = new_child
7819 else
7820 abort
7821 end
7822 return
7823 end
7824 if _n_kwas == old_child then
7825 if new_child != null then
7826 new_child.parent = self
7827 assert new_child isa TKwas
7828 _n_kwas = new_child
7829 else
7830 abort
7831 end
7832 return
7833 end
7834 if _n_to_type == old_child then
7835 if new_child != null then
7836 new_child.parent = self
7837 assert new_child isa AType
7838 _n_to_type = new_child
7839 else
7840 abort
7841 end
7842 return
7843 end
7844 end
7845
7846 redef fun visit_all(v: Visitor)
7847 do
7848 v.enter_visit(_n_from_type)
7849 v.enter_visit(_n_kwas)
7850 v.enter_visit(_n_to_type)
7851 end
7852 end
7853 redef class AAsNullableExternCall
7854 private init empty_init do end
7855
7856 init init_aasnullableexterncall (
7857 n_type: nullable AType,
7858 n_kwas: nullable TKwas,
7859 n_kwnullable: nullable TKwnullable
7860 )
7861 do
7862 empty_init
7863 _n_type = n_type.as(not null)
7864 n_type.parent = self
7865 _n_kwas = n_kwas.as(not null)
7866 n_kwas.parent = self
7867 _n_kwnullable = n_kwnullable.as(not null)
7868 n_kwnullable.parent = self
7869 end
7870
7871 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7872 do
7873 if _n_type == old_child then
7874 if new_child != null then
7875 new_child.parent = self
7876 assert new_child isa AType
7877 _n_type = new_child
7878 else
7879 abort
7880 end
7881 return
7882 end
7883 if _n_kwas == old_child then
7884 if new_child != null then
7885 new_child.parent = self
7886 assert new_child isa TKwas
7887 _n_kwas = new_child
7888 else
7889 abort
7890 end
7891 return
7892 end
7893 if _n_kwnullable == old_child then
7894 if new_child != null then
7895 new_child.parent = self
7896 assert new_child isa TKwnullable
7897 _n_kwnullable = new_child
7898 else
7899 abort
7900 end
7901 return
7902 end
7903 end
7904
7905 redef fun visit_all(v: Visitor)
7906 do
7907 v.enter_visit(_n_type)
7908 v.enter_visit(_n_kwas)
7909 v.enter_visit(_n_kwnullable)
7910 end
7911 end
7912 redef class AAsNotNullableExternCall
7913 private init empty_init do end
7914
7915 init init_aasnotnullableexterncall (
7916 n_type: nullable AType,
7917 n_kwas: nullable TKwas,
7918 n_kwnot: nullable TKwnot,
7919 n_kwnullable: nullable TKwnullable
7920 )
7921 do
7922 empty_init
7923 _n_type = n_type.as(not null)
7924 n_type.parent = self
7925 _n_kwas = n_kwas.as(not null)
7926 n_kwas.parent = self
7927 _n_kwnot = n_kwnot.as(not null)
7928 n_kwnot.parent = self
7929 _n_kwnullable = n_kwnullable.as(not null)
7930 n_kwnullable.parent = self
7931 end
7932
7933 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
7934 do
7935 if _n_type == old_child then
7936 if new_child != null then
7937 new_child.parent = self
7938 assert new_child isa AType
7939 _n_type = new_child
7940 else
7941 abort
7942 end
7943 return
7944 end
7945 if _n_kwas == old_child then
7946 if new_child != null then
7947 new_child.parent = self
7948 assert new_child isa TKwas
7949 _n_kwas = new_child
7950 else
7951 abort
7952 end
7953 return
7954 end
7955 if _n_kwnot == old_child then
7956 if new_child != null then
7957 new_child.parent = self
7958 assert new_child isa TKwnot
7959 _n_kwnot = new_child
7960 else
7961 abort
7962 end
7963 return
7964 end
7965 if _n_kwnullable == old_child then
7966 if new_child != null then
7967 new_child.parent = self
7968 assert new_child isa TKwnullable
7969 _n_kwnullable = new_child
7970 else
7971 abort
7972 end
7973 return
7974 end
7975 end
7976
7977 redef fun visit_all(v: Visitor)
7978 do
7979 v.enter_visit(_n_type)
7980 v.enter_visit(_n_kwas)
7981 v.enter_visit(_n_kwnot)
7982 v.enter_visit(_n_kwnullable)
7983 end
7984 end
7985 redef class AQualified
7986 private init empty_init do end
7987
7988 init init_aqualified (
7989 n_id: Collection[Object], # Should be Collection[TId]
7990 n_classid: nullable TClassid
7991 )
7992 do
7993 empty_init
7994 for n in n_id do
7995 assert n isa TId
7996 _n_id.add(n)
7997 n.parent = self
7998 end
7999 _n_classid = n_classid
8000 if n_classid != null then
8001 n_classid.parent = self
8002 end
8003 end
8004
8005 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8006 do
8007 for i in [0.._n_id.length[ do
8008 if _n_id[i] == old_child then
8009 if new_child != null then
8010 assert new_child isa TId
8011 _n_id[i] = new_child
8012 new_child.parent = self
8013 else
8014 _n_id.remove_at(i)
8015 end
8016 return
8017 end
8018 end
8019 if _n_classid == old_child then
8020 if new_child != null then
8021 new_child.parent = self
8022 assert new_child isa TClassid
8023 _n_classid = new_child
8024 else
8025 _n_classid = null
8026 end
8027 return
8028 end
8029 end
8030
8031 redef fun visit_all(v: Visitor)
8032 do
8033 for n in _n_id do
8034 v.enter_visit(n)
8035 end
8036 if _n_classid != null then
8037 v.enter_visit(_n_classid.as(not null))
8038 end
8039 end
8040 end
8041 redef class ADoc
8042 private init empty_init do end
8043
8044 init init_adoc (
8045 n_comment: Collection[Object] # Should be Collection[TComment]
8046 )
8047 do
8048 empty_init
8049 for n in n_comment do
8050 assert n isa TComment
8051 _n_comment.add(n)
8052 n.parent = self
8053 end
8054 end
8055
8056 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8057 do
8058 for i in [0.._n_comment.length[ do
8059 if _n_comment[i] == old_child then
8060 if new_child != null then
8061 assert new_child isa TComment
8062 _n_comment[i] = new_child
8063 new_child.parent = self
8064 else
8065 _n_comment.remove_at(i)
8066 end
8067 return
8068 end
8069 end
8070 end
8071
8072 redef fun visit_all(v: Visitor)
8073 do
8074 for n in _n_comment do
8075 v.enter_visit(n)
8076 end
8077 end
8078 end
8079
8080 redef class Start
8081 init(
8082 n_base: nullable AModule,
8083 n_eof: EOF)
8084 do
8085 _n_base = n_base
8086 _n_eof = n_eof
8087 end
8088
8089 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
8090 do
8091 if _n_base == old_child then
8092 if new_child == null then
8093 else
8094 new_child.parent = self
8095 assert new_child isa AModule
8096 _n_base = new_child
8097 end
8098 old_child.parent = null
8099 return
8100 end
8101 end
8102
8103 redef fun visit_all(v: Visitor)
8104 do
8105 if _n_base != null then
8106 v.enter_visit(_n_base.as(not null))
8107 end
8108 v.enter_visit(_n_eof)
8109 end
8110 end