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