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,
153 n_name
: nullable AModuleName
158 if n_doc
!= null then
161 _n_kwmodule
= n_kwmodule
.as(not null)
162 n_kwmodule
.parent
= self
163 _n_name
= n_name
.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_name
== old_child
then
190 if new_child
!= null then
191 new_child
.parent
= self
192 assert new_child
isa AModuleName
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
)
207 v
.enter_visit
(_n_name
)
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,
216 n_name
: nullable AModuleName
220 _n_visibility
= n_visibility
.as(not null)
221 n_visibility
.parent
= self
222 _n_kwimport
= n_kwimport
.as(not null)
223 n_kwimport
.parent
= self
224 _n_name
= n_name
.as(not null)
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_name
== old_child
then
251 if new_child
!= null then
252 new_child
.parent
= self
253 assert new_child
isa AModuleName
262 redef fun visit_all
(v
: Visitor)
264 v
.enter_visit
(_n_visibility
)
265 v
.enter_visit
(_n_kwimport
)
266 v
.enter_visit
(_n_name
)
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 AExternClasskind
814 private init empty_init
do end
816 init init_aexternclasskind
(
817 n_kwextern
: nullable TKwextern
821 _n_kwextern
= n_kwextern
.as(not null)
822 n_kwextern
.parent
= self
825 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
827 if _n_kwextern
== old_child
then
828 if new_child
!= null then
829 new_child
.parent
= self
830 assert new_child
isa TKwextern
831 _n_kwextern
= new_child
839 redef fun visit_all
(v
: Visitor)
841 v
.enter_visit
(_n_kwextern
)
844 redef class AFormaldef
845 private init empty_init
do end
847 init init_aformaldef
(
848 n_id
: nullable TClassid,
849 n_type
: nullable AType
853 _n_id
= n_id
.as(not null)
856 if n_type
!= null then
861 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
863 if _n_id
== old_child
then
864 if new_child
!= null then
865 new_child
.parent
= self
866 assert new_child
isa TClassid
873 if _n_type
== old_child
then
874 if new_child
!= null then
875 new_child
.parent
= self
876 assert new_child
isa AType
885 redef fun visit_all
(v
: Visitor)
888 if _n_type
!= null then
889 v
.enter_visit
(_n_type
.as(not null))
893 redef class ASuperclass
894 private init empty_init
do end
896 init init_asuperclass
(
897 n_kwspecial
: nullable TKwspecial,
898 n_kwsuper
: nullable TKwsuper,
899 n_type
: nullable AType
903 _n_kwspecial
= n_kwspecial
904 if n_kwspecial
!= null then
905 n_kwspecial
.parent
= self
907 _n_kwsuper
= n_kwsuper
908 if n_kwsuper
!= null then
909 n_kwsuper
.parent
= self
911 _n_type
= n_type
.as(not null)
915 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
917 if _n_kwspecial
== old_child
then
918 if new_child
!= null then
919 new_child
.parent
= self
920 assert new_child
isa TKwspecial
921 _n_kwspecial
= new_child
927 if _n_kwsuper
== old_child
then
928 if new_child
!= null then
929 new_child
.parent
= self
930 assert new_child
isa TKwsuper
931 _n_kwsuper
= new_child
937 if _n_type
== old_child
then
938 if new_child
!= null then
939 new_child
.parent
= self
940 assert new_child
isa AType
949 redef fun visit_all
(v
: Visitor)
951 if _n_kwspecial
!= null then
952 v
.enter_visit
(_n_kwspecial
.as(not null))
954 if _n_kwsuper
!= null then
955 v
.enter_visit
(_n_kwsuper
.as(not null))
957 v
.enter_visit
(_n_type
)
960 redef class AAttrPropdef
961 private init empty_init
do end
963 init init_aattrpropdef
(
964 n_doc
: nullable ADoc,
965 n_readable
: nullable AAble,
966 n_writable
: nullable AAble,
967 n_kwredef
: nullable TKwredef,
968 n_visibility
: nullable AVisibility,
969 n_kwvar
: nullable TKwvar,
970 n_id
: nullable TAttrid,
972 n_type
: nullable AType,
973 n_expr
: nullable AExpr
978 if n_doc
!= null then
981 _n_readable
= n_readable
982 if n_readable
!= null then
983 n_readable
.parent
= self
985 _n_writable
= n_writable
986 if n_writable
!= null then
987 n_writable
.parent
= self
989 _n_kwredef
= n_kwredef
990 if n_kwredef
!= null then
991 n_kwredef
.parent
= self
993 _n_visibility
= n_visibility
.as(not null)
994 n_visibility
.parent
= self
995 _n_kwvar
= n_kwvar
.as(not null)
996 n_kwvar
.parent
= self
1002 if n_id2
!= null then
1006 if n_type
!= null then
1007 n_type
.parent
= self
1010 if n_expr
!= null then
1011 n_expr
.parent
= self
1015 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1017 if _n_doc
== old_child
then
1018 if new_child
!= null then
1019 new_child
.parent
= self
1020 assert new_child
isa ADoc
1027 if _n_readable
== old_child
then
1028 if new_child
!= null then
1029 new_child
.parent
= self
1030 assert new_child
isa AAble
1031 _n_readable
= new_child
1037 if _n_writable
== old_child
then
1038 if new_child
!= null then
1039 new_child
.parent
= self
1040 assert new_child
isa AAble
1041 _n_writable
= new_child
1047 if _n_kwredef
== old_child
then
1048 if new_child
!= null then
1049 new_child
.parent
= self
1050 assert new_child
isa TKwredef
1051 _n_kwredef
= new_child
1057 if _n_visibility
== old_child
then
1058 if new_child
!= null then
1059 new_child
.parent
= self
1060 assert new_child
isa AVisibility
1061 _n_visibility
= new_child
1067 if _n_kwvar
== old_child
then
1068 if new_child
!= null then
1069 new_child
.parent
= self
1070 assert new_child
isa TKwvar
1071 _n_kwvar
= new_child
1077 if _n_id
== old_child
then
1078 if new_child
!= null then
1079 new_child
.parent
= self
1080 assert new_child
isa TAttrid
1087 if _n_id2
== old_child
then
1088 if new_child
!= null then
1089 new_child
.parent
= self
1090 assert new_child
isa TId
1097 if _n_type
== old_child
then
1098 if new_child
!= null then
1099 new_child
.parent
= self
1100 assert new_child
isa AType
1107 if _n_expr
== old_child
then
1108 if new_child
!= null then
1109 new_child
.parent
= self
1110 assert new_child
isa AExpr
1119 redef fun visit_all
(v
: Visitor)
1121 if _n_doc
!= null then
1122 v
.enter_visit
(_n_doc
.as(not null))
1124 if _n_readable
!= null then
1125 v
.enter_visit
(_n_readable
.as(not null))
1127 if _n_writable
!= null then
1128 v
.enter_visit
(_n_writable
.as(not null))
1130 if _n_kwredef
!= null then
1131 v
.enter_visit
(_n_kwredef
.as(not null))
1133 v
.enter_visit
(_n_visibility
)
1134 v
.enter_visit
(_n_kwvar
)
1135 if _n_id
!= null then
1136 v
.enter_visit
(_n_id
.as(not null))
1138 if _n_id2
!= null then
1139 v
.enter_visit
(_n_id2
.as(not null))
1141 if _n_type
!= null then
1142 v
.enter_visit
(_n_type
.as(not null))
1144 if _n_expr
!= null then
1145 v
.enter_visit
(_n_expr
.as(not null))
1149 redef class AMethPropdef
1150 private init empty_init
do end
1152 init init_amethpropdef
(
1153 n_doc
: nullable ADoc,
1154 n_kwredef
: nullable TKwredef,
1155 n_visibility
: nullable AVisibility,
1156 n_methid
: nullable AMethid,
1157 n_signature
: nullable ASignature
1162 if n_doc
!= null then
1165 _n_kwredef
= n_kwredef
1166 if n_kwredef
!= null then
1167 n_kwredef
.parent
= self
1169 _n_visibility
= n_visibility
.as(not null)
1170 n_visibility
.parent
= self
1171 _n_methid
= n_methid
.as(not null)
1172 n_methid
.parent
= self
1173 _n_signature
= n_signature
.as(not null)
1174 n_signature
.parent
= self
1177 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1179 if _n_doc
== old_child
then
1180 if new_child
!= null then
1181 new_child
.parent
= self
1182 assert new_child
isa ADoc
1189 if _n_kwredef
== old_child
then
1190 if new_child
!= null then
1191 new_child
.parent
= self
1192 assert new_child
isa TKwredef
1193 _n_kwredef
= new_child
1199 if _n_visibility
== old_child
then
1200 if new_child
!= null then
1201 new_child
.parent
= self
1202 assert new_child
isa AVisibility
1203 _n_visibility
= new_child
1209 if _n_methid
== old_child
then
1210 if new_child
!= null then
1211 new_child
.parent
= self
1212 assert new_child
isa AMethid
1213 _n_methid
= new_child
1219 if _n_signature
== old_child
then
1220 if new_child
!= null then
1221 new_child
.parent
= self
1222 assert new_child
isa ASignature
1223 _n_signature
= new_child
1231 redef fun visit_all
(v
: Visitor)
1233 if _n_doc
!= null then
1234 v
.enter_visit
(_n_doc
.as(not null))
1236 if _n_kwredef
!= null then
1237 v
.enter_visit
(_n_kwredef
.as(not null))
1239 v
.enter_visit
(_n_visibility
)
1240 v
.enter_visit
(_n_methid
)
1241 v
.enter_visit
(_n_signature
)
1244 redef class ADeferredMethPropdef
1245 private init empty_init
do end
1247 init init_adeferredmethpropdef
(
1248 n_doc
: nullable ADoc,
1249 n_kwredef
: nullable TKwredef,
1250 n_visibility
: nullable AVisibility,
1251 n_kwmeth
: nullable TKwmeth,
1252 n_methid
: nullable AMethid,
1253 n_signature
: nullable ASignature
1258 if n_doc
!= null then
1261 _n_kwredef
= n_kwredef
1262 if n_kwredef
!= null then
1263 n_kwredef
.parent
= self
1265 _n_visibility
= n_visibility
.as(not null)
1266 n_visibility
.parent
= self
1267 _n_kwmeth
= n_kwmeth
.as(not null)
1268 n_kwmeth
.parent
= self
1269 _n_methid
= n_methid
.as(not null)
1270 n_methid
.parent
= self
1271 _n_signature
= n_signature
.as(not null)
1272 n_signature
.parent
= self
1275 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1277 if _n_doc
== old_child
then
1278 if new_child
!= null then
1279 new_child
.parent
= self
1280 assert new_child
isa ADoc
1287 if _n_kwredef
== old_child
then
1288 if new_child
!= null then
1289 new_child
.parent
= self
1290 assert new_child
isa TKwredef
1291 _n_kwredef
= new_child
1297 if _n_visibility
== old_child
then
1298 if new_child
!= null then
1299 new_child
.parent
= self
1300 assert new_child
isa AVisibility
1301 _n_visibility
= new_child
1307 if _n_kwmeth
== old_child
then
1308 if new_child
!= null then
1309 new_child
.parent
= self
1310 assert new_child
isa TKwmeth
1311 _n_kwmeth
= new_child
1317 if _n_methid
== old_child
then
1318 if new_child
!= null then
1319 new_child
.parent
= self
1320 assert new_child
isa AMethid
1321 _n_methid
= new_child
1327 if _n_signature
== old_child
then
1328 if new_child
!= null then
1329 new_child
.parent
= self
1330 assert new_child
isa ASignature
1331 _n_signature
= new_child
1339 redef fun visit_all
(v
: Visitor)
1341 if _n_doc
!= null then
1342 v
.enter_visit
(_n_doc
.as(not null))
1344 if _n_kwredef
!= null then
1345 v
.enter_visit
(_n_kwredef
.as(not null))
1347 v
.enter_visit
(_n_visibility
)
1348 v
.enter_visit
(_n_kwmeth
)
1349 v
.enter_visit
(_n_methid
)
1350 v
.enter_visit
(_n_signature
)
1353 redef class AInternMethPropdef
1354 private init empty_init
do end
1356 init init_ainternmethpropdef
(
1357 n_doc
: nullable ADoc,
1358 n_kwredef
: nullable TKwredef,
1359 n_visibility
: nullable AVisibility,
1360 n_kwmeth
: nullable TKwmeth,
1361 n_methid
: nullable AMethid,
1362 n_signature
: nullable ASignature
1367 if n_doc
!= null then
1370 _n_kwredef
= n_kwredef
1371 if n_kwredef
!= null then
1372 n_kwredef
.parent
= self
1374 _n_visibility
= n_visibility
.as(not null)
1375 n_visibility
.parent
= self
1376 _n_kwmeth
= n_kwmeth
.as(not null)
1377 n_kwmeth
.parent
= self
1378 _n_methid
= n_methid
.as(not null)
1379 n_methid
.parent
= self
1380 _n_signature
= n_signature
.as(not null)
1381 n_signature
.parent
= self
1384 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1386 if _n_doc
== old_child
then
1387 if new_child
!= null then
1388 new_child
.parent
= self
1389 assert new_child
isa ADoc
1396 if _n_kwredef
== old_child
then
1397 if new_child
!= null then
1398 new_child
.parent
= self
1399 assert new_child
isa TKwredef
1400 _n_kwredef
= new_child
1406 if _n_visibility
== old_child
then
1407 if new_child
!= null then
1408 new_child
.parent
= self
1409 assert new_child
isa AVisibility
1410 _n_visibility
= new_child
1416 if _n_kwmeth
== old_child
then
1417 if new_child
!= null then
1418 new_child
.parent
= self
1419 assert new_child
isa TKwmeth
1420 _n_kwmeth
= new_child
1426 if _n_methid
== old_child
then
1427 if new_child
!= null then
1428 new_child
.parent
= self
1429 assert new_child
isa AMethid
1430 _n_methid
= new_child
1436 if _n_signature
== old_child
then
1437 if new_child
!= null then
1438 new_child
.parent
= self
1439 assert new_child
isa ASignature
1440 _n_signature
= new_child
1448 redef fun visit_all
(v
: Visitor)
1450 if _n_doc
!= null then
1451 v
.enter_visit
(_n_doc
.as(not null))
1453 if _n_kwredef
!= null then
1454 v
.enter_visit
(_n_kwredef
.as(not null))
1456 v
.enter_visit
(_n_visibility
)
1457 v
.enter_visit
(_n_kwmeth
)
1458 v
.enter_visit
(_n_methid
)
1459 v
.enter_visit
(_n_signature
)
1462 redef class AExternMethPropdef
1463 private init empty_init
do end
1465 init init_aexternmethpropdef
(
1466 n_doc
: nullable ADoc,
1467 n_kwredef
: nullable TKwredef,
1468 n_visibility
: nullable AVisibility,
1469 n_kwmeth
: nullable TKwmeth,
1470 n_methid
: nullable AMethid,
1471 n_signature
: nullable ASignature,
1472 n_extern
: nullable TString,
1473 n_extern_calls
: nullable AExternCalls
1478 if n_doc
!= null then
1481 _n_kwredef
= n_kwredef
1482 if n_kwredef
!= null then
1483 n_kwredef
.parent
= self
1485 _n_visibility
= n_visibility
.as(not null)
1486 n_visibility
.parent
= self
1487 _n_kwmeth
= n_kwmeth
.as(not null)
1488 n_kwmeth
.parent
= self
1489 _n_methid
= n_methid
.as(not null)
1490 n_methid
.parent
= self
1491 _n_signature
= n_signature
.as(not null)
1492 n_signature
.parent
= self
1493 _n_extern
= n_extern
1494 if n_extern
!= null then
1495 n_extern
.parent
= self
1497 _n_extern_calls
= n_extern_calls
1498 if n_extern_calls
!= null then
1499 n_extern_calls
.parent
= self
1503 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1505 if _n_doc
== old_child
then
1506 if new_child
!= null then
1507 new_child
.parent
= self
1508 assert new_child
isa ADoc
1515 if _n_kwredef
== old_child
then
1516 if new_child
!= null then
1517 new_child
.parent
= self
1518 assert new_child
isa TKwredef
1519 _n_kwredef
= new_child
1525 if _n_visibility
== old_child
then
1526 if new_child
!= null then
1527 new_child
.parent
= self
1528 assert new_child
isa AVisibility
1529 _n_visibility
= new_child
1535 if _n_kwmeth
== old_child
then
1536 if new_child
!= null then
1537 new_child
.parent
= self
1538 assert new_child
isa TKwmeth
1539 _n_kwmeth
= new_child
1545 if _n_methid
== old_child
then
1546 if new_child
!= null then
1547 new_child
.parent
= self
1548 assert new_child
isa AMethid
1549 _n_methid
= new_child
1555 if _n_signature
== old_child
then
1556 if new_child
!= null then
1557 new_child
.parent
= self
1558 assert new_child
isa ASignature
1559 _n_signature
= new_child
1565 if _n_extern
== old_child
then
1566 if new_child
!= null then
1567 new_child
.parent
= self
1568 assert new_child
isa TString
1569 _n_extern
= new_child
1575 if _n_extern_calls
== old_child
then
1576 if new_child
!= null then
1577 new_child
.parent
= self
1578 assert new_child
isa AExternCalls
1579 _n_extern_calls
= new_child
1581 _n_extern_calls
= null
1587 redef fun visit_all
(v
: Visitor)
1589 if _n_doc
!= null then
1590 v
.enter_visit
(_n_doc
.as(not null))
1592 if _n_kwredef
!= null then
1593 v
.enter_visit
(_n_kwredef
.as(not null))
1595 v
.enter_visit
(_n_visibility
)
1596 v
.enter_visit
(_n_kwmeth
)
1597 v
.enter_visit
(_n_methid
)
1598 v
.enter_visit
(_n_signature
)
1599 if _n_extern
!= null then
1600 v
.enter_visit
(_n_extern
.as(not null))
1602 if _n_extern_calls
!= null then
1603 v
.enter_visit
(_n_extern_calls
.as(not null))
1607 redef class AConcreteMethPropdef
1608 private init empty_init
do end
1610 init init_aconcretemethpropdef
(
1611 n_doc
: nullable ADoc,
1612 n_kwredef
: nullable TKwredef,
1613 n_visibility
: nullable AVisibility,
1614 n_kwmeth
: nullable TKwmeth,
1615 n_methid
: nullable AMethid,
1616 n_signature
: nullable ASignature,
1617 n_block
: nullable AExpr
1622 if n_doc
!= null then
1625 _n_kwredef
= n_kwredef
1626 if n_kwredef
!= null then
1627 n_kwredef
.parent
= self
1629 _n_visibility
= n_visibility
.as(not null)
1630 n_visibility
.parent
= self
1631 _n_kwmeth
= n_kwmeth
.as(not null)
1632 n_kwmeth
.parent
= self
1633 _n_methid
= n_methid
.as(not null)
1634 n_methid
.parent
= self
1635 _n_signature
= n_signature
.as(not null)
1636 n_signature
.parent
= self
1638 if n_block
!= null then
1639 n_block
.parent
= self
1643 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1645 if _n_doc
== old_child
then
1646 if new_child
!= null then
1647 new_child
.parent
= self
1648 assert new_child
isa ADoc
1655 if _n_kwredef
== old_child
then
1656 if new_child
!= null then
1657 new_child
.parent
= self
1658 assert new_child
isa TKwredef
1659 _n_kwredef
= new_child
1665 if _n_visibility
== old_child
then
1666 if new_child
!= null then
1667 new_child
.parent
= self
1668 assert new_child
isa AVisibility
1669 _n_visibility
= new_child
1675 if _n_kwmeth
== old_child
then
1676 if new_child
!= null then
1677 new_child
.parent
= self
1678 assert new_child
isa TKwmeth
1679 _n_kwmeth
= new_child
1685 if _n_methid
== old_child
then
1686 if new_child
!= null then
1687 new_child
.parent
= self
1688 assert new_child
isa AMethid
1689 _n_methid
= new_child
1695 if _n_signature
== old_child
then
1696 if new_child
!= null then
1697 new_child
.parent
= self
1698 assert new_child
isa ASignature
1699 _n_signature
= new_child
1705 if _n_block
== old_child
then
1706 if new_child
!= null then
1707 new_child
.parent
= self
1708 assert new_child
isa AExpr
1709 _n_block
= new_child
1717 redef fun visit_all
(v
: Visitor)
1719 if _n_doc
!= null then
1720 v
.enter_visit
(_n_doc
.as(not null))
1722 if _n_kwredef
!= null then
1723 v
.enter_visit
(_n_kwredef
.as(not null))
1725 v
.enter_visit
(_n_visibility
)
1726 v
.enter_visit
(_n_kwmeth
)
1727 v
.enter_visit
(_n_methid
)
1728 v
.enter_visit
(_n_signature
)
1729 if _n_block
!= null then
1730 v
.enter_visit
(_n_block
.as(not null))
1734 redef class AConcreteInitPropdef
1735 private init empty_init
do end
1737 init init_aconcreteinitpropdef
(
1738 n_doc
: nullable ADoc,
1739 n_kwredef
: nullable TKwredef,
1740 n_visibility
: nullable AVisibility,
1741 n_kwinit
: nullable TKwinit,
1742 n_methid
: nullable AMethid,
1743 n_signature
: nullable ASignature,
1744 n_block
: nullable AExpr
1749 if n_doc
!= null then
1752 _n_kwredef
= n_kwredef
1753 if n_kwredef
!= null then
1754 n_kwredef
.parent
= self
1756 _n_visibility
= n_visibility
.as(not null)
1757 n_visibility
.parent
= self
1758 _n_kwinit
= n_kwinit
.as(not null)
1759 n_kwinit
.parent
= self
1760 _n_methid
= n_methid
1761 if n_methid
!= null then
1762 n_methid
.parent
= self
1764 _n_signature
= n_signature
.as(not null)
1765 n_signature
.parent
= self
1767 if n_block
!= null then
1768 n_block
.parent
= self
1772 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1774 if _n_doc
== old_child
then
1775 if new_child
!= null then
1776 new_child
.parent
= self
1777 assert new_child
isa ADoc
1784 if _n_kwredef
== old_child
then
1785 if new_child
!= null then
1786 new_child
.parent
= self
1787 assert new_child
isa TKwredef
1788 _n_kwredef
= new_child
1794 if _n_visibility
== old_child
then
1795 if new_child
!= null then
1796 new_child
.parent
= self
1797 assert new_child
isa AVisibility
1798 _n_visibility
= new_child
1804 if _n_kwinit
== old_child
then
1805 if new_child
!= null then
1806 new_child
.parent
= self
1807 assert new_child
isa TKwinit
1808 _n_kwinit
= new_child
1814 if _n_methid
== old_child
then
1815 if new_child
!= null then
1816 new_child
.parent
= self
1817 assert new_child
isa AMethid
1818 _n_methid
= new_child
1824 if _n_signature
== old_child
then
1825 if new_child
!= null then
1826 new_child
.parent
= self
1827 assert new_child
isa ASignature
1828 _n_signature
= new_child
1834 if _n_block
== old_child
then
1835 if new_child
!= null then
1836 new_child
.parent
= self
1837 assert new_child
isa AExpr
1838 _n_block
= new_child
1846 redef fun visit_all
(v
: Visitor)
1848 if _n_doc
!= null then
1849 v
.enter_visit
(_n_doc
.as(not null))
1851 if _n_kwredef
!= null then
1852 v
.enter_visit
(_n_kwredef
.as(not null))
1854 v
.enter_visit
(_n_visibility
)
1855 v
.enter_visit
(_n_kwinit
)
1856 if _n_methid
!= null then
1857 v
.enter_visit
(_n_methid
.as(not null))
1859 v
.enter_visit
(_n_signature
)
1860 if _n_block
!= null then
1861 v
.enter_visit
(_n_block
.as(not null))
1865 redef class AExternInitPropdef
1866 private init empty_init
do end
1868 init init_aexterninitpropdef
(
1869 n_doc
: nullable ADoc,
1870 n_kwredef
: nullable TKwredef,
1871 n_visibility
: nullable AVisibility,
1872 n_kwnew
: nullable TKwnew,
1873 n_methid
: nullable AMethid,
1874 n_signature
: nullable ASignature,
1875 n_extern
: nullable TString,
1876 n_extern_calls
: nullable AExternCalls
1881 if n_doc
!= null then
1884 _n_kwredef
= n_kwredef
1885 if n_kwredef
!= null then
1886 n_kwredef
.parent
= self
1888 _n_visibility
= n_visibility
.as(not null)
1889 n_visibility
.parent
= self
1890 _n_kwnew
= n_kwnew
.as(not null)
1891 n_kwnew
.parent
= self
1892 _n_methid
= n_methid
1893 if n_methid
!= null then
1894 n_methid
.parent
= self
1896 _n_signature
= n_signature
.as(not null)
1897 n_signature
.parent
= self
1898 _n_extern
= n_extern
1899 if n_extern
!= null then
1900 n_extern
.parent
= self
1902 _n_extern_calls
= n_extern_calls
1903 if n_extern_calls
!= null then
1904 n_extern_calls
.parent
= self
1908 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1910 if _n_doc
== old_child
then
1911 if new_child
!= null then
1912 new_child
.parent
= self
1913 assert new_child
isa ADoc
1920 if _n_kwredef
== old_child
then
1921 if new_child
!= null then
1922 new_child
.parent
= self
1923 assert new_child
isa TKwredef
1924 _n_kwredef
= new_child
1930 if _n_visibility
== old_child
then
1931 if new_child
!= null then
1932 new_child
.parent
= self
1933 assert new_child
isa AVisibility
1934 _n_visibility
= new_child
1940 if _n_kwnew
== old_child
then
1941 if new_child
!= null then
1942 new_child
.parent
= self
1943 assert new_child
isa TKwnew
1944 _n_kwnew
= new_child
1950 if _n_methid
== old_child
then
1951 if new_child
!= null then
1952 new_child
.parent
= self
1953 assert new_child
isa AMethid
1954 _n_methid
= new_child
1960 if _n_signature
== old_child
then
1961 if new_child
!= null then
1962 new_child
.parent
= self
1963 assert new_child
isa ASignature
1964 _n_signature
= new_child
1970 if _n_extern
== old_child
then
1971 if new_child
!= null then
1972 new_child
.parent
= self
1973 assert new_child
isa TString
1974 _n_extern
= new_child
1980 if _n_extern_calls
== old_child
then
1981 if new_child
!= null then
1982 new_child
.parent
= self
1983 assert new_child
isa AExternCalls
1984 _n_extern_calls
= new_child
1986 _n_extern_calls
= null
1992 redef fun visit_all
(v
: Visitor)
1994 if _n_doc
!= null then
1995 v
.enter_visit
(_n_doc
.as(not null))
1997 if _n_kwredef
!= null then
1998 v
.enter_visit
(_n_kwredef
.as(not null))
2000 v
.enter_visit
(_n_visibility
)
2001 v
.enter_visit
(_n_kwnew
)
2002 if _n_methid
!= null then
2003 v
.enter_visit
(_n_methid
.as(not null))
2005 v
.enter_visit
(_n_signature
)
2006 if _n_extern
!= null then
2007 v
.enter_visit
(_n_extern
.as(not null))
2009 if _n_extern_calls
!= null then
2010 v
.enter_visit
(_n_extern_calls
.as(not null))
2014 redef class AMainMethPropdef
2015 private init empty_init
do end
2017 init init_amainmethpropdef
(
2018 n_kwredef
: nullable TKwredef,
2019 n_block
: nullable AExpr
2023 _n_kwredef
= n_kwredef
2024 if n_kwredef
!= null then
2025 n_kwredef
.parent
= self
2028 if n_block
!= null then
2029 n_block
.parent
= self
2033 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2035 if _n_kwredef
== old_child
then
2036 if new_child
!= null then
2037 new_child
.parent
= self
2038 assert new_child
isa TKwredef
2039 _n_kwredef
= new_child
2045 if _n_block
== old_child
then
2046 if new_child
!= null then
2047 new_child
.parent
= self
2048 assert new_child
isa AExpr
2049 _n_block
= new_child
2057 redef fun visit_all
(v
: Visitor)
2059 if _n_kwredef
!= null then
2060 v
.enter_visit
(_n_kwredef
.as(not null))
2062 if _n_block
!= null then
2063 v
.enter_visit
(_n_block
.as(not null))
2067 redef class ATypePropdef
2068 private init empty_init
do end
2070 init init_atypepropdef
(
2071 n_doc
: nullable ADoc,
2072 n_kwredef
: nullable TKwredef,
2073 n_visibility
: nullable AVisibility,
2074 n_kwtype
: nullable TKwtype,
2075 n_id
: nullable TClassid,
2076 n_type
: nullable AType
2081 if n_doc
!= null then
2084 _n_kwredef
= n_kwredef
2085 if n_kwredef
!= null then
2086 n_kwredef
.parent
= self
2088 _n_visibility
= n_visibility
.as(not null)
2089 n_visibility
.parent
= self
2090 _n_kwtype
= n_kwtype
.as(not null)
2091 n_kwtype
.parent
= self
2092 _n_id
= n_id
.as(not null)
2094 _n_type
= n_type
.as(not null)
2095 n_type
.parent
= self
2098 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2100 if _n_doc
== old_child
then
2101 if new_child
!= null then
2102 new_child
.parent
= self
2103 assert new_child
isa ADoc
2110 if _n_kwredef
== old_child
then
2111 if new_child
!= null then
2112 new_child
.parent
= self
2113 assert new_child
isa TKwredef
2114 _n_kwredef
= new_child
2120 if _n_visibility
== old_child
then
2121 if new_child
!= null then
2122 new_child
.parent
= self
2123 assert new_child
isa AVisibility
2124 _n_visibility
= new_child
2130 if _n_kwtype
== old_child
then
2131 if new_child
!= null then
2132 new_child
.parent
= self
2133 assert new_child
isa TKwtype
2134 _n_kwtype
= new_child
2140 if _n_id
== old_child
then
2141 if new_child
!= null then
2142 new_child
.parent
= self
2143 assert new_child
isa TClassid
2150 if _n_type
== old_child
then
2151 if new_child
!= null then
2152 new_child
.parent
= self
2153 assert new_child
isa AType
2162 redef fun visit_all
(v
: Visitor)
2164 if _n_doc
!= null then
2165 v
.enter_visit
(_n_doc
.as(not null))
2167 if _n_kwredef
!= null then
2168 v
.enter_visit
(_n_kwredef
.as(not null))
2170 v
.enter_visit
(_n_visibility
)
2171 v
.enter_visit
(_n_kwtype
)
2172 v
.enter_visit
(_n_id
)
2173 v
.enter_visit
(_n_type
)
2176 redef class AReadAble
2177 private init empty_init
do end
2179 init init_areadable
(
2180 n_kwredef
: nullable TKwredef,
2181 n_kwreadable
: nullable TKwreadable
2185 _n_kwredef
= n_kwredef
2186 if n_kwredef
!= null then
2187 n_kwredef
.parent
= self
2189 _n_kwreadable
= n_kwreadable
.as(not null)
2190 n_kwreadable
.parent
= self
2193 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2195 if _n_kwredef
== old_child
then
2196 if new_child
!= null then
2197 new_child
.parent
= self
2198 assert new_child
isa TKwredef
2199 _n_kwredef
= new_child
2205 if _n_kwreadable
== old_child
then
2206 if new_child
!= null then
2207 new_child
.parent
= self
2208 assert new_child
isa TKwreadable
2209 _n_kwreadable
= new_child
2217 redef fun visit_all
(v
: Visitor)
2219 if _n_kwredef
!= null then
2220 v
.enter_visit
(_n_kwredef
.as(not null))
2222 v
.enter_visit
(_n_kwreadable
)
2225 redef class AWriteAble
2226 private init empty_init
do end
2228 init init_awriteable
(
2229 n_kwredef
: nullable TKwredef,
2230 n_visibility
: nullable AVisibility,
2231 n_kwwritable
: nullable TKwwritable
2235 _n_kwredef
= n_kwredef
2236 if n_kwredef
!= null then
2237 n_kwredef
.parent
= self
2239 _n_visibility
= n_visibility
2240 if n_visibility
!= null then
2241 n_visibility
.parent
= self
2243 _n_kwwritable
= n_kwwritable
.as(not null)
2244 n_kwwritable
.parent
= self
2247 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2249 if _n_kwredef
== old_child
then
2250 if new_child
!= null then
2251 new_child
.parent
= self
2252 assert new_child
isa TKwredef
2253 _n_kwredef
= new_child
2259 if _n_visibility
== old_child
then
2260 if new_child
!= null then
2261 new_child
.parent
= self
2262 assert new_child
isa AVisibility
2263 _n_visibility
= new_child
2265 _n_visibility
= null
2269 if _n_kwwritable
== old_child
then
2270 if new_child
!= null then
2271 new_child
.parent
= self
2272 assert new_child
isa TKwwritable
2273 _n_kwwritable
= new_child
2281 redef fun visit_all
(v
: Visitor)
2283 if _n_kwredef
!= null then
2284 v
.enter_visit
(_n_kwredef
.as(not null))
2286 if _n_visibility
!= null then
2287 v
.enter_visit
(_n_visibility
.as(not null))
2289 v
.enter_visit
(_n_kwwritable
)
2292 redef class AIdMethid
2293 private init empty_init
do end
2295 init init_aidmethid
(
2300 _n_id
= n_id
.as(not null)
2304 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2306 if _n_id
== old_child
then
2307 if new_child
!= null then
2308 new_child
.parent
= self
2309 assert new_child
isa TId
2318 redef fun visit_all
(v
: Visitor)
2320 v
.enter_visit
(_n_id
)
2323 redef class APlusMethid
2324 private init empty_init
do end
2326 init init_aplusmethid
(
2327 n_plus
: nullable TPlus
2331 _n_plus
= n_plus
.as(not null)
2332 n_plus
.parent
= self
2335 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2337 if _n_plus
== old_child
then
2338 if new_child
!= null then
2339 new_child
.parent
= self
2340 assert new_child
isa TPlus
2349 redef fun visit_all
(v
: Visitor)
2351 v
.enter_visit
(_n_plus
)
2354 redef class AMinusMethid
2355 private init empty_init
do end
2357 init init_aminusmethid
(
2358 n_minus
: nullable TMinus
2362 _n_minus
= n_minus
.as(not null)
2363 n_minus
.parent
= self
2366 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2368 if _n_minus
== old_child
then
2369 if new_child
!= null then
2370 new_child
.parent
= self
2371 assert new_child
isa TMinus
2372 _n_minus
= new_child
2380 redef fun visit_all
(v
: Visitor)
2382 v
.enter_visit
(_n_minus
)
2385 redef class AStarMethid
2386 private init empty_init
do end
2388 init init_astarmethid
(
2389 n_star
: nullable TStar
2393 _n_star
= n_star
.as(not null)
2394 n_star
.parent
= self
2397 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2399 if _n_star
== old_child
then
2400 if new_child
!= null then
2401 new_child
.parent
= self
2402 assert new_child
isa TStar
2411 redef fun visit_all
(v
: Visitor)
2413 v
.enter_visit
(_n_star
)
2416 redef class ASlashMethid
2417 private init empty_init
do end
2419 init init_aslashmethid
(
2420 n_slash
: nullable TSlash
2424 _n_slash
= n_slash
.as(not null)
2425 n_slash
.parent
= self
2428 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2430 if _n_slash
== old_child
then
2431 if new_child
!= null then
2432 new_child
.parent
= self
2433 assert new_child
isa TSlash
2434 _n_slash
= new_child
2442 redef fun visit_all
(v
: Visitor)
2444 v
.enter_visit
(_n_slash
)
2447 redef class APercentMethid
2448 private init empty_init
do end
2450 init init_apercentmethid
(
2451 n_percent
: nullable TPercent
2455 _n_percent
= n_percent
.as(not null)
2456 n_percent
.parent
= self
2459 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2461 if _n_percent
== old_child
then
2462 if new_child
!= null then
2463 new_child
.parent
= self
2464 assert new_child
isa TPercent
2465 _n_percent
= new_child
2473 redef fun visit_all
(v
: Visitor)
2475 v
.enter_visit
(_n_percent
)
2478 redef class AEqMethid
2479 private init empty_init
do end
2481 init init_aeqmethid
(
2486 _n_eq
= n_eq
.as(not null)
2490 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2492 if _n_eq
== old_child
then
2493 if new_child
!= null then
2494 new_child
.parent
= self
2495 assert new_child
isa TEq
2504 redef fun visit_all
(v
: Visitor)
2506 v
.enter_visit
(_n_eq
)
2509 redef class ANeMethid
2510 private init empty_init
do end
2512 init init_anemethid
(
2517 _n_ne
= n_ne
.as(not null)
2521 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2523 if _n_ne
== old_child
then
2524 if new_child
!= null then
2525 new_child
.parent
= self
2526 assert new_child
isa TNe
2535 redef fun visit_all
(v
: Visitor)
2537 v
.enter_visit
(_n_ne
)
2540 redef class ALeMethid
2541 private init empty_init
do end
2543 init init_alemethid
(
2548 _n_le
= n_le
.as(not null)
2552 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2554 if _n_le
== old_child
then
2555 if new_child
!= null then
2556 new_child
.parent
= self
2557 assert new_child
isa TLe
2566 redef fun visit_all
(v
: Visitor)
2568 v
.enter_visit
(_n_le
)
2571 redef class AGeMethid
2572 private init empty_init
do end
2574 init init_agemethid
(
2579 _n_ge
= n_ge
.as(not null)
2583 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2585 if _n_ge
== old_child
then
2586 if new_child
!= null then
2587 new_child
.parent
= self
2588 assert new_child
isa TGe
2597 redef fun visit_all
(v
: Visitor)
2599 v
.enter_visit
(_n_ge
)
2602 redef class ALtMethid
2603 private init empty_init
do end
2605 init init_altmethid
(
2610 _n_lt
= n_lt
.as(not null)
2614 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2616 if _n_lt
== old_child
then
2617 if new_child
!= null then
2618 new_child
.parent
= self
2619 assert new_child
isa TLt
2628 redef fun visit_all
(v
: Visitor)
2630 v
.enter_visit
(_n_lt
)
2633 redef class AGtMethid
2634 private init empty_init
do end
2636 init init_agtmethid
(
2641 _n_gt
= n_gt
.as(not null)
2645 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2647 if _n_gt
== old_child
then
2648 if new_child
!= null then
2649 new_child
.parent
= self
2650 assert new_child
isa TGt
2659 redef fun visit_all
(v
: Visitor)
2661 v
.enter_visit
(_n_gt
)
2664 redef class ALlMethid
2665 private init empty_init
do end
2667 init init_allmethid
(
2672 _n_ll
= n_ll
.as(not null)
2676 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2678 if _n_ll
== old_child
then
2679 if new_child
!= null then
2680 new_child
.parent
= self
2681 assert new_child
isa TLl
2690 redef fun visit_all
(v
: Visitor)
2692 v
.enter_visit
(_n_ll
)
2695 redef class AGgMethid
2696 private init empty_init
do end
2698 init init_aggmethid
(
2703 _n_gg
= n_gg
.as(not null)
2707 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2709 if _n_gg
== old_child
then
2710 if new_child
!= null then
2711 new_child
.parent
= self
2712 assert new_child
isa TGg
2721 redef fun visit_all
(v
: Visitor)
2723 v
.enter_visit
(_n_gg
)
2726 redef class ABraMethid
2727 private init empty_init
do end
2729 init init_abramethid
(
2730 n_obra
: nullable TObra,
2731 n_cbra
: nullable TCbra
2735 _n_obra
= n_obra
.as(not null)
2736 n_obra
.parent
= self
2737 _n_cbra
= n_cbra
.as(not null)
2738 n_cbra
.parent
= self
2741 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2743 if _n_obra
== old_child
then
2744 if new_child
!= null then
2745 new_child
.parent
= self
2746 assert new_child
isa TObra
2753 if _n_cbra
== old_child
then
2754 if new_child
!= null then
2755 new_child
.parent
= self
2756 assert new_child
isa TCbra
2765 redef fun visit_all
(v
: Visitor)
2767 v
.enter_visit
(_n_obra
)
2768 v
.enter_visit
(_n_cbra
)
2771 redef class AStarshipMethid
2772 private init empty_init
do end
2774 init init_astarshipmethid
(
2775 n_starship
: nullable TStarship
2779 _n_starship
= n_starship
.as(not null)
2780 n_starship
.parent
= self
2783 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2785 if _n_starship
== old_child
then
2786 if new_child
!= null then
2787 new_child
.parent
= self
2788 assert new_child
isa TStarship
2789 _n_starship
= new_child
2797 redef fun visit_all
(v
: Visitor)
2799 v
.enter_visit
(_n_starship
)
2802 redef class AAssignMethid
2803 private init empty_init
do end
2805 init init_aassignmethid
(
2807 n_assign
: nullable TAssign
2811 _n_id
= n_id
.as(not null)
2813 _n_assign
= n_assign
.as(not null)
2814 n_assign
.parent
= self
2817 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2819 if _n_id
== old_child
then
2820 if new_child
!= null then
2821 new_child
.parent
= self
2822 assert new_child
isa TId
2829 if _n_assign
== old_child
then
2830 if new_child
!= null then
2831 new_child
.parent
= self
2832 assert new_child
isa TAssign
2833 _n_assign
= new_child
2841 redef fun visit_all
(v
: Visitor)
2843 v
.enter_visit
(_n_id
)
2844 v
.enter_visit
(_n_assign
)
2847 redef class ABraassignMethid
2848 private init empty_init
do end
2850 init init_abraassignmethid
(
2851 n_obra
: nullable TObra,
2852 n_cbra
: nullable TCbra,
2853 n_assign
: nullable TAssign
2857 _n_obra
= n_obra
.as(not null)
2858 n_obra
.parent
= self
2859 _n_cbra
= n_cbra
.as(not null)
2860 n_cbra
.parent
= self
2861 _n_assign
= n_assign
.as(not null)
2862 n_assign
.parent
= self
2865 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2867 if _n_obra
== old_child
then
2868 if new_child
!= null then
2869 new_child
.parent
= self
2870 assert new_child
isa TObra
2877 if _n_cbra
== old_child
then
2878 if new_child
!= null then
2879 new_child
.parent
= self
2880 assert new_child
isa TCbra
2887 if _n_assign
== old_child
then
2888 if new_child
!= null then
2889 new_child
.parent
= self
2890 assert new_child
isa TAssign
2891 _n_assign
= new_child
2899 redef fun visit_all
(v
: Visitor)
2901 v
.enter_visit
(_n_obra
)
2902 v
.enter_visit
(_n_cbra
)
2903 v
.enter_visit
(_n_assign
)
2906 redef class ASignature
2907 private init empty_init
do end
2909 init init_asignature
(
2910 n_params
: Collection[Object], # Should be Collection[AParam]
2911 n_type
: nullable AType,
2912 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2916 for n
in n_params
do
2922 if n_type
!= null then
2923 n_type
.parent
= self
2925 for n
in n_closure_decls
do
2926 assert n
isa AClosureDecl
2927 _n_closure_decls
.add
(n
)
2932 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2934 for i
in [0.._n_params
.length
[ do
2935 if _n_params
[i
] == old_child
then
2936 if new_child
!= null then
2937 assert new_child
isa AParam
2938 _n_params
[i
] = new_child
2939 new_child
.parent
= self
2941 _n_params
.remove_at
(i
)
2946 if _n_type
== old_child
then
2947 if new_child
!= null then
2948 new_child
.parent
= self
2949 assert new_child
isa AType
2956 for i
in [0.._n_closure_decls
.length
[ do
2957 if _n_closure_decls
[i
] == old_child
then
2958 if new_child
!= null then
2959 assert new_child
isa AClosureDecl
2960 _n_closure_decls
[i
] = new_child
2961 new_child
.parent
= self
2963 _n_closure_decls
.remove_at
(i
)
2970 redef fun visit_all
(v
: Visitor)
2972 for n
in _n_params
do
2975 if _n_type
!= null then
2976 v
.enter_visit
(_n_type
.as(not null))
2978 for n
in _n_closure_decls
do
2984 private init empty_init
do end
2988 n_type
: nullable AType,
2989 n_dotdotdot
: nullable TDotdotdot
2993 _n_id
= n_id
.as(not null)
2996 if n_type
!= null then
2997 n_type
.parent
= self
2999 _n_dotdotdot
= n_dotdotdot
3000 if n_dotdotdot
!= null then
3001 n_dotdotdot
.parent
= self
3005 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3007 if _n_id
== old_child
then
3008 if new_child
!= null then
3009 new_child
.parent
= self
3010 assert new_child
isa TId
3017 if _n_type
== old_child
then
3018 if new_child
!= null then
3019 new_child
.parent
= self
3020 assert new_child
isa AType
3027 if _n_dotdotdot
== old_child
then
3028 if new_child
!= null then
3029 new_child
.parent
= self
3030 assert new_child
isa TDotdotdot
3031 _n_dotdotdot
= new_child
3039 redef fun visit_all
(v
: Visitor)
3041 v
.enter_visit
(_n_id
)
3042 if _n_type
!= null then
3043 v
.enter_visit
(_n_type
.as(not null))
3045 if _n_dotdotdot
!= null then
3046 v
.enter_visit
(_n_dotdotdot
.as(not null))
3050 redef class AClosureDecl
3051 private init empty_init
do end
3053 init init_aclosuredecl
(
3054 n_kwbreak
: nullable TKwbreak,
3055 n_bang
: nullable TBang,
3057 n_signature
: nullable ASignature,
3058 n_expr
: nullable AExpr
3062 _n_kwbreak
= n_kwbreak
3063 if n_kwbreak
!= null then
3064 n_kwbreak
.parent
= self
3066 _n_bang
= n_bang
.as(not null)
3067 n_bang
.parent
= self
3068 _n_id
= n_id
.as(not null)
3070 _n_signature
= n_signature
.as(not null)
3071 n_signature
.parent
= self
3073 if n_expr
!= null then
3074 n_expr
.parent
= self
3078 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3080 if _n_kwbreak
== old_child
then
3081 if new_child
!= null then
3082 new_child
.parent
= self
3083 assert new_child
isa TKwbreak
3084 _n_kwbreak
= new_child
3090 if _n_bang
== old_child
then
3091 if new_child
!= null then
3092 new_child
.parent
= self
3093 assert new_child
isa TBang
3100 if _n_id
== old_child
then
3101 if new_child
!= null then
3102 new_child
.parent
= self
3103 assert new_child
isa TId
3110 if _n_signature
== old_child
then
3111 if new_child
!= null then
3112 new_child
.parent
= self
3113 assert new_child
isa ASignature
3114 _n_signature
= new_child
3120 if _n_expr
== old_child
then
3121 if new_child
!= null then
3122 new_child
.parent
= self
3123 assert new_child
isa AExpr
3132 redef fun visit_all
(v
: Visitor)
3134 if _n_kwbreak
!= null then
3135 v
.enter_visit
(_n_kwbreak
.as(not null))
3137 v
.enter_visit
(_n_bang
)
3138 v
.enter_visit
(_n_id
)
3139 v
.enter_visit
(_n_signature
)
3140 if _n_expr
!= null then
3141 v
.enter_visit
(_n_expr
.as(not null))
3146 private init empty_init
do end
3149 n_kwnullable
: nullable TKwnullable,
3150 n_id
: nullable TClassid,
3151 n_types
: Collection[Object] # Should be Collection[AType]
3155 _n_kwnullable
= n_kwnullable
3156 if n_kwnullable
!= null then
3157 n_kwnullable
.parent
= self
3159 _n_id
= n_id
.as(not null)
3168 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3170 if _n_kwnullable
== old_child
then
3171 if new_child
!= null then
3172 new_child
.parent
= self
3173 assert new_child
isa TKwnullable
3174 _n_kwnullable
= new_child
3176 _n_kwnullable
= null
3180 if _n_id
== old_child
then
3181 if new_child
!= null then
3182 new_child
.parent
= self
3183 assert new_child
isa TClassid
3190 for i
in [0.._n_types
.length
[ do
3191 if _n_types
[i
] == old_child
then
3192 if new_child
!= null then
3193 assert new_child
isa AType
3194 _n_types
[i
] = new_child
3195 new_child
.parent
= self
3197 _n_types
.remove_at
(i
)
3204 redef fun visit_all
(v
: Visitor)
3206 if _n_kwnullable
!= null then
3207 v
.enter_visit
(_n_kwnullable
.as(not null))
3209 v
.enter_visit
(_n_id
)
3210 for n
in _n_types
do
3216 private init empty_init
do end
3219 n_kwlabel
: nullable TKwlabel,
3224 _n_kwlabel
= n_kwlabel
.as(not null)
3225 n_kwlabel
.parent
= self
3226 _n_id
= n_id
.as(not null)
3230 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3232 if _n_kwlabel
== old_child
then
3233 if new_child
!= null then
3234 new_child
.parent
= self
3235 assert new_child
isa TKwlabel
3236 _n_kwlabel
= new_child
3242 if _n_id
== old_child
then
3243 if new_child
!= null then
3244 new_child
.parent
= self
3245 assert new_child
isa TId
3254 redef fun visit_all
(v
: Visitor)
3256 v
.enter_visit
(_n_kwlabel
)
3257 v
.enter_visit
(_n_id
)
3260 redef class ABlockExpr
3261 private init empty_init
do end
3263 init init_ablockexpr
(
3264 n_expr
: Collection[Object] # Should be Collection[AExpr]
3275 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3277 for i
in [0.._n_expr
.length
[ do
3278 if _n_expr
[i
] == old_child
then
3279 if new_child
!= null then
3280 assert new_child
isa AExpr
3281 _n_expr
[i
] = new_child
3282 new_child
.parent
= self
3284 _n_expr
.remove_at
(i
)
3291 redef fun visit_all
(v
: Visitor)
3298 redef class AVardeclExpr
3299 private init empty_init
do end
3301 init init_avardeclexpr
(
3302 n_kwvar
: nullable TKwvar,
3304 n_type
: nullable AType,
3305 n_assign
: nullable TAssign,
3306 n_expr
: nullable AExpr
3310 _n_kwvar
= n_kwvar
.as(not null)
3311 n_kwvar
.parent
= self
3312 _n_id
= n_id
.as(not null)
3315 if n_type
!= null then
3316 n_type
.parent
= self
3318 _n_assign
= n_assign
3319 if n_assign
!= null then
3320 n_assign
.parent
= self
3323 if n_expr
!= null then
3324 n_expr
.parent
= self
3328 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3330 if _n_kwvar
== old_child
then
3331 if new_child
!= null then
3332 new_child
.parent
= self
3333 assert new_child
isa TKwvar
3334 _n_kwvar
= new_child
3340 if _n_id
== old_child
then
3341 if new_child
!= null then
3342 new_child
.parent
= self
3343 assert new_child
isa TId
3350 if _n_type
== old_child
then
3351 if new_child
!= null then
3352 new_child
.parent
= self
3353 assert new_child
isa AType
3360 if _n_assign
== old_child
then
3361 if new_child
!= null then
3362 new_child
.parent
= self
3363 assert new_child
isa TAssign
3364 _n_assign
= new_child
3370 if _n_expr
== old_child
then
3371 if new_child
!= null then
3372 new_child
.parent
= self
3373 assert new_child
isa AExpr
3382 redef fun visit_all
(v
: Visitor)
3384 v
.enter_visit
(_n_kwvar
)
3385 v
.enter_visit
(_n_id
)
3386 if _n_type
!= null then
3387 v
.enter_visit
(_n_type
.as(not null))
3389 if _n_assign
!= null then
3390 v
.enter_visit
(_n_assign
.as(not null))
3392 if _n_expr
!= null then
3393 v
.enter_visit
(_n_expr
.as(not null))
3397 redef class AReturnExpr
3398 private init empty_init
do end
3400 init init_areturnexpr
(
3401 n_kwreturn
: nullable TKwreturn,
3402 n_expr
: nullable AExpr
3406 _n_kwreturn
= n_kwreturn
3407 if n_kwreturn
!= null then
3408 n_kwreturn
.parent
= self
3411 if n_expr
!= null then
3412 n_expr
.parent
= self
3416 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3418 if _n_kwreturn
== old_child
then
3419 if new_child
!= null then
3420 new_child
.parent
= self
3421 assert new_child
isa TKwreturn
3422 _n_kwreturn
= new_child
3428 if _n_expr
== old_child
then
3429 if new_child
!= null then
3430 new_child
.parent
= self
3431 assert new_child
isa AExpr
3440 redef fun visit_all
(v
: Visitor)
3442 if _n_kwreturn
!= null then
3443 v
.enter_visit
(_n_kwreturn
.as(not null))
3445 if _n_expr
!= null then
3446 v
.enter_visit
(_n_expr
.as(not null))
3450 redef class ABreakExpr
3451 private init empty_init
do end
3453 init init_abreakexpr
(
3454 n_kwbreak
: nullable TKwbreak,
3455 n_label
: nullable ALabel,
3456 n_expr
: nullable AExpr
3460 _n_kwbreak
= n_kwbreak
.as(not null)
3461 n_kwbreak
.parent
= self
3463 if n_label
!= null then
3464 n_label
.parent
= self
3467 if n_expr
!= null then
3468 n_expr
.parent
= self
3472 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3474 if _n_kwbreak
== old_child
then
3475 if new_child
!= null then
3476 new_child
.parent
= self
3477 assert new_child
isa TKwbreak
3478 _n_kwbreak
= new_child
3484 if _n_label
== old_child
then
3485 if new_child
!= null then
3486 new_child
.parent
= self
3487 assert new_child
isa ALabel
3488 _n_label
= new_child
3494 if _n_expr
== old_child
then
3495 if new_child
!= null then
3496 new_child
.parent
= self
3497 assert new_child
isa AExpr
3506 redef fun visit_all
(v
: Visitor)
3508 v
.enter_visit
(_n_kwbreak
)
3509 if _n_label
!= null then
3510 v
.enter_visit
(_n_label
.as(not null))
3512 if _n_expr
!= null then
3513 v
.enter_visit
(_n_expr
.as(not null))
3517 redef class AAbortExpr
3518 private init empty_init
do end
3520 init init_aabortexpr
(
3521 n_kwabort
: nullable TKwabort
3525 _n_kwabort
= n_kwabort
.as(not null)
3526 n_kwabort
.parent
= self
3529 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3531 if _n_kwabort
== old_child
then
3532 if new_child
!= null then
3533 new_child
.parent
= self
3534 assert new_child
isa TKwabort
3535 _n_kwabort
= new_child
3543 redef fun visit_all
(v
: Visitor)
3545 v
.enter_visit
(_n_kwabort
)
3548 redef class AContinueExpr
3549 private init empty_init
do end
3551 init init_acontinueexpr
(
3552 n_kwcontinue
: nullable TKwcontinue,
3553 n_label
: nullable ALabel,
3554 n_expr
: nullable AExpr
3558 _n_kwcontinue
= n_kwcontinue
3559 if n_kwcontinue
!= null then
3560 n_kwcontinue
.parent
= self
3563 if n_label
!= null then
3564 n_label
.parent
= self
3567 if n_expr
!= null then
3568 n_expr
.parent
= self
3572 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3574 if _n_kwcontinue
== old_child
then
3575 if new_child
!= null then
3576 new_child
.parent
= self
3577 assert new_child
isa TKwcontinue
3578 _n_kwcontinue
= new_child
3580 _n_kwcontinue
= null
3584 if _n_label
== old_child
then
3585 if new_child
!= null then
3586 new_child
.parent
= self
3587 assert new_child
isa ALabel
3588 _n_label
= new_child
3594 if _n_expr
== old_child
then
3595 if new_child
!= null then
3596 new_child
.parent
= self
3597 assert new_child
isa AExpr
3606 redef fun visit_all
(v
: Visitor)
3608 if _n_kwcontinue
!= null then
3609 v
.enter_visit
(_n_kwcontinue
.as(not null))
3611 if _n_label
!= null then
3612 v
.enter_visit
(_n_label
.as(not null))
3614 if _n_expr
!= null then
3615 v
.enter_visit
(_n_expr
.as(not null))
3620 private init empty_init
do end
3623 n_kwdo
: nullable TKwdo,
3624 n_block
: nullable AExpr,
3625 n_label
: nullable ALabel
3629 _n_kwdo
= n_kwdo
.as(not null)
3630 n_kwdo
.parent
= self
3632 if n_block
!= null then
3633 n_block
.parent
= self
3636 if n_label
!= null then
3637 n_label
.parent
= self
3641 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3643 if _n_kwdo
== old_child
then
3644 if new_child
!= null then
3645 new_child
.parent
= self
3646 assert new_child
isa TKwdo
3653 if _n_block
== old_child
then
3654 if new_child
!= null then
3655 new_child
.parent
= self
3656 assert new_child
isa AExpr
3657 _n_block
= new_child
3663 if _n_label
== old_child
then
3664 if new_child
!= null then
3665 new_child
.parent
= self
3666 assert new_child
isa ALabel
3667 _n_label
= new_child
3675 redef fun visit_all
(v
: Visitor)
3677 v
.enter_visit
(_n_kwdo
)
3678 if _n_block
!= null then
3679 v
.enter_visit
(_n_block
.as(not null))
3681 if _n_label
!= null then
3682 v
.enter_visit
(_n_label
.as(not null))
3687 private init empty_init
do end
3690 n_kwif
: nullable TKwif,
3691 n_expr
: nullable AExpr,
3692 n_then
: nullable AExpr,
3693 n_else
: nullable AExpr
3697 _n_kwif
= n_kwif
.as(not null)
3698 n_kwif
.parent
= self
3699 _n_expr
= n_expr
.as(not null)
3700 n_expr
.parent
= self
3702 if n_then
!= null then
3703 n_then
.parent
= self
3706 if n_else
!= null then
3707 n_else
.parent
= self
3711 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3713 if _n_kwif
== old_child
then
3714 if new_child
!= null then
3715 new_child
.parent
= self
3716 assert new_child
isa TKwif
3723 if _n_expr
== old_child
then
3724 if new_child
!= null then
3725 new_child
.parent
= self
3726 assert new_child
isa AExpr
3733 if _n_then
== old_child
then
3734 if new_child
!= null then
3735 new_child
.parent
= self
3736 assert new_child
isa AExpr
3743 if _n_else
== old_child
then
3744 if new_child
!= null then
3745 new_child
.parent
= self
3746 assert new_child
isa AExpr
3755 redef fun visit_all
(v
: Visitor)
3757 v
.enter_visit
(_n_kwif
)
3758 v
.enter_visit
(_n_expr
)
3759 if _n_then
!= null then
3760 v
.enter_visit
(_n_then
.as(not null))
3762 if _n_else
!= null then
3763 v
.enter_visit
(_n_else
.as(not null))
3767 redef class AIfexprExpr
3768 private init empty_init
do end
3770 init init_aifexprexpr
(
3771 n_kwif
: nullable TKwif,
3772 n_expr
: nullable AExpr,
3773 n_kwthen
: nullable TKwthen,
3774 n_then
: nullable AExpr,
3775 n_kwelse
: nullable TKwelse,
3776 n_else
: nullable AExpr
3780 _n_kwif
= n_kwif
.as(not null)
3781 n_kwif
.parent
= self
3782 _n_expr
= n_expr
.as(not null)
3783 n_expr
.parent
= self
3784 _n_kwthen
= n_kwthen
.as(not null)
3785 n_kwthen
.parent
= self
3786 _n_then
= n_then
.as(not null)
3787 n_then
.parent
= self
3788 _n_kwelse
= n_kwelse
.as(not null)
3789 n_kwelse
.parent
= self
3790 _n_else
= n_else
.as(not null)
3791 n_else
.parent
= self
3794 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3796 if _n_kwif
== old_child
then
3797 if new_child
!= null then
3798 new_child
.parent
= self
3799 assert new_child
isa TKwif
3806 if _n_expr
== old_child
then
3807 if new_child
!= null then
3808 new_child
.parent
= self
3809 assert new_child
isa AExpr
3816 if _n_kwthen
== old_child
then
3817 if new_child
!= null then
3818 new_child
.parent
= self
3819 assert new_child
isa TKwthen
3820 _n_kwthen
= new_child
3826 if _n_then
== old_child
then
3827 if new_child
!= null then
3828 new_child
.parent
= self
3829 assert new_child
isa AExpr
3836 if _n_kwelse
== old_child
then
3837 if new_child
!= null then
3838 new_child
.parent
= self
3839 assert new_child
isa TKwelse
3840 _n_kwelse
= new_child
3846 if _n_else
== old_child
then
3847 if new_child
!= null then
3848 new_child
.parent
= self
3849 assert new_child
isa AExpr
3858 redef fun visit_all
(v
: Visitor)
3860 v
.enter_visit
(_n_kwif
)
3861 v
.enter_visit
(_n_expr
)
3862 v
.enter_visit
(_n_kwthen
)
3863 v
.enter_visit
(_n_then
)
3864 v
.enter_visit
(_n_kwelse
)
3865 v
.enter_visit
(_n_else
)
3868 redef class AWhileExpr
3869 private init empty_init
do end
3871 init init_awhileexpr
(
3872 n_kwwhile
: nullable TKwwhile,
3873 n_expr
: nullable AExpr,
3874 n_kwdo
: nullable TKwdo,
3875 n_block
: nullable AExpr,
3876 n_label
: nullable ALabel
3880 _n_kwwhile
= n_kwwhile
.as(not null)
3881 n_kwwhile
.parent
= self
3882 _n_expr
= n_expr
.as(not null)
3883 n_expr
.parent
= self
3884 _n_kwdo
= n_kwdo
.as(not null)
3885 n_kwdo
.parent
= self
3887 if n_block
!= null then
3888 n_block
.parent
= self
3891 if n_label
!= null then
3892 n_label
.parent
= self
3896 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3898 if _n_kwwhile
== old_child
then
3899 if new_child
!= null then
3900 new_child
.parent
= self
3901 assert new_child
isa TKwwhile
3902 _n_kwwhile
= new_child
3908 if _n_expr
== old_child
then
3909 if new_child
!= null then
3910 new_child
.parent
= self
3911 assert new_child
isa AExpr
3918 if _n_kwdo
== old_child
then
3919 if new_child
!= null then
3920 new_child
.parent
= self
3921 assert new_child
isa TKwdo
3928 if _n_block
== old_child
then
3929 if new_child
!= null then
3930 new_child
.parent
= self
3931 assert new_child
isa AExpr
3932 _n_block
= new_child
3938 if _n_label
== old_child
then
3939 if new_child
!= null then
3940 new_child
.parent
= self
3941 assert new_child
isa ALabel
3942 _n_label
= new_child
3950 redef fun visit_all
(v
: Visitor)
3952 v
.enter_visit
(_n_kwwhile
)
3953 v
.enter_visit
(_n_expr
)
3954 v
.enter_visit
(_n_kwdo
)
3955 if _n_block
!= null then
3956 v
.enter_visit
(_n_block
.as(not null))
3958 if _n_label
!= null then
3959 v
.enter_visit
(_n_label
.as(not null))
3963 redef class ALoopExpr
3964 private init empty_init
do end
3966 init init_aloopexpr
(
3967 n_kwloop
: nullable TKwloop,
3968 n_block
: nullable AExpr,
3969 n_label
: nullable ALabel
3973 _n_kwloop
= n_kwloop
.as(not null)
3974 n_kwloop
.parent
= self
3976 if n_block
!= null then
3977 n_block
.parent
= self
3980 if n_label
!= null then
3981 n_label
.parent
= self
3985 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3987 if _n_kwloop
== old_child
then
3988 if new_child
!= null then
3989 new_child
.parent
= self
3990 assert new_child
isa TKwloop
3991 _n_kwloop
= new_child
3997 if _n_block
== old_child
then
3998 if new_child
!= null then
3999 new_child
.parent
= self
4000 assert new_child
isa AExpr
4001 _n_block
= new_child
4007 if _n_label
== old_child
then
4008 if new_child
!= null then
4009 new_child
.parent
= self
4010 assert new_child
isa ALabel
4011 _n_label
= new_child
4019 redef fun visit_all
(v
: Visitor)
4021 v
.enter_visit
(_n_kwloop
)
4022 if _n_block
!= null then
4023 v
.enter_visit
(_n_block
.as(not null))
4025 if _n_label
!= null then
4026 v
.enter_visit
(_n_label
.as(not null))
4030 redef class AForExpr
4031 private init empty_init
do end
4033 init init_aforexpr
(
4034 n_kwfor
: nullable TKwfor,
4035 n_ids
: Collection[Object], # Should be Collection[TId]
4036 n_expr
: nullable AExpr,
4037 n_kwdo
: nullable TKwdo,
4038 n_block
: nullable AExpr,
4039 n_label
: nullable ALabel
4043 _n_kwfor
= n_kwfor
.as(not null)
4044 n_kwfor
.parent
= self
4050 _n_expr
= n_expr
.as(not null)
4051 n_expr
.parent
= self
4052 _n_kwdo
= n_kwdo
.as(not null)
4053 n_kwdo
.parent
= self
4055 if n_block
!= null then
4056 n_block
.parent
= self
4059 if n_label
!= null then
4060 n_label
.parent
= self
4064 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4066 if _n_kwfor
== old_child
then
4067 if new_child
!= null then
4068 new_child
.parent
= self
4069 assert new_child
isa TKwfor
4070 _n_kwfor
= new_child
4076 for i
in [0.._n_ids
.length
[ do
4077 if _n_ids
[i
] == old_child
then
4078 if new_child
!= null then
4079 assert new_child
isa TId
4080 _n_ids
[i
] = new_child
4081 new_child
.parent
= self
4088 if _n_expr
== old_child
then
4089 if new_child
!= null then
4090 new_child
.parent
= self
4091 assert new_child
isa AExpr
4098 if _n_kwdo
== old_child
then
4099 if new_child
!= null then
4100 new_child
.parent
= self
4101 assert new_child
isa TKwdo
4108 if _n_block
== old_child
then
4109 if new_child
!= null then
4110 new_child
.parent
= self
4111 assert new_child
isa AExpr
4112 _n_block
= new_child
4118 if _n_label
== old_child
then
4119 if new_child
!= null then
4120 new_child
.parent
= self
4121 assert new_child
isa ALabel
4122 _n_label
= new_child
4130 redef fun visit_all
(v
: Visitor)
4132 v
.enter_visit
(_n_kwfor
)
4136 v
.enter_visit
(_n_expr
)
4137 v
.enter_visit
(_n_kwdo
)
4138 if _n_block
!= null then
4139 v
.enter_visit
(_n_block
.as(not null))
4141 if _n_label
!= null then
4142 v
.enter_visit
(_n_label
.as(not null))
4146 redef class AAssertExpr
4147 private init empty_init
do end
4149 init init_aassertexpr
(
4150 n_kwassert
: nullable TKwassert,
4152 n_expr
: nullable AExpr,
4153 n_else
: nullable AExpr
4157 _n_kwassert
= n_kwassert
.as(not null)
4158 n_kwassert
.parent
= self
4160 if n_id
!= null then
4163 _n_expr
= n_expr
.as(not null)
4164 n_expr
.parent
= self
4166 if n_else
!= null then
4167 n_else
.parent
= self
4171 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4173 if _n_kwassert
== old_child
then
4174 if new_child
!= null then
4175 new_child
.parent
= self
4176 assert new_child
isa TKwassert
4177 _n_kwassert
= new_child
4183 if _n_id
== old_child
then
4184 if new_child
!= null then
4185 new_child
.parent
= self
4186 assert new_child
isa TId
4193 if _n_expr
== old_child
then
4194 if new_child
!= null then
4195 new_child
.parent
= self
4196 assert new_child
isa AExpr
4203 if _n_else
== old_child
then
4204 if new_child
!= null then
4205 new_child
.parent
= self
4206 assert new_child
isa AExpr
4215 redef fun visit_all
(v
: Visitor)
4217 v
.enter_visit
(_n_kwassert
)
4218 if _n_id
!= null then
4219 v
.enter_visit
(_n_id
.as(not null))
4221 v
.enter_visit
(_n_expr
)
4222 if _n_else
!= null then
4223 v
.enter_visit
(_n_else
.as(not null))
4227 redef class AOnceExpr
4228 private init empty_init
do end
4230 init init_aonceexpr
(
4231 n_kwonce
: nullable TKwonce,
4232 n_expr
: nullable AExpr
4236 _n_kwonce
= n_kwonce
.as(not null)
4237 n_kwonce
.parent
= self
4238 _n_expr
= n_expr
.as(not null)
4239 n_expr
.parent
= self
4242 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4244 if _n_kwonce
== old_child
then
4245 if new_child
!= null then
4246 new_child
.parent
= self
4247 assert new_child
isa TKwonce
4248 _n_kwonce
= new_child
4254 if _n_expr
== old_child
then
4255 if new_child
!= null then
4256 new_child
.parent
= self
4257 assert new_child
isa AExpr
4266 redef fun visit_all
(v
: Visitor)
4268 v
.enter_visit
(_n_kwonce
)
4269 v
.enter_visit
(_n_expr
)
4272 redef class ASendExpr
4273 private init empty_init
do end
4275 init init_asendexpr
(
4276 n_expr
: nullable AExpr
4280 _n_expr
= n_expr
.as(not null)
4281 n_expr
.parent
= self
4284 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4286 if _n_expr
== old_child
then
4287 if new_child
!= null then
4288 new_child
.parent
= self
4289 assert new_child
isa AExpr
4298 redef fun visit_all
(v
: Visitor)
4300 v
.enter_visit
(_n_expr
)
4303 redef class ABinopExpr
4304 private init empty_init
do end
4306 init init_abinopexpr
(
4307 n_expr
: nullable AExpr,
4308 n_expr2
: nullable AExpr
4312 _n_expr
= n_expr
.as(not null)
4313 n_expr
.parent
= self
4314 _n_expr2
= n_expr2
.as(not null)
4315 n_expr2
.parent
= self
4318 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4320 if _n_expr
== old_child
then
4321 if new_child
!= null then
4322 new_child
.parent
= self
4323 assert new_child
isa AExpr
4330 if _n_expr2
== old_child
then
4331 if new_child
!= null then
4332 new_child
.parent
= self
4333 assert new_child
isa AExpr
4334 _n_expr2
= new_child
4342 redef fun visit_all
(v
: Visitor)
4344 v
.enter_visit
(_n_expr
)
4345 v
.enter_visit
(_n_expr2
)
4349 private init empty_init
do end
4352 n_expr
: nullable AExpr,
4353 n_expr2
: nullable AExpr
4357 _n_expr
= n_expr
.as(not null)
4358 n_expr
.parent
= self
4359 _n_expr2
= n_expr2
.as(not null)
4360 n_expr2
.parent
= self
4363 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4365 if _n_expr
== old_child
then
4366 if new_child
!= null then
4367 new_child
.parent
= self
4368 assert new_child
isa AExpr
4375 if _n_expr2
== old_child
then
4376 if new_child
!= null then
4377 new_child
.parent
= self
4378 assert new_child
isa AExpr
4379 _n_expr2
= new_child
4387 redef fun visit_all
(v
: Visitor)
4389 v
.enter_visit
(_n_expr
)
4390 v
.enter_visit
(_n_expr2
)
4393 redef class AAndExpr
4394 private init empty_init
do end
4396 init init_aandexpr
(
4397 n_expr
: nullable AExpr,
4398 n_expr2
: nullable AExpr
4402 _n_expr
= n_expr
.as(not null)
4403 n_expr
.parent
= self
4404 _n_expr2
= n_expr2
.as(not null)
4405 n_expr2
.parent
= self
4408 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4410 if _n_expr
== old_child
then
4411 if new_child
!= null then
4412 new_child
.parent
= self
4413 assert new_child
isa AExpr
4420 if _n_expr2
== old_child
then
4421 if new_child
!= null then
4422 new_child
.parent
= self
4423 assert new_child
isa AExpr
4424 _n_expr2
= new_child
4432 redef fun visit_all
(v
: Visitor)
4434 v
.enter_visit
(_n_expr
)
4435 v
.enter_visit
(_n_expr2
)
4438 redef class AOrElseExpr
4439 private init empty_init
do end
4441 init init_aorelseexpr
(
4442 n_expr
: nullable AExpr,
4443 n_expr2
: nullable AExpr
4447 _n_expr
= n_expr
.as(not null)
4448 n_expr
.parent
= self
4449 _n_expr2
= n_expr2
.as(not null)
4450 n_expr2
.parent
= self
4453 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4455 if _n_expr
== old_child
then
4456 if new_child
!= null then
4457 new_child
.parent
= self
4458 assert new_child
isa AExpr
4465 if _n_expr2
== old_child
then
4466 if new_child
!= null then
4467 new_child
.parent
= self
4468 assert new_child
isa AExpr
4469 _n_expr2
= new_child
4477 redef fun visit_all
(v
: Visitor)
4479 v
.enter_visit
(_n_expr
)
4480 v
.enter_visit
(_n_expr2
)
4483 redef class ANotExpr
4484 private init empty_init
do end
4486 init init_anotexpr
(
4487 n_kwnot
: nullable TKwnot,
4488 n_expr
: nullable AExpr
4492 _n_kwnot
= n_kwnot
.as(not null)
4493 n_kwnot
.parent
= self
4494 _n_expr
= n_expr
.as(not null)
4495 n_expr
.parent
= self
4498 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4500 if _n_kwnot
== old_child
then
4501 if new_child
!= null then
4502 new_child
.parent
= self
4503 assert new_child
isa TKwnot
4504 _n_kwnot
= new_child
4510 if _n_expr
== old_child
then
4511 if new_child
!= null then
4512 new_child
.parent
= self
4513 assert new_child
isa AExpr
4522 redef fun visit_all
(v
: Visitor)
4524 v
.enter_visit
(_n_kwnot
)
4525 v
.enter_visit
(_n_expr
)
4529 private init empty_init
do end
4532 n_expr
: nullable AExpr,
4533 n_expr2
: nullable AExpr
4537 _n_expr
= n_expr
.as(not null)
4538 n_expr
.parent
= self
4539 _n_expr2
= n_expr2
.as(not null)
4540 n_expr2
.parent
= self
4543 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4545 if _n_expr
== old_child
then
4546 if new_child
!= null then
4547 new_child
.parent
= self
4548 assert new_child
isa AExpr
4555 if _n_expr2
== old_child
then
4556 if new_child
!= null then
4557 new_child
.parent
= self
4558 assert new_child
isa AExpr
4559 _n_expr2
= new_child
4567 redef fun visit_all
(v
: Visitor)
4569 v
.enter_visit
(_n_expr
)
4570 v
.enter_visit
(_n_expr2
)
4574 private init empty_init
do end
4577 n_expr
: nullable AExpr,
4578 n_expr2
: nullable AExpr
4582 _n_expr
= n_expr
.as(not null)
4583 n_expr
.parent
= self
4584 _n_expr2
= n_expr2
.as(not null)
4585 n_expr2
.parent
= self
4588 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4590 if _n_expr
== old_child
then
4591 if new_child
!= null then
4592 new_child
.parent
= self
4593 assert new_child
isa AExpr
4600 if _n_expr2
== old_child
then
4601 if new_child
!= null then
4602 new_child
.parent
= self
4603 assert new_child
isa AExpr
4604 _n_expr2
= new_child
4612 redef fun visit_all
(v
: Visitor)
4614 v
.enter_visit
(_n_expr
)
4615 v
.enter_visit
(_n_expr2
)
4619 private init empty_init
do end
4622 n_expr
: nullable AExpr,
4623 n_expr2
: nullable AExpr
4627 _n_expr
= n_expr
.as(not null)
4628 n_expr
.parent
= self
4629 _n_expr2
= n_expr2
.as(not null)
4630 n_expr2
.parent
= self
4633 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4635 if _n_expr
== old_child
then
4636 if new_child
!= null then
4637 new_child
.parent
= self
4638 assert new_child
isa AExpr
4645 if _n_expr2
== old_child
then
4646 if new_child
!= null then
4647 new_child
.parent
= self
4648 assert new_child
isa AExpr
4649 _n_expr2
= new_child
4657 redef fun visit_all
(v
: Visitor)
4659 v
.enter_visit
(_n_expr
)
4660 v
.enter_visit
(_n_expr2
)
4664 private init empty_init
do end
4667 n_expr
: nullable AExpr,
4668 n_expr2
: nullable AExpr
4672 _n_expr
= n_expr
.as(not null)
4673 n_expr
.parent
= self
4674 _n_expr2
= n_expr2
.as(not null)
4675 n_expr2
.parent
= self
4678 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4680 if _n_expr
== old_child
then
4681 if new_child
!= null then
4682 new_child
.parent
= self
4683 assert new_child
isa AExpr
4690 if _n_expr2
== old_child
then
4691 if new_child
!= null then
4692 new_child
.parent
= self
4693 assert new_child
isa AExpr
4694 _n_expr2
= new_child
4702 redef fun visit_all
(v
: Visitor)
4704 v
.enter_visit
(_n_expr
)
4705 v
.enter_visit
(_n_expr2
)
4709 private init empty_init
do end
4712 n_expr
: nullable AExpr,
4713 n_expr2
: nullable AExpr
4717 _n_expr
= n_expr
.as(not null)
4718 n_expr
.parent
= self
4719 _n_expr2
= n_expr2
.as(not null)
4720 n_expr2
.parent
= self
4723 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4725 if _n_expr
== old_child
then
4726 if new_child
!= null then
4727 new_child
.parent
= self
4728 assert new_child
isa AExpr
4735 if _n_expr2
== old_child
then
4736 if new_child
!= null then
4737 new_child
.parent
= self
4738 assert new_child
isa AExpr
4739 _n_expr2
= new_child
4747 redef fun visit_all
(v
: Visitor)
4749 v
.enter_visit
(_n_expr
)
4750 v
.enter_visit
(_n_expr2
)
4754 private init empty_init
do end
4757 n_expr
: nullable AExpr,
4758 n_expr2
: nullable AExpr
4762 _n_expr
= n_expr
.as(not null)
4763 n_expr
.parent
= self
4764 _n_expr2
= n_expr2
.as(not null)
4765 n_expr2
.parent
= self
4768 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4770 if _n_expr
== old_child
then
4771 if new_child
!= null then
4772 new_child
.parent
= self
4773 assert new_child
isa AExpr
4780 if _n_expr2
== old_child
then
4781 if new_child
!= null then
4782 new_child
.parent
= self
4783 assert new_child
isa AExpr
4784 _n_expr2
= new_child
4792 redef fun visit_all
(v
: Visitor)
4794 v
.enter_visit
(_n_expr
)
4795 v
.enter_visit
(_n_expr2
)
4799 private init empty_init
do end
4802 n_expr
: nullable AExpr,
4803 n_expr2
: nullable AExpr
4807 _n_expr
= n_expr
.as(not null)
4808 n_expr
.parent
= self
4809 _n_expr2
= n_expr2
.as(not null)
4810 n_expr2
.parent
= self
4813 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4815 if _n_expr
== old_child
then
4816 if new_child
!= null then
4817 new_child
.parent
= self
4818 assert new_child
isa AExpr
4825 if _n_expr2
== old_child
then
4826 if new_child
!= null then
4827 new_child
.parent
= self
4828 assert new_child
isa AExpr
4829 _n_expr2
= new_child
4837 redef fun visit_all
(v
: Visitor)
4839 v
.enter_visit
(_n_expr
)
4840 v
.enter_visit
(_n_expr2
)
4844 private init empty_init
do end
4847 n_expr
: nullable AExpr,
4848 n_expr2
: nullable AExpr
4852 _n_expr
= n_expr
.as(not null)
4853 n_expr
.parent
= self
4854 _n_expr2
= n_expr2
.as(not null)
4855 n_expr2
.parent
= self
4858 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4860 if _n_expr
== old_child
then
4861 if new_child
!= null then
4862 new_child
.parent
= self
4863 assert new_child
isa AExpr
4870 if _n_expr2
== old_child
then
4871 if new_child
!= null then
4872 new_child
.parent
= self
4873 assert new_child
isa AExpr
4874 _n_expr2
= new_child
4882 redef fun visit_all
(v
: Visitor)
4884 v
.enter_visit
(_n_expr
)
4885 v
.enter_visit
(_n_expr2
)
4889 private init empty_init
do end
4892 n_expr
: nullable AExpr,
4893 n_expr2
: nullable AExpr
4897 _n_expr
= n_expr
.as(not null)
4898 n_expr
.parent
= self
4899 _n_expr2
= n_expr2
.as(not null)
4900 n_expr2
.parent
= self
4903 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4905 if _n_expr
== old_child
then
4906 if new_child
!= null then
4907 new_child
.parent
= self
4908 assert new_child
isa AExpr
4915 if _n_expr2
== old_child
then
4916 if new_child
!= null then
4917 new_child
.parent
= self
4918 assert new_child
isa AExpr
4919 _n_expr2
= new_child
4927 redef fun visit_all
(v
: Visitor)
4929 v
.enter_visit
(_n_expr
)
4930 v
.enter_visit
(_n_expr2
)
4933 redef class AIsaExpr
4934 private init empty_init
do end
4936 init init_aisaexpr
(
4937 n_expr
: nullable AExpr,
4938 n_type
: nullable AType
4942 _n_expr
= n_expr
.as(not null)
4943 n_expr
.parent
= self
4944 _n_type
= n_type
.as(not null)
4945 n_type
.parent
= self
4948 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4950 if _n_expr
== old_child
then
4951 if new_child
!= null then
4952 new_child
.parent
= self
4953 assert new_child
isa AExpr
4960 if _n_type
== old_child
then
4961 if new_child
!= null then
4962 new_child
.parent
= self
4963 assert new_child
isa AType
4972 redef fun visit_all
(v
: Visitor)
4974 v
.enter_visit
(_n_expr
)
4975 v
.enter_visit
(_n_type
)
4978 redef class APlusExpr
4979 private init empty_init
do end
4981 init init_aplusexpr
(
4982 n_expr
: nullable AExpr,
4983 n_expr2
: nullable AExpr
4987 _n_expr
= n_expr
.as(not null)
4988 n_expr
.parent
= self
4989 _n_expr2
= n_expr2
.as(not null)
4990 n_expr2
.parent
= self
4993 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4995 if _n_expr
== old_child
then
4996 if new_child
!= null then
4997 new_child
.parent
= self
4998 assert new_child
isa AExpr
5005 if _n_expr2
== old_child
then
5006 if new_child
!= null then
5007 new_child
.parent
= self
5008 assert new_child
isa AExpr
5009 _n_expr2
= new_child
5017 redef fun visit_all
(v
: Visitor)
5019 v
.enter_visit
(_n_expr
)
5020 v
.enter_visit
(_n_expr2
)
5023 redef class AMinusExpr
5024 private init empty_init
do end
5026 init init_aminusexpr
(
5027 n_expr
: nullable AExpr,
5028 n_expr2
: nullable AExpr
5032 _n_expr
= n_expr
.as(not null)
5033 n_expr
.parent
= self
5034 _n_expr2
= n_expr2
.as(not null)
5035 n_expr2
.parent
= self
5038 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5040 if _n_expr
== old_child
then
5041 if new_child
!= null then
5042 new_child
.parent
= self
5043 assert new_child
isa AExpr
5050 if _n_expr2
== old_child
then
5051 if new_child
!= null then
5052 new_child
.parent
= self
5053 assert new_child
isa AExpr
5054 _n_expr2
= new_child
5062 redef fun visit_all
(v
: Visitor)
5064 v
.enter_visit
(_n_expr
)
5065 v
.enter_visit
(_n_expr2
)
5068 redef class AStarshipExpr
5069 private init empty_init
do end
5071 init init_astarshipexpr
(
5072 n_expr
: nullable AExpr,
5073 n_expr2
: nullable AExpr
5077 _n_expr
= n_expr
.as(not null)
5078 n_expr
.parent
= self
5079 _n_expr2
= n_expr2
.as(not null)
5080 n_expr2
.parent
= self
5083 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5085 if _n_expr
== old_child
then
5086 if new_child
!= null then
5087 new_child
.parent
= self
5088 assert new_child
isa AExpr
5095 if _n_expr2
== old_child
then
5096 if new_child
!= null then
5097 new_child
.parent
= self
5098 assert new_child
isa AExpr
5099 _n_expr2
= new_child
5107 redef fun visit_all
(v
: Visitor)
5109 v
.enter_visit
(_n_expr
)
5110 v
.enter_visit
(_n_expr2
)
5113 redef class AStarExpr
5114 private init empty_init
do end
5116 init init_astarexpr
(
5117 n_expr
: nullable AExpr,
5118 n_expr2
: nullable AExpr
5122 _n_expr
= n_expr
.as(not null)
5123 n_expr
.parent
= self
5124 _n_expr2
= n_expr2
.as(not null)
5125 n_expr2
.parent
= self
5128 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5130 if _n_expr
== old_child
then
5131 if new_child
!= null then
5132 new_child
.parent
= self
5133 assert new_child
isa AExpr
5140 if _n_expr2
== old_child
then
5141 if new_child
!= null then
5142 new_child
.parent
= self
5143 assert new_child
isa AExpr
5144 _n_expr2
= new_child
5152 redef fun visit_all
(v
: Visitor)
5154 v
.enter_visit
(_n_expr
)
5155 v
.enter_visit
(_n_expr2
)
5158 redef class ASlashExpr
5159 private init empty_init
do end
5161 init init_aslashexpr
(
5162 n_expr
: nullable AExpr,
5163 n_expr2
: nullable AExpr
5167 _n_expr
= n_expr
.as(not null)
5168 n_expr
.parent
= self
5169 _n_expr2
= n_expr2
.as(not null)
5170 n_expr2
.parent
= self
5173 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5175 if _n_expr
== old_child
then
5176 if new_child
!= null then
5177 new_child
.parent
= self
5178 assert new_child
isa AExpr
5185 if _n_expr2
== old_child
then
5186 if new_child
!= null then
5187 new_child
.parent
= self
5188 assert new_child
isa AExpr
5189 _n_expr2
= new_child
5197 redef fun visit_all
(v
: Visitor)
5199 v
.enter_visit
(_n_expr
)
5200 v
.enter_visit
(_n_expr2
)
5203 redef class APercentExpr
5204 private init empty_init
do end
5206 init init_apercentexpr
(
5207 n_expr
: nullable AExpr,
5208 n_expr2
: nullable AExpr
5212 _n_expr
= n_expr
.as(not null)
5213 n_expr
.parent
= self
5214 _n_expr2
= n_expr2
.as(not null)
5215 n_expr2
.parent
= self
5218 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5220 if _n_expr
== old_child
then
5221 if new_child
!= null then
5222 new_child
.parent
= self
5223 assert new_child
isa AExpr
5230 if _n_expr2
== old_child
then
5231 if new_child
!= null then
5232 new_child
.parent
= self
5233 assert new_child
isa AExpr
5234 _n_expr2
= new_child
5242 redef fun visit_all
(v
: Visitor)
5244 v
.enter_visit
(_n_expr
)
5245 v
.enter_visit
(_n_expr2
)
5248 redef class AUminusExpr
5249 private init empty_init
do end
5251 init init_auminusexpr
(
5252 n_minus
: nullable TMinus,
5253 n_expr
: nullable AExpr
5257 _n_minus
= n_minus
.as(not null)
5258 n_minus
.parent
= self
5259 _n_expr
= n_expr
.as(not null)
5260 n_expr
.parent
= self
5263 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5265 if _n_minus
== old_child
then
5266 if new_child
!= null then
5267 new_child
.parent
= self
5268 assert new_child
isa TMinus
5269 _n_minus
= new_child
5275 if _n_expr
== old_child
then
5276 if new_child
!= null then
5277 new_child
.parent
= self
5278 assert new_child
isa AExpr
5287 redef fun visit_all
(v
: Visitor)
5289 v
.enter_visit
(_n_minus
)
5290 v
.enter_visit
(_n_expr
)
5293 redef class ANewExpr
5294 private init empty_init
do end
5296 init init_anewexpr
(
5297 n_kwnew
: nullable TKwnew,
5298 n_type
: nullable AType,
5300 n_args
: Collection[Object] # Should be Collection[AExpr]
5304 _n_kwnew
= n_kwnew
.as(not null)
5305 n_kwnew
.parent
= self
5306 _n_type
= n_type
.as(not null)
5307 n_type
.parent
= self
5309 if n_id
!= null then
5319 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5321 if _n_kwnew
== old_child
then
5322 if new_child
!= null then
5323 new_child
.parent
= self
5324 assert new_child
isa TKwnew
5325 _n_kwnew
= new_child
5331 if _n_type
== old_child
then
5332 if new_child
!= null then
5333 new_child
.parent
= self
5334 assert new_child
isa AType
5341 if _n_id
== old_child
then
5342 if new_child
!= null then
5343 new_child
.parent
= self
5344 assert new_child
isa TId
5351 for i
in [0.._n_args
.length
[ do
5352 if _n_args
[i
] == old_child
then
5353 if new_child
!= null then
5354 assert new_child
isa AExpr
5355 _n_args
[i
] = new_child
5356 new_child
.parent
= self
5358 _n_args
.remove_at
(i
)
5365 redef fun visit_all
(v
: Visitor)
5367 v
.enter_visit
(_n_kwnew
)
5368 v
.enter_visit
(_n_type
)
5369 if _n_id
!= null then
5370 v
.enter_visit
(_n_id
.as(not null))
5377 redef class AAttrExpr
5378 private init empty_init
do end
5380 init init_aattrexpr
(
5381 n_expr
: nullable AExpr,
5382 n_id
: nullable TAttrid
5386 _n_expr
= n_expr
.as(not null)
5387 n_expr
.parent
= self
5388 _n_id
= n_id
.as(not null)
5392 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5394 if _n_expr
== old_child
then
5395 if new_child
!= null then
5396 new_child
.parent
= self
5397 assert new_child
isa AExpr
5404 if _n_id
== old_child
then
5405 if new_child
!= null then
5406 new_child
.parent
= self
5407 assert new_child
isa TAttrid
5416 redef fun visit_all
(v
: Visitor)
5418 v
.enter_visit
(_n_expr
)
5419 v
.enter_visit
(_n_id
)
5422 redef class AAttrAssignExpr
5423 private init empty_init
do end
5425 init init_aattrassignexpr
(
5426 n_expr
: nullable AExpr,
5427 n_id
: nullable TAttrid,
5428 n_assign
: nullable TAssign,
5429 n_value
: nullable AExpr
5433 _n_expr
= n_expr
.as(not null)
5434 n_expr
.parent
= self
5435 _n_id
= n_id
.as(not null)
5437 _n_assign
= n_assign
.as(not null)
5438 n_assign
.parent
= self
5439 _n_value
= n_value
.as(not null)
5440 n_value
.parent
= self
5443 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5445 if _n_expr
== old_child
then
5446 if new_child
!= null then
5447 new_child
.parent
= self
5448 assert new_child
isa AExpr
5455 if _n_id
== old_child
then
5456 if new_child
!= null then
5457 new_child
.parent
= self
5458 assert new_child
isa TAttrid
5465 if _n_assign
== old_child
then
5466 if new_child
!= null then
5467 new_child
.parent
= self
5468 assert new_child
isa TAssign
5469 _n_assign
= new_child
5475 if _n_value
== old_child
then
5476 if new_child
!= null then
5477 new_child
.parent
= self
5478 assert new_child
isa AExpr
5479 _n_value
= new_child
5487 redef fun visit_all
(v
: Visitor)
5489 v
.enter_visit
(_n_expr
)
5490 v
.enter_visit
(_n_id
)
5491 v
.enter_visit
(_n_assign
)
5492 v
.enter_visit
(_n_value
)
5495 redef class AAttrReassignExpr
5496 private init empty_init
do end
5498 init init_aattrreassignexpr
(
5499 n_expr
: nullable AExpr,
5500 n_id
: nullable TAttrid,
5501 n_assign_op
: nullable AAssignOp,
5502 n_value
: nullable AExpr
5506 _n_expr
= n_expr
.as(not null)
5507 n_expr
.parent
= self
5508 _n_id
= n_id
.as(not null)
5510 _n_assign_op
= n_assign_op
.as(not null)
5511 n_assign_op
.parent
= self
5512 _n_value
= n_value
.as(not null)
5513 n_value
.parent
= self
5516 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5518 if _n_expr
== old_child
then
5519 if new_child
!= null then
5520 new_child
.parent
= self
5521 assert new_child
isa AExpr
5528 if _n_id
== old_child
then
5529 if new_child
!= null then
5530 new_child
.parent
= self
5531 assert new_child
isa TAttrid
5538 if _n_assign_op
== old_child
then
5539 if new_child
!= null then
5540 new_child
.parent
= self
5541 assert new_child
isa AAssignOp
5542 _n_assign_op
= new_child
5548 if _n_value
== old_child
then
5549 if new_child
!= null then
5550 new_child
.parent
= self
5551 assert new_child
isa AExpr
5552 _n_value
= new_child
5560 redef fun visit_all
(v
: Visitor)
5562 v
.enter_visit
(_n_expr
)
5563 v
.enter_visit
(_n_id
)
5564 v
.enter_visit
(_n_assign_op
)
5565 v
.enter_visit
(_n_value
)
5568 redef class ACallExpr
5569 private init empty_init
do end
5571 init init_acallexpr
(
5572 n_expr
: nullable AExpr,
5574 n_args
: Collection[Object], # Should be Collection[AExpr]
5575 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5579 _n_expr
= n_expr
.as(not null)
5580 n_expr
.parent
= self
5581 _n_id
= n_id
.as(not null)
5588 for n
in n_closure_defs
do
5589 assert n
isa AClosureDef
5590 _n_closure_defs
.add
(n
)
5595 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5597 if _n_expr
== old_child
then
5598 if new_child
!= null then
5599 new_child
.parent
= self
5600 assert new_child
isa AExpr
5607 if _n_id
== old_child
then
5608 if new_child
!= null then
5609 new_child
.parent
= self
5610 assert new_child
isa TId
5617 for i
in [0.._n_args
.length
[ do
5618 if _n_args
[i
] == old_child
then
5619 if new_child
!= null then
5620 assert new_child
isa AExpr
5621 _n_args
[i
] = new_child
5622 new_child
.parent
= self
5624 _n_args
.remove_at
(i
)
5629 for i
in [0.._n_closure_defs
.length
[ do
5630 if _n_closure_defs
[i
] == old_child
then
5631 if new_child
!= null then
5632 assert new_child
isa AClosureDef
5633 _n_closure_defs
[i
] = new_child
5634 new_child
.parent
= self
5636 _n_closure_defs
.remove_at
(i
)
5643 redef fun visit_all
(v
: Visitor)
5645 v
.enter_visit
(_n_expr
)
5646 v
.enter_visit
(_n_id
)
5650 for n
in _n_closure_defs
do
5655 redef class ACallAssignExpr
5656 private init empty_init
do end
5658 init init_acallassignexpr
(
5659 n_expr
: nullable AExpr,
5661 n_args
: Collection[Object], # Should be Collection[AExpr]
5662 n_assign
: nullable TAssign,
5663 n_value
: nullable AExpr
5667 _n_expr
= n_expr
.as(not null)
5668 n_expr
.parent
= self
5669 _n_id
= n_id
.as(not null)
5676 _n_assign
= n_assign
.as(not null)
5677 n_assign
.parent
= self
5678 _n_value
= n_value
.as(not null)
5679 n_value
.parent
= self
5682 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5684 if _n_expr
== old_child
then
5685 if new_child
!= null then
5686 new_child
.parent
= self
5687 assert new_child
isa AExpr
5694 if _n_id
== old_child
then
5695 if new_child
!= null then
5696 new_child
.parent
= self
5697 assert new_child
isa TId
5704 for i
in [0.._n_args
.length
[ do
5705 if _n_args
[i
] == old_child
then
5706 if new_child
!= null then
5707 assert new_child
isa AExpr
5708 _n_args
[i
] = new_child
5709 new_child
.parent
= self
5711 _n_args
.remove_at
(i
)
5716 if _n_assign
== old_child
then
5717 if new_child
!= null then
5718 new_child
.parent
= self
5719 assert new_child
isa TAssign
5720 _n_assign
= new_child
5726 if _n_value
== old_child
then
5727 if new_child
!= null then
5728 new_child
.parent
= self
5729 assert new_child
isa AExpr
5730 _n_value
= new_child
5738 redef fun visit_all
(v
: Visitor)
5740 v
.enter_visit
(_n_expr
)
5741 v
.enter_visit
(_n_id
)
5745 v
.enter_visit
(_n_assign
)
5746 v
.enter_visit
(_n_value
)
5749 redef class ACallReassignExpr
5750 private init empty_init
do end
5752 init init_acallreassignexpr
(
5753 n_expr
: nullable AExpr,
5755 n_args
: Collection[Object], # Should be Collection[AExpr]
5756 n_assign_op
: nullable AAssignOp,
5757 n_value
: nullable AExpr
5761 _n_expr
= n_expr
.as(not null)
5762 n_expr
.parent
= self
5763 _n_id
= n_id
.as(not null)
5770 _n_assign_op
= n_assign_op
.as(not null)
5771 n_assign_op
.parent
= self
5772 _n_value
= n_value
.as(not null)
5773 n_value
.parent
= self
5776 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5778 if _n_expr
== old_child
then
5779 if new_child
!= null then
5780 new_child
.parent
= self
5781 assert new_child
isa AExpr
5788 if _n_id
== old_child
then
5789 if new_child
!= null then
5790 new_child
.parent
= self
5791 assert new_child
isa TId
5798 for i
in [0.._n_args
.length
[ do
5799 if _n_args
[i
] == old_child
then
5800 if new_child
!= null then
5801 assert new_child
isa AExpr
5802 _n_args
[i
] = new_child
5803 new_child
.parent
= self
5805 _n_args
.remove_at
(i
)
5810 if _n_assign_op
== old_child
then
5811 if new_child
!= null then
5812 new_child
.parent
= self
5813 assert new_child
isa AAssignOp
5814 _n_assign_op
= new_child
5820 if _n_value
== old_child
then
5821 if new_child
!= null then
5822 new_child
.parent
= self
5823 assert new_child
isa AExpr
5824 _n_value
= new_child
5832 redef fun visit_all
(v
: Visitor)
5834 v
.enter_visit
(_n_expr
)
5835 v
.enter_visit
(_n_id
)
5839 v
.enter_visit
(_n_assign_op
)
5840 v
.enter_visit
(_n_value
)
5843 redef class ASuperExpr
5844 private init empty_init
do end
5846 init init_asuperexpr
(
5847 n_qualified
: nullable AQualified,
5848 n_kwsuper
: nullable TKwsuper,
5849 n_args
: Collection[Object] # Should be Collection[AExpr]
5853 _n_qualified
= n_qualified
5854 if n_qualified
!= null then
5855 n_qualified
.parent
= self
5857 _n_kwsuper
= n_kwsuper
.as(not null)
5858 n_kwsuper
.parent
= self
5866 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5868 if _n_qualified
== old_child
then
5869 if new_child
!= null then
5870 new_child
.parent
= self
5871 assert new_child
isa AQualified
5872 _n_qualified
= new_child
5878 if _n_kwsuper
== old_child
then
5879 if new_child
!= null then
5880 new_child
.parent
= self
5881 assert new_child
isa TKwsuper
5882 _n_kwsuper
= new_child
5888 for i
in [0.._n_args
.length
[ do
5889 if _n_args
[i
] == old_child
then
5890 if new_child
!= null then
5891 assert new_child
isa AExpr
5892 _n_args
[i
] = new_child
5893 new_child
.parent
= self
5895 _n_args
.remove_at
(i
)
5902 redef fun visit_all
(v
: Visitor)
5904 if _n_qualified
!= null then
5905 v
.enter_visit
(_n_qualified
.as(not null))
5907 v
.enter_visit
(_n_kwsuper
)
5913 redef class AInitExpr
5914 private init empty_init
do end
5916 init init_ainitexpr
(
5917 n_expr
: nullable AExpr,
5918 n_kwinit
: nullable TKwinit,
5919 n_args
: Collection[Object] # Should be Collection[AExpr]
5923 _n_expr
= n_expr
.as(not null)
5924 n_expr
.parent
= self
5925 _n_kwinit
= n_kwinit
.as(not null)
5926 n_kwinit
.parent
= self
5934 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5936 if _n_expr
== old_child
then
5937 if new_child
!= null then
5938 new_child
.parent
= self
5939 assert new_child
isa AExpr
5946 if _n_kwinit
== old_child
then
5947 if new_child
!= null then
5948 new_child
.parent
= self
5949 assert new_child
isa TKwinit
5950 _n_kwinit
= new_child
5956 for i
in [0.._n_args
.length
[ do
5957 if _n_args
[i
] == old_child
then
5958 if new_child
!= null then
5959 assert new_child
isa AExpr
5960 _n_args
[i
] = new_child
5961 new_child
.parent
= self
5963 _n_args
.remove_at
(i
)
5970 redef fun visit_all
(v
: Visitor)
5972 v
.enter_visit
(_n_expr
)
5973 v
.enter_visit
(_n_kwinit
)
5979 redef class ABraExpr
5980 private init empty_init
do end
5982 init init_abraexpr
(
5983 n_expr
: nullable AExpr,
5984 n_args
: Collection[Object], # Should be Collection[AExpr]
5985 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5989 _n_expr
= n_expr
.as(not null)
5990 n_expr
.parent
= self
5996 for n
in n_closure_defs
do
5997 assert n
isa AClosureDef
5998 _n_closure_defs
.add
(n
)
6003 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6005 if _n_expr
== old_child
then
6006 if new_child
!= null then
6007 new_child
.parent
= self
6008 assert new_child
isa AExpr
6015 for i
in [0.._n_args
.length
[ do
6016 if _n_args
[i
] == old_child
then
6017 if new_child
!= null then
6018 assert new_child
isa AExpr
6019 _n_args
[i
] = new_child
6020 new_child
.parent
= self
6022 _n_args
.remove_at
(i
)
6027 for i
in [0.._n_closure_defs
.length
[ do
6028 if _n_closure_defs
[i
] == old_child
then
6029 if new_child
!= null then
6030 assert new_child
isa AClosureDef
6031 _n_closure_defs
[i
] = new_child
6032 new_child
.parent
= self
6034 _n_closure_defs
.remove_at
(i
)
6041 redef fun visit_all
(v
: Visitor)
6043 v
.enter_visit
(_n_expr
)
6047 for n
in _n_closure_defs
do
6052 redef class ABraAssignExpr
6053 private init empty_init
do end
6055 init init_abraassignexpr
(
6056 n_expr
: nullable AExpr,
6057 n_args
: Collection[Object], # Should be Collection[AExpr]
6058 n_assign
: nullable TAssign,
6059 n_value
: nullable AExpr
6063 _n_expr
= n_expr
.as(not null)
6064 n_expr
.parent
= self
6070 _n_assign
= n_assign
.as(not null)
6071 n_assign
.parent
= self
6072 _n_value
= n_value
.as(not null)
6073 n_value
.parent
= self
6076 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6078 if _n_expr
== old_child
then
6079 if new_child
!= null then
6080 new_child
.parent
= self
6081 assert new_child
isa AExpr
6088 for i
in [0.._n_args
.length
[ do
6089 if _n_args
[i
] == old_child
then
6090 if new_child
!= null then
6091 assert new_child
isa AExpr
6092 _n_args
[i
] = new_child
6093 new_child
.parent
= self
6095 _n_args
.remove_at
(i
)
6100 if _n_assign
== old_child
then
6101 if new_child
!= null then
6102 new_child
.parent
= self
6103 assert new_child
isa TAssign
6104 _n_assign
= new_child
6110 if _n_value
== old_child
then
6111 if new_child
!= null then
6112 new_child
.parent
= self
6113 assert new_child
isa AExpr
6114 _n_value
= new_child
6122 redef fun visit_all
(v
: Visitor)
6124 v
.enter_visit
(_n_expr
)
6128 v
.enter_visit
(_n_assign
)
6129 v
.enter_visit
(_n_value
)
6132 redef class ABraReassignExpr
6133 private init empty_init
do end
6135 init init_abrareassignexpr
(
6136 n_expr
: nullable AExpr,
6137 n_args
: Collection[Object], # Should be Collection[AExpr]
6138 n_assign_op
: nullable AAssignOp,
6139 n_value
: nullable AExpr
6143 _n_expr
= n_expr
.as(not null)
6144 n_expr
.parent
= self
6150 _n_assign_op
= n_assign_op
.as(not null)
6151 n_assign_op
.parent
= self
6152 _n_value
= n_value
.as(not null)
6153 n_value
.parent
= self
6156 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6158 if _n_expr
== old_child
then
6159 if new_child
!= null then
6160 new_child
.parent
= self
6161 assert new_child
isa AExpr
6168 for i
in [0.._n_args
.length
[ do
6169 if _n_args
[i
] == old_child
then
6170 if new_child
!= null then
6171 assert new_child
isa AExpr
6172 _n_args
[i
] = new_child
6173 new_child
.parent
= self
6175 _n_args
.remove_at
(i
)
6180 if _n_assign_op
== old_child
then
6181 if new_child
!= null then
6182 new_child
.parent
= self
6183 assert new_child
isa AAssignOp
6184 _n_assign_op
= new_child
6190 if _n_value
== old_child
then
6191 if new_child
!= null then
6192 new_child
.parent
= self
6193 assert new_child
isa AExpr
6194 _n_value
= new_child
6202 redef fun visit_all
(v
: Visitor)
6204 v
.enter_visit
(_n_expr
)
6208 v
.enter_visit
(_n_assign_op
)
6209 v
.enter_visit
(_n_value
)
6212 redef class AClosureCallExpr
6213 private init empty_init
do end
6215 init init_aclosurecallexpr
(
6217 n_args
: Collection[Object], # Should be Collection[AExpr]
6218 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6222 _n_id
= n_id
.as(not null)
6229 for n
in n_closure_defs
do
6230 assert n
isa AClosureDef
6231 _n_closure_defs
.add
(n
)
6236 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6238 if _n_id
== old_child
then
6239 if new_child
!= null then
6240 new_child
.parent
= self
6241 assert new_child
isa TId
6248 for i
in [0.._n_args
.length
[ do
6249 if _n_args
[i
] == old_child
then
6250 if new_child
!= null then
6251 assert new_child
isa AExpr
6252 _n_args
[i
] = new_child
6253 new_child
.parent
= self
6255 _n_args
.remove_at
(i
)
6260 for i
in [0.._n_closure_defs
.length
[ do
6261 if _n_closure_defs
[i
] == old_child
then
6262 if new_child
!= null then
6263 assert new_child
isa AClosureDef
6264 _n_closure_defs
[i
] = new_child
6265 new_child
.parent
= self
6267 _n_closure_defs
.remove_at
(i
)
6274 redef fun visit_all
(v
: Visitor)
6276 v
.enter_visit
(_n_id
)
6280 for n
in _n_closure_defs
do
6285 redef class AVarExpr
6286 private init empty_init
do end
6288 init init_avarexpr
(
6293 _n_id
= n_id
.as(not null)
6297 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6299 if _n_id
== old_child
then
6300 if new_child
!= null then
6301 new_child
.parent
= self
6302 assert new_child
isa TId
6311 redef fun visit_all
(v
: Visitor)
6313 v
.enter_visit
(_n_id
)
6316 redef class AVarAssignExpr
6317 private init empty_init
do end
6319 init init_avarassignexpr
(
6321 n_assign
: nullable TAssign,
6322 n_value
: nullable AExpr
6326 _n_id
= n_id
.as(not null)
6328 _n_assign
= n_assign
.as(not null)
6329 n_assign
.parent
= self
6330 _n_value
= n_value
.as(not null)
6331 n_value
.parent
= self
6334 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6336 if _n_id
== old_child
then
6337 if new_child
!= null then
6338 new_child
.parent
= self
6339 assert new_child
isa TId
6346 if _n_assign
== old_child
then
6347 if new_child
!= null then
6348 new_child
.parent
= self
6349 assert new_child
isa TAssign
6350 _n_assign
= new_child
6356 if _n_value
== old_child
then
6357 if new_child
!= null then
6358 new_child
.parent
= self
6359 assert new_child
isa AExpr
6360 _n_value
= new_child
6368 redef fun visit_all
(v
: Visitor)
6370 v
.enter_visit
(_n_id
)
6371 v
.enter_visit
(_n_assign
)
6372 v
.enter_visit
(_n_value
)
6375 redef class AVarReassignExpr
6376 private init empty_init
do end
6378 init init_avarreassignexpr
(
6380 n_assign_op
: nullable AAssignOp,
6381 n_value
: nullable AExpr
6385 _n_id
= n_id
.as(not null)
6387 _n_assign_op
= n_assign_op
.as(not null)
6388 n_assign_op
.parent
= self
6389 _n_value
= n_value
.as(not null)
6390 n_value
.parent
= self
6393 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6395 if _n_id
== old_child
then
6396 if new_child
!= null then
6397 new_child
.parent
= self
6398 assert new_child
isa TId
6405 if _n_assign_op
== old_child
then
6406 if new_child
!= null then
6407 new_child
.parent
= self
6408 assert new_child
isa AAssignOp
6409 _n_assign_op
= new_child
6415 if _n_value
== old_child
then
6416 if new_child
!= null then
6417 new_child
.parent
= self
6418 assert new_child
isa AExpr
6419 _n_value
= new_child
6427 redef fun visit_all
(v
: Visitor)
6429 v
.enter_visit
(_n_id
)
6430 v
.enter_visit
(_n_assign_op
)
6431 v
.enter_visit
(_n_value
)
6434 redef class ARangeExpr
6435 private init empty_init
do end
6437 init init_arangeexpr
(
6438 n_expr
: nullable AExpr,
6439 n_expr2
: nullable AExpr
6443 _n_expr
= n_expr
.as(not null)
6444 n_expr
.parent
= self
6445 _n_expr2
= n_expr2
.as(not null)
6446 n_expr2
.parent
= self
6449 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6451 if _n_expr
== old_child
then
6452 if new_child
!= null then
6453 new_child
.parent
= self
6454 assert new_child
isa AExpr
6461 if _n_expr2
== old_child
then
6462 if new_child
!= null then
6463 new_child
.parent
= self
6464 assert new_child
isa AExpr
6465 _n_expr2
= new_child
6473 redef fun visit_all
(v
: Visitor)
6475 v
.enter_visit
(_n_expr
)
6476 v
.enter_visit
(_n_expr2
)
6479 redef class ACrangeExpr
6480 private init empty_init
do end
6482 init init_acrangeexpr
(
6483 n_expr
: nullable AExpr,
6484 n_expr2
: nullable AExpr
6488 _n_expr
= n_expr
.as(not null)
6489 n_expr
.parent
= self
6490 _n_expr2
= n_expr2
.as(not null)
6491 n_expr2
.parent
= self
6494 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6496 if _n_expr
== old_child
then
6497 if new_child
!= null then
6498 new_child
.parent
= self
6499 assert new_child
isa AExpr
6506 if _n_expr2
== old_child
then
6507 if new_child
!= null then
6508 new_child
.parent
= self
6509 assert new_child
isa AExpr
6510 _n_expr2
= new_child
6518 redef fun visit_all
(v
: Visitor)
6520 v
.enter_visit
(_n_expr
)
6521 v
.enter_visit
(_n_expr2
)
6524 redef class AOrangeExpr
6525 private init empty_init
do end
6527 init init_aorangeexpr
(
6528 n_expr
: nullable AExpr,
6529 n_expr2
: nullable AExpr
6533 _n_expr
= n_expr
.as(not null)
6534 n_expr
.parent
= self
6535 _n_expr2
= n_expr2
.as(not null)
6536 n_expr2
.parent
= self
6539 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6541 if _n_expr
== old_child
then
6542 if new_child
!= null then
6543 new_child
.parent
= self
6544 assert new_child
isa AExpr
6551 if _n_expr2
== old_child
then
6552 if new_child
!= null then
6553 new_child
.parent
= self
6554 assert new_child
isa AExpr
6555 _n_expr2
= new_child
6563 redef fun visit_all
(v
: Visitor)
6565 v
.enter_visit
(_n_expr
)
6566 v
.enter_visit
(_n_expr2
)
6569 redef class AArrayExpr
6570 private init empty_init
do end
6572 init init_aarrayexpr
(
6573 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6584 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6586 for i
in [0.._n_exprs
.length
[ do
6587 if _n_exprs
[i
] == old_child
then
6588 if new_child
!= null then
6589 assert new_child
isa AExpr
6590 _n_exprs
[i
] = new_child
6591 new_child
.parent
= self
6593 _n_exprs
.remove_at
(i
)
6600 redef fun visit_all
(v
: Visitor)
6602 for n
in _n_exprs
do
6607 redef class ASelfExpr
6608 private init empty_init
do end
6610 init init_aselfexpr
(
6611 n_kwself
: nullable TKwself
6615 _n_kwself
= n_kwself
.as(not null)
6616 n_kwself
.parent
= self
6619 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6621 if _n_kwself
== old_child
then
6622 if new_child
!= null then
6623 new_child
.parent
= self
6624 assert new_child
isa TKwself
6625 _n_kwself
= new_child
6633 redef fun visit_all
(v
: Visitor)
6635 v
.enter_visit
(_n_kwself
)
6638 redef class AImplicitSelfExpr
6639 private init empty_init
do end
6641 init init_aimplicitselfexpr
6646 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6650 redef fun visit_all
(v
: Visitor)
6654 redef class ATrueExpr
6655 private init empty_init
do end
6657 init init_atrueexpr
(
6658 n_kwtrue
: nullable TKwtrue
6662 _n_kwtrue
= n_kwtrue
.as(not null)
6663 n_kwtrue
.parent
= self
6666 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6668 if _n_kwtrue
== old_child
then
6669 if new_child
!= null then
6670 new_child
.parent
= self
6671 assert new_child
isa TKwtrue
6672 _n_kwtrue
= new_child
6680 redef fun visit_all
(v
: Visitor)
6682 v
.enter_visit
(_n_kwtrue
)
6685 redef class AFalseExpr
6686 private init empty_init
do end
6688 init init_afalseexpr
(
6689 n_kwfalse
: nullable TKwfalse
6693 _n_kwfalse
= n_kwfalse
.as(not null)
6694 n_kwfalse
.parent
= self
6697 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6699 if _n_kwfalse
== old_child
then
6700 if new_child
!= null then
6701 new_child
.parent
= self
6702 assert new_child
isa TKwfalse
6703 _n_kwfalse
= new_child
6711 redef fun visit_all
(v
: Visitor)
6713 v
.enter_visit
(_n_kwfalse
)
6716 redef class ANullExpr
6717 private init empty_init
do end
6719 init init_anullexpr
(
6720 n_kwnull
: nullable TKwnull
6724 _n_kwnull
= n_kwnull
.as(not null)
6725 n_kwnull
.parent
= self
6728 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6730 if _n_kwnull
== old_child
then
6731 if new_child
!= null then
6732 new_child
.parent
= self
6733 assert new_child
isa TKwnull
6734 _n_kwnull
= new_child
6742 redef fun visit_all
(v
: Visitor)
6744 v
.enter_visit
(_n_kwnull
)
6747 redef class AIntExpr
6748 private init empty_init
do end
6750 init init_aintexpr
(
6751 n_number
: nullable TNumber
6755 _n_number
= n_number
.as(not null)
6756 n_number
.parent
= self
6759 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6761 if _n_number
== old_child
then
6762 if new_child
!= null then
6763 new_child
.parent
= self
6764 assert new_child
isa TNumber
6765 _n_number
= new_child
6773 redef fun visit_all
(v
: Visitor)
6775 v
.enter_visit
(_n_number
)
6778 redef class AFloatExpr
6779 private init empty_init
do end
6781 init init_afloatexpr
(
6782 n_float
: nullable TFloat
6786 _n_float
= n_float
.as(not null)
6787 n_float
.parent
= self
6790 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6792 if _n_float
== old_child
then
6793 if new_child
!= null then
6794 new_child
.parent
= self
6795 assert new_child
isa TFloat
6796 _n_float
= new_child
6804 redef fun visit_all
(v
: Visitor)
6806 v
.enter_visit
(_n_float
)
6809 redef class ACharExpr
6810 private init empty_init
do end
6812 init init_acharexpr
(
6813 n_char
: nullable TChar
6817 _n_char
= n_char
.as(not null)
6818 n_char
.parent
= self
6821 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6823 if _n_char
== old_child
then
6824 if new_child
!= null then
6825 new_child
.parent
= self
6826 assert new_child
isa TChar
6835 redef fun visit_all
(v
: Visitor)
6837 v
.enter_visit
(_n_char
)
6840 redef class AStringExpr
6841 private init empty_init
do end
6843 init init_astringexpr
(
6844 n_string
: nullable TString
6848 _n_string
= n_string
.as(not null)
6849 n_string
.parent
= self
6852 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6854 if _n_string
== old_child
then
6855 if new_child
!= null then
6856 new_child
.parent
= self
6857 assert new_child
isa TString
6858 _n_string
= new_child
6866 redef fun visit_all
(v
: Visitor)
6868 v
.enter_visit
(_n_string
)
6871 redef class AStartStringExpr
6872 private init empty_init
do end
6874 init init_astartstringexpr
(
6875 n_string
: nullable TStartString
6879 _n_string
= n_string
.as(not null)
6880 n_string
.parent
= self
6883 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6885 if _n_string
== old_child
then
6886 if new_child
!= null then
6887 new_child
.parent
= self
6888 assert new_child
isa TStartString
6889 _n_string
= new_child
6897 redef fun visit_all
(v
: Visitor)
6899 v
.enter_visit
(_n_string
)
6902 redef class AMidStringExpr
6903 private init empty_init
do end
6905 init init_amidstringexpr
(
6906 n_string
: nullable TMidString
6910 _n_string
= n_string
.as(not null)
6911 n_string
.parent
= self
6914 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6916 if _n_string
== old_child
then
6917 if new_child
!= null then
6918 new_child
.parent
= self
6919 assert new_child
isa TMidString
6920 _n_string
= new_child
6928 redef fun visit_all
(v
: Visitor)
6930 v
.enter_visit
(_n_string
)
6933 redef class AEndStringExpr
6934 private init empty_init
do end
6936 init init_aendstringexpr
(
6937 n_string
: nullable TEndString
6941 _n_string
= n_string
.as(not null)
6942 n_string
.parent
= self
6945 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6947 if _n_string
== old_child
then
6948 if new_child
!= null then
6949 new_child
.parent
= self
6950 assert new_child
isa TEndString
6951 _n_string
= new_child
6959 redef fun visit_all
(v
: Visitor)
6961 v
.enter_visit
(_n_string
)
6964 redef class ASuperstringExpr
6965 private init empty_init
do end
6967 init init_asuperstringexpr
(
6968 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6979 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6981 for i
in [0.._n_exprs
.length
[ do
6982 if _n_exprs
[i
] == old_child
then
6983 if new_child
!= null then
6984 assert new_child
isa AExpr
6985 _n_exprs
[i
] = new_child
6986 new_child
.parent
= self
6988 _n_exprs
.remove_at
(i
)
6995 redef fun visit_all
(v
: Visitor)
6997 for n
in _n_exprs
do
7002 redef class AParExpr
7003 private init empty_init
do end
7005 init init_aparexpr
(
7006 n_expr
: nullable AExpr
7010 _n_expr
= n_expr
.as(not null)
7011 n_expr
.parent
= self
7014 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7016 if _n_expr
== old_child
then
7017 if new_child
!= null then
7018 new_child
.parent
= self
7019 assert new_child
isa AExpr
7028 redef fun visit_all
(v
: Visitor)
7030 v
.enter_visit
(_n_expr
)
7033 redef class AAsCastExpr
7034 private init empty_init
do end
7036 init init_aascastexpr
(
7037 n_expr
: nullable AExpr,
7038 n_kwas
: nullable TKwas,
7039 n_type
: nullable AType
7043 _n_expr
= n_expr
.as(not null)
7044 n_expr
.parent
= self
7045 _n_kwas
= n_kwas
.as(not null)
7046 n_kwas
.parent
= self
7047 _n_type
= n_type
.as(not null)
7048 n_type
.parent
= self
7051 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7053 if _n_expr
== old_child
then
7054 if new_child
!= null then
7055 new_child
.parent
= self
7056 assert new_child
isa AExpr
7063 if _n_kwas
== old_child
then
7064 if new_child
!= null then
7065 new_child
.parent
= self
7066 assert new_child
isa TKwas
7073 if _n_type
== old_child
then
7074 if new_child
!= null then
7075 new_child
.parent
= self
7076 assert new_child
isa AType
7085 redef fun visit_all
(v
: Visitor)
7087 v
.enter_visit
(_n_expr
)
7088 v
.enter_visit
(_n_kwas
)
7089 v
.enter_visit
(_n_type
)
7092 redef class AAsNotnullExpr
7093 private init empty_init
do end
7095 init init_aasnotnullexpr
(
7096 n_expr
: nullable AExpr,
7097 n_kwas
: nullable TKwas,
7098 n_kwnot
: nullable TKwnot,
7099 n_kwnull
: nullable TKwnull
7103 _n_expr
= n_expr
.as(not null)
7104 n_expr
.parent
= self
7105 _n_kwas
= n_kwas
.as(not null)
7106 n_kwas
.parent
= self
7107 _n_kwnot
= n_kwnot
.as(not null)
7108 n_kwnot
.parent
= self
7109 _n_kwnull
= n_kwnull
.as(not null)
7110 n_kwnull
.parent
= self
7113 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7115 if _n_expr
== old_child
then
7116 if new_child
!= null then
7117 new_child
.parent
= self
7118 assert new_child
isa AExpr
7125 if _n_kwas
== old_child
then
7126 if new_child
!= null then
7127 new_child
.parent
= self
7128 assert new_child
isa TKwas
7135 if _n_kwnot
== old_child
then
7136 if new_child
!= null then
7137 new_child
.parent
= self
7138 assert new_child
isa TKwnot
7139 _n_kwnot
= new_child
7145 if _n_kwnull
== old_child
then
7146 if new_child
!= null then
7147 new_child
.parent
= self
7148 assert new_child
isa TKwnull
7149 _n_kwnull
= new_child
7157 redef fun visit_all
(v
: Visitor)
7159 v
.enter_visit
(_n_expr
)
7160 v
.enter_visit
(_n_kwas
)
7161 v
.enter_visit
(_n_kwnot
)
7162 v
.enter_visit
(_n_kwnull
)
7165 redef class AIssetAttrExpr
7166 private init empty_init
do end
7168 init init_aissetattrexpr
(
7169 n_kwisset
: nullable TKwisset,
7170 n_expr
: nullable AExpr,
7171 n_id
: nullable TAttrid
7175 _n_kwisset
= n_kwisset
.as(not null)
7176 n_kwisset
.parent
= self
7177 _n_expr
= n_expr
.as(not null)
7178 n_expr
.parent
= self
7179 _n_id
= n_id
.as(not null)
7183 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7185 if _n_kwisset
== old_child
then
7186 if new_child
!= null then
7187 new_child
.parent
= self
7188 assert new_child
isa TKwisset
7189 _n_kwisset
= new_child
7195 if _n_expr
== old_child
then
7196 if new_child
!= null then
7197 new_child
.parent
= self
7198 assert new_child
isa AExpr
7205 if _n_id
== old_child
then
7206 if new_child
!= null then
7207 new_child
.parent
= self
7208 assert new_child
isa TAttrid
7217 redef fun visit_all
(v
: Visitor)
7219 v
.enter_visit
(_n_kwisset
)
7220 v
.enter_visit
(_n_expr
)
7221 v
.enter_visit
(_n_id
)
7224 redef class APlusAssignOp
7225 private init empty_init
do end
7227 init init_aplusassignop
(
7228 n_pluseq
: nullable TPluseq
7232 _n_pluseq
= n_pluseq
.as(not null)
7233 n_pluseq
.parent
= self
7236 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7238 if _n_pluseq
== old_child
then
7239 if new_child
!= null then
7240 new_child
.parent
= self
7241 assert new_child
isa TPluseq
7242 _n_pluseq
= new_child
7250 redef fun visit_all
(v
: Visitor)
7252 v
.enter_visit
(_n_pluseq
)
7255 redef class AMinusAssignOp
7256 private init empty_init
do end
7258 init init_aminusassignop
(
7259 n_minuseq
: nullable TMinuseq
7263 _n_minuseq
= n_minuseq
.as(not null)
7264 n_minuseq
.parent
= self
7267 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7269 if _n_minuseq
== old_child
then
7270 if new_child
!= null then
7271 new_child
.parent
= self
7272 assert new_child
isa TMinuseq
7273 _n_minuseq
= new_child
7281 redef fun visit_all
(v
: Visitor)
7283 v
.enter_visit
(_n_minuseq
)
7286 redef class AClosureDef
7287 private init empty_init
do end
7289 init init_aclosuredef
(
7290 n_bang
: nullable TBang,
7291 n_id
: nullable AClosureId,
7292 n_ids
: Collection[Object], # Should be Collection[TId]
7293 n_kwdo
: nullable TKwdo,
7294 n_expr
: nullable AExpr,
7295 n_label
: nullable ALabel
7299 _n_bang
= n_bang
.as(not null)
7300 n_bang
.parent
= self
7301 _n_id
= n_id
.as(not null)
7309 if n_kwdo
!= null then
7310 n_kwdo
.parent
= self
7313 if n_expr
!= null then
7314 n_expr
.parent
= self
7317 if n_label
!= null then
7318 n_label
.parent
= self
7322 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7324 if _n_bang
== old_child
then
7325 if new_child
!= null then
7326 new_child
.parent
= self
7327 assert new_child
isa TBang
7334 if _n_id
== old_child
then
7335 if new_child
!= null then
7336 new_child
.parent
= self
7337 assert new_child
isa AClosureId
7344 for i
in [0.._n_ids
.length
[ do
7345 if _n_ids
[i
] == old_child
then
7346 if new_child
!= null then
7347 assert new_child
isa TId
7348 _n_ids
[i
] = new_child
7349 new_child
.parent
= self
7356 if _n_kwdo
== old_child
then
7357 if new_child
!= null then
7358 new_child
.parent
= self
7359 assert new_child
isa TKwdo
7366 if _n_expr
== old_child
then
7367 if new_child
!= null then
7368 new_child
.parent
= self
7369 assert new_child
isa AExpr
7376 if _n_label
== old_child
then
7377 if new_child
!= null then
7378 new_child
.parent
= self
7379 assert new_child
isa ALabel
7380 _n_label
= new_child
7388 redef fun visit_all
(v
: Visitor)
7390 v
.enter_visit
(_n_bang
)
7391 v
.enter_visit
(_n_id
)
7395 if _n_kwdo
!= null then
7396 v
.enter_visit
(_n_kwdo
.as(not null))
7398 if _n_expr
!= null then
7399 v
.enter_visit
(_n_expr
.as(not null))
7401 if _n_label
!= null then
7402 v
.enter_visit
(_n_label
.as(not null))
7406 redef class ASimpleClosureId
7407 private init empty_init
do end
7409 init init_asimpleclosureid
(
7414 _n_id
= n_id
.as(not null)
7418 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7420 if _n_id
== old_child
then
7421 if new_child
!= null then
7422 new_child
.parent
= self
7423 assert new_child
isa TId
7432 redef fun visit_all
(v
: Visitor)
7434 v
.enter_visit
(_n_id
)
7437 redef class ABreakClosureId
7438 private init empty_init
do end
7440 init init_abreakclosureid
(
7441 n_kwbreak
: nullable TKwbreak
7445 _n_kwbreak
= n_kwbreak
.as(not null)
7446 n_kwbreak
.parent
= self
7449 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7451 if _n_kwbreak
== old_child
then
7452 if new_child
!= null then
7453 new_child
.parent
= self
7454 assert new_child
isa TKwbreak
7455 _n_kwbreak
= new_child
7463 redef fun visit_all
(v
: Visitor)
7465 v
.enter_visit
(_n_kwbreak
)
7468 redef class AModuleName
7469 private init empty_init
do end
7471 init init_amodulename
(
7472 n_quad
: nullable TQuad,
7473 n_path
: Collection[Object], # Should be Collection[TId]
7479 if n_quad
!= null then
7480 n_quad
.parent
= self
7487 _n_id
= n_id
.as(not null)
7491 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7493 if _n_quad
== old_child
then
7494 if new_child
!= null then
7495 new_child
.parent
= self
7496 assert new_child
isa TQuad
7503 for i
in [0.._n_path
.length
[ do
7504 if _n_path
[i
] == old_child
then
7505 if new_child
!= null then
7506 assert new_child
isa TId
7507 _n_path
[i
] = new_child
7508 new_child
.parent
= self
7510 _n_path
.remove_at
(i
)
7515 if _n_id
== old_child
then
7516 if new_child
!= null then
7517 new_child
.parent
= self
7518 assert new_child
isa TId
7527 redef fun visit_all
(v
: Visitor)
7529 if _n_quad
!= null then
7530 v
.enter_visit
(_n_quad
.as(not null))
7535 v
.enter_visit
(_n_id
)
7538 redef class AExternCalls
7539 private init empty_init
do end
7541 init init_aexterncalls
(
7542 n_kwimport
: nullable TKwimport,
7543 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7547 _n_kwimport
= n_kwimport
.as(not null)
7548 n_kwimport
.parent
= self
7549 for n
in n_extern_calls
do
7550 assert n
isa AExternCall
7551 _n_extern_calls
.add
(n
)
7556 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7558 if _n_kwimport
== old_child
then
7559 if new_child
!= null then
7560 new_child
.parent
= self
7561 assert new_child
isa TKwimport
7562 _n_kwimport
= new_child
7568 for i
in [0.._n_extern_calls
.length
[ do
7569 if _n_extern_calls
[i
] == old_child
then
7570 if new_child
!= null then
7571 assert new_child
isa AExternCall
7572 _n_extern_calls
[i
] = new_child
7573 new_child
.parent
= self
7575 _n_extern_calls
.remove_at
(i
)
7582 redef fun visit_all
(v
: Visitor)
7584 v
.enter_visit
(_n_kwimport
)
7585 for n
in _n_extern_calls
do
7590 redef class AExternCall
7591 private init empty_init
do end
7593 init init_aexterncall
7598 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7602 redef fun visit_all
(v
: Visitor)
7606 redef class ASuperExternCall
7607 private init empty_init
do end
7609 init init_asuperexterncall
(
7610 n_kwsuper
: nullable TKwsuper
7614 _n_kwsuper
= n_kwsuper
.as(not null)
7615 n_kwsuper
.parent
= self
7618 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7620 if _n_kwsuper
== old_child
then
7621 if new_child
!= null then
7622 new_child
.parent
= self
7623 assert new_child
isa TKwsuper
7624 _n_kwsuper
= new_child
7632 redef fun visit_all
(v
: Visitor)
7634 v
.enter_visit
(_n_kwsuper
)
7637 redef class ALocalPropExternCall
7638 private init empty_init
do end
7640 init init_alocalpropexterncall
(
7641 n_methid
: nullable AMethid
7645 _n_methid
= n_methid
.as(not null)
7646 n_methid
.parent
= self
7649 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7651 if _n_methid
== old_child
then
7652 if new_child
!= null then
7653 new_child
.parent
= self
7654 assert new_child
isa AMethid
7655 _n_methid
= new_child
7663 redef fun visit_all
(v
: Visitor)
7665 v
.enter_visit
(_n_methid
)
7668 redef class AFullPropExternCall
7669 private init empty_init
do end
7671 init init_afullpropexterncall
(
7672 n_classid
: nullable TClassid,
7673 n_quad
: nullable TQuad,
7674 n_methid
: nullable AMethid
7678 _n_classid
= n_classid
.as(not null)
7679 n_classid
.parent
= self
7681 if n_quad
!= null then
7682 n_quad
.parent
= self
7684 _n_methid
= n_methid
.as(not null)
7685 n_methid
.parent
= self
7688 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7690 if _n_classid
== old_child
then
7691 if new_child
!= null then
7692 new_child
.parent
= self
7693 assert new_child
isa TClassid
7694 _n_classid
= new_child
7700 if _n_quad
== old_child
then
7701 if new_child
!= null then
7702 new_child
.parent
= self
7703 assert new_child
isa TQuad
7710 if _n_methid
== old_child
then
7711 if new_child
!= null then
7712 new_child
.parent
= self
7713 assert new_child
isa AMethid
7714 _n_methid
= new_child
7722 redef fun visit_all
(v
: Visitor)
7724 v
.enter_visit
(_n_classid
)
7725 if _n_quad
!= null then
7726 v
.enter_visit
(_n_quad
.as(not null))
7728 v
.enter_visit
(_n_methid
)
7731 redef class AInitPropExternCall
7732 private init empty_init
do end
7734 init init_ainitpropexterncall
(
7735 n_classid
: nullable TClassid
7739 _n_classid
= n_classid
.as(not null)
7740 n_classid
.parent
= self
7743 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7745 if _n_classid
== old_child
then
7746 if new_child
!= null then
7747 new_child
.parent
= self
7748 assert new_child
isa TClassid
7749 _n_classid
= new_child
7757 redef fun visit_all
(v
: Visitor)
7759 v
.enter_visit
(_n_classid
)
7762 redef class ACastAsExternCall
7763 private init empty_init
do end
7765 init init_acastasexterncall
(
7766 n_from_type
: nullable AType,
7767 n_kwas
: nullable TKwas,
7768 n_to_type
: nullable AType
7772 _n_from_type
= n_from_type
.as(not null)
7773 n_from_type
.parent
= self
7774 _n_kwas
= n_kwas
.as(not null)
7775 n_kwas
.parent
= self
7776 _n_to_type
= n_to_type
.as(not null)
7777 n_to_type
.parent
= self
7780 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7782 if _n_from_type
== old_child
then
7783 if new_child
!= null then
7784 new_child
.parent
= self
7785 assert new_child
isa AType
7786 _n_from_type
= new_child
7792 if _n_kwas
== old_child
then
7793 if new_child
!= null then
7794 new_child
.parent
= self
7795 assert new_child
isa TKwas
7802 if _n_to_type
== old_child
then
7803 if new_child
!= null then
7804 new_child
.parent
= self
7805 assert new_child
isa AType
7806 _n_to_type
= new_child
7814 redef fun visit_all
(v
: Visitor)
7816 v
.enter_visit
(_n_from_type
)
7817 v
.enter_visit
(_n_kwas
)
7818 v
.enter_visit
(_n_to_type
)
7821 redef class AAsNullableExternCall
7822 private init empty_init
do end
7824 init init_aasnullableexterncall
(
7825 n_type
: nullable AType,
7826 n_kwas
: nullable TKwas,
7827 n_kwnullable
: nullable TKwnullable
7831 _n_type
= n_type
.as(not null)
7832 n_type
.parent
= self
7833 _n_kwas
= n_kwas
.as(not null)
7834 n_kwas
.parent
= self
7835 _n_kwnullable
= n_kwnullable
.as(not null)
7836 n_kwnullable
.parent
= self
7839 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7841 if _n_type
== old_child
then
7842 if new_child
!= null then
7843 new_child
.parent
= self
7844 assert new_child
isa AType
7851 if _n_kwas
== old_child
then
7852 if new_child
!= null then
7853 new_child
.parent
= self
7854 assert new_child
isa TKwas
7861 if _n_kwnullable
== old_child
then
7862 if new_child
!= null then
7863 new_child
.parent
= self
7864 assert new_child
isa TKwnullable
7865 _n_kwnullable
= new_child
7873 redef fun visit_all
(v
: Visitor)
7875 v
.enter_visit
(_n_type
)
7876 v
.enter_visit
(_n_kwas
)
7877 v
.enter_visit
(_n_kwnullable
)
7880 redef class AAsNotNullableExternCall
7881 private init empty_init
do end
7883 init init_aasnotnullableexterncall
(
7884 n_type
: nullable AType,
7885 n_kwas
: nullable TKwas,
7886 n_kwnot
: nullable TKwnot,
7887 n_kwnullable
: nullable TKwnullable
7891 _n_type
= n_type
.as(not null)
7892 n_type
.parent
= self
7893 _n_kwas
= n_kwas
.as(not null)
7894 n_kwas
.parent
= self
7895 _n_kwnot
= n_kwnot
.as(not null)
7896 n_kwnot
.parent
= self
7897 _n_kwnullable
= n_kwnullable
.as(not null)
7898 n_kwnullable
.parent
= self
7901 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7903 if _n_type
== old_child
then
7904 if new_child
!= null then
7905 new_child
.parent
= self
7906 assert new_child
isa AType
7913 if _n_kwas
== old_child
then
7914 if new_child
!= null then
7915 new_child
.parent
= self
7916 assert new_child
isa TKwas
7923 if _n_kwnot
== old_child
then
7924 if new_child
!= null then
7925 new_child
.parent
= self
7926 assert new_child
isa TKwnot
7927 _n_kwnot
= new_child
7933 if _n_kwnullable
== old_child
then
7934 if new_child
!= null then
7935 new_child
.parent
= self
7936 assert new_child
isa TKwnullable
7937 _n_kwnullable
= new_child
7945 redef fun visit_all
(v
: Visitor)
7947 v
.enter_visit
(_n_type
)
7948 v
.enter_visit
(_n_kwas
)
7949 v
.enter_visit
(_n_kwnot
)
7950 v
.enter_visit
(_n_kwnullable
)
7953 redef class AQualified
7954 private init empty_init
do end
7956 init init_aqualified
(
7957 n_id
: Collection[Object], # Should be Collection[TId]
7958 n_classid
: nullable TClassid
7967 _n_classid
= n_classid
7968 if n_classid
!= null then
7969 n_classid
.parent
= self
7973 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7975 for i
in [0.._n_id
.length
[ do
7976 if _n_id
[i
] == old_child
then
7977 if new_child
!= null then
7978 assert new_child
isa TId
7979 _n_id
[i
] = new_child
7980 new_child
.parent
= self
7987 if _n_classid
== old_child
then
7988 if new_child
!= null then
7989 new_child
.parent
= self
7990 assert new_child
isa TClassid
7991 _n_classid
= new_child
7999 redef fun visit_all
(v
: Visitor)
8004 if _n_classid
!= null then
8005 v
.enter_visit
(_n_classid
.as(not null))
8010 private init empty_init
do end
8013 n_comment
: Collection[Object] # Should be Collection[TComment]
8017 for n
in n_comment
do
8018 assert n
isa TComment
8024 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8026 for i
in [0.._n_comment
.length
[ do
8027 if _n_comment
[i
] == old_child
then
8028 if new_child
!= null then
8029 assert new_child
isa TComment
8030 _n_comment
[i
] = new_child
8031 new_child
.parent
= self
8033 _n_comment
.remove_at
(i
)
8040 redef fun visit_all
(v
: Visitor)
8042 for n
in _n_comment
do
8050 n_base
: nullable AModule,
8057 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8059 if _n_base
== old_child
then
8060 if new_child
== null then
8062 new_child
.parent
= self
8063 assert new_child
isa AModule
8066 old_child
.parent
= null
8071 redef fun visit_all
(v
: Visitor)
8073 if _n_base
!= null then
8074 v
.enter_visit
(_n_base
.as(not null))
8076 v
.enter_visit
(_n_eof
)