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