1 # Production AST nodes full definition.
2 # This file was generated by SableCC (http://www.sablecc.org/).
6 intrude import parser_nodes
10 # Parent of the node in the AST
11 readable writable var _parent
: nullable ANode
13 # Remove a child from the AST
14 fun remove_child
(child
: ANode)
16 replace_child
(child
, null)
19 # Replace a child with an other node in the AST
20 fun replace_child
(old_child
: ANode, new_child
: nullable ANode) is abstract
22 # Replace itself with an other node in the AST
23 fun replace_with
(node
: ANode)
25 if (_parent
!= null) then
26 _parent
.replace_child
(self, node
)
30 # Visit all nodes in order.
31 # Thus, call "v.visit(e)" for each node e
32 fun visit_all
(v
: Visitor) is abstract
36 redef fun visit_all
(v
: Visitor) do end
37 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode) do end
41 redef fun replace_with
(n
: ANode)
49 # Abstract standard 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
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)
60 var old
= _current_node
66 # The current visited node
67 readable var _current_node
: nullable ANode = null
71 private init empty_init
do end
74 n_moduledecl
: nullable AModuledecl,
75 n_imports
: Collection[Object], # Should be Collection[AImport]
76 n_classdefs
: Collection[Object] # Should be Collection[AClassdef]
80 _n_moduledecl
= n_moduledecl
81 if n_moduledecl
!= null then
82 n_moduledecl
.parent
= self
89 for n
in n_classdefs
do
90 assert n
isa AClassdef
96 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
98 if _n_moduledecl
== old_child
then
99 if new_child
!= null then
100 new_child
.parent
= self
101 assert new_child
isa AModuledecl
102 _n_moduledecl
= new_child
108 for i
in [0.._n_imports
.length
[ do
109 if _n_imports
[i
] == old_child
then
110 if new_child
!= null then
111 assert new_child
isa AImport
112 _n_imports
[i
] = new_child
113 new_child
.parent
= self
115 _n_imports
.remove_at
(i
)
120 for i
in [0.._n_classdefs
.length
[ do
121 if _n_classdefs
[i
] == old_child
then
122 if new_child
!= null then
123 assert new_child
isa AClassdef
124 _n_classdefs
[i
] = new_child
125 new_child
.parent
= self
127 _n_classdefs
.remove_at
(i
)
134 redef fun visit_all
(v
: Visitor)
136 if _n_moduledecl
!= null then
137 v
.enter_visit
(_n_moduledecl
.as(not null))
139 for n
in _n_imports
do
142 for n
in _n_classdefs
do
147 redef class AModuledecl
148 private init empty_init
do end
150 init init_amoduledecl
(
151 n_doc
: nullable ADoc,
152 n_kwmodule
: nullable TKwmodule,
158 if n_doc
!= null then
161 _n_kwmodule
= n_kwmodule
.as(not null)
162 n_kwmodule
.parent
= self
163 _n_id
= n_id
.as(not null)
167 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
169 if _n_doc
== old_child
then
170 if new_child
!= null then
171 new_child
.parent
= self
172 assert new_child
isa ADoc
179 if _n_kwmodule
== old_child
then
180 if new_child
!= null then
181 new_child
.parent
= self
182 assert new_child
isa TKwmodule
183 _n_kwmodule
= new_child
189 if _n_id
== old_child
then
190 if new_child
!= null then
191 new_child
.parent
= self
192 assert new_child
isa TId
201 redef fun visit_all
(v
: Visitor)
203 if _n_doc
!= null then
204 v
.enter_visit
(_n_doc
.as(not null))
206 v
.enter_visit
(_n_kwmodule
)
210 redef class AStdImport
211 private init empty_init
do end
213 init init_astdimport
(
214 n_visibility
: nullable AVisibility,
215 n_kwimport
: nullable TKwimport,
220 _n_visibility
= n_visibility
.as(not null)
221 n_visibility
.parent
= self
222 _n_kwimport
= n_kwimport
.as(not null)
223 n_kwimport
.parent
= self
224 _n_id
= n_id
.as(not null)
228 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
230 if _n_visibility
== old_child
then
231 if new_child
!= null then
232 new_child
.parent
= self
233 assert new_child
isa AVisibility
234 _n_visibility
= new_child
240 if _n_kwimport
== old_child
then
241 if new_child
!= null then
242 new_child
.parent
= self
243 assert new_child
isa TKwimport
244 _n_kwimport
= new_child
250 if _n_id
== old_child
then
251 if new_child
!= null then
252 new_child
.parent
= self
253 assert new_child
isa TId
262 redef fun visit_all
(v
: Visitor)
264 v
.enter_visit
(_n_visibility
)
265 v
.enter_visit
(_n_kwimport
)
269 redef class ANoImport
270 private init empty_init
do end
272 init init_anoimport
(
273 n_visibility
: nullable AVisibility,
274 n_kwimport
: nullable TKwimport,
275 n_kwend
: nullable TKwend
279 _n_visibility
= n_visibility
.as(not null)
280 n_visibility
.parent
= self
281 _n_kwimport
= n_kwimport
.as(not null)
282 n_kwimport
.parent
= self
283 _n_kwend
= n_kwend
.as(not null)
284 n_kwend
.parent
= self
287 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
289 if _n_visibility
== old_child
then
290 if new_child
!= null then
291 new_child
.parent
= self
292 assert new_child
isa AVisibility
293 _n_visibility
= new_child
299 if _n_kwimport
== old_child
then
300 if new_child
!= null then
301 new_child
.parent
= self
302 assert new_child
isa TKwimport
303 _n_kwimport
= new_child
309 if _n_kwend
== old_child
then
310 if new_child
!= null then
311 new_child
.parent
= self
312 assert new_child
isa TKwend
321 redef fun visit_all
(v
: Visitor)
323 v
.enter_visit
(_n_visibility
)
324 v
.enter_visit
(_n_kwimport
)
325 v
.enter_visit
(_n_kwend
)
328 redef class APublicVisibility
329 private init empty_init
do end
331 init init_apublicvisibility
336 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
340 redef fun visit_all
(v
: Visitor)
344 redef class APrivateVisibility
345 private init empty_init
do end
347 init init_aprivatevisibility
(
348 n_kwprivate
: nullable TKwprivate
352 _n_kwprivate
= n_kwprivate
.as(not null)
353 n_kwprivate
.parent
= self
356 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
358 if _n_kwprivate
== old_child
then
359 if new_child
!= null then
360 new_child
.parent
= self
361 assert new_child
isa TKwprivate
362 _n_kwprivate
= new_child
370 redef fun visit_all
(v
: Visitor)
372 v
.enter_visit
(_n_kwprivate
)
375 redef class AProtectedVisibility
376 private init empty_init
do end
378 init init_aprotectedvisibility
(
379 n_kwprotected
: nullable TKwprotected
383 _n_kwprotected
= n_kwprotected
.as(not null)
384 n_kwprotected
.parent
= self
387 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
389 if _n_kwprotected
== old_child
then
390 if new_child
!= null then
391 new_child
.parent
= self
392 assert new_child
isa TKwprotected
393 _n_kwprotected
= new_child
401 redef fun visit_all
(v
: Visitor)
403 v
.enter_visit
(_n_kwprotected
)
406 redef class AIntrudeVisibility
407 private init empty_init
do end
409 init init_aintrudevisibility
(
410 n_kwintrude
: nullable TKwintrude
414 _n_kwintrude
= n_kwintrude
.as(not null)
415 n_kwintrude
.parent
= self
418 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
420 if _n_kwintrude
== old_child
then
421 if new_child
!= null then
422 new_child
.parent
= self
423 assert new_child
isa TKwintrude
424 _n_kwintrude
= new_child
432 redef fun visit_all
(v
: Visitor)
434 v
.enter_visit
(_n_kwintrude
)
437 redef class AStdClassdef
438 private init empty_init
do end
440 init init_astdclassdef
(
441 n_doc
: nullable ADoc,
442 n_kwredef
: nullable TKwredef,
443 n_visibility
: nullable AVisibility,
444 n_classkind
: nullable AClasskind,
445 n_id
: nullable TClassid,
446 n_formaldefs
: Collection[Object], # Should be Collection[AFormaldef]
447 n_superclasses
: Collection[Object], # Should be Collection[ASuperclass]
448 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
453 if n_doc
!= null then
456 _n_kwredef
= n_kwredef
457 if n_kwredef
!= null then
458 n_kwredef
.parent
= self
460 _n_visibility
= n_visibility
.as(not null)
461 n_visibility
.parent
= self
462 _n_classkind
= n_classkind
.as(not null)
463 n_classkind
.parent
= self
468 for n
in n_formaldefs
do
469 assert n
isa AFormaldef
473 for n
in n_superclasses
do
474 assert n
isa ASuperclass
475 _n_superclasses
.add
(n
)
478 for n
in n_propdefs
do
479 assert n
isa APropdef
485 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
487 if _n_doc
== old_child
then
488 if new_child
!= null then
489 new_child
.parent
= self
490 assert new_child
isa ADoc
497 if _n_kwredef
== old_child
then
498 if new_child
!= null then
499 new_child
.parent
= self
500 assert new_child
isa TKwredef
501 _n_kwredef
= new_child
507 if _n_visibility
== old_child
then
508 if new_child
!= null then
509 new_child
.parent
= self
510 assert new_child
isa AVisibility
511 _n_visibility
= new_child
517 if _n_classkind
== old_child
then
518 if new_child
!= null then
519 new_child
.parent
= self
520 assert new_child
isa AClasskind
521 _n_classkind
= new_child
527 if _n_id
== old_child
then
528 if new_child
!= null then
529 new_child
.parent
= self
530 assert new_child
isa TClassid
537 for i
in [0.._n_formaldefs
.length
[ do
538 if _n_formaldefs
[i
] == old_child
then
539 if new_child
!= null then
540 assert new_child
isa AFormaldef
541 _n_formaldefs
[i
] = new_child
542 new_child
.parent
= self
544 _n_formaldefs
.remove_at
(i
)
549 for i
in [0.._n_superclasses
.length
[ do
550 if _n_superclasses
[i
] == old_child
then
551 if new_child
!= null then
552 assert new_child
isa ASuperclass
553 _n_superclasses
[i
] = new_child
554 new_child
.parent
= self
556 _n_superclasses
.remove_at
(i
)
561 for i
in [0.._n_propdefs
.length
[ do
562 if _n_propdefs
[i
] == old_child
then
563 if new_child
!= null then
564 assert new_child
isa APropdef
565 _n_propdefs
[i
] = new_child
566 new_child
.parent
= self
568 _n_propdefs
.remove_at
(i
)
575 redef fun visit_all
(v
: Visitor)
577 if _n_doc
!= null then
578 v
.enter_visit
(_n_doc
.as(not null))
580 if _n_kwredef
!= null then
581 v
.enter_visit
(_n_kwredef
.as(not null))
583 v
.enter_visit
(_n_visibility
)
584 v
.enter_visit
(_n_classkind
)
585 if _n_id
!= null then
586 v
.enter_visit
(_n_id
.as(not null))
588 for n
in _n_formaldefs
do
591 for n
in _n_superclasses
do
594 for n
in _n_propdefs
do
599 redef class ATopClassdef
600 private init empty_init
do end
602 init init_atopclassdef
(
603 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
607 for n
in n_propdefs
do
608 assert n
isa APropdef
614 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
616 for i
in [0.._n_propdefs
.length
[ do
617 if _n_propdefs
[i
] == old_child
then
618 if new_child
!= null then
619 assert new_child
isa APropdef
620 _n_propdefs
[i
] = new_child
621 new_child
.parent
= self
623 _n_propdefs
.remove_at
(i
)
630 redef fun visit_all
(v
: Visitor)
632 for n
in _n_propdefs
do
637 redef class AMainClassdef
638 private init empty_init
do end
640 init init_amainclassdef
(
641 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
645 for n
in n_propdefs
do
646 assert n
isa APropdef
652 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
654 for i
in [0.._n_propdefs
.length
[ do
655 if _n_propdefs
[i
] == old_child
then
656 if new_child
!= null then
657 assert new_child
isa APropdef
658 _n_propdefs
[i
] = new_child
659 new_child
.parent
= self
661 _n_propdefs
.remove_at
(i
)
668 redef fun visit_all
(v
: Visitor)
670 for n
in _n_propdefs
do
675 redef class AConcreteClasskind
676 private init empty_init
do end
678 init init_aconcreteclasskind
(
679 n_kwclass
: nullable TKwclass
683 _n_kwclass
= n_kwclass
.as(not null)
684 n_kwclass
.parent
= self
687 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
689 if _n_kwclass
== old_child
then
690 if new_child
!= null then
691 new_child
.parent
= self
692 assert new_child
isa TKwclass
693 _n_kwclass
= new_child
701 redef fun visit_all
(v
: Visitor)
703 v
.enter_visit
(_n_kwclass
)
706 redef class AAbstractClasskind
707 private init empty_init
do end
709 init init_aabstractclasskind
(
710 n_kwabstract
: nullable TKwabstract,
711 n_kwclass
: nullable TKwclass
715 _n_kwabstract
= n_kwabstract
.as(not null)
716 n_kwabstract
.parent
= self
717 _n_kwclass
= n_kwclass
.as(not null)
718 n_kwclass
.parent
= self
721 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
723 if _n_kwabstract
== old_child
then
724 if new_child
!= null then
725 new_child
.parent
= self
726 assert new_child
isa TKwabstract
727 _n_kwabstract
= new_child
733 if _n_kwclass
== old_child
then
734 if new_child
!= null then
735 new_child
.parent
= self
736 assert new_child
isa TKwclass
737 _n_kwclass
= new_child
745 redef fun visit_all
(v
: Visitor)
747 v
.enter_visit
(_n_kwabstract
)
748 v
.enter_visit
(_n_kwclass
)
751 redef class AInterfaceClasskind
752 private init empty_init
do end
754 init init_ainterfaceclasskind
(
755 n_kwinterface
: nullable TKwinterface
759 _n_kwinterface
= n_kwinterface
.as(not null)
760 n_kwinterface
.parent
= self
763 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
765 if _n_kwinterface
== old_child
then
766 if new_child
!= null then
767 new_child
.parent
= self
768 assert new_child
isa TKwinterface
769 _n_kwinterface
= new_child
777 redef fun visit_all
(v
: Visitor)
779 v
.enter_visit
(_n_kwinterface
)
782 redef class AEnumClasskind
783 private init empty_init
do end
785 init init_aenumclasskind
(
786 n_kwenum
: nullable TKwenum
790 _n_kwenum
= n_kwenum
.as(not null)
791 n_kwenum
.parent
= self
794 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
796 if _n_kwenum
== old_child
then
797 if new_child
!= null then
798 new_child
.parent
= self
799 assert new_child
isa TKwenum
800 _n_kwenum
= new_child
808 redef fun visit_all
(v
: Visitor)
810 v
.enter_visit
(_n_kwenum
)
813 redef class AFormaldef
814 private init empty_init
do end
816 init init_aformaldef
(
817 n_id
: nullable TClassid,
818 n_type
: nullable AType
822 _n_id
= n_id
.as(not null)
825 if n_type
!= null then
830 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
832 if _n_id
== old_child
then
833 if new_child
!= null then
834 new_child
.parent
= self
835 assert new_child
isa TClassid
842 if _n_type
== old_child
then
843 if new_child
!= null then
844 new_child
.parent
= self
845 assert new_child
isa AType
854 redef fun visit_all
(v
: Visitor)
857 if _n_type
!= null then
858 v
.enter_visit
(_n_type
.as(not null))
862 redef class ASuperclass
863 private init empty_init
do end
865 init init_asuperclass
(
866 n_kwspecial
: nullable TKwspecial,
867 n_kwsuper
: nullable TKwsuper,
868 n_type
: nullable AType
872 _n_kwspecial
= n_kwspecial
873 if n_kwspecial
!= null then
874 n_kwspecial
.parent
= self
876 _n_kwsuper
= n_kwsuper
877 if n_kwsuper
!= null then
878 n_kwsuper
.parent
= self
880 _n_type
= n_type
.as(not null)
884 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
886 if _n_kwspecial
== old_child
then
887 if new_child
!= null then
888 new_child
.parent
= self
889 assert new_child
isa TKwspecial
890 _n_kwspecial
= new_child
896 if _n_kwsuper
== old_child
then
897 if new_child
!= null then
898 new_child
.parent
= self
899 assert new_child
isa TKwsuper
900 _n_kwsuper
= new_child
906 if _n_type
== old_child
then
907 if new_child
!= null then
908 new_child
.parent
= self
909 assert new_child
isa AType
918 redef fun visit_all
(v
: Visitor)
920 if _n_kwspecial
!= null then
921 v
.enter_visit
(_n_kwspecial
.as(not null))
923 if _n_kwsuper
!= null then
924 v
.enter_visit
(_n_kwsuper
.as(not null))
926 v
.enter_visit
(_n_type
)
929 redef class AAttrPropdef
930 private init empty_init
do end
932 init init_aattrpropdef
(
933 n_doc
: nullable ADoc,
934 n_readable
: nullable AAble,
935 n_writable
: nullable AAble,
936 n_kwredef
: nullable TKwredef,
937 n_visibility
: nullable AVisibility,
938 n_kwvar
: nullable TKwvar,
939 n_id
: nullable TAttrid,
941 n_type
: nullable AType,
942 n_expr
: nullable AExpr
947 if n_doc
!= null then
950 _n_readable
= n_readable
951 if n_readable
!= null then
952 n_readable
.parent
= self
954 _n_writable
= n_writable
955 if n_writable
!= null then
956 n_writable
.parent
= self
958 _n_kwredef
= n_kwredef
959 if n_kwredef
!= null then
960 n_kwredef
.parent
= self
962 _n_visibility
= n_visibility
.as(not null)
963 n_visibility
.parent
= self
964 _n_kwvar
= n_kwvar
.as(not null)
965 n_kwvar
.parent
= self
971 if n_id2
!= null then
975 if n_type
!= null then
979 if n_expr
!= null then
984 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
986 if _n_doc
== old_child
then
987 if new_child
!= null then
988 new_child
.parent
= self
989 assert new_child
isa ADoc
996 if _n_readable
== old_child
then
997 if new_child
!= null then
998 new_child
.parent
= self
999 assert new_child
isa AAble
1000 _n_readable
= new_child
1006 if _n_writable
== old_child
then
1007 if new_child
!= null then
1008 new_child
.parent
= self
1009 assert new_child
isa AAble
1010 _n_writable
= new_child
1016 if _n_kwredef
== old_child
then
1017 if new_child
!= null then
1018 new_child
.parent
= self
1019 assert new_child
isa TKwredef
1020 _n_kwredef
= new_child
1026 if _n_visibility
== old_child
then
1027 if new_child
!= null then
1028 new_child
.parent
= self
1029 assert new_child
isa AVisibility
1030 _n_visibility
= new_child
1036 if _n_kwvar
== old_child
then
1037 if new_child
!= null then
1038 new_child
.parent
= self
1039 assert new_child
isa TKwvar
1040 _n_kwvar
= new_child
1046 if _n_id
== old_child
then
1047 if new_child
!= null then
1048 new_child
.parent
= self
1049 assert new_child
isa TAttrid
1056 if _n_id2
== old_child
then
1057 if new_child
!= null then
1058 new_child
.parent
= self
1059 assert new_child
isa TId
1066 if _n_type
== old_child
then
1067 if new_child
!= null then
1068 new_child
.parent
= self
1069 assert new_child
isa AType
1076 if _n_expr
== old_child
then
1077 if new_child
!= null then
1078 new_child
.parent
= self
1079 assert new_child
isa AExpr
1088 redef fun visit_all
(v
: Visitor)
1090 if _n_doc
!= null then
1091 v
.enter_visit
(_n_doc
.as(not null))
1093 if _n_readable
!= null then
1094 v
.enter_visit
(_n_readable
.as(not null))
1096 if _n_writable
!= null then
1097 v
.enter_visit
(_n_writable
.as(not null))
1099 if _n_kwredef
!= null then
1100 v
.enter_visit
(_n_kwredef
.as(not null))
1102 v
.enter_visit
(_n_visibility
)
1103 v
.enter_visit
(_n_kwvar
)
1104 if _n_id
!= null then
1105 v
.enter_visit
(_n_id
.as(not null))
1107 if _n_id2
!= null then
1108 v
.enter_visit
(_n_id2
.as(not null))
1110 if _n_type
!= null then
1111 v
.enter_visit
(_n_type
.as(not null))
1113 if _n_expr
!= null then
1114 v
.enter_visit
(_n_expr
.as(not null))
1118 redef class AMethPropdef
1119 private init empty_init
do end
1121 init init_amethpropdef
(
1122 n_doc
: nullable ADoc,
1123 n_kwredef
: nullable TKwredef,
1124 n_visibility
: nullable AVisibility,
1125 n_methid
: nullable AMethid,
1126 n_signature
: nullable ASignature
1131 if n_doc
!= null then
1134 _n_kwredef
= n_kwredef
1135 if n_kwredef
!= null then
1136 n_kwredef
.parent
= self
1138 _n_visibility
= n_visibility
.as(not null)
1139 n_visibility
.parent
= self
1140 _n_methid
= n_methid
.as(not null)
1141 n_methid
.parent
= self
1142 _n_signature
= n_signature
.as(not null)
1143 n_signature
.parent
= self
1146 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1148 if _n_doc
== old_child
then
1149 if new_child
!= null then
1150 new_child
.parent
= self
1151 assert new_child
isa ADoc
1158 if _n_kwredef
== old_child
then
1159 if new_child
!= null then
1160 new_child
.parent
= self
1161 assert new_child
isa TKwredef
1162 _n_kwredef
= new_child
1168 if _n_visibility
== old_child
then
1169 if new_child
!= null then
1170 new_child
.parent
= self
1171 assert new_child
isa AVisibility
1172 _n_visibility
= new_child
1178 if _n_methid
== old_child
then
1179 if new_child
!= null then
1180 new_child
.parent
= self
1181 assert new_child
isa AMethid
1182 _n_methid
= new_child
1188 if _n_signature
== old_child
then
1189 if new_child
!= null then
1190 new_child
.parent
= self
1191 assert new_child
isa ASignature
1192 _n_signature
= new_child
1200 redef fun visit_all
(v
: Visitor)
1202 if _n_doc
!= null then
1203 v
.enter_visit
(_n_doc
.as(not null))
1205 if _n_kwredef
!= null then
1206 v
.enter_visit
(_n_kwredef
.as(not null))
1208 v
.enter_visit
(_n_visibility
)
1209 v
.enter_visit
(_n_methid
)
1210 v
.enter_visit
(_n_signature
)
1213 redef class ADeferredMethPropdef
1214 private init empty_init
do end
1216 init init_adeferredmethpropdef
(
1217 n_doc
: nullable ADoc,
1218 n_kwredef
: nullable TKwredef,
1219 n_visibility
: nullable AVisibility,
1220 n_kwmeth
: nullable TKwmeth,
1221 n_methid
: nullable AMethid,
1222 n_signature
: nullable ASignature
1227 if n_doc
!= null then
1230 _n_kwredef
= n_kwredef
1231 if n_kwredef
!= null then
1232 n_kwredef
.parent
= self
1234 _n_visibility
= n_visibility
.as(not null)
1235 n_visibility
.parent
= self
1236 _n_kwmeth
= n_kwmeth
.as(not null)
1237 n_kwmeth
.parent
= self
1238 _n_methid
= n_methid
.as(not null)
1239 n_methid
.parent
= self
1240 _n_signature
= n_signature
.as(not null)
1241 n_signature
.parent
= self
1244 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1246 if _n_doc
== old_child
then
1247 if new_child
!= null then
1248 new_child
.parent
= self
1249 assert new_child
isa ADoc
1256 if _n_kwredef
== old_child
then
1257 if new_child
!= null then
1258 new_child
.parent
= self
1259 assert new_child
isa TKwredef
1260 _n_kwredef
= new_child
1266 if _n_visibility
== old_child
then
1267 if new_child
!= null then
1268 new_child
.parent
= self
1269 assert new_child
isa AVisibility
1270 _n_visibility
= new_child
1276 if _n_kwmeth
== old_child
then
1277 if new_child
!= null then
1278 new_child
.parent
= self
1279 assert new_child
isa TKwmeth
1280 _n_kwmeth
= new_child
1286 if _n_methid
== old_child
then
1287 if new_child
!= null then
1288 new_child
.parent
= self
1289 assert new_child
isa AMethid
1290 _n_methid
= new_child
1296 if _n_signature
== old_child
then
1297 if new_child
!= null then
1298 new_child
.parent
= self
1299 assert new_child
isa ASignature
1300 _n_signature
= new_child
1308 redef fun visit_all
(v
: Visitor)
1310 if _n_doc
!= null then
1311 v
.enter_visit
(_n_doc
.as(not null))
1313 if _n_kwredef
!= null then
1314 v
.enter_visit
(_n_kwredef
.as(not null))
1316 v
.enter_visit
(_n_visibility
)
1317 v
.enter_visit
(_n_kwmeth
)
1318 v
.enter_visit
(_n_methid
)
1319 v
.enter_visit
(_n_signature
)
1322 redef class AInternMethPropdef
1323 private init empty_init
do end
1325 init init_ainternmethpropdef
(
1326 n_doc
: nullable ADoc,
1327 n_kwredef
: nullable TKwredef,
1328 n_visibility
: nullable AVisibility,
1329 n_kwmeth
: nullable TKwmeth,
1330 n_methid
: nullable AMethid,
1331 n_signature
: nullable ASignature
1336 if n_doc
!= null then
1339 _n_kwredef
= n_kwredef
1340 if n_kwredef
!= null then
1341 n_kwredef
.parent
= self
1343 _n_visibility
= n_visibility
.as(not null)
1344 n_visibility
.parent
= self
1345 _n_kwmeth
= n_kwmeth
.as(not null)
1346 n_kwmeth
.parent
= self
1347 _n_methid
= n_methid
.as(not null)
1348 n_methid
.parent
= self
1349 _n_signature
= n_signature
.as(not null)
1350 n_signature
.parent
= self
1353 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1355 if _n_doc
== old_child
then
1356 if new_child
!= null then
1357 new_child
.parent
= self
1358 assert new_child
isa ADoc
1365 if _n_kwredef
== old_child
then
1366 if new_child
!= null then
1367 new_child
.parent
= self
1368 assert new_child
isa TKwredef
1369 _n_kwredef
= new_child
1375 if _n_visibility
== old_child
then
1376 if new_child
!= null then
1377 new_child
.parent
= self
1378 assert new_child
isa AVisibility
1379 _n_visibility
= new_child
1385 if _n_kwmeth
== old_child
then
1386 if new_child
!= null then
1387 new_child
.parent
= self
1388 assert new_child
isa TKwmeth
1389 _n_kwmeth
= new_child
1395 if _n_methid
== old_child
then
1396 if new_child
!= null then
1397 new_child
.parent
= self
1398 assert new_child
isa AMethid
1399 _n_methid
= new_child
1405 if _n_signature
== old_child
then
1406 if new_child
!= null then
1407 new_child
.parent
= self
1408 assert new_child
isa ASignature
1409 _n_signature
= new_child
1417 redef fun visit_all
(v
: Visitor)
1419 if _n_doc
!= null then
1420 v
.enter_visit
(_n_doc
.as(not null))
1422 if _n_kwredef
!= null then
1423 v
.enter_visit
(_n_kwredef
.as(not null))
1425 v
.enter_visit
(_n_visibility
)
1426 v
.enter_visit
(_n_kwmeth
)
1427 v
.enter_visit
(_n_methid
)
1428 v
.enter_visit
(_n_signature
)
1431 redef class AExternMethPropdef
1432 private init empty_init
do end
1434 init init_aexternmethpropdef
(
1435 n_doc
: nullable ADoc,
1436 n_kwredef
: nullable TKwredef,
1437 n_visibility
: nullable AVisibility,
1438 n_kwmeth
: nullable TKwmeth,
1439 n_methid
: nullable AMethid,
1440 n_signature
: nullable ASignature,
1441 n_extern
: nullable TString
1446 if n_doc
!= null then
1449 _n_kwredef
= n_kwredef
1450 if n_kwredef
!= null then
1451 n_kwredef
.parent
= self
1453 _n_visibility
= n_visibility
.as(not null)
1454 n_visibility
.parent
= self
1455 _n_kwmeth
= n_kwmeth
.as(not null)
1456 n_kwmeth
.parent
= self
1457 _n_methid
= n_methid
.as(not null)
1458 n_methid
.parent
= self
1459 _n_signature
= n_signature
.as(not null)
1460 n_signature
.parent
= self
1461 _n_extern
= n_extern
1462 if n_extern
!= null then
1463 n_extern
.parent
= self
1467 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1469 if _n_doc
== old_child
then
1470 if new_child
!= null then
1471 new_child
.parent
= self
1472 assert new_child
isa ADoc
1479 if _n_kwredef
== old_child
then
1480 if new_child
!= null then
1481 new_child
.parent
= self
1482 assert new_child
isa TKwredef
1483 _n_kwredef
= new_child
1489 if _n_visibility
== old_child
then
1490 if new_child
!= null then
1491 new_child
.parent
= self
1492 assert new_child
isa AVisibility
1493 _n_visibility
= new_child
1499 if _n_kwmeth
== old_child
then
1500 if new_child
!= null then
1501 new_child
.parent
= self
1502 assert new_child
isa TKwmeth
1503 _n_kwmeth
= new_child
1509 if _n_methid
== old_child
then
1510 if new_child
!= null then
1511 new_child
.parent
= self
1512 assert new_child
isa AMethid
1513 _n_methid
= new_child
1519 if _n_signature
== old_child
then
1520 if new_child
!= null then
1521 new_child
.parent
= self
1522 assert new_child
isa ASignature
1523 _n_signature
= new_child
1529 if _n_extern
== old_child
then
1530 if new_child
!= null then
1531 new_child
.parent
= self
1532 assert new_child
isa TString
1533 _n_extern
= new_child
1541 redef fun visit_all
(v
: Visitor)
1543 if _n_doc
!= null then
1544 v
.enter_visit
(_n_doc
.as(not null))
1546 if _n_kwredef
!= null then
1547 v
.enter_visit
(_n_kwredef
.as(not null))
1549 v
.enter_visit
(_n_visibility
)
1550 v
.enter_visit
(_n_kwmeth
)
1551 v
.enter_visit
(_n_methid
)
1552 v
.enter_visit
(_n_signature
)
1553 if _n_extern
!= null then
1554 v
.enter_visit
(_n_extern
.as(not null))
1558 redef class AConcreteMethPropdef
1559 private init empty_init
do end
1561 init init_aconcretemethpropdef
(
1562 n_doc
: nullable ADoc,
1563 n_kwredef
: nullable TKwredef,
1564 n_visibility
: nullable AVisibility,
1565 n_kwmeth
: nullable TKwmeth,
1566 n_methid
: nullable AMethid,
1567 n_signature
: nullable ASignature,
1568 n_block
: nullable AExpr
1573 if n_doc
!= null then
1576 _n_kwredef
= n_kwredef
1577 if n_kwredef
!= null then
1578 n_kwredef
.parent
= self
1580 _n_visibility
= n_visibility
.as(not null)
1581 n_visibility
.parent
= self
1582 _n_kwmeth
= n_kwmeth
.as(not null)
1583 n_kwmeth
.parent
= self
1584 _n_methid
= n_methid
.as(not null)
1585 n_methid
.parent
= self
1586 _n_signature
= n_signature
.as(not null)
1587 n_signature
.parent
= self
1589 if n_block
!= null then
1590 n_block
.parent
= self
1594 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1596 if _n_doc
== old_child
then
1597 if new_child
!= null then
1598 new_child
.parent
= self
1599 assert new_child
isa ADoc
1606 if _n_kwredef
== old_child
then
1607 if new_child
!= null then
1608 new_child
.parent
= self
1609 assert new_child
isa TKwredef
1610 _n_kwredef
= new_child
1616 if _n_visibility
== old_child
then
1617 if new_child
!= null then
1618 new_child
.parent
= self
1619 assert new_child
isa AVisibility
1620 _n_visibility
= new_child
1626 if _n_kwmeth
== old_child
then
1627 if new_child
!= null then
1628 new_child
.parent
= self
1629 assert new_child
isa TKwmeth
1630 _n_kwmeth
= new_child
1636 if _n_methid
== old_child
then
1637 if new_child
!= null then
1638 new_child
.parent
= self
1639 assert new_child
isa AMethid
1640 _n_methid
= new_child
1646 if _n_signature
== old_child
then
1647 if new_child
!= null then
1648 new_child
.parent
= self
1649 assert new_child
isa ASignature
1650 _n_signature
= new_child
1656 if _n_block
== old_child
then
1657 if new_child
!= null then
1658 new_child
.parent
= self
1659 assert new_child
isa AExpr
1660 _n_block
= new_child
1668 redef fun visit_all
(v
: Visitor)
1670 if _n_doc
!= null then
1671 v
.enter_visit
(_n_doc
.as(not null))
1673 if _n_kwredef
!= null then
1674 v
.enter_visit
(_n_kwredef
.as(not null))
1676 v
.enter_visit
(_n_visibility
)
1677 v
.enter_visit
(_n_kwmeth
)
1678 v
.enter_visit
(_n_methid
)
1679 v
.enter_visit
(_n_signature
)
1680 if _n_block
!= null then
1681 v
.enter_visit
(_n_block
.as(not null))
1685 redef class AConcreteInitPropdef
1686 private init empty_init
do end
1688 init init_aconcreteinitpropdef
(
1689 n_doc
: nullable ADoc,
1690 n_kwredef
: nullable TKwredef,
1691 n_visibility
: nullable AVisibility,
1692 n_kwinit
: nullable TKwinit,
1693 n_methid
: nullable AMethid,
1694 n_signature
: nullable ASignature,
1695 n_block
: nullable AExpr
1700 if n_doc
!= null then
1703 _n_kwredef
= n_kwredef
1704 if n_kwredef
!= null then
1705 n_kwredef
.parent
= self
1707 _n_visibility
= n_visibility
.as(not null)
1708 n_visibility
.parent
= self
1709 _n_kwinit
= n_kwinit
.as(not null)
1710 n_kwinit
.parent
= self
1711 _n_methid
= n_methid
1712 if n_methid
!= null then
1713 n_methid
.parent
= self
1715 _n_signature
= n_signature
.as(not null)
1716 n_signature
.parent
= self
1718 if n_block
!= null then
1719 n_block
.parent
= self
1723 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1725 if _n_doc
== old_child
then
1726 if new_child
!= null then
1727 new_child
.parent
= self
1728 assert new_child
isa ADoc
1735 if _n_kwredef
== old_child
then
1736 if new_child
!= null then
1737 new_child
.parent
= self
1738 assert new_child
isa TKwredef
1739 _n_kwredef
= new_child
1745 if _n_visibility
== old_child
then
1746 if new_child
!= null then
1747 new_child
.parent
= self
1748 assert new_child
isa AVisibility
1749 _n_visibility
= new_child
1755 if _n_kwinit
== old_child
then
1756 if new_child
!= null then
1757 new_child
.parent
= self
1758 assert new_child
isa TKwinit
1759 _n_kwinit
= new_child
1765 if _n_methid
== old_child
then
1766 if new_child
!= null then
1767 new_child
.parent
= self
1768 assert new_child
isa AMethid
1769 _n_methid
= new_child
1775 if _n_signature
== old_child
then
1776 if new_child
!= null then
1777 new_child
.parent
= self
1778 assert new_child
isa ASignature
1779 _n_signature
= new_child
1785 if _n_block
== old_child
then
1786 if new_child
!= null then
1787 new_child
.parent
= self
1788 assert new_child
isa AExpr
1789 _n_block
= new_child
1797 redef fun visit_all
(v
: Visitor)
1799 if _n_doc
!= null then
1800 v
.enter_visit
(_n_doc
.as(not null))
1802 if _n_kwredef
!= null then
1803 v
.enter_visit
(_n_kwredef
.as(not null))
1805 v
.enter_visit
(_n_visibility
)
1806 v
.enter_visit
(_n_kwinit
)
1807 if _n_methid
!= null then
1808 v
.enter_visit
(_n_methid
.as(not null))
1810 v
.enter_visit
(_n_signature
)
1811 if _n_block
!= null then
1812 v
.enter_visit
(_n_block
.as(not null))
1816 redef class AMainMethPropdef
1817 private init empty_init
do end
1819 init init_amainmethpropdef
(
1820 n_kwredef
: nullable TKwredef,
1821 n_block
: nullable AExpr
1825 _n_kwredef
= n_kwredef
1826 if n_kwredef
!= null then
1827 n_kwredef
.parent
= self
1830 if n_block
!= null then
1831 n_block
.parent
= self
1835 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1837 if _n_kwredef
== old_child
then
1838 if new_child
!= null then
1839 new_child
.parent
= self
1840 assert new_child
isa TKwredef
1841 _n_kwredef
= new_child
1847 if _n_block
== old_child
then
1848 if new_child
!= null then
1849 new_child
.parent
= self
1850 assert new_child
isa AExpr
1851 _n_block
= new_child
1859 redef fun visit_all
(v
: Visitor)
1861 if _n_kwredef
!= null then
1862 v
.enter_visit
(_n_kwredef
.as(not null))
1864 if _n_block
!= null then
1865 v
.enter_visit
(_n_block
.as(not null))
1869 redef class ATypePropdef
1870 private init empty_init
do end
1872 init init_atypepropdef
(
1873 n_doc
: nullable ADoc,
1874 n_kwredef
: nullable TKwredef,
1875 n_visibility
: nullable AVisibility,
1876 n_kwtype
: nullable TKwtype,
1877 n_id
: nullable TClassid,
1878 n_type
: nullable AType
1883 if n_doc
!= null then
1886 _n_kwredef
= n_kwredef
1887 if n_kwredef
!= null then
1888 n_kwredef
.parent
= self
1890 _n_visibility
= n_visibility
.as(not null)
1891 n_visibility
.parent
= self
1892 _n_kwtype
= n_kwtype
.as(not null)
1893 n_kwtype
.parent
= self
1894 _n_id
= n_id
.as(not null)
1896 _n_type
= n_type
.as(not null)
1897 n_type
.parent
= self
1900 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1902 if _n_doc
== old_child
then
1903 if new_child
!= null then
1904 new_child
.parent
= self
1905 assert new_child
isa ADoc
1912 if _n_kwredef
== old_child
then
1913 if new_child
!= null then
1914 new_child
.parent
= self
1915 assert new_child
isa TKwredef
1916 _n_kwredef
= new_child
1922 if _n_visibility
== old_child
then
1923 if new_child
!= null then
1924 new_child
.parent
= self
1925 assert new_child
isa AVisibility
1926 _n_visibility
= new_child
1932 if _n_kwtype
== old_child
then
1933 if new_child
!= null then
1934 new_child
.parent
= self
1935 assert new_child
isa TKwtype
1936 _n_kwtype
= new_child
1942 if _n_id
== old_child
then
1943 if new_child
!= null then
1944 new_child
.parent
= self
1945 assert new_child
isa TClassid
1952 if _n_type
== old_child
then
1953 if new_child
!= null then
1954 new_child
.parent
= self
1955 assert new_child
isa AType
1964 redef fun visit_all
(v
: Visitor)
1966 if _n_doc
!= null then
1967 v
.enter_visit
(_n_doc
.as(not null))
1969 if _n_kwredef
!= null then
1970 v
.enter_visit
(_n_kwredef
.as(not null))
1972 v
.enter_visit
(_n_visibility
)
1973 v
.enter_visit
(_n_kwtype
)
1974 v
.enter_visit
(_n_id
)
1975 v
.enter_visit
(_n_type
)
1978 redef class AReadAble
1979 private init empty_init
do end
1981 init init_areadable
(
1982 n_kwredef
: nullable TKwredef,
1983 n_kwreadable
: nullable TKwreadable
1987 _n_kwredef
= n_kwredef
1988 if n_kwredef
!= null then
1989 n_kwredef
.parent
= self
1991 _n_kwreadable
= n_kwreadable
.as(not null)
1992 n_kwreadable
.parent
= self
1995 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1997 if _n_kwredef
== old_child
then
1998 if new_child
!= null then
1999 new_child
.parent
= self
2000 assert new_child
isa TKwredef
2001 _n_kwredef
= new_child
2007 if _n_kwreadable
== old_child
then
2008 if new_child
!= null then
2009 new_child
.parent
= self
2010 assert new_child
isa TKwreadable
2011 _n_kwreadable
= new_child
2019 redef fun visit_all
(v
: Visitor)
2021 if _n_kwredef
!= null then
2022 v
.enter_visit
(_n_kwredef
.as(not null))
2024 v
.enter_visit
(_n_kwreadable
)
2027 redef class AWriteAble
2028 private init empty_init
do end
2030 init init_awriteable
(
2031 n_kwredef
: nullable TKwredef,
2032 n_visibility
: nullable AVisibility,
2033 n_kwwritable
: nullable TKwwritable
2037 _n_kwredef
= n_kwredef
2038 if n_kwredef
!= null then
2039 n_kwredef
.parent
= self
2041 _n_visibility
= n_visibility
2042 if n_visibility
!= null then
2043 n_visibility
.parent
= self
2045 _n_kwwritable
= n_kwwritable
.as(not null)
2046 n_kwwritable
.parent
= self
2049 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2051 if _n_kwredef
== old_child
then
2052 if new_child
!= null then
2053 new_child
.parent
= self
2054 assert new_child
isa TKwredef
2055 _n_kwredef
= new_child
2061 if _n_visibility
== old_child
then
2062 if new_child
!= null then
2063 new_child
.parent
= self
2064 assert new_child
isa AVisibility
2065 _n_visibility
= new_child
2067 _n_visibility
= null
2071 if _n_kwwritable
== old_child
then
2072 if new_child
!= null then
2073 new_child
.parent
= self
2074 assert new_child
isa TKwwritable
2075 _n_kwwritable
= new_child
2083 redef fun visit_all
(v
: Visitor)
2085 if _n_kwredef
!= null then
2086 v
.enter_visit
(_n_kwredef
.as(not null))
2088 if _n_visibility
!= null then
2089 v
.enter_visit
(_n_visibility
.as(not null))
2091 v
.enter_visit
(_n_kwwritable
)
2094 redef class AIdMethid
2095 private init empty_init
do end
2097 init init_aidmethid
(
2102 _n_id
= n_id
.as(not null)
2106 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2108 if _n_id
== old_child
then
2109 if new_child
!= null then
2110 new_child
.parent
= self
2111 assert new_child
isa TId
2120 redef fun visit_all
(v
: Visitor)
2122 v
.enter_visit
(_n_id
)
2125 redef class APlusMethid
2126 private init empty_init
do end
2128 init init_aplusmethid
(
2129 n_plus
: nullable TPlus
2133 _n_plus
= n_plus
.as(not null)
2134 n_plus
.parent
= self
2137 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2139 if _n_plus
== old_child
then
2140 if new_child
!= null then
2141 new_child
.parent
= self
2142 assert new_child
isa TPlus
2151 redef fun visit_all
(v
: Visitor)
2153 v
.enter_visit
(_n_plus
)
2156 redef class AMinusMethid
2157 private init empty_init
do end
2159 init init_aminusmethid
(
2160 n_minus
: nullable TMinus
2164 _n_minus
= n_minus
.as(not null)
2165 n_minus
.parent
= self
2168 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2170 if _n_minus
== old_child
then
2171 if new_child
!= null then
2172 new_child
.parent
= self
2173 assert new_child
isa TMinus
2174 _n_minus
= new_child
2182 redef fun visit_all
(v
: Visitor)
2184 v
.enter_visit
(_n_minus
)
2187 redef class AStarMethid
2188 private init empty_init
do end
2190 init init_astarmethid
(
2191 n_star
: nullable TStar
2195 _n_star
= n_star
.as(not null)
2196 n_star
.parent
= self
2199 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2201 if _n_star
== old_child
then
2202 if new_child
!= null then
2203 new_child
.parent
= self
2204 assert new_child
isa TStar
2213 redef fun visit_all
(v
: Visitor)
2215 v
.enter_visit
(_n_star
)
2218 redef class ASlashMethid
2219 private init empty_init
do end
2221 init init_aslashmethid
(
2222 n_slash
: nullable TSlash
2226 _n_slash
= n_slash
.as(not null)
2227 n_slash
.parent
= self
2230 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2232 if _n_slash
== old_child
then
2233 if new_child
!= null then
2234 new_child
.parent
= self
2235 assert new_child
isa TSlash
2236 _n_slash
= new_child
2244 redef fun visit_all
(v
: Visitor)
2246 v
.enter_visit
(_n_slash
)
2249 redef class APercentMethid
2250 private init empty_init
do end
2252 init init_apercentmethid
(
2253 n_percent
: nullable TPercent
2257 _n_percent
= n_percent
.as(not null)
2258 n_percent
.parent
= self
2261 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2263 if _n_percent
== old_child
then
2264 if new_child
!= null then
2265 new_child
.parent
= self
2266 assert new_child
isa TPercent
2267 _n_percent
= new_child
2275 redef fun visit_all
(v
: Visitor)
2277 v
.enter_visit
(_n_percent
)
2280 redef class AEqMethid
2281 private init empty_init
do end
2283 init init_aeqmethid
(
2288 _n_eq
= n_eq
.as(not null)
2292 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2294 if _n_eq
== old_child
then
2295 if new_child
!= null then
2296 new_child
.parent
= self
2297 assert new_child
isa TEq
2306 redef fun visit_all
(v
: Visitor)
2308 v
.enter_visit
(_n_eq
)
2311 redef class ANeMethid
2312 private init empty_init
do end
2314 init init_anemethid
(
2319 _n_ne
= n_ne
.as(not null)
2323 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2325 if _n_ne
== old_child
then
2326 if new_child
!= null then
2327 new_child
.parent
= self
2328 assert new_child
isa TNe
2337 redef fun visit_all
(v
: Visitor)
2339 v
.enter_visit
(_n_ne
)
2342 redef class ALeMethid
2343 private init empty_init
do end
2345 init init_alemethid
(
2350 _n_le
= n_le
.as(not null)
2354 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2356 if _n_le
== old_child
then
2357 if new_child
!= null then
2358 new_child
.parent
= self
2359 assert new_child
isa TLe
2368 redef fun visit_all
(v
: Visitor)
2370 v
.enter_visit
(_n_le
)
2373 redef class AGeMethid
2374 private init empty_init
do end
2376 init init_agemethid
(
2381 _n_ge
= n_ge
.as(not null)
2385 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2387 if _n_ge
== old_child
then
2388 if new_child
!= null then
2389 new_child
.parent
= self
2390 assert new_child
isa TGe
2399 redef fun visit_all
(v
: Visitor)
2401 v
.enter_visit
(_n_ge
)
2404 redef class ALtMethid
2405 private init empty_init
do end
2407 init init_altmethid
(
2412 _n_lt
= n_lt
.as(not null)
2416 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2418 if _n_lt
== old_child
then
2419 if new_child
!= null then
2420 new_child
.parent
= self
2421 assert new_child
isa TLt
2430 redef fun visit_all
(v
: Visitor)
2432 v
.enter_visit
(_n_lt
)
2435 redef class AGtMethid
2436 private init empty_init
do end
2438 init init_agtmethid
(
2443 _n_gt
= n_gt
.as(not null)
2447 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2449 if _n_gt
== old_child
then
2450 if new_child
!= null then
2451 new_child
.parent
= self
2452 assert new_child
isa TGt
2461 redef fun visit_all
(v
: Visitor)
2463 v
.enter_visit
(_n_gt
)
2466 redef class ALlMethid
2467 private init empty_init
do end
2469 init init_allmethid
(
2474 _n_ll
= n_ll
.as(not null)
2478 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2480 if _n_ll
== old_child
then
2481 if new_child
!= null then
2482 new_child
.parent
= self
2483 assert new_child
isa TLl
2492 redef fun visit_all
(v
: Visitor)
2494 v
.enter_visit
(_n_ll
)
2497 redef class AGgMethid
2498 private init empty_init
do end
2500 init init_aggmethid
(
2505 _n_gg
= n_gg
.as(not null)
2509 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2511 if _n_gg
== old_child
then
2512 if new_child
!= null then
2513 new_child
.parent
= self
2514 assert new_child
isa TGg
2523 redef fun visit_all
(v
: Visitor)
2525 v
.enter_visit
(_n_gg
)
2528 redef class ABraMethid
2529 private init empty_init
do end
2531 init init_abramethid
(
2532 n_obra
: nullable TObra,
2533 n_cbra
: nullable TCbra
2537 _n_obra
= n_obra
.as(not null)
2538 n_obra
.parent
= self
2539 _n_cbra
= n_cbra
.as(not null)
2540 n_cbra
.parent
= self
2543 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2545 if _n_obra
== old_child
then
2546 if new_child
!= null then
2547 new_child
.parent
= self
2548 assert new_child
isa TObra
2555 if _n_cbra
== old_child
then
2556 if new_child
!= null then
2557 new_child
.parent
= self
2558 assert new_child
isa TCbra
2567 redef fun visit_all
(v
: Visitor)
2569 v
.enter_visit
(_n_obra
)
2570 v
.enter_visit
(_n_cbra
)
2573 redef class AStarshipMethid
2574 private init empty_init
do end
2576 init init_astarshipmethid
(
2577 n_starship
: nullable TStarship
2581 _n_starship
= n_starship
.as(not null)
2582 n_starship
.parent
= self
2585 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2587 if _n_starship
== old_child
then
2588 if new_child
!= null then
2589 new_child
.parent
= self
2590 assert new_child
isa TStarship
2591 _n_starship
= new_child
2599 redef fun visit_all
(v
: Visitor)
2601 v
.enter_visit
(_n_starship
)
2604 redef class AAssignMethid
2605 private init empty_init
do end
2607 init init_aassignmethid
(
2609 n_assign
: nullable TAssign
2613 _n_id
= n_id
.as(not null)
2615 _n_assign
= n_assign
.as(not null)
2616 n_assign
.parent
= self
2619 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2621 if _n_id
== old_child
then
2622 if new_child
!= null then
2623 new_child
.parent
= self
2624 assert new_child
isa TId
2631 if _n_assign
== old_child
then
2632 if new_child
!= null then
2633 new_child
.parent
= self
2634 assert new_child
isa TAssign
2635 _n_assign
= new_child
2643 redef fun visit_all
(v
: Visitor)
2645 v
.enter_visit
(_n_id
)
2646 v
.enter_visit
(_n_assign
)
2649 redef class ABraassignMethid
2650 private init empty_init
do end
2652 init init_abraassignmethid
(
2653 n_obra
: nullable TObra,
2654 n_cbra
: nullable TCbra,
2655 n_assign
: nullable TAssign
2659 _n_obra
= n_obra
.as(not null)
2660 n_obra
.parent
= self
2661 _n_cbra
= n_cbra
.as(not null)
2662 n_cbra
.parent
= self
2663 _n_assign
= n_assign
.as(not null)
2664 n_assign
.parent
= self
2667 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2669 if _n_obra
== old_child
then
2670 if new_child
!= null then
2671 new_child
.parent
= self
2672 assert new_child
isa TObra
2679 if _n_cbra
== old_child
then
2680 if new_child
!= null then
2681 new_child
.parent
= self
2682 assert new_child
isa TCbra
2689 if _n_assign
== old_child
then
2690 if new_child
!= null then
2691 new_child
.parent
= self
2692 assert new_child
isa TAssign
2693 _n_assign
= new_child
2701 redef fun visit_all
(v
: Visitor)
2703 v
.enter_visit
(_n_obra
)
2704 v
.enter_visit
(_n_cbra
)
2705 v
.enter_visit
(_n_assign
)
2708 redef class ASignature
2709 private init empty_init
do end
2711 init init_asignature
(
2712 n_params
: Collection[Object], # Should be Collection[AParam]
2713 n_type
: nullable AType,
2714 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2718 for n
in n_params
do
2724 if n_type
!= null then
2725 n_type
.parent
= self
2727 for n
in n_closure_decls
do
2728 assert n
isa AClosureDecl
2729 _n_closure_decls
.add
(n
)
2734 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2736 for i
in [0.._n_params
.length
[ do
2737 if _n_params
[i
] == old_child
then
2738 if new_child
!= null then
2739 assert new_child
isa AParam
2740 _n_params
[i
] = new_child
2741 new_child
.parent
= self
2743 _n_params
.remove_at
(i
)
2748 if _n_type
== old_child
then
2749 if new_child
!= null then
2750 new_child
.parent
= self
2751 assert new_child
isa AType
2758 for i
in [0.._n_closure_decls
.length
[ do
2759 if _n_closure_decls
[i
] == old_child
then
2760 if new_child
!= null then
2761 assert new_child
isa AClosureDecl
2762 _n_closure_decls
[i
] = new_child
2763 new_child
.parent
= self
2765 _n_closure_decls
.remove_at
(i
)
2772 redef fun visit_all
(v
: Visitor)
2774 for n
in _n_params
do
2777 if _n_type
!= null then
2778 v
.enter_visit
(_n_type
.as(not null))
2780 for n
in _n_closure_decls
do
2786 private init empty_init
do end
2790 n_type
: nullable AType,
2791 n_dotdotdot
: nullable TDotdotdot
2795 _n_id
= n_id
.as(not null)
2798 if n_type
!= null then
2799 n_type
.parent
= self
2801 _n_dotdotdot
= n_dotdotdot
2802 if n_dotdotdot
!= null then
2803 n_dotdotdot
.parent
= self
2807 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2809 if _n_id
== old_child
then
2810 if new_child
!= null then
2811 new_child
.parent
= self
2812 assert new_child
isa TId
2819 if _n_type
== old_child
then
2820 if new_child
!= null then
2821 new_child
.parent
= self
2822 assert new_child
isa AType
2829 if _n_dotdotdot
== old_child
then
2830 if new_child
!= null then
2831 new_child
.parent
= self
2832 assert new_child
isa TDotdotdot
2833 _n_dotdotdot
= new_child
2841 redef fun visit_all
(v
: Visitor)
2843 v
.enter_visit
(_n_id
)
2844 if _n_type
!= null then
2845 v
.enter_visit
(_n_type
.as(not null))
2847 if _n_dotdotdot
!= null then
2848 v
.enter_visit
(_n_dotdotdot
.as(not null))
2852 redef class AClosureDecl
2853 private init empty_init
do end
2855 init init_aclosuredecl
(
2856 n_kwbreak
: nullable TKwbreak,
2857 n_bang
: nullable TBang,
2859 n_signature
: nullable ASignature,
2860 n_expr
: nullable AExpr
2864 _n_kwbreak
= n_kwbreak
2865 if n_kwbreak
!= null then
2866 n_kwbreak
.parent
= self
2868 _n_bang
= n_bang
.as(not null)
2869 n_bang
.parent
= self
2870 _n_id
= n_id
.as(not null)
2872 _n_signature
= n_signature
.as(not null)
2873 n_signature
.parent
= self
2875 if n_expr
!= null then
2876 n_expr
.parent
= self
2880 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2882 if _n_kwbreak
== old_child
then
2883 if new_child
!= null then
2884 new_child
.parent
= self
2885 assert new_child
isa TKwbreak
2886 _n_kwbreak
= new_child
2892 if _n_bang
== old_child
then
2893 if new_child
!= null then
2894 new_child
.parent
= self
2895 assert new_child
isa TBang
2902 if _n_id
== old_child
then
2903 if new_child
!= null then
2904 new_child
.parent
= self
2905 assert new_child
isa TId
2912 if _n_signature
== old_child
then
2913 if new_child
!= null then
2914 new_child
.parent
= self
2915 assert new_child
isa ASignature
2916 _n_signature
= new_child
2922 if _n_expr
== old_child
then
2923 if new_child
!= null then
2924 new_child
.parent
= self
2925 assert new_child
isa AExpr
2934 redef fun visit_all
(v
: Visitor)
2936 if _n_kwbreak
!= null then
2937 v
.enter_visit
(_n_kwbreak
.as(not null))
2939 v
.enter_visit
(_n_bang
)
2940 v
.enter_visit
(_n_id
)
2941 v
.enter_visit
(_n_signature
)
2942 if _n_expr
!= null then
2943 v
.enter_visit
(_n_expr
.as(not null))
2948 private init empty_init
do end
2951 n_kwnullable
: nullable TKwnullable,
2952 n_id
: nullable TClassid,
2953 n_types
: Collection[Object] # Should be Collection[AType]
2957 _n_kwnullable
= n_kwnullable
2958 if n_kwnullable
!= null then
2959 n_kwnullable
.parent
= self
2961 _n_id
= n_id
.as(not null)
2970 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2972 if _n_kwnullable
== old_child
then
2973 if new_child
!= null then
2974 new_child
.parent
= self
2975 assert new_child
isa TKwnullable
2976 _n_kwnullable
= new_child
2978 _n_kwnullable
= null
2982 if _n_id
== old_child
then
2983 if new_child
!= null then
2984 new_child
.parent
= self
2985 assert new_child
isa TClassid
2992 for i
in [0.._n_types
.length
[ do
2993 if _n_types
[i
] == old_child
then
2994 if new_child
!= null then
2995 assert new_child
isa AType
2996 _n_types
[i
] = new_child
2997 new_child
.parent
= self
2999 _n_types
.remove_at
(i
)
3006 redef fun visit_all
(v
: Visitor)
3008 if _n_kwnullable
!= null then
3009 v
.enter_visit
(_n_kwnullable
.as(not null))
3011 v
.enter_visit
(_n_id
)
3012 for n
in _n_types
do
3018 private init empty_init
do end
3021 n_kwlabel
: nullable TKwlabel,
3026 _n_kwlabel
= n_kwlabel
.as(not null)
3027 n_kwlabel
.parent
= self
3028 _n_id
= n_id
.as(not null)
3032 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3034 if _n_kwlabel
== old_child
then
3035 if new_child
!= null then
3036 new_child
.parent
= self
3037 assert new_child
isa TKwlabel
3038 _n_kwlabel
= new_child
3044 if _n_id
== old_child
then
3045 if new_child
!= null then
3046 new_child
.parent
= self
3047 assert new_child
isa TId
3056 redef fun visit_all
(v
: Visitor)
3058 v
.enter_visit
(_n_kwlabel
)
3059 v
.enter_visit
(_n_id
)
3062 redef class ABlockExpr
3063 private init empty_init
do end
3065 init init_ablockexpr
(
3066 n_expr
: Collection[Object] # Should be Collection[AExpr]
3077 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3079 for i
in [0.._n_expr
.length
[ do
3080 if _n_expr
[i
] == old_child
then
3081 if new_child
!= null then
3082 assert new_child
isa AExpr
3083 _n_expr
[i
] = new_child
3084 new_child
.parent
= self
3086 _n_expr
.remove_at
(i
)
3093 redef fun visit_all
(v
: Visitor)
3100 redef class AVardeclExpr
3101 private init empty_init
do end
3103 init init_avardeclexpr
(
3104 n_kwvar
: nullable TKwvar,
3106 n_type
: nullable AType,
3107 n_assign
: nullable TAssign,
3108 n_expr
: nullable AExpr
3112 _n_kwvar
= n_kwvar
.as(not null)
3113 n_kwvar
.parent
= self
3114 _n_id
= n_id
.as(not null)
3117 if n_type
!= null then
3118 n_type
.parent
= self
3120 _n_assign
= n_assign
3121 if n_assign
!= null then
3122 n_assign
.parent
= self
3125 if n_expr
!= null then
3126 n_expr
.parent
= self
3130 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3132 if _n_kwvar
== old_child
then
3133 if new_child
!= null then
3134 new_child
.parent
= self
3135 assert new_child
isa TKwvar
3136 _n_kwvar
= new_child
3142 if _n_id
== old_child
then
3143 if new_child
!= null then
3144 new_child
.parent
= self
3145 assert new_child
isa TId
3152 if _n_type
== old_child
then
3153 if new_child
!= null then
3154 new_child
.parent
= self
3155 assert new_child
isa AType
3162 if _n_assign
== old_child
then
3163 if new_child
!= null then
3164 new_child
.parent
= self
3165 assert new_child
isa TAssign
3166 _n_assign
= new_child
3172 if _n_expr
== old_child
then
3173 if new_child
!= null then
3174 new_child
.parent
= self
3175 assert new_child
isa AExpr
3184 redef fun visit_all
(v
: Visitor)
3186 v
.enter_visit
(_n_kwvar
)
3187 v
.enter_visit
(_n_id
)
3188 if _n_type
!= null then
3189 v
.enter_visit
(_n_type
.as(not null))
3191 if _n_assign
!= null then
3192 v
.enter_visit
(_n_assign
.as(not null))
3194 if _n_expr
!= null then
3195 v
.enter_visit
(_n_expr
.as(not null))
3199 redef class AReturnExpr
3200 private init empty_init
do end
3202 init init_areturnexpr
(
3203 n_kwreturn
: nullable TKwreturn,
3204 n_expr
: nullable AExpr
3208 _n_kwreturn
= n_kwreturn
3209 if n_kwreturn
!= null then
3210 n_kwreturn
.parent
= self
3213 if n_expr
!= null then
3214 n_expr
.parent
= self
3218 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3220 if _n_kwreturn
== old_child
then
3221 if new_child
!= null then
3222 new_child
.parent
= self
3223 assert new_child
isa TKwreturn
3224 _n_kwreturn
= new_child
3230 if _n_expr
== old_child
then
3231 if new_child
!= null then
3232 new_child
.parent
= self
3233 assert new_child
isa AExpr
3242 redef fun visit_all
(v
: Visitor)
3244 if _n_kwreturn
!= null then
3245 v
.enter_visit
(_n_kwreturn
.as(not null))
3247 if _n_expr
!= null then
3248 v
.enter_visit
(_n_expr
.as(not null))
3252 redef class ABreakExpr
3253 private init empty_init
do end
3255 init init_abreakexpr
(
3256 n_kwbreak
: nullable TKwbreak,
3257 n_label
: nullable ALabel,
3258 n_expr
: nullable AExpr
3262 _n_kwbreak
= n_kwbreak
.as(not null)
3263 n_kwbreak
.parent
= self
3265 if n_label
!= null then
3266 n_label
.parent
= self
3269 if n_expr
!= null then
3270 n_expr
.parent
= self
3274 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3276 if _n_kwbreak
== old_child
then
3277 if new_child
!= null then
3278 new_child
.parent
= self
3279 assert new_child
isa TKwbreak
3280 _n_kwbreak
= new_child
3286 if _n_label
== old_child
then
3287 if new_child
!= null then
3288 new_child
.parent
= self
3289 assert new_child
isa ALabel
3290 _n_label
= new_child
3296 if _n_expr
== old_child
then
3297 if new_child
!= null then
3298 new_child
.parent
= self
3299 assert new_child
isa AExpr
3308 redef fun visit_all
(v
: Visitor)
3310 v
.enter_visit
(_n_kwbreak
)
3311 if _n_label
!= null then
3312 v
.enter_visit
(_n_label
.as(not null))
3314 if _n_expr
!= null then
3315 v
.enter_visit
(_n_expr
.as(not null))
3319 redef class AAbortExpr
3320 private init empty_init
do end
3322 init init_aabortexpr
(
3323 n_kwabort
: nullable TKwabort
3327 _n_kwabort
= n_kwabort
.as(not null)
3328 n_kwabort
.parent
= self
3331 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3333 if _n_kwabort
== old_child
then
3334 if new_child
!= null then
3335 new_child
.parent
= self
3336 assert new_child
isa TKwabort
3337 _n_kwabort
= new_child
3345 redef fun visit_all
(v
: Visitor)
3347 v
.enter_visit
(_n_kwabort
)
3350 redef class AContinueExpr
3351 private init empty_init
do end
3353 init init_acontinueexpr
(
3354 n_kwcontinue
: nullable TKwcontinue,
3355 n_label
: nullable ALabel,
3356 n_expr
: nullable AExpr
3360 _n_kwcontinue
= n_kwcontinue
3361 if n_kwcontinue
!= null then
3362 n_kwcontinue
.parent
= self
3365 if n_label
!= null then
3366 n_label
.parent
= self
3369 if n_expr
!= null then
3370 n_expr
.parent
= self
3374 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3376 if _n_kwcontinue
== old_child
then
3377 if new_child
!= null then
3378 new_child
.parent
= self
3379 assert new_child
isa TKwcontinue
3380 _n_kwcontinue
= new_child
3382 _n_kwcontinue
= null
3386 if _n_label
== old_child
then
3387 if new_child
!= null then
3388 new_child
.parent
= self
3389 assert new_child
isa ALabel
3390 _n_label
= new_child
3396 if _n_expr
== old_child
then
3397 if new_child
!= null then
3398 new_child
.parent
= self
3399 assert new_child
isa AExpr
3408 redef fun visit_all
(v
: Visitor)
3410 if _n_kwcontinue
!= null then
3411 v
.enter_visit
(_n_kwcontinue
.as(not null))
3413 if _n_label
!= null then
3414 v
.enter_visit
(_n_label
.as(not null))
3416 if _n_expr
!= null then
3417 v
.enter_visit
(_n_expr
.as(not null))
3422 private init empty_init
do end
3425 n_kwdo
: nullable TKwdo,
3426 n_block
: nullable AExpr,
3427 n_label
: nullable ALabel
3431 _n_kwdo
= n_kwdo
.as(not null)
3432 n_kwdo
.parent
= self
3434 if n_block
!= null then
3435 n_block
.parent
= self
3438 if n_label
!= null then
3439 n_label
.parent
= self
3443 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3445 if _n_kwdo
== old_child
then
3446 if new_child
!= null then
3447 new_child
.parent
= self
3448 assert new_child
isa TKwdo
3455 if _n_block
== old_child
then
3456 if new_child
!= null then
3457 new_child
.parent
= self
3458 assert new_child
isa AExpr
3459 _n_block
= new_child
3465 if _n_label
== old_child
then
3466 if new_child
!= null then
3467 new_child
.parent
= self
3468 assert new_child
isa ALabel
3469 _n_label
= new_child
3477 redef fun visit_all
(v
: Visitor)
3479 v
.enter_visit
(_n_kwdo
)
3480 if _n_block
!= null then
3481 v
.enter_visit
(_n_block
.as(not null))
3483 if _n_label
!= null then
3484 v
.enter_visit
(_n_label
.as(not null))
3489 private init empty_init
do end
3492 n_kwif
: nullable TKwif,
3493 n_expr
: nullable AExpr,
3494 n_then
: nullable AExpr,
3495 n_else
: nullable AExpr
3499 _n_kwif
= n_kwif
.as(not null)
3500 n_kwif
.parent
= self
3501 _n_expr
= n_expr
.as(not null)
3502 n_expr
.parent
= self
3504 if n_then
!= null then
3505 n_then
.parent
= self
3508 if n_else
!= null then
3509 n_else
.parent
= self
3513 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3515 if _n_kwif
== old_child
then
3516 if new_child
!= null then
3517 new_child
.parent
= self
3518 assert new_child
isa TKwif
3525 if _n_expr
== old_child
then
3526 if new_child
!= null then
3527 new_child
.parent
= self
3528 assert new_child
isa AExpr
3535 if _n_then
== old_child
then
3536 if new_child
!= null then
3537 new_child
.parent
= self
3538 assert new_child
isa AExpr
3545 if _n_else
== old_child
then
3546 if new_child
!= null then
3547 new_child
.parent
= self
3548 assert new_child
isa AExpr
3557 redef fun visit_all
(v
: Visitor)
3559 v
.enter_visit
(_n_kwif
)
3560 v
.enter_visit
(_n_expr
)
3561 if _n_then
!= null then
3562 v
.enter_visit
(_n_then
.as(not null))
3564 if _n_else
!= null then
3565 v
.enter_visit
(_n_else
.as(not null))
3569 redef class AIfexprExpr
3570 private init empty_init
do end
3572 init init_aifexprexpr
(
3573 n_kwif
: nullable TKwif,
3574 n_expr
: nullable AExpr,
3575 n_kwthen
: nullable TKwthen,
3576 n_then
: nullable AExpr,
3577 n_kwelse
: nullable TKwelse,
3578 n_else
: nullable AExpr
3582 _n_kwif
= n_kwif
.as(not null)
3583 n_kwif
.parent
= self
3584 _n_expr
= n_expr
.as(not null)
3585 n_expr
.parent
= self
3586 _n_kwthen
= n_kwthen
.as(not null)
3587 n_kwthen
.parent
= self
3588 _n_then
= n_then
.as(not null)
3589 n_then
.parent
= self
3590 _n_kwelse
= n_kwelse
.as(not null)
3591 n_kwelse
.parent
= self
3592 _n_else
= n_else
.as(not null)
3593 n_else
.parent
= self
3596 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3598 if _n_kwif
== old_child
then
3599 if new_child
!= null then
3600 new_child
.parent
= self
3601 assert new_child
isa TKwif
3608 if _n_expr
== old_child
then
3609 if new_child
!= null then
3610 new_child
.parent
= self
3611 assert new_child
isa AExpr
3618 if _n_kwthen
== old_child
then
3619 if new_child
!= null then
3620 new_child
.parent
= self
3621 assert new_child
isa TKwthen
3622 _n_kwthen
= new_child
3628 if _n_then
== old_child
then
3629 if new_child
!= null then
3630 new_child
.parent
= self
3631 assert new_child
isa AExpr
3638 if _n_kwelse
== old_child
then
3639 if new_child
!= null then
3640 new_child
.parent
= self
3641 assert new_child
isa TKwelse
3642 _n_kwelse
= new_child
3648 if _n_else
== old_child
then
3649 if new_child
!= null then
3650 new_child
.parent
= self
3651 assert new_child
isa AExpr
3660 redef fun visit_all
(v
: Visitor)
3662 v
.enter_visit
(_n_kwif
)
3663 v
.enter_visit
(_n_expr
)
3664 v
.enter_visit
(_n_kwthen
)
3665 v
.enter_visit
(_n_then
)
3666 v
.enter_visit
(_n_kwelse
)
3667 v
.enter_visit
(_n_else
)
3670 redef class AWhileExpr
3671 private init empty_init
do end
3673 init init_awhileexpr
(
3674 n_kwwhile
: nullable TKwwhile,
3675 n_expr
: nullable AExpr,
3676 n_kwdo
: nullable TKwdo,
3677 n_block
: nullable AExpr,
3678 n_label
: nullable ALabel
3682 _n_kwwhile
= n_kwwhile
.as(not null)
3683 n_kwwhile
.parent
= self
3684 _n_expr
= n_expr
.as(not null)
3685 n_expr
.parent
= self
3686 _n_kwdo
= n_kwdo
.as(not null)
3687 n_kwdo
.parent
= self
3689 if n_block
!= null then
3690 n_block
.parent
= self
3693 if n_label
!= null then
3694 n_label
.parent
= self
3698 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3700 if _n_kwwhile
== old_child
then
3701 if new_child
!= null then
3702 new_child
.parent
= self
3703 assert new_child
isa TKwwhile
3704 _n_kwwhile
= new_child
3710 if _n_expr
== old_child
then
3711 if new_child
!= null then
3712 new_child
.parent
= self
3713 assert new_child
isa AExpr
3720 if _n_kwdo
== old_child
then
3721 if new_child
!= null then
3722 new_child
.parent
= self
3723 assert new_child
isa TKwdo
3730 if _n_block
== old_child
then
3731 if new_child
!= null then
3732 new_child
.parent
= self
3733 assert new_child
isa AExpr
3734 _n_block
= new_child
3740 if _n_label
== old_child
then
3741 if new_child
!= null then
3742 new_child
.parent
= self
3743 assert new_child
isa ALabel
3744 _n_label
= new_child
3752 redef fun visit_all
(v
: Visitor)
3754 v
.enter_visit
(_n_kwwhile
)
3755 v
.enter_visit
(_n_expr
)
3756 v
.enter_visit
(_n_kwdo
)
3757 if _n_block
!= null then
3758 v
.enter_visit
(_n_block
.as(not null))
3760 if _n_label
!= null then
3761 v
.enter_visit
(_n_label
.as(not null))
3765 redef class ALoopExpr
3766 private init empty_init
do end
3768 init init_aloopexpr
(
3769 n_kwloop
: nullable TKwloop,
3770 n_block
: nullable AExpr,
3771 n_label
: nullable ALabel
3775 _n_kwloop
= n_kwloop
.as(not null)
3776 n_kwloop
.parent
= self
3778 if n_block
!= null then
3779 n_block
.parent
= self
3782 if n_label
!= null then
3783 n_label
.parent
= self
3787 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3789 if _n_kwloop
== old_child
then
3790 if new_child
!= null then
3791 new_child
.parent
= self
3792 assert new_child
isa TKwloop
3793 _n_kwloop
= new_child
3799 if _n_block
== old_child
then
3800 if new_child
!= null then
3801 new_child
.parent
= self
3802 assert new_child
isa AExpr
3803 _n_block
= new_child
3809 if _n_label
== old_child
then
3810 if new_child
!= null then
3811 new_child
.parent
= self
3812 assert new_child
isa ALabel
3813 _n_label
= new_child
3821 redef fun visit_all
(v
: Visitor)
3823 v
.enter_visit
(_n_kwloop
)
3824 if _n_block
!= null then
3825 v
.enter_visit
(_n_block
.as(not null))
3827 if _n_label
!= null then
3828 v
.enter_visit
(_n_label
.as(not null))
3832 redef class AForExpr
3833 private init empty_init
do end
3835 init init_aforexpr
(
3836 n_kwfor
: nullable TKwfor,
3837 n_ids
: Collection[Object], # Should be Collection[TId]
3838 n_expr
: nullable AExpr,
3839 n_kwdo
: nullable TKwdo,
3840 n_block
: nullable AExpr,
3841 n_label
: nullable ALabel
3845 _n_kwfor
= n_kwfor
.as(not null)
3846 n_kwfor
.parent
= self
3852 _n_expr
= n_expr
.as(not null)
3853 n_expr
.parent
= self
3854 _n_kwdo
= n_kwdo
.as(not null)
3855 n_kwdo
.parent
= self
3857 if n_block
!= null then
3858 n_block
.parent
= self
3861 if n_label
!= null then
3862 n_label
.parent
= self
3866 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3868 if _n_kwfor
== old_child
then
3869 if new_child
!= null then
3870 new_child
.parent
= self
3871 assert new_child
isa TKwfor
3872 _n_kwfor
= new_child
3878 for i
in [0.._n_ids
.length
[ do
3879 if _n_ids
[i
] == old_child
then
3880 if new_child
!= null then
3881 assert new_child
isa TId
3882 _n_ids
[i
] = new_child
3883 new_child
.parent
= self
3890 if _n_expr
== old_child
then
3891 if new_child
!= null then
3892 new_child
.parent
= self
3893 assert new_child
isa AExpr
3900 if _n_kwdo
== old_child
then
3901 if new_child
!= null then
3902 new_child
.parent
= self
3903 assert new_child
isa TKwdo
3910 if _n_block
== old_child
then
3911 if new_child
!= null then
3912 new_child
.parent
= self
3913 assert new_child
isa AExpr
3914 _n_block
= new_child
3920 if _n_label
== old_child
then
3921 if new_child
!= null then
3922 new_child
.parent
= self
3923 assert new_child
isa ALabel
3924 _n_label
= new_child
3932 redef fun visit_all
(v
: Visitor)
3934 v
.enter_visit
(_n_kwfor
)
3938 v
.enter_visit
(_n_expr
)
3939 v
.enter_visit
(_n_kwdo
)
3940 if _n_block
!= null then
3941 v
.enter_visit
(_n_block
.as(not null))
3943 if _n_label
!= null then
3944 v
.enter_visit
(_n_label
.as(not null))
3948 redef class AAssertExpr
3949 private init empty_init
do end
3951 init init_aassertexpr
(
3952 n_kwassert
: nullable TKwassert,
3954 n_expr
: nullable AExpr,
3955 n_else
: nullable AExpr
3959 _n_kwassert
= n_kwassert
.as(not null)
3960 n_kwassert
.parent
= self
3962 if n_id
!= null then
3965 _n_expr
= n_expr
.as(not null)
3966 n_expr
.parent
= self
3968 if n_else
!= null then
3969 n_else
.parent
= self
3973 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3975 if _n_kwassert
== old_child
then
3976 if new_child
!= null then
3977 new_child
.parent
= self
3978 assert new_child
isa TKwassert
3979 _n_kwassert
= new_child
3985 if _n_id
== old_child
then
3986 if new_child
!= null then
3987 new_child
.parent
= self
3988 assert new_child
isa TId
3995 if _n_expr
== old_child
then
3996 if new_child
!= null then
3997 new_child
.parent
= self
3998 assert new_child
isa AExpr
4005 if _n_else
== old_child
then
4006 if new_child
!= null then
4007 new_child
.parent
= self
4008 assert new_child
isa AExpr
4017 redef fun visit_all
(v
: Visitor)
4019 v
.enter_visit
(_n_kwassert
)
4020 if _n_id
!= null then
4021 v
.enter_visit
(_n_id
.as(not null))
4023 v
.enter_visit
(_n_expr
)
4024 if _n_else
!= null then
4025 v
.enter_visit
(_n_else
.as(not null))
4029 redef class AOnceExpr
4030 private init empty_init
do end
4032 init init_aonceexpr
(
4033 n_kwonce
: nullable TKwonce,
4034 n_expr
: nullable AExpr
4038 _n_kwonce
= n_kwonce
.as(not null)
4039 n_kwonce
.parent
= self
4040 _n_expr
= n_expr
.as(not null)
4041 n_expr
.parent
= self
4044 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4046 if _n_kwonce
== old_child
then
4047 if new_child
!= null then
4048 new_child
.parent
= self
4049 assert new_child
isa TKwonce
4050 _n_kwonce
= new_child
4056 if _n_expr
== old_child
then
4057 if new_child
!= null then
4058 new_child
.parent
= self
4059 assert new_child
isa AExpr
4068 redef fun visit_all
(v
: Visitor)
4070 v
.enter_visit
(_n_kwonce
)
4071 v
.enter_visit
(_n_expr
)
4074 redef class ASendExpr
4075 private init empty_init
do end
4077 init init_asendexpr
(
4078 n_expr
: nullable AExpr
4082 _n_expr
= n_expr
.as(not null)
4083 n_expr
.parent
= self
4086 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4088 if _n_expr
== old_child
then
4089 if new_child
!= null then
4090 new_child
.parent
= self
4091 assert new_child
isa AExpr
4100 redef fun visit_all
(v
: Visitor)
4102 v
.enter_visit
(_n_expr
)
4105 redef class ABinopExpr
4106 private init empty_init
do end
4108 init init_abinopexpr
(
4109 n_expr
: nullable AExpr,
4110 n_expr2
: nullable AExpr
4114 _n_expr
= n_expr
.as(not null)
4115 n_expr
.parent
= self
4116 _n_expr2
= n_expr2
.as(not null)
4117 n_expr2
.parent
= self
4120 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4122 if _n_expr
== old_child
then
4123 if new_child
!= null then
4124 new_child
.parent
= self
4125 assert new_child
isa AExpr
4132 if _n_expr2
== old_child
then
4133 if new_child
!= null then
4134 new_child
.parent
= self
4135 assert new_child
isa AExpr
4136 _n_expr2
= new_child
4144 redef fun visit_all
(v
: Visitor)
4146 v
.enter_visit
(_n_expr
)
4147 v
.enter_visit
(_n_expr2
)
4151 private init empty_init
do end
4154 n_expr
: nullable AExpr,
4155 n_expr2
: nullable AExpr
4159 _n_expr
= n_expr
.as(not null)
4160 n_expr
.parent
= self
4161 _n_expr2
= n_expr2
.as(not null)
4162 n_expr2
.parent
= self
4165 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4167 if _n_expr
== old_child
then
4168 if new_child
!= null then
4169 new_child
.parent
= self
4170 assert new_child
isa AExpr
4177 if _n_expr2
== old_child
then
4178 if new_child
!= null then
4179 new_child
.parent
= self
4180 assert new_child
isa AExpr
4181 _n_expr2
= new_child
4189 redef fun visit_all
(v
: Visitor)
4191 v
.enter_visit
(_n_expr
)
4192 v
.enter_visit
(_n_expr2
)
4195 redef class AAndExpr
4196 private init empty_init
do end
4198 init init_aandexpr
(
4199 n_expr
: nullable AExpr,
4200 n_expr2
: nullable AExpr
4204 _n_expr
= n_expr
.as(not null)
4205 n_expr
.parent
= self
4206 _n_expr2
= n_expr2
.as(not null)
4207 n_expr2
.parent
= self
4210 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4212 if _n_expr
== old_child
then
4213 if new_child
!= null then
4214 new_child
.parent
= self
4215 assert new_child
isa AExpr
4222 if _n_expr2
== old_child
then
4223 if new_child
!= null then
4224 new_child
.parent
= self
4225 assert new_child
isa AExpr
4226 _n_expr2
= new_child
4234 redef fun visit_all
(v
: Visitor)
4236 v
.enter_visit
(_n_expr
)
4237 v
.enter_visit
(_n_expr2
)
4240 redef class AOrElseExpr
4241 private init empty_init
do end
4243 init init_aorelseexpr
(
4244 n_expr
: nullable AExpr,
4245 n_expr2
: nullable AExpr
4249 _n_expr
= n_expr
.as(not null)
4250 n_expr
.parent
= self
4251 _n_expr2
= n_expr2
.as(not null)
4252 n_expr2
.parent
= self
4255 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4257 if _n_expr
== old_child
then
4258 if new_child
!= null then
4259 new_child
.parent
= self
4260 assert new_child
isa AExpr
4267 if _n_expr2
== old_child
then
4268 if new_child
!= null then
4269 new_child
.parent
= self
4270 assert new_child
isa AExpr
4271 _n_expr2
= new_child
4279 redef fun visit_all
(v
: Visitor)
4281 v
.enter_visit
(_n_expr
)
4282 v
.enter_visit
(_n_expr2
)
4285 redef class ANotExpr
4286 private init empty_init
do end
4288 init init_anotexpr
(
4289 n_kwnot
: nullable TKwnot,
4290 n_expr
: nullable AExpr
4294 _n_kwnot
= n_kwnot
.as(not null)
4295 n_kwnot
.parent
= self
4296 _n_expr
= n_expr
.as(not null)
4297 n_expr
.parent
= self
4300 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4302 if _n_kwnot
== old_child
then
4303 if new_child
!= null then
4304 new_child
.parent
= self
4305 assert new_child
isa TKwnot
4306 _n_kwnot
= new_child
4312 if _n_expr
== old_child
then
4313 if new_child
!= null then
4314 new_child
.parent
= self
4315 assert new_child
isa AExpr
4324 redef fun visit_all
(v
: Visitor)
4326 v
.enter_visit
(_n_kwnot
)
4327 v
.enter_visit
(_n_expr
)
4331 private init empty_init
do end
4334 n_expr
: nullable AExpr,
4335 n_expr2
: nullable AExpr
4339 _n_expr
= n_expr
.as(not null)
4340 n_expr
.parent
= self
4341 _n_expr2
= n_expr2
.as(not null)
4342 n_expr2
.parent
= self
4345 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4347 if _n_expr
== old_child
then
4348 if new_child
!= null then
4349 new_child
.parent
= self
4350 assert new_child
isa AExpr
4357 if _n_expr2
== old_child
then
4358 if new_child
!= null then
4359 new_child
.parent
= self
4360 assert new_child
isa AExpr
4361 _n_expr2
= new_child
4369 redef fun visit_all
(v
: Visitor)
4371 v
.enter_visit
(_n_expr
)
4372 v
.enter_visit
(_n_expr2
)
4376 private init empty_init
do end
4379 n_expr
: nullable AExpr,
4380 n_expr2
: nullable AExpr
4384 _n_expr
= n_expr
.as(not null)
4385 n_expr
.parent
= self
4386 _n_expr2
= n_expr2
.as(not null)
4387 n_expr2
.parent
= self
4390 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4392 if _n_expr
== old_child
then
4393 if new_child
!= null then
4394 new_child
.parent
= self
4395 assert new_child
isa AExpr
4402 if _n_expr2
== old_child
then
4403 if new_child
!= null then
4404 new_child
.parent
= self
4405 assert new_child
isa AExpr
4406 _n_expr2
= new_child
4414 redef fun visit_all
(v
: Visitor)
4416 v
.enter_visit
(_n_expr
)
4417 v
.enter_visit
(_n_expr2
)
4421 private init empty_init
do end
4424 n_expr
: nullable AExpr,
4425 n_expr2
: nullable AExpr
4429 _n_expr
= n_expr
.as(not null)
4430 n_expr
.parent
= self
4431 _n_expr2
= n_expr2
.as(not null)
4432 n_expr2
.parent
= self
4435 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4437 if _n_expr
== old_child
then
4438 if new_child
!= null then
4439 new_child
.parent
= self
4440 assert new_child
isa AExpr
4447 if _n_expr2
== old_child
then
4448 if new_child
!= null then
4449 new_child
.parent
= self
4450 assert new_child
isa AExpr
4451 _n_expr2
= new_child
4459 redef fun visit_all
(v
: Visitor)
4461 v
.enter_visit
(_n_expr
)
4462 v
.enter_visit
(_n_expr2
)
4466 private init empty_init
do end
4469 n_expr
: nullable AExpr,
4470 n_expr2
: nullable AExpr
4474 _n_expr
= n_expr
.as(not null)
4475 n_expr
.parent
= self
4476 _n_expr2
= n_expr2
.as(not null)
4477 n_expr2
.parent
= self
4480 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4482 if _n_expr
== old_child
then
4483 if new_child
!= null then
4484 new_child
.parent
= self
4485 assert new_child
isa AExpr
4492 if _n_expr2
== old_child
then
4493 if new_child
!= null then
4494 new_child
.parent
= self
4495 assert new_child
isa AExpr
4496 _n_expr2
= new_child
4504 redef fun visit_all
(v
: Visitor)
4506 v
.enter_visit
(_n_expr
)
4507 v
.enter_visit
(_n_expr2
)
4511 private init empty_init
do end
4514 n_expr
: nullable AExpr,
4515 n_expr2
: nullable AExpr
4519 _n_expr
= n_expr
.as(not null)
4520 n_expr
.parent
= self
4521 _n_expr2
= n_expr2
.as(not null)
4522 n_expr2
.parent
= self
4525 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4527 if _n_expr
== old_child
then
4528 if new_child
!= null then
4529 new_child
.parent
= self
4530 assert new_child
isa AExpr
4537 if _n_expr2
== old_child
then
4538 if new_child
!= null then
4539 new_child
.parent
= self
4540 assert new_child
isa AExpr
4541 _n_expr2
= new_child
4549 redef fun visit_all
(v
: Visitor)
4551 v
.enter_visit
(_n_expr
)
4552 v
.enter_visit
(_n_expr2
)
4556 private init empty_init
do end
4559 n_expr
: nullable AExpr,
4560 n_expr2
: nullable AExpr
4564 _n_expr
= n_expr
.as(not null)
4565 n_expr
.parent
= self
4566 _n_expr2
= n_expr2
.as(not null)
4567 n_expr2
.parent
= self
4570 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4572 if _n_expr
== old_child
then
4573 if new_child
!= null then
4574 new_child
.parent
= self
4575 assert new_child
isa AExpr
4582 if _n_expr2
== old_child
then
4583 if new_child
!= null then
4584 new_child
.parent
= self
4585 assert new_child
isa AExpr
4586 _n_expr2
= new_child
4594 redef fun visit_all
(v
: Visitor)
4596 v
.enter_visit
(_n_expr
)
4597 v
.enter_visit
(_n_expr2
)
4601 private init empty_init
do end
4604 n_expr
: nullable AExpr,
4605 n_expr2
: nullable AExpr
4609 _n_expr
= n_expr
.as(not null)
4610 n_expr
.parent
= self
4611 _n_expr2
= n_expr2
.as(not null)
4612 n_expr2
.parent
= self
4615 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4617 if _n_expr
== old_child
then
4618 if new_child
!= null then
4619 new_child
.parent
= self
4620 assert new_child
isa AExpr
4627 if _n_expr2
== old_child
then
4628 if new_child
!= null then
4629 new_child
.parent
= self
4630 assert new_child
isa AExpr
4631 _n_expr2
= new_child
4639 redef fun visit_all
(v
: Visitor)
4641 v
.enter_visit
(_n_expr
)
4642 v
.enter_visit
(_n_expr2
)
4646 private init empty_init
do end
4649 n_expr
: nullable AExpr,
4650 n_expr2
: nullable AExpr
4654 _n_expr
= n_expr
.as(not null)
4655 n_expr
.parent
= self
4656 _n_expr2
= n_expr2
.as(not null)
4657 n_expr2
.parent
= self
4660 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4662 if _n_expr
== old_child
then
4663 if new_child
!= null then
4664 new_child
.parent
= self
4665 assert new_child
isa AExpr
4672 if _n_expr2
== old_child
then
4673 if new_child
!= null then
4674 new_child
.parent
= self
4675 assert new_child
isa AExpr
4676 _n_expr2
= new_child
4684 redef fun visit_all
(v
: Visitor)
4686 v
.enter_visit
(_n_expr
)
4687 v
.enter_visit
(_n_expr2
)
4691 private init empty_init
do end
4694 n_expr
: nullable AExpr,
4695 n_expr2
: nullable AExpr
4699 _n_expr
= n_expr
.as(not null)
4700 n_expr
.parent
= self
4701 _n_expr2
= n_expr2
.as(not null)
4702 n_expr2
.parent
= self
4705 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4707 if _n_expr
== old_child
then
4708 if new_child
!= null then
4709 new_child
.parent
= self
4710 assert new_child
isa AExpr
4717 if _n_expr2
== old_child
then
4718 if new_child
!= null then
4719 new_child
.parent
= self
4720 assert new_child
isa AExpr
4721 _n_expr2
= new_child
4729 redef fun visit_all
(v
: Visitor)
4731 v
.enter_visit
(_n_expr
)
4732 v
.enter_visit
(_n_expr2
)
4735 redef class AIsaExpr
4736 private init empty_init
do end
4738 init init_aisaexpr
(
4739 n_expr
: nullable AExpr,
4740 n_type
: nullable AType
4744 _n_expr
= n_expr
.as(not null)
4745 n_expr
.parent
= self
4746 _n_type
= n_type
.as(not null)
4747 n_type
.parent
= self
4750 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4752 if _n_expr
== old_child
then
4753 if new_child
!= null then
4754 new_child
.parent
= self
4755 assert new_child
isa AExpr
4762 if _n_type
== old_child
then
4763 if new_child
!= null then
4764 new_child
.parent
= self
4765 assert new_child
isa AType
4774 redef fun visit_all
(v
: Visitor)
4776 v
.enter_visit
(_n_expr
)
4777 v
.enter_visit
(_n_type
)
4780 redef class APlusExpr
4781 private init empty_init
do end
4783 init init_aplusexpr
(
4784 n_expr
: nullable AExpr,
4785 n_expr2
: nullable AExpr
4789 _n_expr
= n_expr
.as(not null)
4790 n_expr
.parent
= self
4791 _n_expr2
= n_expr2
.as(not null)
4792 n_expr2
.parent
= self
4795 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4797 if _n_expr
== old_child
then
4798 if new_child
!= null then
4799 new_child
.parent
= self
4800 assert new_child
isa AExpr
4807 if _n_expr2
== old_child
then
4808 if new_child
!= null then
4809 new_child
.parent
= self
4810 assert new_child
isa AExpr
4811 _n_expr2
= new_child
4819 redef fun visit_all
(v
: Visitor)
4821 v
.enter_visit
(_n_expr
)
4822 v
.enter_visit
(_n_expr2
)
4825 redef class AMinusExpr
4826 private init empty_init
do end
4828 init init_aminusexpr
(
4829 n_expr
: nullable AExpr,
4830 n_expr2
: nullable AExpr
4834 _n_expr
= n_expr
.as(not null)
4835 n_expr
.parent
= self
4836 _n_expr2
= n_expr2
.as(not null)
4837 n_expr2
.parent
= self
4840 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4842 if _n_expr
== old_child
then
4843 if new_child
!= null then
4844 new_child
.parent
= self
4845 assert new_child
isa AExpr
4852 if _n_expr2
== old_child
then
4853 if new_child
!= null then
4854 new_child
.parent
= self
4855 assert new_child
isa AExpr
4856 _n_expr2
= new_child
4864 redef fun visit_all
(v
: Visitor)
4866 v
.enter_visit
(_n_expr
)
4867 v
.enter_visit
(_n_expr2
)
4870 redef class AStarshipExpr
4871 private init empty_init
do end
4873 init init_astarshipexpr
(
4874 n_expr
: nullable AExpr,
4875 n_expr2
: nullable AExpr
4879 _n_expr
= n_expr
.as(not null)
4880 n_expr
.parent
= self
4881 _n_expr2
= n_expr2
.as(not null)
4882 n_expr2
.parent
= self
4885 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4887 if _n_expr
== old_child
then
4888 if new_child
!= null then
4889 new_child
.parent
= self
4890 assert new_child
isa AExpr
4897 if _n_expr2
== old_child
then
4898 if new_child
!= null then
4899 new_child
.parent
= self
4900 assert new_child
isa AExpr
4901 _n_expr2
= new_child
4909 redef fun visit_all
(v
: Visitor)
4911 v
.enter_visit
(_n_expr
)
4912 v
.enter_visit
(_n_expr2
)
4915 redef class AStarExpr
4916 private init empty_init
do end
4918 init init_astarexpr
(
4919 n_expr
: nullable AExpr,
4920 n_expr2
: nullable AExpr
4924 _n_expr
= n_expr
.as(not null)
4925 n_expr
.parent
= self
4926 _n_expr2
= n_expr2
.as(not null)
4927 n_expr2
.parent
= self
4930 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4932 if _n_expr
== old_child
then
4933 if new_child
!= null then
4934 new_child
.parent
= self
4935 assert new_child
isa AExpr
4942 if _n_expr2
== old_child
then
4943 if new_child
!= null then
4944 new_child
.parent
= self
4945 assert new_child
isa AExpr
4946 _n_expr2
= new_child
4954 redef fun visit_all
(v
: Visitor)
4956 v
.enter_visit
(_n_expr
)
4957 v
.enter_visit
(_n_expr2
)
4960 redef class ASlashExpr
4961 private init empty_init
do end
4963 init init_aslashexpr
(
4964 n_expr
: nullable AExpr,
4965 n_expr2
: nullable AExpr
4969 _n_expr
= n_expr
.as(not null)
4970 n_expr
.parent
= self
4971 _n_expr2
= n_expr2
.as(not null)
4972 n_expr2
.parent
= self
4975 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4977 if _n_expr
== old_child
then
4978 if new_child
!= null then
4979 new_child
.parent
= self
4980 assert new_child
isa AExpr
4987 if _n_expr2
== old_child
then
4988 if new_child
!= null then
4989 new_child
.parent
= self
4990 assert new_child
isa AExpr
4991 _n_expr2
= new_child
4999 redef fun visit_all
(v
: Visitor)
5001 v
.enter_visit
(_n_expr
)
5002 v
.enter_visit
(_n_expr2
)
5005 redef class APercentExpr
5006 private init empty_init
do end
5008 init init_apercentexpr
(
5009 n_expr
: nullable AExpr,
5010 n_expr2
: nullable AExpr
5014 _n_expr
= n_expr
.as(not null)
5015 n_expr
.parent
= self
5016 _n_expr2
= n_expr2
.as(not null)
5017 n_expr2
.parent
= self
5020 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5022 if _n_expr
== old_child
then
5023 if new_child
!= null then
5024 new_child
.parent
= self
5025 assert new_child
isa AExpr
5032 if _n_expr2
== old_child
then
5033 if new_child
!= null then
5034 new_child
.parent
= self
5035 assert new_child
isa AExpr
5036 _n_expr2
= new_child
5044 redef fun visit_all
(v
: Visitor)
5046 v
.enter_visit
(_n_expr
)
5047 v
.enter_visit
(_n_expr2
)
5050 redef class AUminusExpr
5051 private init empty_init
do end
5053 init init_auminusexpr
(
5054 n_minus
: nullable TMinus,
5055 n_expr
: nullable AExpr
5059 _n_minus
= n_minus
.as(not null)
5060 n_minus
.parent
= self
5061 _n_expr
= n_expr
.as(not null)
5062 n_expr
.parent
= self
5065 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5067 if _n_minus
== old_child
then
5068 if new_child
!= null then
5069 new_child
.parent
= self
5070 assert new_child
isa TMinus
5071 _n_minus
= new_child
5077 if _n_expr
== old_child
then
5078 if new_child
!= null then
5079 new_child
.parent
= self
5080 assert new_child
isa AExpr
5089 redef fun visit_all
(v
: Visitor)
5091 v
.enter_visit
(_n_minus
)
5092 v
.enter_visit
(_n_expr
)
5095 redef class ANewExpr
5096 private init empty_init
do end
5098 init init_anewexpr
(
5099 n_kwnew
: nullable TKwnew,
5100 n_type
: nullable AType,
5102 n_args
: Collection[Object] # Should be Collection[AExpr]
5106 _n_kwnew
= n_kwnew
.as(not null)
5107 n_kwnew
.parent
= self
5108 _n_type
= n_type
.as(not null)
5109 n_type
.parent
= self
5111 if n_id
!= null then
5121 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5123 if _n_kwnew
== old_child
then
5124 if new_child
!= null then
5125 new_child
.parent
= self
5126 assert new_child
isa TKwnew
5127 _n_kwnew
= new_child
5133 if _n_type
== old_child
then
5134 if new_child
!= null then
5135 new_child
.parent
= self
5136 assert new_child
isa AType
5143 if _n_id
== old_child
then
5144 if new_child
!= null then
5145 new_child
.parent
= self
5146 assert new_child
isa TId
5153 for i
in [0.._n_args
.length
[ do
5154 if _n_args
[i
] == old_child
then
5155 if new_child
!= null then
5156 assert new_child
isa AExpr
5157 _n_args
[i
] = new_child
5158 new_child
.parent
= self
5160 _n_args
.remove_at
(i
)
5167 redef fun visit_all
(v
: Visitor)
5169 v
.enter_visit
(_n_kwnew
)
5170 v
.enter_visit
(_n_type
)
5171 if _n_id
!= null then
5172 v
.enter_visit
(_n_id
.as(not null))
5179 redef class AAttrExpr
5180 private init empty_init
do end
5182 init init_aattrexpr
(
5183 n_expr
: nullable AExpr,
5184 n_id
: nullable TAttrid
5188 _n_expr
= n_expr
.as(not null)
5189 n_expr
.parent
= self
5190 _n_id
= n_id
.as(not null)
5194 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5196 if _n_expr
== old_child
then
5197 if new_child
!= null then
5198 new_child
.parent
= self
5199 assert new_child
isa AExpr
5206 if _n_id
== old_child
then
5207 if new_child
!= null then
5208 new_child
.parent
= self
5209 assert new_child
isa TAttrid
5218 redef fun visit_all
(v
: Visitor)
5220 v
.enter_visit
(_n_expr
)
5221 v
.enter_visit
(_n_id
)
5224 redef class AAttrAssignExpr
5225 private init empty_init
do end
5227 init init_aattrassignexpr
(
5228 n_expr
: nullable AExpr,
5229 n_id
: nullable TAttrid,
5230 n_assign
: nullable TAssign,
5231 n_value
: nullable AExpr
5235 _n_expr
= n_expr
.as(not null)
5236 n_expr
.parent
= self
5237 _n_id
= n_id
.as(not null)
5239 _n_assign
= n_assign
.as(not null)
5240 n_assign
.parent
= self
5241 _n_value
= n_value
.as(not null)
5242 n_value
.parent
= self
5245 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5247 if _n_expr
== old_child
then
5248 if new_child
!= null then
5249 new_child
.parent
= self
5250 assert new_child
isa AExpr
5257 if _n_id
== old_child
then
5258 if new_child
!= null then
5259 new_child
.parent
= self
5260 assert new_child
isa TAttrid
5267 if _n_assign
== old_child
then
5268 if new_child
!= null then
5269 new_child
.parent
= self
5270 assert new_child
isa TAssign
5271 _n_assign
= new_child
5277 if _n_value
== old_child
then
5278 if new_child
!= null then
5279 new_child
.parent
= self
5280 assert new_child
isa AExpr
5281 _n_value
= new_child
5289 redef fun visit_all
(v
: Visitor)
5291 v
.enter_visit
(_n_expr
)
5292 v
.enter_visit
(_n_id
)
5293 v
.enter_visit
(_n_assign
)
5294 v
.enter_visit
(_n_value
)
5297 redef class AAttrReassignExpr
5298 private init empty_init
do end
5300 init init_aattrreassignexpr
(
5301 n_expr
: nullable AExpr,
5302 n_id
: nullable TAttrid,
5303 n_assign_op
: nullable AAssignOp,
5304 n_value
: nullable AExpr
5308 _n_expr
= n_expr
.as(not null)
5309 n_expr
.parent
= self
5310 _n_id
= n_id
.as(not null)
5312 _n_assign_op
= n_assign_op
.as(not null)
5313 n_assign_op
.parent
= self
5314 _n_value
= n_value
.as(not null)
5315 n_value
.parent
= self
5318 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5320 if _n_expr
== old_child
then
5321 if new_child
!= null then
5322 new_child
.parent
= self
5323 assert new_child
isa AExpr
5330 if _n_id
== old_child
then
5331 if new_child
!= null then
5332 new_child
.parent
= self
5333 assert new_child
isa TAttrid
5340 if _n_assign_op
== old_child
then
5341 if new_child
!= null then
5342 new_child
.parent
= self
5343 assert new_child
isa AAssignOp
5344 _n_assign_op
= new_child
5350 if _n_value
== old_child
then
5351 if new_child
!= null then
5352 new_child
.parent
= self
5353 assert new_child
isa AExpr
5354 _n_value
= new_child
5362 redef fun visit_all
(v
: Visitor)
5364 v
.enter_visit
(_n_expr
)
5365 v
.enter_visit
(_n_id
)
5366 v
.enter_visit
(_n_assign_op
)
5367 v
.enter_visit
(_n_value
)
5370 redef class ACallExpr
5371 private init empty_init
do end
5373 init init_acallexpr
(
5374 n_expr
: nullable AExpr,
5376 n_args
: Collection[Object], # Should be Collection[AExpr]
5377 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5381 _n_expr
= n_expr
.as(not null)
5382 n_expr
.parent
= self
5383 _n_id
= n_id
.as(not null)
5390 for n
in n_closure_defs
do
5391 assert n
isa AClosureDef
5392 _n_closure_defs
.add
(n
)
5397 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5399 if _n_expr
== old_child
then
5400 if new_child
!= null then
5401 new_child
.parent
= self
5402 assert new_child
isa AExpr
5409 if _n_id
== old_child
then
5410 if new_child
!= null then
5411 new_child
.parent
= self
5412 assert new_child
isa TId
5419 for i
in [0.._n_args
.length
[ do
5420 if _n_args
[i
] == old_child
then
5421 if new_child
!= null then
5422 assert new_child
isa AExpr
5423 _n_args
[i
] = new_child
5424 new_child
.parent
= self
5426 _n_args
.remove_at
(i
)
5431 for i
in [0.._n_closure_defs
.length
[ do
5432 if _n_closure_defs
[i
] == old_child
then
5433 if new_child
!= null then
5434 assert new_child
isa AClosureDef
5435 _n_closure_defs
[i
] = new_child
5436 new_child
.parent
= self
5438 _n_closure_defs
.remove_at
(i
)
5445 redef fun visit_all
(v
: Visitor)
5447 v
.enter_visit
(_n_expr
)
5448 v
.enter_visit
(_n_id
)
5452 for n
in _n_closure_defs
do
5457 redef class ACallAssignExpr
5458 private init empty_init
do end
5460 init init_acallassignexpr
(
5461 n_expr
: nullable AExpr,
5463 n_args
: Collection[Object], # Should be Collection[AExpr]
5464 n_assign
: nullable TAssign,
5465 n_value
: nullable AExpr
5469 _n_expr
= n_expr
.as(not null)
5470 n_expr
.parent
= self
5471 _n_id
= n_id
.as(not null)
5478 _n_assign
= n_assign
.as(not null)
5479 n_assign
.parent
= self
5480 _n_value
= n_value
.as(not null)
5481 n_value
.parent
= self
5484 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5486 if _n_expr
== old_child
then
5487 if new_child
!= null then
5488 new_child
.parent
= self
5489 assert new_child
isa AExpr
5496 if _n_id
== old_child
then
5497 if new_child
!= null then
5498 new_child
.parent
= self
5499 assert new_child
isa TId
5506 for i
in [0.._n_args
.length
[ do
5507 if _n_args
[i
] == old_child
then
5508 if new_child
!= null then
5509 assert new_child
isa AExpr
5510 _n_args
[i
] = new_child
5511 new_child
.parent
= self
5513 _n_args
.remove_at
(i
)
5518 if _n_assign
== old_child
then
5519 if new_child
!= null then
5520 new_child
.parent
= self
5521 assert new_child
isa TAssign
5522 _n_assign
= new_child
5528 if _n_value
== old_child
then
5529 if new_child
!= null then
5530 new_child
.parent
= self
5531 assert new_child
isa AExpr
5532 _n_value
= new_child
5540 redef fun visit_all
(v
: Visitor)
5542 v
.enter_visit
(_n_expr
)
5543 v
.enter_visit
(_n_id
)
5547 v
.enter_visit
(_n_assign
)
5548 v
.enter_visit
(_n_value
)
5551 redef class ACallReassignExpr
5552 private init empty_init
do end
5554 init init_acallreassignexpr
(
5555 n_expr
: nullable AExpr,
5557 n_args
: Collection[Object], # Should be Collection[AExpr]
5558 n_assign_op
: nullable AAssignOp,
5559 n_value
: nullable AExpr
5563 _n_expr
= n_expr
.as(not null)
5564 n_expr
.parent
= self
5565 _n_id
= n_id
.as(not null)
5572 _n_assign_op
= n_assign_op
.as(not null)
5573 n_assign_op
.parent
= self
5574 _n_value
= n_value
.as(not null)
5575 n_value
.parent
= self
5578 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5580 if _n_expr
== old_child
then
5581 if new_child
!= null then
5582 new_child
.parent
= self
5583 assert new_child
isa AExpr
5590 if _n_id
== old_child
then
5591 if new_child
!= null then
5592 new_child
.parent
= self
5593 assert new_child
isa TId
5600 for i
in [0.._n_args
.length
[ do
5601 if _n_args
[i
] == old_child
then
5602 if new_child
!= null then
5603 assert new_child
isa AExpr
5604 _n_args
[i
] = new_child
5605 new_child
.parent
= self
5607 _n_args
.remove_at
(i
)
5612 if _n_assign_op
== old_child
then
5613 if new_child
!= null then
5614 new_child
.parent
= self
5615 assert new_child
isa AAssignOp
5616 _n_assign_op
= new_child
5622 if _n_value
== old_child
then
5623 if new_child
!= null then
5624 new_child
.parent
= self
5625 assert new_child
isa AExpr
5626 _n_value
= new_child
5634 redef fun visit_all
(v
: Visitor)
5636 v
.enter_visit
(_n_expr
)
5637 v
.enter_visit
(_n_id
)
5641 v
.enter_visit
(_n_assign_op
)
5642 v
.enter_visit
(_n_value
)
5645 redef class ASuperExpr
5646 private init empty_init
do end
5648 init init_asuperexpr
(
5649 n_qualified
: nullable AQualified,
5650 n_kwsuper
: nullable TKwsuper,
5651 n_args
: Collection[Object] # Should be Collection[AExpr]
5655 _n_qualified
= n_qualified
5656 if n_qualified
!= null then
5657 n_qualified
.parent
= self
5659 _n_kwsuper
= n_kwsuper
.as(not null)
5660 n_kwsuper
.parent
= self
5668 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5670 if _n_qualified
== old_child
then
5671 if new_child
!= null then
5672 new_child
.parent
= self
5673 assert new_child
isa AQualified
5674 _n_qualified
= new_child
5680 if _n_kwsuper
== old_child
then
5681 if new_child
!= null then
5682 new_child
.parent
= self
5683 assert new_child
isa TKwsuper
5684 _n_kwsuper
= new_child
5690 for i
in [0.._n_args
.length
[ do
5691 if _n_args
[i
] == old_child
then
5692 if new_child
!= null then
5693 assert new_child
isa AExpr
5694 _n_args
[i
] = new_child
5695 new_child
.parent
= self
5697 _n_args
.remove_at
(i
)
5704 redef fun visit_all
(v
: Visitor)
5706 if _n_qualified
!= null then
5707 v
.enter_visit
(_n_qualified
.as(not null))
5709 v
.enter_visit
(_n_kwsuper
)
5715 redef class AInitExpr
5716 private init empty_init
do end
5718 init init_ainitexpr
(
5719 n_expr
: nullable AExpr,
5720 n_kwinit
: nullable TKwinit,
5721 n_args
: Collection[Object] # Should be Collection[AExpr]
5725 _n_expr
= n_expr
.as(not null)
5726 n_expr
.parent
= self
5727 _n_kwinit
= n_kwinit
.as(not null)
5728 n_kwinit
.parent
= self
5736 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5738 if _n_expr
== old_child
then
5739 if new_child
!= null then
5740 new_child
.parent
= self
5741 assert new_child
isa AExpr
5748 if _n_kwinit
== old_child
then
5749 if new_child
!= null then
5750 new_child
.parent
= self
5751 assert new_child
isa TKwinit
5752 _n_kwinit
= new_child
5758 for i
in [0.._n_args
.length
[ do
5759 if _n_args
[i
] == old_child
then
5760 if new_child
!= null then
5761 assert new_child
isa AExpr
5762 _n_args
[i
] = new_child
5763 new_child
.parent
= self
5765 _n_args
.remove_at
(i
)
5772 redef fun visit_all
(v
: Visitor)
5774 v
.enter_visit
(_n_expr
)
5775 v
.enter_visit
(_n_kwinit
)
5781 redef class ABraExpr
5782 private init empty_init
do end
5784 init init_abraexpr
(
5785 n_expr
: nullable AExpr,
5786 n_args
: Collection[Object], # Should be Collection[AExpr]
5787 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5791 _n_expr
= n_expr
.as(not null)
5792 n_expr
.parent
= self
5798 for n
in n_closure_defs
do
5799 assert n
isa AClosureDef
5800 _n_closure_defs
.add
(n
)
5805 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5807 if _n_expr
== old_child
then
5808 if new_child
!= null then
5809 new_child
.parent
= self
5810 assert new_child
isa AExpr
5817 for i
in [0.._n_args
.length
[ do
5818 if _n_args
[i
] == old_child
then
5819 if new_child
!= null then
5820 assert new_child
isa AExpr
5821 _n_args
[i
] = new_child
5822 new_child
.parent
= self
5824 _n_args
.remove_at
(i
)
5829 for i
in [0.._n_closure_defs
.length
[ do
5830 if _n_closure_defs
[i
] == old_child
then
5831 if new_child
!= null then
5832 assert new_child
isa AClosureDef
5833 _n_closure_defs
[i
] = new_child
5834 new_child
.parent
= self
5836 _n_closure_defs
.remove_at
(i
)
5843 redef fun visit_all
(v
: Visitor)
5845 v
.enter_visit
(_n_expr
)
5849 for n
in _n_closure_defs
do
5854 redef class ABraAssignExpr
5855 private init empty_init
do end
5857 init init_abraassignexpr
(
5858 n_expr
: nullable AExpr,
5859 n_args
: Collection[Object], # Should be Collection[AExpr]
5860 n_assign
: nullable TAssign,
5861 n_value
: nullable AExpr
5865 _n_expr
= n_expr
.as(not null)
5866 n_expr
.parent
= self
5872 _n_assign
= n_assign
.as(not null)
5873 n_assign
.parent
= self
5874 _n_value
= n_value
.as(not null)
5875 n_value
.parent
= self
5878 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5880 if _n_expr
== old_child
then
5881 if new_child
!= null then
5882 new_child
.parent
= self
5883 assert new_child
isa AExpr
5890 for i
in [0.._n_args
.length
[ do
5891 if _n_args
[i
] == old_child
then
5892 if new_child
!= null then
5893 assert new_child
isa AExpr
5894 _n_args
[i
] = new_child
5895 new_child
.parent
= self
5897 _n_args
.remove_at
(i
)
5902 if _n_assign
== old_child
then
5903 if new_child
!= null then
5904 new_child
.parent
= self
5905 assert new_child
isa TAssign
5906 _n_assign
= new_child
5912 if _n_value
== old_child
then
5913 if new_child
!= null then
5914 new_child
.parent
= self
5915 assert new_child
isa AExpr
5916 _n_value
= new_child
5924 redef fun visit_all
(v
: Visitor)
5926 v
.enter_visit
(_n_expr
)
5930 v
.enter_visit
(_n_assign
)
5931 v
.enter_visit
(_n_value
)
5934 redef class ABraReassignExpr
5935 private init empty_init
do end
5937 init init_abrareassignexpr
(
5938 n_expr
: nullable AExpr,
5939 n_args
: Collection[Object], # Should be Collection[AExpr]
5940 n_assign_op
: nullable AAssignOp,
5941 n_value
: nullable AExpr
5945 _n_expr
= n_expr
.as(not null)
5946 n_expr
.parent
= self
5952 _n_assign_op
= n_assign_op
.as(not null)
5953 n_assign_op
.parent
= self
5954 _n_value
= n_value
.as(not null)
5955 n_value
.parent
= self
5958 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5960 if _n_expr
== old_child
then
5961 if new_child
!= null then
5962 new_child
.parent
= self
5963 assert new_child
isa AExpr
5970 for i
in [0.._n_args
.length
[ do
5971 if _n_args
[i
] == old_child
then
5972 if new_child
!= null then
5973 assert new_child
isa AExpr
5974 _n_args
[i
] = new_child
5975 new_child
.parent
= self
5977 _n_args
.remove_at
(i
)
5982 if _n_assign_op
== old_child
then
5983 if new_child
!= null then
5984 new_child
.parent
= self
5985 assert new_child
isa AAssignOp
5986 _n_assign_op
= new_child
5992 if _n_value
== old_child
then
5993 if new_child
!= null then
5994 new_child
.parent
= self
5995 assert new_child
isa AExpr
5996 _n_value
= new_child
6004 redef fun visit_all
(v
: Visitor)
6006 v
.enter_visit
(_n_expr
)
6010 v
.enter_visit
(_n_assign_op
)
6011 v
.enter_visit
(_n_value
)
6014 redef class AClosureCallExpr
6015 private init empty_init
do end
6017 init init_aclosurecallexpr
(
6019 n_args
: Collection[Object], # Should be Collection[AExpr]
6020 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6024 _n_id
= n_id
.as(not null)
6031 for n
in n_closure_defs
do
6032 assert n
isa AClosureDef
6033 _n_closure_defs
.add
(n
)
6038 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6040 if _n_id
== old_child
then
6041 if new_child
!= null then
6042 new_child
.parent
= self
6043 assert new_child
isa TId
6050 for i
in [0.._n_args
.length
[ do
6051 if _n_args
[i
] == old_child
then
6052 if new_child
!= null then
6053 assert new_child
isa AExpr
6054 _n_args
[i
] = new_child
6055 new_child
.parent
= self
6057 _n_args
.remove_at
(i
)
6062 for i
in [0.._n_closure_defs
.length
[ do
6063 if _n_closure_defs
[i
] == old_child
then
6064 if new_child
!= null then
6065 assert new_child
isa AClosureDef
6066 _n_closure_defs
[i
] = new_child
6067 new_child
.parent
= self
6069 _n_closure_defs
.remove_at
(i
)
6076 redef fun visit_all
(v
: Visitor)
6078 v
.enter_visit
(_n_id
)
6082 for n
in _n_closure_defs
do
6087 redef class AVarExpr
6088 private init empty_init
do end
6090 init init_avarexpr
(
6095 _n_id
= n_id
.as(not null)
6099 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6101 if _n_id
== old_child
then
6102 if new_child
!= null then
6103 new_child
.parent
= self
6104 assert new_child
isa TId
6113 redef fun visit_all
(v
: Visitor)
6115 v
.enter_visit
(_n_id
)
6118 redef class AVarAssignExpr
6119 private init empty_init
do end
6121 init init_avarassignexpr
(
6123 n_assign
: nullable TAssign,
6124 n_value
: nullable AExpr
6128 _n_id
= n_id
.as(not null)
6130 _n_assign
= n_assign
.as(not null)
6131 n_assign
.parent
= self
6132 _n_value
= n_value
.as(not null)
6133 n_value
.parent
= self
6136 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6138 if _n_id
== old_child
then
6139 if new_child
!= null then
6140 new_child
.parent
= self
6141 assert new_child
isa TId
6148 if _n_assign
== old_child
then
6149 if new_child
!= null then
6150 new_child
.parent
= self
6151 assert new_child
isa TAssign
6152 _n_assign
= new_child
6158 if _n_value
== old_child
then
6159 if new_child
!= null then
6160 new_child
.parent
= self
6161 assert new_child
isa AExpr
6162 _n_value
= new_child
6170 redef fun visit_all
(v
: Visitor)
6172 v
.enter_visit
(_n_id
)
6173 v
.enter_visit
(_n_assign
)
6174 v
.enter_visit
(_n_value
)
6177 redef class AVarReassignExpr
6178 private init empty_init
do end
6180 init init_avarreassignexpr
(
6182 n_assign_op
: nullable AAssignOp,
6183 n_value
: nullable AExpr
6187 _n_id
= n_id
.as(not null)
6189 _n_assign_op
= n_assign_op
.as(not null)
6190 n_assign_op
.parent
= self
6191 _n_value
= n_value
.as(not null)
6192 n_value
.parent
= self
6195 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6197 if _n_id
== old_child
then
6198 if new_child
!= null then
6199 new_child
.parent
= self
6200 assert new_child
isa TId
6207 if _n_assign_op
== old_child
then
6208 if new_child
!= null then
6209 new_child
.parent
= self
6210 assert new_child
isa AAssignOp
6211 _n_assign_op
= new_child
6217 if _n_value
== old_child
then
6218 if new_child
!= null then
6219 new_child
.parent
= self
6220 assert new_child
isa AExpr
6221 _n_value
= new_child
6229 redef fun visit_all
(v
: Visitor)
6231 v
.enter_visit
(_n_id
)
6232 v
.enter_visit
(_n_assign_op
)
6233 v
.enter_visit
(_n_value
)
6236 redef class ARangeExpr
6237 private init empty_init
do end
6239 init init_arangeexpr
(
6240 n_expr
: nullable AExpr,
6241 n_expr2
: nullable AExpr
6245 _n_expr
= n_expr
.as(not null)
6246 n_expr
.parent
= self
6247 _n_expr2
= n_expr2
.as(not null)
6248 n_expr2
.parent
= self
6251 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6253 if _n_expr
== old_child
then
6254 if new_child
!= null then
6255 new_child
.parent
= self
6256 assert new_child
isa AExpr
6263 if _n_expr2
== old_child
then
6264 if new_child
!= null then
6265 new_child
.parent
= self
6266 assert new_child
isa AExpr
6267 _n_expr2
= new_child
6275 redef fun visit_all
(v
: Visitor)
6277 v
.enter_visit
(_n_expr
)
6278 v
.enter_visit
(_n_expr2
)
6281 redef class ACrangeExpr
6282 private init empty_init
do end
6284 init init_acrangeexpr
(
6285 n_expr
: nullable AExpr,
6286 n_expr2
: nullable AExpr
6290 _n_expr
= n_expr
.as(not null)
6291 n_expr
.parent
= self
6292 _n_expr2
= n_expr2
.as(not null)
6293 n_expr2
.parent
= self
6296 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6298 if _n_expr
== old_child
then
6299 if new_child
!= null then
6300 new_child
.parent
= self
6301 assert new_child
isa AExpr
6308 if _n_expr2
== old_child
then
6309 if new_child
!= null then
6310 new_child
.parent
= self
6311 assert new_child
isa AExpr
6312 _n_expr2
= new_child
6320 redef fun visit_all
(v
: Visitor)
6322 v
.enter_visit
(_n_expr
)
6323 v
.enter_visit
(_n_expr2
)
6326 redef class AOrangeExpr
6327 private init empty_init
do end
6329 init init_aorangeexpr
(
6330 n_expr
: nullable AExpr,
6331 n_expr2
: nullable AExpr
6335 _n_expr
= n_expr
.as(not null)
6336 n_expr
.parent
= self
6337 _n_expr2
= n_expr2
.as(not null)
6338 n_expr2
.parent
= self
6341 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6343 if _n_expr
== old_child
then
6344 if new_child
!= null then
6345 new_child
.parent
= self
6346 assert new_child
isa AExpr
6353 if _n_expr2
== old_child
then
6354 if new_child
!= null then
6355 new_child
.parent
= self
6356 assert new_child
isa AExpr
6357 _n_expr2
= new_child
6365 redef fun visit_all
(v
: Visitor)
6367 v
.enter_visit
(_n_expr
)
6368 v
.enter_visit
(_n_expr2
)
6371 redef class AArrayExpr
6372 private init empty_init
do end
6374 init init_aarrayexpr
(
6375 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6386 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6388 for i
in [0.._n_exprs
.length
[ do
6389 if _n_exprs
[i
] == old_child
then
6390 if new_child
!= null then
6391 assert new_child
isa AExpr
6392 _n_exprs
[i
] = new_child
6393 new_child
.parent
= self
6395 _n_exprs
.remove_at
(i
)
6402 redef fun visit_all
(v
: Visitor)
6404 for n
in _n_exprs
do
6409 redef class ASelfExpr
6410 private init empty_init
do end
6412 init init_aselfexpr
(
6413 n_kwself
: nullable TKwself
6417 _n_kwself
= n_kwself
.as(not null)
6418 n_kwself
.parent
= self
6421 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6423 if _n_kwself
== old_child
then
6424 if new_child
!= null then
6425 new_child
.parent
= self
6426 assert new_child
isa TKwself
6427 _n_kwself
= new_child
6435 redef fun visit_all
(v
: Visitor)
6437 v
.enter_visit
(_n_kwself
)
6440 redef class AImplicitSelfExpr
6441 private init empty_init
do end
6443 init init_aimplicitselfexpr
6448 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6452 redef fun visit_all
(v
: Visitor)
6456 redef class ATrueExpr
6457 private init empty_init
do end
6459 init init_atrueexpr
(
6460 n_kwtrue
: nullable TKwtrue
6464 _n_kwtrue
= n_kwtrue
.as(not null)
6465 n_kwtrue
.parent
= self
6468 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6470 if _n_kwtrue
== old_child
then
6471 if new_child
!= null then
6472 new_child
.parent
= self
6473 assert new_child
isa TKwtrue
6474 _n_kwtrue
= new_child
6482 redef fun visit_all
(v
: Visitor)
6484 v
.enter_visit
(_n_kwtrue
)
6487 redef class AFalseExpr
6488 private init empty_init
do end
6490 init init_afalseexpr
(
6491 n_kwfalse
: nullable TKwfalse
6495 _n_kwfalse
= n_kwfalse
.as(not null)
6496 n_kwfalse
.parent
= self
6499 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6501 if _n_kwfalse
== old_child
then
6502 if new_child
!= null then
6503 new_child
.parent
= self
6504 assert new_child
isa TKwfalse
6505 _n_kwfalse
= new_child
6513 redef fun visit_all
(v
: Visitor)
6515 v
.enter_visit
(_n_kwfalse
)
6518 redef class ANullExpr
6519 private init empty_init
do end
6521 init init_anullexpr
(
6522 n_kwnull
: nullable TKwnull
6526 _n_kwnull
= n_kwnull
.as(not null)
6527 n_kwnull
.parent
= self
6530 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6532 if _n_kwnull
== old_child
then
6533 if new_child
!= null then
6534 new_child
.parent
= self
6535 assert new_child
isa TKwnull
6536 _n_kwnull
= new_child
6544 redef fun visit_all
(v
: Visitor)
6546 v
.enter_visit
(_n_kwnull
)
6549 redef class AIntExpr
6550 private init empty_init
do end
6552 init init_aintexpr
(
6553 n_number
: nullable TNumber
6557 _n_number
= n_number
.as(not null)
6558 n_number
.parent
= self
6561 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6563 if _n_number
== old_child
then
6564 if new_child
!= null then
6565 new_child
.parent
= self
6566 assert new_child
isa TNumber
6567 _n_number
= new_child
6575 redef fun visit_all
(v
: Visitor)
6577 v
.enter_visit
(_n_number
)
6580 redef class AFloatExpr
6581 private init empty_init
do end
6583 init init_afloatexpr
(
6584 n_float
: nullable TFloat
6588 _n_float
= n_float
.as(not null)
6589 n_float
.parent
= self
6592 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6594 if _n_float
== old_child
then
6595 if new_child
!= null then
6596 new_child
.parent
= self
6597 assert new_child
isa TFloat
6598 _n_float
= new_child
6606 redef fun visit_all
(v
: Visitor)
6608 v
.enter_visit
(_n_float
)
6611 redef class ACharExpr
6612 private init empty_init
do end
6614 init init_acharexpr
(
6615 n_char
: nullable TChar
6619 _n_char
= n_char
.as(not null)
6620 n_char
.parent
= self
6623 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6625 if _n_char
== old_child
then
6626 if new_child
!= null then
6627 new_child
.parent
= self
6628 assert new_child
isa TChar
6637 redef fun visit_all
(v
: Visitor)
6639 v
.enter_visit
(_n_char
)
6642 redef class AStringExpr
6643 private init empty_init
do end
6645 init init_astringexpr
(
6646 n_string
: nullable TString
6650 _n_string
= n_string
.as(not null)
6651 n_string
.parent
= self
6654 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6656 if _n_string
== old_child
then
6657 if new_child
!= null then
6658 new_child
.parent
= self
6659 assert new_child
isa TString
6660 _n_string
= new_child
6668 redef fun visit_all
(v
: Visitor)
6670 v
.enter_visit
(_n_string
)
6673 redef class AStartStringExpr
6674 private init empty_init
do end
6676 init init_astartstringexpr
(
6677 n_string
: nullable TStartString
6681 _n_string
= n_string
.as(not null)
6682 n_string
.parent
= self
6685 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6687 if _n_string
== old_child
then
6688 if new_child
!= null then
6689 new_child
.parent
= self
6690 assert new_child
isa TStartString
6691 _n_string
= new_child
6699 redef fun visit_all
(v
: Visitor)
6701 v
.enter_visit
(_n_string
)
6704 redef class AMidStringExpr
6705 private init empty_init
do end
6707 init init_amidstringexpr
(
6708 n_string
: nullable TMidString
6712 _n_string
= n_string
.as(not null)
6713 n_string
.parent
= self
6716 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6718 if _n_string
== old_child
then
6719 if new_child
!= null then
6720 new_child
.parent
= self
6721 assert new_child
isa TMidString
6722 _n_string
= new_child
6730 redef fun visit_all
(v
: Visitor)
6732 v
.enter_visit
(_n_string
)
6735 redef class AEndStringExpr
6736 private init empty_init
do end
6738 init init_aendstringexpr
(
6739 n_string
: nullable TEndString
6743 _n_string
= n_string
.as(not null)
6744 n_string
.parent
= self
6747 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6749 if _n_string
== old_child
then
6750 if new_child
!= null then
6751 new_child
.parent
= self
6752 assert new_child
isa TEndString
6753 _n_string
= new_child
6761 redef fun visit_all
(v
: Visitor)
6763 v
.enter_visit
(_n_string
)
6766 redef class ASuperstringExpr
6767 private init empty_init
do end
6769 init init_asuperstringexpr
(
6770 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6781 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6783 for i
in [0.._n_exprs
.length
[ do
6784 if _n_exprs
[i
] == old_child
then
6785 if new_child
!= null then
6786 assert new_child
isa AExpr
6787 _n_exprs
[i
] = new_child
6788 new_child
.parent
= self
6790 _n_exprs
.remove_at
(i
)
6797 redef fun visit_all
(v
: Visitor)
6799 for n
in _n_exprs
do
6804 redef class AParExpr
6805 private init empty_init
do end
6807 init init_aparexpr
(
6808 n_expr
: nullable AExpr
6812 _n_expr
= n_expr
.as(not null)
6813 n_expr
.parent
= self
6816 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6818 if _n_expr
== old_child
then
6819 if new_child
!= null then
6820 new_child
.parent
= self
6821 assert new_child
isa AExpr
6830 redef fun visit_all
(v
: Visitor)
6832 v
.enter_visit
(_n_expr
)
6835 redef class AAsCastExpr
6836 private init empty_init
do end
6838 init init_aascastexpr
(
6839 n_expr
: nullable AExpr,
6840 n_kwas
: nullable TKwas,
6841 n_type
: nullable AType
6845 _n_expr
= n_expr
.as(not null)
6846 n_expr
.parent
= self
6847 _n_kwas
= n_kwas
.as(not null)
6848 n_kwas
.parent
= self
6849 _n_type
= n_type
.as(not null)
6850 n_type
.parent
= self
6853 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6855 if _n_expr
== old_child
then
6856 if new_child
!= null then
6857 new_child
.parent
= self
6858 assert new_child
isa AExpr
6865 if _n_kwas
== old_child
then
6866 if new_child
!= null then
6867 new_child
.parent
= self
6868 assert new_child
isa TKwas
6875 if _n_type
== old_child
then
6876 if new_child
!= null then
6877 new_child
.parent
= self
6878 assert new_child
isa AType
6887 redef fun visit_all
(v
: Visitor)
6889 v
.enter_visit
(_n_expr
)
6890 v
.enter_visit
(_n_kwas
)
6891 v
.enter_visit
(_n_type
)
6894 redef class AAsNotnullExpr
6895 private init empty_init
do end
6897 init init_aasnotnullexpr
(
6898 n_expr
: nullable AExpr,
6899 n_kwas
: nullable TKwas,
6900 n_kwnot
: nullable TKwnot,
6901 n_kwnull
: nullable TKwnull
6905 _n_expr
= n_expr
.as(not null)
6906 n_expr
.parent
= self
6907 _n_kwas
= n_kwas
.as(not null)
6908 n_kwas
.parent
= self
6909 _n_kwnot
= n_kwnot
.as(not null)
6910 n_kwnot
.parent
= self
6911 _n_kwnull
= n_kwnull
.as(not null)
6912 n_kwnull
.parent
= self
6915 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6917 if _n_expr
== old_child
then
6918 if new_child
!= null then
6919 new_child
.parent
= self
6920 assert new_child
isa AExpr
6927 if _n_kwas
== old_child
then
6928 if new_child
!= null then
6929 new_child
.parent
= self
6930 assert new_child
isa TKwas
6937 if _n_kwnot
== old_child
then
6938 if new_child
!= null then
6939 new_child
.parent
= self
6940 assert new_child
isa TKwnot
6941 _n_kwnot
= new_child
6947 if _n_kwnull
== old_child
then
6948 if new_child
!= null then
6949 new_child
.parent
= self
6950 assert new_child
isa TKwnull
6951 _n_kwnull
= new_child
6959 redef fun visit_all
(v
: Visitor)
6961 v
.enter_visit
(_n_expr
)
6962 v
.enter_visit
(_n_kwas
)
6963 v
.enter_visit
(_n_kwnot
)
6964 v
.enter_visit
(_n_kwnull
)
6967 redef class AIssetAttrExpr
6968 private init empty_init
do end
6970 init init_aissetattrexpr
(
6971 n_kwisset
: nullable TKwisset,
6972 n_expr
: nullable AExpr,
6973 n_id
: nullable TAttrid
6977 _n_kwisset
= n_kwisset
.as(not null)
6978 n_kwisset
.parent
= self
6979 _n_expr
= n_expr
.as(not null)
6980 n_expr
.parent
= self
6981 _n_id
= n_id
.as(not null)
6985 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6987 if _n_kwisset
== old_child
then
6988 if new_child
!= null then
6989 new_child
.parent
= self
6990 assert new_child
isa TKwisset
6991 _n_kwisset
= new_child
6997 if _n_expr
== old_child
then
6998 if new_child
!= null then
6999 new_child
.parent
= self
7000 assert new_child
isa AExpr
7007 if _n_id
== old_child
then
7008 if new_child
!= null then
7009 new_child
.parent
= self
7010 assert new_child
isa TAttrid
7019 redef fun visit_all
(v
: Visitor)
7021 v
.enter_visit
(_n_kwisset
)
7022 v
.enter_visit
(_n_expr
)
7023 v
.enter_visit
(_n_id
)
7026 redef class APlusAssignOp
7027 private init empty_init
do end
7029 init init_aplusassignop
(
7030 n_pluseq
: nullable TPluseq
7034 _n_pluseq
= n_pluseq
.as(not null)
7035 n_pluseq
.parent
= self
7038 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7040 if _n_pluseq
== old_child
then
7041 if new_child
!= null then
7042 new_child
.parent
= self
7043 assert new_child
isa TPluseq
7044 _n_pluseq
= new_child
7052 redef fun visit_all
(v
: Visitor)
7054 v
.enter_visit
(_n_pluseq
)
7057 redef class AMinusAssignOp
7058 private init empty_init
do end
7060 init init_aminusassignop
(
7061 n_minuseq
: nullable TMinuseq
7065 _n_minuseq
= n_minuseq
.as(not null)
7066 n_minuseq
.parent
= self
7069 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7071 if _n_minuseq
== old_child
then
7072 if new_child
!= null then
7073 new_child
.parent
= self
7074 assert new_child
isa TMinuseq
7075 _n_minuseq
= new_child
7083 redef fun visit_all
(v
: Visitor)
7085 v
.enter_visit
(_n_minuseq
)
7088 redef class AClosureDef
7089 private init empty_init
do end
7091 init init_aclosuredef
(
7092 n_bang
: nullable TBang,
7093 n_id
: nullable AClosureId,
7094 n_ids
: Collection[Object], # Should be Collection[TId]
7095 n_kwdo
: nullable TKwdo,
7096 n_expr
: nullable AExpr,
7097 n_label
: nullable ALabel
7101 _n_bang
= n_bang
.as(not null)
7102 n_bang
.parent
= self
7103 _n_id
= n_id
.as(not null)
7111 if n_kwdo
!= null then
7112 n_kwdo
.parent
= self
7115 if n_expr
!= null then
7116 n_expr
.parent
= self
7119 if n_label
!= null then
7120 n_label
.parent
= self
7124 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7126 if _n_bang
== old_child
then
7127 if new_child
!= null then
7128 new_child
.parent
= self
7129 assert new_child
isa TBang
7136 if _n_id
== old_child
then
7137 if new_child
!= null then
7138 new_child
.parent
= self
7139 assert new_child
isa AClosureId
7146 for i
in [0.._n_ids
.length
[ do
7147 if _n_ids
[i
] == old_child
then
7148 if new_child
!= null then
7149 assert new_child
isa TId
7150 _n_ids
[i
] = new_child
7151 new_child
.parent
= self
7158 if _n_kwdo
== old_child
then
7159 if new_child
!= null then
7160 new_child
.parent
= self
7161 assert new_child
isa TKwdo
7168 if _n_expr
== old_child
then
7169 if new_child
!= null then
7170 new_child
.parent
= self
7171 assert new_child
isa AExpr
7178 if _n_label
== old_child
then
7179 if new_child
!= null then
7180 new_child
.parent
= self
7181 assert new_child
isa ALabel
7182 _n_label
= new_child
7190 redef fun visit_all
(v
: Visitor)
7192 v
.enter_visit
(_n_bang
)
7193 v
.enter_visit
(_n_id
)
7197 if _n_kwdo
!= null then
7198 v
.enter_visit
(_n_kwdo
.as(not null))
7200 if _n_expr
!= null then
7201 v
.enter_visit
(_n_expr
.as(not null))
7203 if _n_label
!= null then
7204 v
.enter_visit
(_n_label
.as(not null))
7208 redef class ASimpleClosureId
7209 private init empty_init
do end
7211 init init_asimpleclosureid
(
7216 _n_id
= n_id
.as(not null)
7220 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7222 if _n_id
== old_child
then
7223 if new_child
!= null then
7224 new_child
.parent
= self
7225 assert new_child
isa TId
7234 redef fun visit_all
(v
: Visitor)
7236 v
.enter_visit
(_n_id
)
7239 redef class ABreakClosureId
7240 private init empty_init
do end
7242 init init_abreakclosureid
(
7243 n_kwbreak
: nullable TKwbreak
7247 _n_kwbreak
= n_kwbreak
.as(not null)
7248 n_kwbreak
.parent
= self
7251 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7253 if _n_kwbreak
== old_child
then
7254 if new_child
!= null then
7255 new_child
.parent
= self
7256 assert new_child
isa TKwbreak
7257 _n_kwbreak
= new_child
7265 redef fun visit_all
(v
: Visitor)
7267 v
.enter_visit
(_n_kwbreak
)
7270 redef class AQualified
7271 private init empty_init
do end
7273 init init_aqualified
(
7274 n_id
: Collection[Object], # Should be Collection[TId]
7275 n_classid
: nullable TClassid
7284 _n_classid
= n_classid
7285 if n_classid
!= null then
7286 n_classid
.parent
= self
7290 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7292 for i
in [0.._n_id
.length
[ do
7293 if _n_id
[i
] == old_child
then
7294 if new_child
!= null then
7295 assert new_child
isa TId
7296 _n_id
[i
] = new_child
7297 new_child
.parent
= self
7304 if _n_classid
== old_child
then
7305 if new_child
!= null then
7306 new_child
.parent
= self
7307 assert new_child
isa TClassid
7308 _n_classid
= new_child
7316 redef fun visit_all
(v
: Visitor)
7321 if _n_classid
!= null then
7322 v
.enter_visit
(_n_classid
.as(not null))
7327 private init empty_init
do end
7330 n_comment
: Collection[Object] # Should be Collection[TComment]
7334 for n
in n_comment
do
7335 assert n
isa TComment
7341 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7343 for i
in [0.._n_comment
.length
[ do
7344 if _n_comment
[i
] == old_child
then
7345 if new_child
!= null then
7346 assert new_child
isa TComment
7347 _n_comment
[i
] = new_child
7348 new_child
.parent
= self
7350 _n_comment
.remove_at
(i
)
7357 redef fun visit_all
(v
: Visitor)
7359 for n
in _n_comment
do
7367 n_base
: nullable AModule,
7374 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7376 if _n_base
== old_child
then
7377 if new_child
== null then
7379 new_child
.parent
= self
7380 assert new_child
isa AModule
7383 old_child
.parent
= null
7388 redef fun visit_all
(v
: Visitor)
7390 if _n_base
!= null then
7391 v
.enter_visit
(_n_base
.as(not null))
7393 v
.enter_visit
(_n_eof
)