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