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