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 AMainMethPropdef
1866 private init empty_init
do end
1868 init init_amainmethpropdef
(
1869 n_kwredef
: nullable TKwredef,
1870 n_block
: nullable AExpr
1874 _n_kwredef
= n_kwredef
1875 if n_kwredef
!= null then
1876 n_kwredef
.parent
= self
1879 if n_block
!= null then
1880 n_block
.parent
= self
1884 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1886 if _n_kwredef
== old_child
then
1887 if new_child
!= null then
1888 new_child
.parent
= self
1889 assert new_child
isa TKwredef
1890 _n_kwredef
= new_child
1896 if _n_block
== old_child
then
1897 if new_child
!= null then
1898 new_child
.parent
= self
1899 assert new_child
isa AExpr
1900 _n_block
= new_child
1908 redef fun visit_all
(v
: Visitor)
1910 if _n_kwredef
!= null then
1911 v
.enter_visit
(_n_kwredef
.as(not null))
1913 if _n_block
!= null then
1914 v
.enter_visit
(_n_block
.as(not null))
1918 redef class ATypePropdef
1919 private init empty_init
do end
1921 init init_atypepropdef
(
1922 n_doc
: nullable ADoc,
1923 n_kwredef
: nullable TKwredef,
1924 n_visibility
: nullable AVisibility,
1925 n_kwtype
: nullable TKwtype,
1926 n_id
: nullable TClassid,
1927 n_type
: nullable AType
1932 if n_doc
!= null then
1935 _n_kwredef
= n_kwredef
1936 if n_kwredef
!= null then
1937 n_kwredef
.parent
= self
1939 _n_visibility
= n_visibility
.as(not null)
1940 n_visibility
.parent
= self
1941 _n_kwtype
= n_kwtype
.as(not null)
1942 n_kwtype
.parent
= self
1943 _n_id
= n_id
.as(not null)
1945 _n_type
= n_type
.as(not null)
1946 n_type
.parent
= self
1949 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1951 if _n_doc
== old_child
then
1952 if new_child
!= null then
1953 new_child
.parent
= self
1954 assert new_child
isa ADoc
1961 if _n_kwredef
== old_child
then
1962 if new_child
!= null then
1963 new_child
.parent
= self
1964 assert new_child
isa TKwredef
1965 _n_kwredef
= new_child
1971 if _n_visibility
== old_child
then
1972 if new_child
!= null then
1973 new_child
.parent
= self
1974 assert new_child
isa AVisibility
1975 _n_visibility
= new_child
1981 if _n_kwtype
== old_child
then
1982 if new_child
!= null then
1983 new_child
.parent
= self
1984 assert new_child
isa TKwtype
1985 _n_kwtype
= new_child
1991 if _n_id
== old_child
then
1992 if new_child
!= null then
1993 new_child
.parent
= self
1994 assert new_child
isa TClassid
2001 if _n_type
== old_child
then
2002 if new_child
!= null then
2003 new_child
.parent
= self
2004 assert new_child
isa AType
2013 redef fun visit_all
(v
: Visitor)
2015 if _n_doc
!= null then
2016 v
.enter_visit
(_n_doc
.as(not null))
2018 if _n_kwredef
!= null then
2019 v
.enter_visit
(_n_kwredef
.as(not null))
2021 v
.enter_visit
(_n_visibility
)
2022 v
.enter_visit
(_n_kwtype
)
2023 v
.enter_visit
(_n_id
)
2024 v
.enter_visit
(_n_type
)
2027 redef class AReadAble
2028 private init empty_init
do end
2030 init init_areadable
(
2031 n_kwredef
: nullable TKwredef,
2032 n_kwreadable
: nullable TKwreadable
2036 _n_kwredef
= n_kwredef
2037 if n_kwredef
!= null then
2038 n_kwredef
.parent
= self
2040 _n_kwreadable
= n_kwreadable
.as(not null)
2041 n_kwreadable
.parent
= self
2044 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2046 if _n_kwredef
== old_child
then
2047 if new_child
!= null then
2048 new_child
.parent
= self
2049 assert new_child
isa TKwredef
2050 _n_kwredef
= new_child
2056 if _n_kwreadable
== old_child
then
2057 if new_child
!= null then
2058 new_child
.parent
= self
2059 assert new_child
isa TKwreadable
2060 _n_kwreadable
= new_child
2068 redef fun visit_all
(v
: Visitor)
2070 if _n_kwredef
!= null then
2071 v
.enter_visit
(_n_kwredef
.as(not null))
2073 v
.enter_visit
(_n_kwreadable
)
2076 redef class AWriteAble
2077 private init empty_init
do end
2079 init init_awriteable
(
2080 n_kwredef
: nullable TKwredef,
2081 n_visibility
: nullable AVisibility,
2082 n_kwwritable
: nullable TKwwritable
2086 _n_kwredef
= n_kwredef
2087 if n_kwredef
!= null then
2088 n_kwredef
.parent
= self
2090 _n_visibility
= n_visibility
2091 if n_visibility
!= null then
2092 n_visibility
.parent
= self
2094 _n_kwwritable
= n_kwwritable
.as(not null)
2095 n_kwwritable
.parent
= self
2098 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2100 if _n_kwredef
== old_child
then
2101 if new_child
!= null then
2102 new_child
.parent
= self
2103 assert new_child
isa TKwredef
2104 _n_kwredef
= new_child
2110 if _n_visibility
== old_child
then
2111 if new_child
!= null then
2112 new_child
.parent
= self
2113 assert new_child
isa AVisibility
2114 _n_visibility
= new_child
2116 _n_visibility
= null
2120 if _n_kwwritable
== old_child
then
2121 if new_child
!= null then
2122 new_child
.parent
= self
2123 assert new_child
isa TKwwritable
2124 _n_kwwritable
= new_child
2132 redef fun visit_all
(v
: Visitor)
2134 if _n_kwredef
!= null then
2135 v
.enter_visit
(_n_kwredef
.as(not null))
2137 if _n_visibility
!= null then
2138 v
.enter_visit
(_n_visibility
.as(not null))
2140 v
.enter_visit
(_n_kwwritable
)
2143 redef class AIdMethid
2144 private init empty_init
do end
2146 init init_aidmethid
(
2151 _n_id
= n_id
.as(not null)
2155 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2157 if _n_id
== old_child
then
2158 if new_child
!= null then
2159 new_child
.parent
= self
2160 assert new_child
isa TId
2169 redef fun visit_all
(v
: Visitor)
2171 v
.enter_visit
(_n_id
)
2174 redef class APlusMethid
2175 private init empty_init
do end
2177 init init_aplusmethid
(
2178 n_plus
: nullable TPlus
2182 _n_plus
= n_plus
.as(not null)
2183 n_plus
.parent
= self
2186 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2188 if _n_plus
== old_child
then
2189 if new_child
!= null then
2190 new_child
.parent
= self
2191 assert new_child
isa TPlus
2200 redef fun visit_all
(v
: Visitor)
2202 v
.enter_visit
(_n_plus
)
2205 redef class AMinusMethid
2206 private init empty_init
do end
2208 init init_aminusmethid
(
2209 n_minus
: nullable TMinus
2213 _n_minus
= n_minus
.as(not null)
2214 n_minus
.parent
= self
2217 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2219 if _n_minus
== old_child
then
2220 if new_child
!= null then
2221 new_child
.parent
= self
2222 assert new_child
isa TMinus
2223 _n_minus
= new_child
2231 redef fun visit_all
(v
: Visitor)
2233 v
.enter_visit
(_n_minus
)
2236 redef class AStarMethid
2237 private init empty_init
do end
2239 init init_astarmethid
(
2240 n_star
: nullable TStar
2244 _n_star
= n_star
.as(not null)
2245 n_star
.parent
= self
2248 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2250 if _n_star
== old_child
then
2251 if new_child
!= null then
2252 new_child
.parent
= self
2253 assert new_child
isa TStar
2262 redef fun visit_all
(v
: Visitor)
2264 v
.enter_visit
(_n_star
)
2267 redef class ASlashMethid
2268 private init empty_init
do end
2270 init init_aslashmethid
(
2271 n_slash
: nullable TSlash
2275 _n_slash
= n_slash
.as(not null)
2276 n_slash
.parent
= self
2279 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2281 if _n_slash
== old_child
then
2282 if new_child
!= null then
2283 new_child
.parent
= self
2284 assert new_child
isa TSlash
2285 _n_slash
= new_child
2293 redef fun visit_all
(v
: Visitor)
2295 v
.enter_visit
(_n_slash
)
2298 redef class APercentMethid
2299 private init empty_init
do end
2301 init init_apercentmethid
(
2302 n_percent
: nullable TPercent
2306 _n_percent
= n_percent
.as(not null)
2307 n_percent
.parent
= self
2310 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2312 if _n_percent
== old_child
then
2313 if new_child
!= null then
2314 new_child
.parent
= self
2315 assert new_child
isa TPercent
2316 _n_percent
= new_child
2324 redef fun visit_all
(v
: Visitor)
2326 v
.enter_visit
(_n_percent
)
2329 redef class AEqMethid
2330 private init empty_init
do end
2332 init init_aeqmethid
(
2337 _n_eq
= n_eq
.as(not null)
2341 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2343 if _n_eq
== old_child
then
2344 if new_child
!= null then
2345 new_child
.parent
= self
2346 assert new_child
isa TEq
2355 redef fun visit_all
(v
: Visitor)
2357 v
.enter_visit
(_n_eq
)
2360 redef class ANeMethid
2361 private init empty_init
do end
2363 init init_anemethid
(
2368 _n_ne
= n_ne
.as(not null)
2372 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2374 if _n_ne
== old_child
then
2375 if new_child
!= null then
2376 new_child
.parent
= self
2377 assert new_child
isa TNe
2386 redef fun visit_all
(v
: Visitor)
2388 v
.enter_visit
(_n_ne
)
2391 redef class ALeMethid
2392 private init empty_init
do end
2394 init init_alemethid
(
2399 _n_le
= n_le
.as(not null)
2403 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2405 if _n_le
== old_child
then
2406 if new_child
!= null then
2407 new_child
.parent
= self
2408 assert new_child
isa TLe
2417 redef fun visit_all
(v
: Visitor)
2419 v
.enter_visit
(_n_le
)
2422 redef class AGeMethid
2423 private init empty_init
do end
2425 init init_agemethid
(
2430 _n_ge
= n_ge
.as(not null)
2434 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2436 if _n_ge
== old_child
then
2437 if new_child
!= null then
2438 new_child
.parent
= self
2439 assert new_child
isa TGe
2448 redef fun visit_all
(v
: Visitor)
2450 v
.enter_visit
(_n_ge
)
2453 redef class ALtMethid
2454 private init empty_init
do end
2456 init init_altmethid
(
2461 _n_lt
= n_lt
.as(not null)
2465 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2467 if _n_lt
== old_child
then
2468 if new_child
!= null then
2469 new_child
.parent
= self
2470 assert new_child
isa TLt
2479 redef fun visit_all
(v
: Visitor)
2481 v
.enter_visit
(_n_lt
)
2484 redef class AGtMethid
2485 private init empty_init
do end
2487 init init_agtmethid
(
2492 _n_gt
= n_gt
.as(not null)
2496 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2498 if _n_gt
== old_child
then
2499 if new_child
!= null then
2500 new_child
.parent
= self
2501 assert new_child
isa TGt
2510 redef fun visit_all
(v
: Visitor)
2512 v
.enter_visit
(_n_gt
)
2515 redef class ALlMethid
2516 private init empty_init
do end
2518 init init_allmethid
(
2523 _n_ll
= n_ll
.as(not null)
2527 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2529 if _n_ll
== old_child
then
2530 if new_child
!= null then
2531 new_child
.parent
= self
2532 assert new_child
isa TLl
2541 redef fun visit_all
(v
: Visitor)
2543 v
.enter_visit
(_n_ll
)
2546 redef class AGgMethid
2547 private init empty_init
do end
2549 init init_aggmethid
(
2554 _n_gg
= n_gg
.as(not null)
2558 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2560 if _n_gg
== old_child
then
2561 if new_child
!= null then
2562 new_child
.parent
= self
2563 assert new_child
isa TGg
2572 redef fun visit_all
(v
: Visitor)
2574 v
.enter_visit
(_n_gg
)
2577 redef class ABraMethid
2578 private init empty_init
do end
2580 init init_abramethid
(
2581 n_obra
: nullable TObra,
2582 n_cbra
: nullable TCbra
2586 _n_obra
= n_obra
.as(not null)
2587 n_obra
.parent
= self
2588 _n_cbra
= n_cbra
.as(not null)
2589 n_cbra
.parent
= self
2592 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2594 if _n_obra
== old_child
then
2595 if new_child
!= null then
2596 new_child
.parent
= self
2597 assert new_child
isa TObra
2604 if _n_cbra
== old_child
then
2605 if new_child
!= null then
2606 new_child
.parent
= self
2607 assert new_child
isa TCbra
2616 redef fun visit_all
(v
: Visitor)
2618 v
.enter_visit
(_n_obra
)
2619 v
.enter_visit
(_n_cbra
)
2622 redef class AStarshipMethid
2623 private init empty_init
do end
2625 init init_astarshipmethid
(
2626 n_starship
: nullable TStarship
2630 _n_starship
= n_starship
.as(not null)
2631 n_starship
.parent
= self
2634 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2636 if _n_starship
== old_child
then
2637 if new_child
!= null then
2638 new_child
.parent
= self
2639 assert new_child
isa TStarship
2640 _n_starship
= new_child
2648 redef fun visit_all
(v
: Visitor)
2650 v
.enter_visit
(_n_starship
)
2653 redef class AAssignMethid
2654 private init empty_init
do end
2656 init init_aassignmethid
(
2658 n_assign
: nullable TAssign
2662 _n_id
= n_id
.as(not null)
2664 _n_assign
= n_assign
.as(not null)
2665 n_assign
.parent
= self
2668 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2670 if _n_id
== old_child
then
2671 if new_child
!= null then
2672 new_child
.parent
= self
2673 assert new_child
isa TId
2680 if _n_assign
== old_child
then
2681 if new_child
!= null then
2682 new_child
.parent
= self
2683 assert new_child
isa TAssign
2684 _n_assign
= new_child
2692 redef fun visit_all
(v
: Visitor)
2694 v
.enter_visit
(_n_id
)
2695 v
.enter_visit
(_n_assign
)
2698 redef class ABraassignMethid
2699 private init empty_init
do end
2701 init init_abraassignmethid
(
2702 n_obra
: nullable TObra,
2703 n_cbra
: nullable TCbra,
2704 n_assign
: nullable TAssign
2708 _n_obra
= n_obra
.as(not null)
2709 n_obra
.parent
= self
2710 _n_cbra
= n_cbra
.as(not null)
2711 n_cbra
.parent
= self
2712 _n_assign
= n_assign
.as(not null)
2713 n_assign
.parent
= self
2716 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2718 if _n_obra
== old_child
then
2719 if new_child
!= null then
2720 new_child
.parent
= self
2721 assert new_child
isa TObra
2728 if _n_cbra
== old_child
then
2729 if new_child
!= null then
2730 new_child
.parent
= self
2731 assert new_child
isa TCbra
2738 if _n_assign
== old_child
then
2739 if new_child
!= null then
2740 new_child
.parent
= self
2741 assert new_child
isa TAssign
2742 _n_assign
= new_child
2750 redef fun visit_all
(v
: Visitor)
2752 v
.enter_visit
(_n_obra
)
2753 v
.enter_visit
(_n_cbra
)
2754 v
.enter_visit
(_n_assign
)
2757 redef class ASignature
2758 private init empty_init
do end
2760 init init_asignature
(
2761 n_params
: Collection[Object], # Should be Collection[AParam]
2762 n_type
: nullable AType,
2763 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2767 for n
in n_params
do
2773 if n_type
!= null then
2774 n_type
.parent
= self
2776 for n
in n_closure_decls
do
2777 assert n
isa AClosureDecl
2778 _n_closure_decls
.add
(n
)
2783 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2785 for i
in [0.._n_params
.length
[ do
2786 if _n_params
[i
] == old_child
then
2787 if new_child
!= null then
2788 assert new_child
isa AParam
2789 _n_params
[i
] = new_child
2790 new_child
.parent
= self
2792 _n_params
.remove_at
(i
)
2797 if _n_type
== old_child
then
2798 if new_child
!= null then
2799 new_child
.parent
= self
2800 assert new_child
isa AType
2807 for i
in [0.._n_closure_decls
.length
[ do
2808 if _n_closure_decls
[i
] == old_child
then
2809 if new_child
!= null then
2810 assert new_child
isa AClosureDecl
2811 _n_closure_decls
[i
] = new_child
2812 new_child
.parent
= self
2814 _n_closure_decls
.remove_at
(i
)
2821 redef fun visit_all
(v
: Visitor)
2823 for n
in _n_params
do
2826 if _n_type
!= null then
2827 v
.enter_visit
(_n_type
.as(not null))
2829 for n
in _n_closure_decls
do
2835 private init empty_init
do end
2839 n_type
: nullable AType,
2840 n_dotdotdot
: nullable TDotdotdot
2844 _n_id
= n_id
.as(not null)
2847 if n_type
!= null then
2848 n_type
.parent
= self
2850 _n_dotdotdot
= n_dotdotdot
2851 if n_dotdotdot
!= null then
2852 n_dotdotdot
.parent
= self
2856 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2858 if _n_id
== old_child
then
2859 if new_child
!= null then
2860 new_child
.parent
= self
2861 assert new_child
isa TId
2868 if _n_type
== old_child
then
2869 if new_child
!= null then
2870 new_child
.parent
= self
2871 assert new_child
isa AType
2878 if _n_dotdotdot
== old_child
then
2879 if new_child
!= null then
2880 new_child
.parent
= self
2881 assert new_child
isa TDotdotdot
2882 _n_dotdotdot
= new_child
2890 redef fun visit_all
(v
: Visitor)
2892 v
.enter_visit
(_n_id
)
2893 if _n_type
!= null then
2894 v
.enter_visit
(_n_type
.as(not null))
2896 if _n_dotdotdot
!= null then
2897 v
.enter_visit
(_n_dotdotdot
.as(not null))
2901 redef class AClosureDecl
2902 private init empty_init
do end
2904 init init_aclosuredecl
(
2905 n_kwbreak
: nullable TKwbreak,
2906 n_bang
: nullable TBang,
2908 n_signature
: nullable ASignature,
2909 n_expr
: nullable AExpr
2913 _n_kwbreak
= n_kwbreak
2914 if n_kwbreak
!= null then
2915 n_kwbreak
.parent
= self
2917 _n_bang
= n_bang
.as(not null)
2918 n_bang
.parent
= self
2919 _n_id
= n_id
.as(not null)
2921 _n_signature
= n_signature
.as(not null)
2922 n_signature
.parent
= self
2924 if n_expr
!= null then
2925 n_expr
.parent
= self
2929 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2931 if _n_kwbreak
== old_child
then
2932 if new_child
!= null then
2933 new_child
.parent
= self
2934 assert new_child
isa TKwbreak
2935 _n_kwbreak
= new_child
2941 if _n_bang
== old_child
then
2942 if new_child
!= null then
2943 new_child
.parent
= self
2944 assert new_child
isa TBang
2951 if _n_id
== old_child
then
2952 if new_child
!= null then
2953 new_child
.parent
= self
2954 assert new_child
isa TId
2961 if _n_signature
== old_child
then
2962 if new_child
!= null then
2963 new_child
.parent
= self
2964 assert new_child
isa ASignature
2965 _n_signature
= new_child
2971 if _n_expr
== old_child
then
2972 if new_child
!= null then
2973 new_child
.parent
= self
2974 assert new_child
isa AExpr
2983 redef fun visit_all
(v
: Visitor)
2985 if _n_kwbreak
!= null then
2986 v
.enter_visit
(_n_kwbreak
.as(not null))
2988 v
.enter_visit
(_n_bang
)
2989 v
.enter_visit
(_n_id
)
2990 v
.enter_visit
(_n_signature
)
2991 if _n_expr
!= null then
2992 v
.enter_visit
(_n_expr
.as(not null))
2997 private init empty_init
do end
3000 n_kwnullable
: nullable TKwnullable,
3001 n_id
: nullable TClassid,
3002 n_types
: Collection[Object] # Should be Collection[AType]
3006 _n_kwnullable
= n_kwnullable
3007 if n_kwnullable
!= null then
3008 n_kwnullable
.parent
= self
3010 _n_id
= n_id
.as(not null)
3019 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3021 if _n_kwnullable
== old_child
then
3022 if new_child
!= null then
3023 new_child
.parent
= self
3024 assert new_child
isa TKwnullable
3025 _n_kwnullable
= new_child
3027 _n_kwnullable
= null
3031 if _n_id
== old_child
then
3032 if new_child
!= null then
3033 new_child
.parent
= self
3034 assert new_child
isa TClassid
3041 for i
in [0.._n_types
.length
[ do
3042 if _n_types
[i
] == old_child
then
3043 if new_child
!= null then
3044 assert new_child
isa AType
3045 _n_types
[i
] = new_child
3046 new_child
.parent
= self
3048 _n_types
.remove_at
(i
)
3055 redef fun visit_all
(v
: Visitor)
3057 if _n_kwnullable
!= null then
3058 v
.enter_visit
(_n_kwnullable
.as(not null))
3060 v
.enter_visit
(_n_id
)
3061 for n
in _n_types
do
3067 private init empty_init
do end
3070 n_kwlabel
: nullable TKwlabel,
3075 _n_kwlabel
= n_kwlabel
.as(not null)
3076 n_kwlabel
.parent
= self
3077 _n_id
= n_id
.as(not null)
3081 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3083 if _n_kwlabel
== old_child
then
3084 if new_child
!= null then
3085 new_child
.parent
= self
3086 assert new_child
isa TKwlabel
3087 _n_kwlabel
= new_child
3093 if _n_id
== old_child
then
3094 if new_child
!= null then
3095 new_child
.parent
= self
3096 assert new_child
isa TId
3105 redef fun visit_all
(v
: Visitor)
3107 v
.enter_visit
(_n_kwlabel
)
3108 v
.enter_visit
(_n_id
)
3111 redef class ABlockExpr
3112 private init empty_init
do end
3114 init init_ablockexpr
(
3115 n_expr
: Collection[Object] # Should be Collection[AExpr]
3126 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3128 for i
in [0.._n_expr
.length
[ do
3129 if _n_expr
[i
] == old_child
then
3130 if new_child
!= null then
3131 assert new_child
isa AExpr
3132 _n_expr
[i
] = new_child
3133 new_child
.parent
= self
3135 _n_expr
.remove_at
(i
)
3142 redef fun visit_all
(v
: Visitor)
3149 redef class AVardeclExpr
3150 private init empty_init
do end
3152 init init_avardeclexpr
(
3153 n_kwvar
: nullable TKwvar,
3155 n_type
: nullable AType,
3156 n_assign
: nullable TAssign,
3157 n_expr
: nullable AExpr
3161 _n_kwvar
= n_kwvar
.as(not null)
3162 n_kwvar
.parent
= self
3163 _n_id
= n_id
.as(not null)
3166 if n_type
!= null then
3167 n_type
.parent
= self
3169 _n_assign
= n_assign
3170 if n_assign
!= null then
3171 n_assign
.parent
= self
3174 if n_expr
!= null then
3175 n_expr
.parent
= self
3179 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3181 if _n_kwvar
== old_child
then
3182 if new_child
!= null then
3183 new_child
.parent
= self
3184 assert new_child
isa TKwvar
3185 _n_kwvar
= new_child
3191 if _n_id
== old_child
then
3192 if new_child
!= null then
3193 new_child
.parent
= self
3194 assert new_child
isa TId
3201 if _n_type
== old_child
then
3202 if new_child
!= null then
3203 new_child
.parent
= self
3204 assert new_child
isa AType
3211 if _n_assign
== old_child
then
3212 if new_child
!= null then
3213 new_child
.parent
= self
3214 assert new_child
isa TAssign
3215 _n_assign
= new_child
3221 if _n_expr
== old_child
then
3222 if new_child
!= null then
3223 new_child
.parent
= self
3224 assert new_child
isa AExpr
3233 redef fun visit_all
(v
: Visitor)
3235 v
.enter_visit
(_n_kwvar
)
3236 v
.enter_visit
(_n_id
)
3237 if _n_type
!= null then
3238 v
.enter_visit
(_n_type
.as(not null))
3240 if _n_assign
!= null then
3241 v
.enter_visit
(_n_assign
.as(not null))
3243 if _n_expr
!= null then
3244 v
.enter_visit
(_n_expr
.as(not null))
3248 redef class AReturnExpr
3249 private init empty_init
do end
3251 init init_areturnexpr
(
3252 n_kwreturn
: nullable TKwreturn,
3253 n_expr
: nullable AExpr
3257 _n_kwreturn
= n_kwreturn
3258 if n_kwreturn
!= null then
3259 n_kwreturn
.parent
= self
3262 if n_expr
!= null then
3263 n_expr
.parent
= self
3267 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3269 if _n_kwreturn
== old_child
then
3270 if new_child
!= null then
3271 new_child
.parent
= self
3272 assert new_child
isa TKwreturn
3273 _n_kwreturn
= new_child
3279 if _n_expr
== old_child
then
3280 if new_child
!= null then
3281 new_child
.parent
= self
3282 assert new_child
isa AExpr
3291 redef fun visit_all
(v
: Visitor)
3293 if _n_kwreturn
!= null then
3294 v
.enter_visit
(_n_kwreturn
.as(not null))
3296 if _n_expr
!= null then
3297 v
.enter_visit
(_n_expr
.as(not null))
3301 redef class ABreakExpr
3302 private init empty_init
do end
3304 init init_abreakexpr
(
3305 n_kwbreak
: nullable TKwbreak,
3306 n_label
: nullable ALabel,
3307 n_expr
: nullable AExpr
3311 _n_kwbreak
= n_kwbreak
.as(not null)
3312 n_kwbreak
.parent
= self
3314 if n_label
!= null then
3315 n_label
.parent
= self
3318 if n_expr
!= null then
3319 n_expr
.parent
= self
3323 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3325 if _n_kwbreak
== old_child
then
3326 if new_child
!= null then
3327 new_child
.parent
= self
3328 assert new_child
isa TKwbreak
3329 _n_kwbreak
= new_child
3335 if _n_label
== old_child
then
3336 if new_child
!= null then
3337 new_child
.parent
= self
3338 assert new_child
isa ALabel
3339 _n_label
= new_child
3345 if _n_expr
== old_child
then
3346 if new_child
!= null then
3347 new_child
.parent
= self
3348 assert new_child
isa AExpr
3357 redef fun visit_all
(v
: Visitor)
3359 v
.enter_visit
(_n_kwbreak
)
3360 if _n_label
!= null then
3361 v
.enter_visit
(_n_label
.as(not null))
3363 if _n_expr
!= null then
3364 v
.enter_visit
(_n_expr
.as(not null))
3368 redef class AAbortExpr
3369 private init empty_init
do end
3371 init init_aabortexpr
(
3372 n_kwabort
: nullable TKwabort
3376 _n_kwabort
= n_kwabort
.as(not null)
3377 n_kwabort
.parent
= self
3380 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3382 if _n_kwabort
== old_child
then
3383 if new_child
!= null then
3384 new_child
.parent
= self
3385 assert new_child
isa TKwabort
3386 _n_kwabort
= new_child
3394 redef fun visit_all
(v
: Visitor)
3396 v
.enter_visit
(_n_kwabort
)
3399 redef class AContinueExpr
3400 private init empty_init
do end
3402 init init_acontinueexpr
(
3403 n_kwcontinue
: nullable TKwcontinue,
3404 n_label
: nullable ALabel,
3405 n_expr
: nullable AExpr
3409 _n_kwcontinue
= n_kwcontinue
3410 if n_kwcontinue
!= null then
3411 n_kwcontinue
.parent
= self
3414 if n_label
!= null then
3415 n_label
.parent
= self
3418 if n_expr
!= null then
3419 n_expr
.parent
= self
3423 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3425 if _n_kwcontinue
== old_child
then
3426 if new_child
!= null then
3427 new_child
.parent
= self
3428 assert new_child
isa TKwcontinue
3429 _n_kwcontinue
= new_child
3431 _n_kwcontinue
= null
3435 if _n_label
== old_child
then
3436 if new_child
!= null then
3437 new_child
.parent
= self
3438 assert new_child
isa ALabel
3439 _n_label
= new_child
3445 if _n_expr
== old_child
then
3446 if new_child
!= null then
3447 new_child
.parent
= self
3448 assert new_child
isa AExpr
3457 redef fun visit_all
(v
: Visitor)
3459 if _n_kwcontinue
!= null then
3460 v
.enter_visit
(_n_kwcontinue
.as(not null))
3462 if _n_label
!= null then
3463 v
.enter_visit
(_n_label
.as(not null))
3465 if _n_expr
!= null then
3466 v
.enter_visit
(_n_expr
.as(not null))
3471 private init empty_init
do end
3474 n_kwdo
: nullable TKwdo,
3475 n_block
: nullable AExpr,
3476 n_label
: nullable ALabel
3480 _n_kwdo
= n_kwdo
.as(not null)
3481 n_kwdo
.parent
= self
3483 if n_block
!= null then
3484 n_block
.parent
= self
3487 if n_label
!= null then
3488 n_label
.parent
= self
3492 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3494 if _n_kwdo
== old_child
then
3495 if new_child
!= null then
3496 new_child
.parent
= self
3497 assert new_child
isa TKwdo
3504 if _n_block
== old_child
then
3505 if new_child
!= null then
3506 new_child
.parent
= self
3507 assert new_child
isa AExpr
3508 _n_block
= new_child
3514 if _n_label
== old_child
then
3515 if new_child
!= null then
3516 new_child
.parent
= self
3517 assert new_child
isa ALabel
3518 _n_label
= new_child
3526 redef fun visit_all
(v
: Visitor)
3528 v
.enter_visit
(_n_kwdo
)
3529 if _n_block
!= null then
3530 v
.enter_visit
(_n_block
.as(not null))
3532 if _n_label
!= null then
3533 v
.enter_visit
(_n_label
.as(not null))
3538 private init empty_init
do end
3541 n_kwif
: nullable TKwif,
3542 n_expr
: nullable AExpr,
3543 n_then
: nullable AExpr,
3544 n_else
: nullable AExpr
3548 _n_kwif
= n_kwif
.as(not null)
3549 n_kwif
.parent
= self
3550 _n_expr
= n_expr
.as(not null)
3551 n_expr
.parent
= self
3553 if n_then
!= null then
3554 n_then
.parent
= self
3557 if n_else
!= null then
3558 n_else
.parent
= self
3562 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3564 if _n_kwif
== old_child
then
3565 if new_child
!= null then
3566 new_child
.parent
= self
3567 assert new_child
isa TKwif
3574 if _n_expr
== old_child
then
3575 if new_child
!= null then
3576 new_child
.parent
= self
3577 assert new_child
isa AExpr
3584 if _n_then
== old_child
then
3585 if new_child
!= null then
3586 new_child
.parent
= self
3587 assert new_child
isa AExpr
3594 if _n_else
== 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 v
.enter_visit
(_n_kwif
)
3609 v
.enter_visit
(_n_expr
)
3610 if _n_then
!= null then
3611 v
.enter_visit
(_n_then
.as(not null))
3613 if _n_else
!= null then
3614 v
.enter_visit
(_n_else
.as(not null))
3618 redef class AIfexprExpr
3619 private init empty_init
do end
3621 init init_aifexprexpr
(
3622 n_kwif
: nullable TKwif,
3623 n_expr
: nullable AExpr,
3624 n_kwthen
: nullable TKwthen,
3625 n_then
: nullable AExpr,
3626 n_kwelse
: nullable TKwelse,
3627 n_else
: nullable AExpr
3631 _n_kwif
= n_kwif
.as(not null)
3632 n_kwif
.parent
= self
3633 _n_expr
= n_expr
.as(not null)
3634 n_expr
.parent
= self
3635 _n_kwthen
= n_kwthen
.as(not null)
3636 n_kwthen
.parent
= self
3637 _n_then
= n_then
.as(not null)
3638 n_then
.parent
= self
3639 _n_kwelse
= n_kwelse
.as(not null)
3640 n_kwelse
.parent
= self
3641 _n_else
= n_else
.as(not null)
3642 n_else
.parent
= self
3645 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3647 if _n_kwif
== old_child
then
3648 if new_child
!= null then
3649 new_child
.parent
= self
3650 assert new_child
isa TKwif
3657 if _n_expr
== old_child
then
3658 if new_child
!= null then
3659 new_child
.parent
= self
3660 assert new_child
isa AExpr
3667 if _n_kwthen
== old_child
then
3668 if new_child
!= null then
3669 new_child
.parent
= self
3670 assert new_child
isa TKwthen
3671 _n_kwthen
= new_child
3677 if _n_then
== old_child
then
3678 if new_child
!= null then
3679 new_child
.parent
= self
3680 assert new_child
isa AExpr
3687 if _n_kwelse
== old_child
then
3688 if new_child
!= null then
3689 new_child
.parent
= self
3690 assert new_child
isa TKwelse
3691 _n_kwelse
= new_child
3697 if _n_else
== old_child
then
3698 if new_child
!= null then
3699 new_child
.parent
= self
3700 assert new_child
isa AExpr
3709 redef fun visit_all
(v
: Visitor)
3711 v
.enter_visit
(_n_kwif
)
3712 v
.enter_visit
(_n_expr
)
3713 v
.enter_visit
(_n_kwthen
)
3714 v
.enter_visit
(_n_then
)
3715 v
.enter_visit
(_n_kwelse
)
3716 v
.enter_visit
(_n_else
)
3719 redef class AWhileExpr
3720 private init empty_init
do end
3722 init init_awhileexpr
(
3723 n_kwwhile
: nullable TKwwhile,
3724 n_expr
: nullable AExpr,
3725 n_kwdo
: nullable TKwdo,
3726 n_block
: nullable AExpr,
3727 n_label
: nullable ALabel
3731 _n_kwwhile
= n_kwwhile
.as(not null)
3732 n_kwwhile
.parent
= self
3733 _n_expr
= n_expr
.as(not null)
3734 n_expr
.parent
= self
3735 _n_kwdo
= n_kwdo
.as(not null)
3736 n_kwdo
.parent
= self
3738 if n_block
!= null then
3739 n_block
.parent
= self
3742 if n_label
!= null then
3743 n_label
.parent
= self
3747 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3749 if _n_kwwhile
== old_child
then
3750 if new_child
!= null then
3751 new_child
.parent
= self
3752 assert new_child
isa TKwwhile
3753 _n_kwwhile
= new_child
3759 if _n_expr
== old_child
then
3760 if new_child
!= null then
3761 new_child
.parent
= self
3762 assert new_child
isa AExpr
3769 if _n_kwdo
== old_child
then
3770 if new_child
!= null then
3771 new_child
.parent
= self
3772 assert new_child
isa TKwdo
3779 if _n_block
== old_child
then
3780 if new_child
!= null then
3781 new_child
.parent
= self
3782 assert new_child
isa AExpr
3783 _n_block
= new_child
3789 if _n_label
== old_child
then
3790 if new_child
!= null then
3791 new_child
.parent
= self
3792 assert new_child
isa ALabel
3793 _n_label
= new_child
3801 redef fun visit_all
(v
: Visitor)
3803 v
.enter_visit
(_n_kwwhile
)
3804 v
.enter_visit
(_n_expr
)
3805 v
.enter_visit
(_n_kwdo
)
3806 if _n_block
!= null then
3807 v
.enter_visit
(_n_block
.as(not null))
3809 if _n_label
!= null then
3810 v
.enter_visit
(_n_label
.as(not null))
3814 redef class ALoopExpr
3815 private init empty_init
do end
3817 init init_aloopexpr
(
3818 n_kwloop
: nullable TKwloop,
3819 n_block
: nullable AExpr,
3820 n_label
: nullable ALabel
3824 _n_kwloop
= n_kwloop
.as(not null)
3825 n_kwloop
.parent
= self
3827 if n_block
!= null then
3828 n_block
.parent
= self
3831 if n_label
!= null then
3832 n_label
.parent
= self
3836 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3838 if _n_kwloop
== old_child
then
3839 if new_child
!= null then
3840 new_child
.parent
= self
3841 assert new_child
isa TKwloop
3842 _n_kwloop
= new_child
3848 if _n_block
== old_child
then
3849 if new_child
!= null then
3850 new_child
.parent
= self
3851 assert new_child
isa AExpr
3852 _n_block
= new_child
3858 if _n_label
== old_child
then
3859 if new_child
!= null then
3860 new_child
.parent
= self
3861 assert new_child
isa ALabel
3862 _n_label
= new_child
3870 redef fun visit_all
(v
: Visitor)
3872 v
.enter_visit
(_n_kwloop
)
3873 if _n_block
!= null then
3874 v
.enter_visit
(_n_block
.as(not null))
3876 if _n_label
!= null then
3877 v
.enter_visit
(_n_label
.as(not null))
3881 redef class AForExpr
3882 private init empty_init
do end
3884 init init_aforexpr
(
3885 n_kwfor
: nullable TKwfor,
3886 n_ids
: Collection[Object], # Should be Collection[TId]
3887 n_expr
: nullable AExpr,
3888 n_kwdo
: nullable TKwdo,
3889 n_block
: nullable AExpr,
3890 n_label
: nullable ALabel
3894 _n_kwfor
= n_kwfor
.as(not null)
3895 n_kwfor
.parent
= self
3901 _n_expr
= n_expr
.as(not null)
3902 n_expr
.parent
= self
3903 _n_kwdo
= n_kwdo
.as(not null)
3904 n_kwdo
.parent
= self
3906 if n_block
!= null then
3907 n_block
.parent
= self
3910 if n_label
!= null then
3911 n_label
.parent
= self
3915 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3917 if _n_kwfor
== old_child
then
3918 if new_child
!= null then
3919 new_child
.parent
= self
3920 assert new_child
isa TKwfor
3921 _n_kwfor
= new_child
3927 for i
in [0.._n_ids
.length
[ do
3928 if _n_ids
[i
] == old_child
then
3929 if new_child
!= null then
3930 assert new_child
isa TId
3931 _n_ids
[i
] = new_child
3932 new_child
.parent
= self
3939 if _n_expr
== old_child
then
3940 if new_child
!= null then
3941 new_child
.parent
= self
3942 assert new_child
isa AExpr
3949 if _n_kwdo
== old_child
then
3950 if new_child
!= null then
3951 new_child
.parent
= self
3952 assert new_child
isa TKwdo
3959 if _n_block
== old_child
then
3960 if new_child
!= null then
3961 new_child
.parent
= self
3962 assert new_child
isa AExpr
3963 _n_block
= new_child
3969 if _n_label
== old_child
then
3970 if new_child
!= null then
3971 new_child
.parent
= self
3972 assert new_child
isa ALabel
3973 _n_label
= new_child
3981 redef fun visit_all
(v
: Visitor)
3983 v
.enter_visit
(_n_kwfor
)
3987 v
.enter_visit
(_n_expr
)
3988 v
.enter_visit
(_n_kwdo
)
3989 if _n_block
!= null then
3990 v
.enter_visit
(_n_block
.as(not null))
3992 if _n_label
!= null then
3993 v
.enter_visit
(_n_label
.as(not null))
3997 redef class AAssertExpr
3998 private init empty_init
do end
4000 init init_aassertexpr
(
4001 n_kwassert
: nullable TKwassert,
4003 n_expr
: nullable AExpr,
4004 n_else
: nullable AExpr
4008 _n_kwassert
= n_kwassert
.as(not null)
4009 n_kwassert
.parent
= self
4011 if n_id
!= null then
4014 _n_expr
= n_expr
.as(not null)
4015 n_expr
.parent
= self
4017 if n_else
!= null then
4018 n_else
.parent
= self
4022 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4024 if _n_kwassert
== old_child
then
4025 if new_child
!= null then
4026 new_child
.parent
= self
4027 assert new_child
isa TKwassert
4028 _n_kwassert
= new_child
4034 if _n_id
== old_child
then
4035 if new_child
!= null then
4036 new_child
.parent
= self
4037 assert new_child
isa TId
4044 if _n_expr
== old_child
then
4045 if new_child
!= null then
4046 new_child
.parent
= self
4047 assert new_child
isa AExpr
4054 if _n_else
== old_child
then
4055 if new_child
!= null then
4056 new_child
.parent
= self
4057 assert new_child
isa AExpr
4066 redef fun visit_all
(v
: Visitor)
4068 v
.enter_visit
(_n_kwassert
)
4069 if _n_id
!= null then
4070 v
.enter_visit
(_n_id
.as(not null))
4072 v
.enter_visit
(_n_expr
)
4073 if _n_else
!= null then
4074 v
.enter_visit
(_n_else
.as(not null))
4078 redef class AOnceExpr
4079 private init empty_init
do end
4081 init init_aonceexpr
(
4082 n_kwonce
: nullable TKwonce,
4083 n_expr
: nullable AExpr
4087 _n_kwonce
= n_kwonce
.as(not null)
4088 n_kwonce
.parent
= self
4089 _n_expr
= n_expr
.as(not null)
4090 n_expr
.parent
= self
4093 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4095 if _n_kwonce
== old_child
then
4096 if new_child
!= null then
4097 new_child
.parent
= self
4098 assert new_child
isa TKwonce
4099 _n_kwonce
= new_child
4105 if _n_expr
== old_child
then
4106 if new_child
!= null then
4107 new_child
.parent
= self
4108 assert new_child
isa AExpr
4117 redef fun visit_all
(v
: Visitor)
4119 v
.enter_visit
(_n_kwonce
)
4120 v
.enter_visit
(_n_expr
)
4123 redef class ASendExpr
4124 private init empty_init
do end
4126 init init_asendexpr
(
4127 n_expr
: nullable AExpr
4131 _n_expr
= n_expr
.as(not null)
4132 n_expr
.parent
= self
4135 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4137 if _n_expr
== old_child
then
4138 if new_child
!= null then
4139 new_child
.parent
= self
4140 assert new_child
isa AExpr
4149 redef fun visit_all
(v
: Visitor)
4151 v
.enter_visit
(_n_expr
)
4154 redef class ABinopExpr
4155 private init empty_init
do end
4157 init init_abinopexpr
(
4158 n_expr
: nullable AExpr,
4159 n_expr2
: nullable AExpr
4163 _n_expr
= n_expr
.as(not null)
4164 n_expr
.parent
= self
4165 _n_expr2
= n_expr2
.as(not null)
4166 n_expr2
.parent
= self
4169 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4171 if _n_expr
== old_child
then
4172 if new_child
!= null then
4173 new_child
.parent
= self
4174 assert new_child
isa AExpr
4181 if _n_expr2
== old_child
then
4182 if new_child
!= null then
4183 new_child
.parent
= self
4184 assert new_child
isa AExpr
4185 _n_expr2
= new_child
4193 redef fun visit_all
(v
: Visitor)
4195 v
.enter_visit
(_n_expr
)
4196 v
.enter_visit
(_n_expr2
)
4200 private init empty_init
do end
4203 n_expr
: nullable AExpr,
4204 n_expr2
: nullable AExpr
4208 _n_expr
= n_expr
.as(not null)
4209 n_expr
.parent
= self
4210 _n_expr2
= n_expr2
.as(not null)
4211 n_expr2
.parent
= self
4214 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4216 if _n_expr
== old_child
then
4217 if new_child
!= null then
4218 new_child
.parent
= self
4219 assert new_child
isa AExpr
4226 if _n_expr2
== old_child
then
4227 if new_child
!= null then
4228 new_child
.parent
= self
4229 assert new_child
isa AExpr
4230 _n_expr2
= new_child
4238 redef fun visit_all
(v
: Visitor)
4240 v
.enter_visit
(_n_expr
)
4241 v
.enter_visit
(_n_expr2
)
4244 redef class AAndExpr
4245 private init empty_init
do end
4247 init init_aandexpr
(
4248 n_expr
: nullable AExpr,
4249 n_expr2
: nullable AExpr
4253 _n_expr
= n_expr
.as(not null)
4254 n_expr
.parent
= self
4255 _n_expr2
= n_expr2
.as(not null)
4256 n_expr2
.parent
= self
4259 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4261 if _n_expr
== old_child
then
4262 if new_child
!= null then
4263 new_child
.parent
= self
4264 assert new_child
isa AExpr
4271 if _n_expr2
== old_child
then
4272 if new_child
!= null then
4273 new_child
.parent
= self
4274 assert new_child
isa AExpr
4275 _n_expr2
= new_child
4283 redef fun visit_all
(v
: Visitor)
4285 v
.enter_visit
(_n_expr
)
4286 v
.enter_visit
(_n_expr2
)
4289 redef class AOrElseExpr
4290 private init empty_init
do end
4292 init init_aorelseexpr
(
4293 n_expr
: nullable AExpr,
4294 n_expr2
: nullable AExpr
4298 _n_expr
= n_expr
.as(not null)
4299 n_expr
.parent
= self
4300 _n_expr2
= n_expr2
.as(not null)
4301 n_expr2
.parent
= self
4304 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4306 if _n_expr
== old_child
then
4307 if new_child
!= null then
4308 new_child
.parent
= self
4309 assert new_child
isa AExpr
4316 if _n_expr2
== old_child
then
4317 if new_child
!= null then
4318 new_child
.parent
= self
4319 assert new_child
isa AExpr
4320 _n_expr2
= new_child
4328 redef fun visit_all
(v
: Visitor)
4330 v
.enter_visit
(_n_expr
)
4331 v
.enter_visit
(_n_expr2
)
4334 redef class ANotExpr
4335 private init empty_init
do end
4337 init init_anotexpr
(
4338 n_kwnot
: nullable TKwnot,
4339 n_expr
: nullable AExpr
4343 _n_kwnot
= n_kwnot
.as(not null)
4344 n_kwnot
.parent
= self
4345 _n_expr
= n_expr
.as(not null)
4346 n_expr
.parent
= self
4349 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4351 if _n_kwnot
== old_child
then
4352 if new_child
!= null then
4353 new_child
.parent
= self
4354 assert new_child
isa TKwnot
4355 _n_kwnot
= new_child
4361 if _n_expr
== old_child
then
4362 if new_child
!= null then
4363 new_child
.parent
= self
4364 assert new_child
isa AExpr
4373 redef fun visit_all
(v
: Visitor)
4375 v
.enter_visit
(_n_kwnot
)
4376 v
.enter_visit
(_n_expr
)
4380 private init empty_init
do end
4383 n_expr
: nullable AExpr,
4384 n_expr2
: nullable AExpr
4388 _n_expr
= n_expr
.as(not null)
4389 n_expr
.parent
= self
4390 _n_expr2
= n_expr2
.as(not null)
4391 n_expr2
.parent
= self
4394 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4396 if _n_expr
== old_child
then
4397 if new_child
!= null then
4398 new_child
.parent
= self
4399 assert new_child
isa AExpr
4406 if _n_expr2
== old_child
then
4407 if new_child
!= null then
4408 new_child
.parent
= self
4409 assert new_child
isa AExpr
4410 _n_expr2
= new_child
4418 redef fun visit_all
(v
: Visitor)
4420 v
.enter_visit
(_n_expr
)
4421 v
.enter_visit
(_n_expr2
)
4425 private init empty_init
do end
4428 n_expr
: nullable AExpr,
4429 n_expr2
: nullable AExpr
4433 _n_expr
= n_expr
.as(not null)
4434 n_expr
.parent
= self
4435 _n_expr2
= n_expr2
.as(not null)
4436 n_expr2
.parent
= self
4439 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4441 if _n_expr
== old_child
then
4442 if new_child
!= null then
4443 new_child
.parent
= self
4444 assert new_child
isa AExpr
4451 if _n_expr2
== old_child
then
4452 if new_child
!= null then
4453 new_child
.parent
= self
4454 assert new_child
isa AExpr
4455 _n_expr2
= new_child
4463 redef fun visit_all
(v
: Visitor)
4465 v
.enter_visit
(_n_expr
)
4466 v
.enter_visit
(_n_expr2
)
4470 private init empty_init
do end
4473 n_expr
: nullable AExpr,
4474 n_expr2
: nullable AExpr
4478 _n_expr
= n_expr
.as(not null)
4479 n_expr
.parent
= self
4480 _n_expr2
= n_expr2
.as(not null)
4481 n_expr2
.parent
= self
4484 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4486 if _n_expr
== old_child
then
4487 if new_child
!= null then
4488 new_child
.parent
= self
4489 assert new_child
isa AExpr
4496 if _n_expr2
== old_child
then
4497 if new_child
!= null then
4498 new_child
.parent
= self
4499 assert new_child
isa AExpr
4500 _n_expr2
= new_child
4508 redef fun visit_all
(v
: Visitor)
4510 v
.enter_visit
(_n_expr
)
4511 v
.enter_visit
(_n_expr2
)
4515 private init empty_init
do end
4518 n_expr
: nullable AExpr,
4519 n_expr2
: nullable AExpr
4523 _n_expr
= n_expr
.as(not null)
4524 n_expr
.parent
= self
4525 _n_expr2
= n_expr2
.as(not null)
4526 n_expr2
.parent
= self
4529 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4531 if _n_expr
== old_child
then
4532 if new_child
!= null then
4533 new_child
.parent
= self
4534 assert new_child
isa AExpr
4541 if _n_expr2
== old_child
then
4542 if new_child
!= null then
4543 new_child
.parent
= self
4544 assert new_child
isa AExpr
4545 _n_expr2
= new_child
4553 redef fun visit_all
(v
: Visitor)
4555 v
.enter_visit
(_n_expr
)
4556 v
.enter_visit
(_n_expr2
)
4560 private init empty_init
do end
4563 n_expr
: nullable AExpr,
4564 n_expr2
: nullable AExpr
4568 _n_expr
= n_expr
.as(not null)
4569 n_expr
.parent
= self
4570 _n_expr2
= n_expr2
.as(not null)
4571 n_expr2
.parent
= self
4574 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4576 if _n_expr
== old_child
then
4577 if new_child
!= null then
4578 new_child
.parent
= self
4579 assert new_child
isa AExpr
4586 if _n_expr2
== old_child
then
4587 if new_child
!= null then
4588 new_child
.parent
= self
4589 assert new_child
isa AExpr
4590 _n_expr2
= new_child
4598 redef fun visit_all
(v
: Visitor)
4600 v
.enter_visit
(_n_expr
)
4601 v
.enter_visit
(_n_expr2
)
4605 private init empty_init
do end
4608 n_expr
: nullable AExpr,
4609 n_expr2
: nullable AExpr
4613 _n_expr
= n_expr
.as(not null)
4614 n_expr
.parent
= self
4615 _n_expr2
= n_expr2
.as(not null)
4616 n_expr2
.parent
= self
4619 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4621 if _n_expr
== old_child
then
4622 if new_child
!= null then
4623 new_child
.parent
= self
4624 assert new_child
isa AExpr
4631 if _n_expr2
== old_child
then
4632 if new_child
!= null then
4633 new_child
.parent
= self
4634 assert new_child
isa AExpr
4635 _n_expr2
= new_child
4643 redef fun visit_all
(v
: Visitor)
4645 v
.enter_visit
(_n_expr
)
4646 v
.enter_visit
(_n_expr2
)
4650 private init empty_init
do end
4653 n_expr
: nullable AExpr,
4654 n_expr2
: nullable AExpr
4658 _n_expr
= n_expr
.as(not null)
4659 n_expr
.parent
= self
4660 _n_expr2
= n_expr2
.as(not null)
4661 n_expr2
.parent
= self
4664 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4666 if _n_expr
== old_child
then
4667 if new_child
!= null then
4668 new_child
.parent
= self
4669 assert new_child
isa AExpr
4676 if _n_expr2
== old_child
then
4677 if new_child
!= null then
4678 new_child
.parent
= self
4679 assert new_child
isa AExpr
4680 _n_expr2
= new_child
4688 redef fun visit_all
(v
: Visitor)
4690 v
.enter_visit
(_n_expr
)
4691 v
.enter_visit
(_n_expr2
)
4695 private init empty_init
do end
4698 n_expr
: nullable AExpr,
4699 n_expr2
: nullable AExpr
4703 _n_expr
= n_expr
.as(not null)
4704 n_expr
.parent
= self
4705 _n_expr2
= n_expr2
.as(not null)
4706 n_expr2
.parent
= self
4709 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4711 if _n_expr
== old_child
then
4712 if new_child
!= null then
4713 new_child
.parent
= self
4714 assert new_child
isa AExpr
4721 if _n_expr2
== old_child
then
4722 if new_child
!= null then
4723 new_child
.parent
= self
4724 assert new_child
isa AExpr
4725 _n_expr2
= new_child
4733 redef fun visit_all
(v
: Visitor)
4735 v
.enter_visit
(_n_expr
)
4736 v
.enter_visit
(_n_expr2
)
4740 private init empty_init
do end
4743 n_expr
: nullable AExpr,
4744 n_expr2
: nullable AExpr
4748 _n_expr
= n_expr
.as(not null)
4749 n_expr
.parent
= self
4750 _n_expr2
= n_expr2
.as(not null)
4751 n_expr2
.parent
= self
4754 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4756 if _n_expr
== old_child
then
4757 if new_child
!= null then
4758 new_child
.parent
= self
4759 assert new_child
isa AExpr
4766 if _n_expr2
== old_child
then
4767 if new_child
!= null then
4768 new_child
.parent
= self
4769 assert new_child
isa AExpr
4770 _n_expr2
= new_child
4778 redef fun visit_all
(v
: Visitor)
4780 v
.enter_visit
(_n_expr
)
4781 v
.enter_visit
(_n_expr2
)
4784 redef class AIsaExpr
4785 private init empty_init
do end
4787 init init_aisaexpr
(
4788 n_expr
: nullable AExpr,
4789 n_type
: nullable AType
4793 _n_expr
= n_expr
.as(not null)
4794 n_expr
.parent
= self
4795 _n_type
= n_type
.as(not null)
4796 n_type
.parent
= self
4799 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4801 if _n_expr
== old_child
then
4802 if new_child
!= null then
4803 new_child
.parent
= self
4804 assert new_child
isa AExpr
4811 if _n_type
== old_child
then
4812 if new_child
!= null then
4813 new_child
.parent
= self
4814 assert new_child
isa AType
4823 redef fun visit_all
(v
: Visitor)
4825 v
.enter_visit
(_n_expr
)
4826 v
.enter_visit
(_n_type
)
4829 redef class APlusExpr
4830 private init empty_init
do end
4832 init init_aplusexpr
(
4833 n_expr
: nullable AExpr,
4834 n_expr2
: nullable AExpr
4838 _n_expr
= n_expr
.as(not null)
4839 n_expr
.parent
= self
4840 _n_expr2
= n_expr2
.as(not null)
4841 n_expr2
.parent
= self
4844 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4846 if _n_expr
== old_child
then
4847 if new_child
!= null then
4848 new_child
.parent
= self
4849 assert new_child
isa AExpr
4856 if _n_expr2
== old_child
then
4857 if new_child
!= null then
4858 new_child
.parent
= self
4859 assert new_child
isa AExpr
4860 _n_expr2
= new_child
4868 redef fun visit_all
(v
: Visitor)
4870 v
.enter_visit
(_n_expr
)
4871 v
.enter_visit
(_n_expr2
)
4874 redef class AMinusExpr
4875 private init empty_init
do end
4877 init init_aminusexpr
(
4878 n_expr
: nullable AExpr,
4879 n_expr2
: nullable AExpr
4883 _n_expr
= n_expr
.as(not null)
4884 n_expr
.parent
= self
4885 _n_expr2
= n_expr2
.as(not null)
4886 n_expr2
.parent
= self
4889 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4891 if _n_expr
== old_child
then
4892 if new_child
!= null then
4893 new_child
.parent
= self
4894 assert new_child
isa AExpr
4901 if _n_expr2
== old_child
then
4902 if new_child
!= null then
4903 new_child
.parent
= self
4904 assert new_child
isa AExpr
4905 _n_expr2
= new_child
4913 redef fun visit_all
(v
: Visitor)
4915 v
.enter_visit
(_n_expr
)
4916 v
.enter_visit
(_n_expr2
)
4919 redef class AStarshipExpr
4920 private init empty_init
do end
4922 init init_astarshipexpr
(
4923 n_expr
: nullable AExpr,
4924 n_expr2
: nullable AExpr
4928 _n_expr
= n_expr
.as(not null)
4929 n_expr
.parent
= self
4930 _n_expr2
= n_expr2
.as(not null)
4931 n_expr2
.parent
= self
4934 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4936 if _n_expr
== old_child
then
4937 if new_child
!= null then
4938 new_child
.parent
= self
4939 assert new_child
isa AExpr
4946 if _n_expr2
== old_child
then
4947 if new_child
!= null then
4948 new_child
.parent
= self
4949 assert new_child
isa AExpr
4950 _n_expr2
= new_child
4958 redef fun visit_all
(v
: Visitor)
4960 v
.enter_visit
(_n_expr
)
4961 v
.enter_visit
(_n_expr2
)
4964 redef class AStarExpr
4965 private init empty_init
do end
4967 init init_astarexpr
(
4968 n_expr
: nullable AExpr,
4969 n_expr2
: nullable AExpr
4973 _n_expr
= n_expr
.as(not null)
4974 n_expr
.parent
= self
4975 _n_expr2
= n_expr2
.as(not null)
4976 n_expr2
.parent
= self
4979 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4981 if _n_expr
== old_child
then
4982 if new_child
!= null then
4983 new_child
.parent
= self
4984 assert new_child
isa AExpr
4991 if _n_expr2
== old_child
then
4992 if new_child
!= null then
4993 new_child
.parent
= self
4994 assert new_child
isa AExpr
4995 _n_expr2
= new_child
5003 redef fun visit_all
(v
: Visitor)
5005 v
.enter_visit
(_n_expr
)
5006 v
.enter_visit
(_n_expr2
)
5009 redef class ASlashExpr
5010 private init empty_init
do end
5012 init init_aslashexpr
(
5013 n_expr
: nullable AExpr,
5014 n_expr2
: nullable AExpr
5018 _n_expr
= n_expr
.as(not null)
5019 n_expr
.parent
= self
5020 _n_expr2
= n_expr2
.as(not null)
5021 n_expr2
.parent
= self
5024 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5026 if _n_expr
== old_child
then
5027 if new_child
!= null then
5028 new_child
.parent
= self
5029 assert new_child
isa AExpr
5036 if _n_expr2
== old_child
then
5037 if new_child
!= null then
5038 new_child
.parent
= self
5039 assert new_child
isa AExpr
5040 _n_expr2
= new_child
5048 redef fun visit_all
(v
: Visitor)
5050 v
.enter_visit
(_n_expr
)
5051 v
.enter_visit
(_n_expr2
)
5054 redef class APercentExpr
5055 private init empty_init
do end
5057 init init_apercentexpr
(
5058 n_expr
: nullable AExpr,
5059 n_expr2
: nullable AExpr
5063 _n_expr
= n_expr
.as(not null)
5064 n_expr
.parent
= self
5065 _n_expr2
= n_expr2
.as(not null)
5066 n_expr2
.parent
= self
5069 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5071 if _n_expr
== old_child
then
5072 if new_child
!= null then
5073 new_child
.parent
= self
5074 assert new_child
isa AExpr
5081 if _n_expr2
== old_child
then
5082 if new_child
!= null then
5083 new_child
.parent
= self
5084 assert new_child
isa AExpr
5085 _n_expr2
= new_child
5093 redef fun visit_all
(v
: Visitor)
5095 v
.enter_visit
(_n_expr
)
5096 v
.enter_visit
(_n_expr2
)
5099 redef class AUminusExpr
5100 private init empty_init
do end
5102 init init_auminusexpr
(
5103 n_minus
: nullable TMinus,
5104 n_expr
: nullable AExpr
5108 _n_minus
= n_minus
.as(not null)
5109 n_minus
.parent
= self
5110 _n_expr
= n_expr
.as(not null)
5111 n_expr
.parent
= self
5114 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5116 if _n_minus
== old_child
then
5117 if new_child
!= null then
5118 new_child
.parent
= self
5119 assert new_child
isa TMinus
5120 _n_minus
= new_child
5126 if _n_expr
== old_child
then
5127 if new_child
!= null then
5128 new_child
.parent
= self
5129 assert new_child
isa AExpr
5138 redef fun visit_all
(v
: Visitor)
5140 v
.enter_visit
(_n_minus
)
5141 v
.enter_visit
(_n_expr
)
5144 redef class ANewExpr
5145 private init empty_init
do end
5147 init init_anewexpr
(
5148 n_kwnew
: nullable TKwnew,
5149 n_type
: nullable AType,
5151 n_args
: Collection[Object] # Should be Collection[AExpr]
5155 _n_kwnew
= n_kwnew
.as(not null)
5156 n_kwnew
.parent
= self
5157 _n_type
= n_type
.as(not null)
5158 n_type
.parent
= self
5160 if n_id
!= null then
5170 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5172 if _n_kwnew
== old_child
then
5173 if new_child
!= null then
5174 new_child
.parent
= self
5175 assert new_child
isa TKwnew
5176 _n_kwnew
= new_child
5182 if _n_type
== old_child
then
5183 if new_child
!= null then
5184 new_child
.parent
= self
5185 assert new_child
isa AType
5192 if _n_id
== old_child
then
5193 if new_child
!= null then
5194 new_child
.parent
= self
5195 assert new_child
isa TId
5202 for i
in [0.._n_args
.length
[ do
5203 if _n_args
[i
] == old_child
then
5204 if new_child
!= null then
5205 assert new_child
isa AExpr
5206 _n_args
[i
] = new_child
5207 new_child
.parent
= self
5209 _n_args
.remove_at
(i
)
5216 redef fun visit_all
(v
: Visitor)
5218 v
.enter_visit
(_n_kwnew
)
5219 v
.enter_visit
(_n_type
)
5220 if _n_id
!= null then
5221 v
.enter_visit
(_n_id
.as(not null))
5228 redef class AAttrExpr
5229 private init empty_init
do end
5231 init init_aattrexpr
(
5232 n_expr
: nullable AExpr,
5233 n_id
: nullable TAttrid
5237 _n_expr
= n_expr
.as(not null)
5238 n_expr
.parent
= self
5239 _n_id
= n_id
.as(not null)
5243 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5245 if _n_expr
== old_child
then
5246 if new_child
!= null then
5247 new_child
.parent
= self
5248 assert new_child
isa AExpr
5255 if _n_id
== old_child
then
5256 if new_child
!= null then
5257 new_child
.parent
= self
5258 assert new_child
isa TAttrid
5267 redef fun visit_all
(v
: Visitor)
5269 v
.enter_visit
(_n_expr
)
5270 v
.enter_visit
(_n_id
)
5273 redef class AAttrAssignExpr
5274 private init empty_init
do end
5276 init init_aattrassignexpr
(
5277 n_expr
: nullable AExpr,
5278 n_id
: nullable TAttrid,
5279 n_assign
: nullable TAssign,
5280 n_value
: nullable AExpr
5284 _n_expr
= n_expr
.as(not null)
5285 n_expr
.parent
= self
5286 _n_id
= n_id
.as(not null)
5288 _n_assign
= n_assign
.as(not null)
5289 n_assign
.parent
= self
5290 _n_value
= n_value
.as(not null)
5291 n_value
.parent
= self
5294 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5296 if _n_expr
== old_child
then
5297 if new_child
!= null then
5298 new_child
.parent
= self
5299 assert new_child
isa AExpr
5306 if _n_id
== old_child
then
5307 if new_child
!= null then
5308 new_child
.parent
= self
5309 assert new_child
isa TAttrid
5316 if _n_assign
== old_child
then
5317 if new_child
!= null then
5318 new_child
.parent
= self
5319 assert new_child
isa TAssign
5320 _n_assign
= new_child
5326 if _n_value
== old_child
then
5327 if new_child
!= null then
5328 new_child
.parent
= self
5329 assert new_child
isa AExpr
5330 _n_value
= new_child
5338 redef fun visit_all
(v
: Visitor)
5340 v
.enter_visit
(_n_expr
)
5341 v
.enter_visit
(_n_id
)
5342 v
.enter_visit
(_n_assign
)
5343 v
.enter_visit
(_n_value
)
5346 redef class AAttrReassignExpr
5347 private init empty_init
do end
5349 init init_aattrreassignexpr
(
5350 n_expr
: nullable AExpr,
5351 n_id
: nullable TAttrid,
5352 n_assign_op
: nullable AAssignOp,
5353 n_value
: nullable AExpr
5357 _n_expr
= n_expr
.as(not null)
5358 n_expr
.parent
= self
5359 _n_id
= n_id
.as(not null)
5361 _n_assign_op
= n_assign_op
.as(not null)
5362 n_assign_op
.parent
= self
5363 _n_value
= n_value
.as(not null)
5364 n_value
.parent
= self
5367 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5369 if _n_expr
== old_child
then
5370 if new_child
!= null then
5371 new_child
.parent
= self
5372 assert new_child
isa AExpr
5379 if _n_id
== old_child
then
5380 if new_child
!= null then
5381 new_child
.parent
= self
5382 assert new_child
isa TAttrid
5389 if _n_assign_op
== old_child
then
5390 if new_child
!= null then
5391 new_child
.parent
= self
5392 assert new_child
isa AAssignOp
5393 _n_assign_op
= new_child
5399 if _n_value
== old_child
then
5400 if new_child
!= null then
5401 new_child
.parent
= self
5402 assert new_child
isa AExpr
5403 _n_value
= new_child
5411 redef fun visit_all
(v
: Visitor)
5413 v
.enter_visit
(_n_expr
)
5414 v
.enter_visit
(_n_id
)
5415 v
.enter_visit
(_n_assign_op
)
5416 v
.enter_visit
(_n_value
)
5419 redef class ACallExpr
5420 private init empty_init
do end
5422 init init_acallexpr
(
5423 n_expr
: nullable AExpr,
5425 n_args
: Collection[Object], # Should be Collection[AExpr]
5426 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5430 _n_expr
= n_expr
.as(not null)
5431 n_expr
.parent
= self
5432 _n_id
= n_id
.as(not null)
5439 for n
in n_closure_defs
do
5440 assert n
isa AClosureDef
5441 _n_closure_defs
.add
(n
)
5446 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5448 if _n_expr
== old_child
then
5449 if new_child
!= null then
5450 new_child
.parent
= self
5451 assert new_child
isa AExpr
5458 if _n_id
== old_child
then
5459 if new_child
!= null then
5460 new_child
.parent
= self
5461 assert new_child
isa TId
5468 for i
in [0.._n_args
.length
[ do
5469 if _n_args
[i
] == old_child
then
5470 if new_child
!= null then
5471 assert new_child
isa AExpr
5472 _n_args
[i
] = new_child
5473 new_child
.parent
= self
5475 _n_args
.remove_at
(i
)
5480 for i
in [0.._n_closure_defs
.length
[ do
5481 if _n_closure_defs
[i
] == old_child
then
5482 if new_child
!= null then
5483 assert new_child
isa AClosureDef
5484 _n_closure_defs
[i
] = new_child
5485 new_child
.parent
= self
5487 _n_closure_defs
.remove_at
(i
)
5494 redef fun visit_all
(v
: Visitor)
5496 v
.enter_visit
(_n_expr
)
5497 v
.enter_visit
(_n_id
)
5501 for n
in _n_closure_defs
do
5506 redef class ACallAssignExpr
5507 private init empty_init
do end
5509 init init_acallassignexpr
(
5510 n_expr
: nullable AExpr,
5512 n_args
: Collection[Object], # Should be Collection[AExpr]
5513 n_assign
: nullable TAssign,
5514 n_value
: nullable AExpr
5518 _n_expr
= n_expr
.as(not null)
5519 n_expr
.parent
= self
5520 _n_id
= n_id
.as(not null)
5527 _n_assign
= n_assign
.as(not null)
5528 n_assign
.parent
= self
5529 _n_value
= n_value
.as(not null)
5530 n_value
.parent
= self
5533 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5535 if _n_expr
== old_child
then
5536 if new_child
!= null then
5537 new_child
.parent
= self
5538 assert new_child
isa AExpr
5545 if _n_id
== old_child
then
5546 if new_child
!= null then
5547 new_child
.parent
= self
5548 assert new_child
isa TId
5555 for i
in [0.._n_args
.length
[ do
5556 if _n_args
[i
] == old_child
then
5557 if new_child
!= null then
5558 assert new_child
isa AExpr
5559 _n_args
[i
] = new_child
5560 new_child
.parent
= self
5562 _n_args
.remove_at
(i
)
5567 if _n_assign
== old_child
then
5568 if new_child
!= null then
5569 new_child
.parent
= self
5570 assert new_child
isa TAssign
5571 _n_assign
= new_child
5577 if _n_value
== old_child
then
5578 if new_child
!= null then
5579 new_child
.parent
= self
5580 assert new_child
isa AExpr
5581 _n_value
= new_child
5589 redef fun visit_all
(v
: Visitor)
5591 v
.enter_visit
(_n_expr
)
5592 v
.enter_visit
(_n_id
)
5596 v
.enter_visit
(_n_assign
)
5597 v
.enter_visit
(_n_value
)
5600 redef class ACallReassignExpr
5601 private init empty_init
do end
5603 init init_acallreassignexpr
(
5604 n_expr
: nullable AExpr,
5606 n_args
: Collection[Object], # Should be Collection[AExpr]
5607 n_assign_op
: nullable AAssignOp,
5608 n_value
: nullable AExpr
5612 _n_expr
= n_expr
.as(not null)
5613 n_expr
.parent
= self
5614 _n_id
= n_id
.as(not null)
5621 _n_assign_op
= n_assign_op
.as(not null)
5622 n_assign_op
.parent
= self
5623 _n_value
= n_value
.as(not null)
5624 n_value
.parent
= self
5627 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5629 if _n_expr
== old_child
then
5630 if new_child
!= null then
5631 new_child
.parent
= self
5632 assert new_child
isa AExpr
5639 if _n_id
== old_child
then
5640 if new_child
!= null then
5641 new_child
.parent
= self
5642 assert new_child
isa TId
5649 for i
in [0.._n_args
.length
[ do
5650 if _n_args
[i
] == old_child
then
5651 if new_child
!= null then
5652 assert new_child
isa AExpr
5653 _n_args
[i
] = new_child
5654 new_child
.parent
= self
5656 _n_args
.remove_at
(i
)
5661 if _n_assign_op
== old_child
then
5662 if new_child
!= null then
5663 new_child
.parent
= self
5664 assert new_child
isa AAssignOp
5665 _n_assign_op
= new_child
5671 if _n_value
== old_child
then
5672 if new_child
!= null then
5673 new_child
.parent
= self
5674 assert new_child
isa AExpr
5675 _n_value
= new_child
5683 redef fun visit_all
(v
: Visitor)
5685 v
.enter_visit
(_n_expr
)
5686 v
.enter_visit
(_n_id
)
5690 v
.enter_visit
(_n_assign_op
)
5691 v
.enter_visit
(_n_value
)
5694 redef class ASuperExpr
5695 private init empty_init
do end
5697 init init_asuperexpr
(
5698 n_qualified
: nullable AQualified,
5699 n_kwsuper
: nullable TKwsuper,
5700 n_args
: Collection[Object] # Should be Collection[AExpr]
5704 _n_qualified
= n_qualified
5705 if n_qualified
!= null then
5706 n_qualified
.parent
= self
5708 _n_kwsuper
= n_kwsuper
.as(not null)
5709 n_kwsuper
.parent
= self
5717 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5719 if _n_qualified
== old_child
then
5720 if new_child
!= null then
5721 new_child
.parent
= self
5722 assert new_child
isa AQualified
5723 _n_qualified
= new_child
5729 if _n_kwsuper
== old_child
then
5730 if new_child
!= null then
5731 new_child
.parent
= self
5732 assert new_child
isa TKwsuper
5733 _n_kwsuper
= new_child
5739 for i
in [0.._n_args
.length
[ do
5740 if _n_args
[i
] == old_child
then
5741 if new_child
!= null then
5742 assert new_child
isa AExpr
5743 _n_args
[i
] = new_child
5744 new_child
.parent
= self
5746 _n_args
.remove_at
(i
)
5753 redef fun visit_all
(v
: Visitor)
5755 if _n_qualified
!= null then
5756 v
.enter_visit
(_n_qualified
.as(not null))
5758 v
.enter_visit
(_n_kwsuper
)
5764 redef class AInitExpr
5765 private init empty_init
do end
5767 init init_ainitexpr
(
5768 n_expr
: nullable AExpr,
5769 n_kwinit
: nullable TKwinit,
5770 n_args
: Collection[Object] # Should be Collection[AExpr]
5774 _n_expr
= n_expr
.as(not null)
5775 n_expr
.parent
= self
5776 _n_kwinit
= n_kwinit
.as(not null)
5777 n_kwinit
.parent
= self
5785 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5787 if _n_expr
== old_child
then
5788 if new_child
!= null then
5789 new_child
.parent
= self
5790 assert new_child
isa AExpr
5797 if _n_kwinit
== old_child
then
5798 if new_child
!= null then
5799 new_child
.parent
= self
5800 assert new_child
isa TKwinit
5801 _n_kwinit
= new_child
5807 for i
in [0.._n_args
.length
[ do
5808 if _n_args
[i
] == old_child
then
5809 if new_child
!= null then
5810 assert new_child
isa AExpr
5811 _n_args
[i
] = new_child
5812 new_child
.parent
= self
5814 _n_args
.remove_at
(i
)
5821 redef fun visit_all
(v
: Visitor)
5823 v
.enter_visit
(_n_expr
)
5824 v
.enter_visit
(_n_kwinit
)
5830 redef class ABraExpr
5831 private init empty_init
do end
5833 init init_abraexpr
(
5834 n_expr
: nullable AExpr,
5835 n_args
: Collection[Object], # Should be Collection[AExpr]
5836 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5840 _n_expr
= n_expr
.as(not null)
5841 n_expr
.parent
= self
5847 for n
in n_closure_defs
do
5848 assert n
isa AClosureDef
5849 _n_closure_defs
.add
(n
)
5854 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5856 if _n_expr
== old_child
then
5857 if new_child
!= null then
5858 new_child
.parent
= self
5859 assert new_child
isa AExpr
5866 for i
in [0.._n_args
.length
[ do
5867 if _n_args
[i
] == old_child
then
5868 if new_child
!= null then
5869 assert new_child
isa AExpr
5870 _n_args
[i
] = new_child
5871 new_child
.parent
= self
5873 _n_args
.remove_at
(i
)
5878 for i
in [0.._n_closure_defs
.length
[ do
5879 if _n_closure_defs
[i
] == old_child
then
5880 if new_child
!= null then
5881 assert new_child
isa AClosureDef
5882 _n_closure_defs
[i
] = new_child
5883 new_child
.parent
= self
5885 _n_closure_defs
.remove_at
(i
)
5892 redef fun visit_all
(v
: Visitor)
5894 v
.enter_visit
(_n_expr
)
5898 for n
in _n_closure_defs
do
5903 redef class ABraAssignExpr
5904 private init empty_init
do end
5906 init init_abraassignexpr
(
5907 n_expr
: nullable AExpr,
5908 n_args
: Collection[Object], # Should be Collection[AExpr]
5909 n_assign
: nullable TAssign,
5910 n_value
: nullable AExpr
5914 _n_expr
= n_expr
.as(not null)
5915 n_expr
.parent
= self
5921 _n_assign
= n_assign
.as(not null)
5922 n_assign
.parent
= self
5923 _n_value
= n_value
.as(not null)
5924 n_value
.parent
= self
5927 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5929 if _n_expr
== old_child
then
5930 if new_child
!= null then
5931 new_child
.parent
= self
5932 assert new_child
isa AExpr
5939 for i
in [0.._n_args
.length
[ do
5940 if _n_args
[i
] == old_child
then
5941 if new_child
!= null then
5942 assert new_child
isa AExpr
5943 _n_args
[i
] = new_child
5944 new_child
.parent
= self
5946 _n_args
.remove_at
(i
)
5951 if _n_assign
== old_child
then
5952 if new_child
!= null then
5953 new_child
.parent
= self
5954 assert new_child
isa TAssign
5955 _n_assign
= new_child
5961 if _n_value
== old_child
then
5962 if new_child
!= null then
5963 new_child
.parent
= self
5964 assert new_child
isa AExpr
5965 _n_value
= new_child
5973 redef fun visit_all
(v
: Visitor)
5975 v
.enter_visit
(_n_expr
)
5979 v
.enter_visit
(_n_assign
)
5980 v
.enter_visit
(_n_value
)
5983 redef class ABraReassignExpr
5984 private init empty_init
do end
5986 init init_abrareassignexpr
(
5987 n_expr
: nullable AExpr,
5988 n_args
: Collection[Object], # Should be Collection[AExpr]
5989 n_assign_op
: nullable AAssignOp,
5990 n_value
: nullable AExpr
5994 _n_expr
= n_expr
.as(not null)
5995 n_expr
.parent
= self
6001 _n_assign_op
= n_assign_op
.as(not null)
6002 n_assign_op
.parent
= self
6003 _n_value
= n_value
.as(not null)
6004 n_value
.parent
= self
6007 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6009 if _n_expr
== old_child
then
6010 if new_child
!= null then
6011 new_child
.parent
= self
6012 assert new_child
isa AExpr
6019 for i
in [0.._n_args
.length
[ do
6020 if _n_args
[i
] == old_child
then
6021 if new_child
!= null then
6022 assert new_child
isa AExpr
6023 _n_args
[i
] = new_child
6024 new_child
.parent
= self
6026 _n_args
.remove_at
(i
)
6031 if _n_assign_op
== old_child
then
6032 if new_child
!= null then
6033 new_child
.parent
= self
6034 assert new_child
isa AAssignOp
6035 _n_assign_op
= new_child
6041 if _n_value
== old_child
then
6042 if new_child
!= null then
6043 new_child
.parent
= self
6044 assert new_child
isa AExpr
6045 _n_value
= new_child
6053 redef fun visit_all
(v
: Visitor)
6055 v
.enter_visit
(_n_expr
)
6059 v
.enter_visit
(_n_assign_op
)
6060 v
.enter_visit
(_n_value
)
6063 redef class AClosureCallExpr
6064 private init empty_init
do end
6066 init init_aclosurecallexpr
(
6068 n_args
: Collection[Object], # Should be Collection[AExpr]
6069 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6073 _n_id
= n_id
.as(not null)
6080 for n
in n_closure_defs
do
6081 assert n
isa AClosureDef
6082 _n_closure_defs
.add
(n
)
6087 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6089 if _n_id
== old_child
then
6090 if new_child
!= null then
6091 new_child
.parent
= self
6092 assert new_child
isa TId
6099 for i
in [0.._n_args
.length
[ do
6100 if _n_args
[i
] == old_child
then
6101 if new_child
!= null then
6102 assert new_child
isa AExpr
6103 _n_args
[i
] = new_child
6104 new_child
.parent
= self
6106 _n_args
.remove_at
(i
)
6111 for i
in [0.._n_closure_defs
.length
[ do
6112 if _n_closure_defs
[i
] == old_child
then
6113 if new_child
!= null then
6114 assert new_child
isa AClosureDef
6115 _n_closure_defs
[i
] = new_child
6116 new_child
.parent
= self
6118 _n_closure_defs
.remove_at
(i
)
6125 redef fun visit_all
(v
: Visitor)
6127 v
.enter_visit
(_n_id
)
6131 for n
in _n_closure_defs
do
6136 redef class AVarExpr
6137 private init empty_init
do end
6139 init init_avarexpr
(
6144 _n_id
= n_id
.as(not null)
6148 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6150 if _n_id
== old_child
then
6151 if new_child
!= null then
6152 new_child
.parent
= self
6153 assert new_child
isa TId
6162 redef fun visit_all
(v
: Visitor)
6164 v
.enter_visit
(_n_id
)
6167 redef class AVarAssignExpr
6168 private init empty_init
do end
6170 init init_avarassignexpr
(
6172 n_assign
: nullable TAssign,
6173 n_value
: nullable AExpr
6177 _n_id
= n_id
.as(not null)
6179 _n_assign
= n_assign
.as(not null)
6180 n_assign
.parent
= self
6181 _n_value
= n_value
.as(not null)
6182 n_value
.parent
= self
6185 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6187 if _n_id
== old_child
then
6188 if new_child
!= null then
6189 new_child
.parent
= self
6190 assert new_child
isa TId
6197 if _n_assign
== old_child
then
6198 if new_child
!= null then
6199 new_child
.parent
= self
6200 assert new_child
isa TAssign
6201 _n_assign
= new_child
6207 if _n_value
== old_child
then
6208 if new_child
!= null then
6209 new_child
.parent
= self
6210 assert new_child
isa AExpr
6211 _n_value
= new_child
6219 redef fun visit_all
(v
: Visitor)
6221 v
.enter_visit
(_n_id
)
6222 v
.enter_visit
(_n_assign
)
6223 v
.enter_visit
(_n_value
)
6226 redef class AVarReassignExpr
6227 private init empty_init
do end
6229 init init_avarreassignexpr
(
6231 n_assign_op
: nullable AAssignOp,
6232 n_value
: nullable AExpr
6236 _n_id
= n_id
.as(not null)
6238 _n_assign_op
= n_assign_op
.as(not null)
6239 n_assign_op
.parent
= self
6240 _n_value
= n_value
.as(not null)
6241 n_value
.parent
= self
6244 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6246 if _n_id
== old_child
then
6247 if new_child
!= null then
6248 new_child
.parent
= self
6249 assert new_child
isa TId
6256 if _n_assign_op
== old_child
then
6257 if new_child
!= null then
6258 new_child
.parent
= self
6259 assert new_child
isa AAssignOp
6260 _n_assign_op
= new_child
6266 if _n_value
== old_child
then
6267 if new_child
!= null then
6268 new_child
.parent
= self
6269 assert new_child
isa AExpr
6270 _n_value
= new_child
6278 redef fun visit_all
(v
: Visitor)
6280 v
.enter_visit
(_n_id
)
6281 v
.enter_visit
(_n_assign_op
)
6282 v
.enter_visit
(_n_value
)
6285 redef class ARangeExpr
6286 private init empty_init
do end
6288 init init_arangeexpr
(
6289 n_expr
: nullable AExpr,
6290 n_expr2
: nullable AExpr
6294 _n_expr
= n_expr
.as(not null)
6295 n_expr
.parent
= self
6296 _n_expr2
= n_expr2
.as(not null)
6297 n_expr2
.parent
= self
6300 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6302 if _n_expr
== old_child
then
6303 if new_child
!= null then
6304 new_child
.parent
= self
6305 assert new_child
isa AExpr
6312 if _n_expr2
== old_child
then
6313 if new_child
!= null then
6314 new_child
.parent
= self
6315 assert new_child
isa AExpr
6316 _n_expr2
= new_child
6324 redef fun visit_all
(v
: Visitor)
6326 v
.enter_visit
(_n_expr
)
6327 v
.enter_visit
(_n_expr2
)
6330 redef class ACrangeExpr
6331 private init empty_init
do end
6333 init init_acrangeexpr
(
6334 n_expr
: nullable AExpr,
6335 n_expr2
: nullable AExpr
6339 _n_expr
= n_expr
.as(not null)
6340 n_expr
.parent
= self
6341 _n_expr2
= n_expr2
.as(not null)
6342 n_expr2
.parent
= self
6345 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6347 if _n_expr
== old_child
then
6348 if new_child
!= null then
6349 new_child
.parent
= self
6350 assert new_child
isa AExpr
6357 if _n_expr2
== old_child
then
6358 if new_child
!= null then
6359 new_child
.parent
= self
6360 assert new_child
isa AExpr
6361 _n_expr2
= new_child
6369 redef fun visit_all
(v
: Visitor)
6371 v
.enter_visit
(_n_expr
)
6372 v
.enter_visit
(_n_expr2
)
6375 redef class AOrangeExpr
6376 private init empty_init
do end
6378 init init_aorangeexpr
(
6379 n_expr
: nullable AExpr,
6380 n_expr2
: nullable AExpr
6384 _n_expr
= n_expr
.as(not null)
6385 n_expr
.parent
= self
6386 _n_expr2
= n_expr2
.as(not null)
6387 n_expr2
.parent
= self
6390 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6392 if _n_expr
== old_child
then
6393 if new_child
!= null then
6394 new_child
.parent
= self
6395 assert new_child
isa AExpr
6402 if _n_expr2
== old_child
then
6403 if new_child
!= null then
6404 new_child
.parent
= self
6405 assert new_child
isa AExpr
6406 _n_expr2
= new_child
6414 redef fun visit_all
(v
: Visitor)
6416 v
.enter_visit
(_n_expr
)
6417 v
.enter_visit
(_n_expr2
)
6420 redef class AArrayExpr
6421 private init empty_init
do end
6423 init init_aarrayexpr
(
6424 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6435 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6437 for i
in [0.._n_exprs
.length
[ do
6438 if _n_exprs
[i
] == old_child
then
6439 if new_child
!= null then
6440 assert new_child
isa AExpr
6441 _n_exprs
[i
] = new_child
6442 new_child
.parent
= self
6444 _n_exprs
.remove_at
(i
)
6451 redef fun visit_all
(v
: Visitor)
6453 for n
in _n_exprs
do
6458 redef class ASelfExpr
6459 private init empty_init
do end
6461 init init_aselfexpr
(
6462 n_kwself
: nullable TKwself
6466 _n_kwself
= n_kwself
.as(not null)
6467 n_kwself
.parent
= self
6470 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6472 if _n_kwself
== old_child
then
6473 if new_child
!= null then
6474 new_child
.parent
= self
6475 assert new_child
isa TKwself
6476 _n_kwself
= new_child
6484 redef fun visit_all
(v
: Visitor)
6486 v
.enter_visit
(_n_kwself
)
6489 redef class AImplicitSelfExpr
6490 private init empty_init
do end
6492 init init_aimplicitselfexpr
6497 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6501 redef fun visit_all
(v
: Visitor)
6505 redef class ATrueExpr
6506 private init empty_init
do end
6508 init init_atrueexpr
(
6509 n_kwtrue
: nullable TKwtrue
6513 _n_kwtrue
= n_kwtrue
.as(not null)
6514 n_kwtrue
.parent
= self
6517 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6519 if _n_kwtrue
== old_child
then
6520 if new_child
!= null then
6521 new_child
.parent
= self
6522 assert new_child
isa TKwtrue
6523 _n_kwtrue
= new_child
6531 redef fun visit_all
(v
: Visitor)
6533 v
.enter_visit
(_n_kwtrue
)
6536 redef class AFalseExpr
6537 private init empty_init
do end
6539 init init_afalseexpr
(
6540 n_kwfalse
: nullable TKwfalse
6544 _n_kwfalse
= n_kwfalse
.as(not null)
6545 n_kwfalse
.parent
= self
6548 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6550 if _n_kwfalse
== old_child
then
6551 if new_child
!= null then
6552 new_child
.parent
= self
6553 assert new_child
isa TKwfalse
6554 _n_kwfalse
= new_child
6562 redef fun visit_all
(v
: Visitor)
6564 v
.enter_visit
(_n_kwfalse
)
6567 redef class ANullExpr
6568 private init empty_init
do end
6570 init init_anullexpr
(
6571 n_kwnull
: nullable TKwnull
6575 _n_kwnull
= n_kwnull
.as(not null)
6576 n_kwnull
.parent
= self
6579 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6581 if _n_kwnull
== old_child
then
6582 if new_child
!= null then
6583 new_child
.parent
= self
6584 assert new_child
isa TKwnull
6585 _n_kwnull
= new_child
6593 redef fun visit_all
(v
: Visitor)
6595 v
.enter_visit
(_n_kwnull
)
6598 redef class AIntExpr
6599 private init empty_init
do end
6601 init init_aintexpr
(
6602 n_number
: nullable TNumber
6606 _n_number
= n_number
.as(not null)
6607 n_number
.parent
= self
6610 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6612 if _n_number
== old_child
then
6613 if new_child
!= null then
6614 new_child
.parent
= self
6615 assert new_child
isa TNumber
6616 _n_number
= new_child
6624 redef fun visit_all
(v
: Visitor)
6626 v
.enter_visit
(_n_number
)
6629 redef class AFloatExpr
6630 private init empty_init
do end
6632 init init_afloatexpr
(
6633 n_float
: nullable TFloat
6637 _n_float
= n_float
.as(not null)
6638 n_float
.parent
= self
6641 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6643 if _n_float
== old_child
then
6644 if new_child
!= null then
6645 new_child
.parent
= self
6646 assert new_child
isa TFloat
6647 _n_float
= new_child
6655 redef fun visit_all
(v
: Visitor)
6657 v
.enter_visit
(_n_float
)
6660 redef class ACharExpr
6661 private init empty_init
do end
6663 init init_acharexpr
(
6664 n_char
: nullable TChar
6668 _n_char
= n_char
.as(not null)
6669 n_char
.parent
= self
6672 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6674 if _n_char
== old_child
then
6675 if new_child
!= null then
6676 new_child
.parent
= self
6677 assert new_child
isa TChar
6686 redef fun visit_all
(v
: Visitor)
6688 v
.enter_visit
(_n_char
)
6691 redef class AStringExpr
6692 private init empty_init
do end
6694 init init_astringexpr
(
6695 n_string
: nullable TString
6699 _n_string
= n_string
.as(not null)
6700 n_string
.parent
= self
6703 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6705 if _n_string
== old_child
then
6706 if new_child
!= null then
6707 new_child
.parent
= self
6708 assert new_child
isa TString
6709 _n_string
= new_child
6717 redef fun visit_all
(v
: Visitor)
6719 v
.enter_visit
(_n_string
)
6722 redef class AStartStringExpr
6723 private init empty_init
do end
6725 init init_astartstringexpr
(
6726 n_string
: nullable TStartString
6730 _n_string
= n_string
.as(not null)
6731 n_string
.parent
= self
6734 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6736 if _n_string
== old_child
then
6737 if new_child
!= null then
6738 new_child
.parent
= self
6739 assert new_child
isa TStartString
6740 _n_string
= new_child
6748 redef fun visit_all
(v
: Visitor)
6750 v
.enter_visit
(_n_string
)
6753 redef class AMidStringExpr
6754 private init empty_init
do end
6756 init init_amidstringexpr
(
6757 n_string
: nullable TMidString
6761 _n_string
= n_string
.as(not null)
6762 n_string
.parent
= self
6765 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6767 if _n_string
== old_child
then
6768 if new_child
!= null then
6769 new_child
.parent
= self
6770 assert new_child
isa TMidString
6771 _n_string
= new_child
6779 redef fun visit_all
(v
: Visitor)
6781 v
.enter_visit
(_n_string
)
6784 redef class AEndStringExpr
6785 private init empty_init
do end
6787 init init_aendstringexpr
(
6788 n_string
: nullable TEndString
6792 _n_string
= n_string
.as(not null)
6793 n_string
.parent
= self
6796 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6798 if _n_string
== old_child
then
6799 if new_child
!= null then
6800 new_child
.parent
= self
6801 assert new_child
isa TEndString
6802 _n_string
= new_child
6810 redef fun visit_all
(v
: Visitor)
6812 v
.enter_visit
(_n_string
)
6815 redef class ASuperstringExpr
6816 private init empty_init
do end
6818 init init_asuperstringexpr
(
6819 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6830 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6832 for i
in [0.._n_exprs
.length
[ do
6833 if _n_exprs
[i
] == old_child
then
6834 if new_child
!= null then
6835 assert new_child
isa AExpr
6836 _n_exprs
[i
] = new_child
6837 new_child
.parent
= self
6839 _n_exprs
.remove_at
(i
)
6846 redef fun visit_all
(v
: Visitor)
6848 for n
in _n_exprs
do
6853 redef class AParExpr
6854 private init empty_init
do end
6856 init init_aparexpr
(
6857 n_expr
: nullable AExpr
6861 _n_expr
= n_expr
.as(not null)
6862 n_expr
.parent
= self
6865 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6867 if _n_expr
== old_child
then
6868 if new_child
!= null then
6869 new_child
.parent
= self
6870 assert new_child
isa AExpr
6879 redef fun visit_all
(v
: Visitor)
6881 v
.enter_visit
(_n_expr
)
6884 redef class AAsCastExpr
6885 private init empty_init
do end
6887 init init_aascastexpr
(
6888 n_expr
: nullable AExpr,
6889 n_kwas
: nullable TKwas,
6890 n_type
: nullable AType
6894 _n_expr
= n_expr
.as(not null)
6895 n_expr
.parent
= self
6896 _n_kwas
= n_kwas
.as(not null)
6897 n_kwas
.parent
= self
6898 _n_type
= n_type
.as(not null)
6899 n_type
.parent
= self
6902 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6904 if _n_expr
== old_child
then
6905 if new_child
!= null then
6906 new_child
.parent
= self
6907 assert new_child
isa AExpr
6914 if _n_kwas
== old_child
then
6915 if new_child
!= null then
6916 new_child
.parent
= self
6917 assert new_child
isa TKwas
6924 if _n_type
== old_child
then
6925 if new_child
!= null then
6926 new_child
.parent
= self
6927 assert new_child
isa AType
6936 redef fun visit_all
(v
: Visitor)
6938 v
.enter_visit
(_n_expr
)
6939 v
.enter_visit
(_n_kwas
)
6940 v
.enter_visit
(_n_type
)
6943 redef class AAsNotnullExpr
6944 private init empty_init
do end
6946 init init_aasnotnullexpr
(
6947 n_expr
: nullable AExpr,
6948 n_kwas
: nullable TKwas,
6949 n_kwnot
: nullable TKwnot,
6950 n_kwnull
: nullable TKwnull
6954 _n_expr
= n_expr
.as(not null)
6955 n_expr
.parent
= self
6956 _n_kwas
= n_kwas
.as(not null)
6957 n_kwas
.parent
= self
6958 _n_kwnot
= n_kwnot
.as(not null)
6959 n_kwnot
.parent
= self
6960 _n_kwnull
= n_kwnull
.as(not null)
6961 n_kwnull
.parent
= self
6964 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6966 if _n_expr
== old_child
then
6967 if new_child
!= null then
6968 new_child
.parent
= self
6969 assert new_child
isa AExpr
6976 if _n_kwas
== old_child
then
6977 if new_child
!= null then
6978 new_child
.parent
= self
6979 assert new_child
isa TKwas
6986 if _n_kwnot
== old_child
then
6987 if new_child
!= null then
6988 new_child
.parent
= self
6989 assert new_child
isa TKwnot
6990 _n_kwnot
= new_child
6996 if _n_kwnull
== old_child
then
6997 if new_child
!= null then
6998 new_child
.parent
= self
6999 assert new_child
isa TKwnull
7000 _n_kwnull
= new_child
7008 redef fun visit_all
(v
: Visitor)
7010 v
.enter_visit
(_n_expr
)
7011 v
.enter_visit
(_n_kwas
)
7012 v
.enter_visit
(_n_kwnot
)
7013 v
.enter_visit
(_n_kwnull
)
7016 redef class AIssetAttrExpr
7017 private init empty_init
do end
7019 init init_aissetattrexpr
(
7020 n_kwisset
: nullable TKwisset,
7021 n_expr
: nullable AExpr,
7022 n_id
: nullable TAttrid
7026 _n_kwisset
= n_kwisset
.as(not null)
7027 n_kwisset
.parent
= self
7028 _n_expr
= n_expr
.as(not null)
7029 n_expr
.parent
= self
7030 _n_id
= n_id
.as(not null)
7034 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7036 if _n_kwisset
== old_child
then
7037 if new_child
!= null then
7038 new_child
.parent
= self
7039 assert new_child
isa TKwisset
7040 _n_kwisset
= new_child
7046 if _n_expr
== old_child
then
7047 if new_child
!= null then
7048 new_child
.parent
= self
7049 assert new_child
isa AExpr
7056 if _n_id
== old_child
then
7057 if new_child
!= null then
7058 new_child
.parent
= self
7059 assert new_child
isa TAttrid
7068 redef fun visit_all
(v
: Visitor)
7070 v
.enter_visit
(_n_kwisset
)
7071 v
.enter_visit
(_n_expr
)
7072 v
.enter_visit
(_n_id
)
7075 redef class APlusAssignOp
7076 private init empty_init
do end
7078 init init_aplusassignop
(
7079 n_pluseq
: nullable TPluseq
7083 _n_pluseq
= n_pluseq
.as(not null)
7084 n_pluseq
.parent
= self
7087 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7089 if _n_pluseq
== old_child
then
7090 if new_child
!= null then
7091 new_child
.parent
= self
7092 assert new_child
isa TPluseq
7093 _n_pluseq
= new_child
7101 redef fun visit_all
(v
: Visitor)
7103 v
.enter_visit
(_n_pluseq
)
7106 redef class AMinusAssignOp
7107 private init empty_init
do end
7109 init init_aminusassignop
(
7110 n_minuseq
: nullable TMinuseq
7114 _n_minuseq
= n_minuseq
.as(not null)
7115 n_minuseq
.parent
= self
7118 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7120 if _n_minuseq
== old_child
then
7121 if new_child
!= null then
7122 new_child
.parent
= self
7123 assert new_child
isa TMinuseq
7124 _n_minuseq
= new_child
7132 redef fun visit_all
(v
: Visitor)
7134 v
.enter_visit
(_n_minuseq
)
7137 redef class AClosureDef
7138 private init empty_init
do end
7140 init init_aclosuredef
(
7141 n_bang
: nullable TBang,
7142 n_id
: nullable AClosureId,
7143 n_ids
: Collection[Object], # Should be Collection[TId]
7144 n_kwdo
: nullable TKwdo,
7145 n_expr
: nullable AExpr,
7146 n_label
: nullable ALabel
7150 _n_bang
= n_bang
.as(not null)
7151 n_bang
.parent
= self
7152 _n_id
= n_id
.as(not null)
7160 if n_kwdo
!= null then
7161 n_kwdo
.parent
= self
7164 if n_expr
!= null then
7165 n_expr
.parent
= self
7168 if n_label
!= null then
7169 n_label
.parent
= self
7173 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7175 if _n_bang
== old_child
then
7176 if new_child
!= null then
7177 new_child
.parent
= self
7178 assert new_child
isa TBang
7185 if _n_id
== old_child
then
7186 if new_child
!= null then
7187 new_child
.parent
= self
7188 assert new_child
isa AClosureId
7195 for i
in [0.._n_ids
.length
[ do
7196 if _n_ids
[i
] == old_child
then
7197 if new_child
!= null then
7198 assert new_child
isa TId
7199 _n_ids
[i
] = new_child
7200 new_child
.parent
= self
7207 if _n_kwdo
== old_child
then
7208 if new_child
!= null then
7209 new_child
.parent
= self
7210 assert new_child
isa TKwdo
7217 if _n_expr
== old_child
then
7218 if new_child
!= null then
7219 new_child
.parent
= self
7220 assert new_child
isa AExpr
7227 if _n_label
== old_child
then
7228 if new_child
!= null then
7229 new_child
.parent
= self
7230 assert new_child
isa ALabel
7231 _n_label
= new_child
7239 redef fun visit_all
(v
: Visitor)
7241 v
.enter_visit
(_n_bang
)
7242 v
.enter_visit
(_n_id
)
7246 if _n_kwdo
!= null then
7247 v
.enter_visit
(_n_kwdo
.as(not null))
7249 if _n_expr
!= null then
7250 v
.enter_visit
(_n_expr
.as(not null))
7252 if _n_label
!= null then
7253 v
.enter_visit
(_n_label
.as(not null))
7257 redef class ASimpleClosureId
7258 private init empty_init
do end
7260 init init_asimpleclosureid
(
7265 _n_id
= n_id
.as(not null)
7269 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7271 if _n_id
== old_child
then
7272 if new_child
!= null then
7273 new_child
.parent
= self
7274 assert new_child
isa TId
7283 redef fun visit_all
(v
: Visitor)
7285 v
.enter_visit
(_n_id
)
7288 redef class ABreakClosureId
7289 private init empty_init
do end
7291 init init_abreakclosureid
(
7292 n_kwbreak
: nullable TKwbreak
7296 _n_kwbreak
= n_kwbreak
.as(not null)
7297 n_kwbreak
.parent
= self
7300 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7302 if _n_kwbreak
== old_child
then
7303 if new_child
!= null then
7304 new_child
.parent
= self
7305 assert new_child
isa TKwbreak
7306 _n_kwbreak
= new_child
7314 redef fun visit_all
(v
: Visitor)
7316 v
.enter_visit
(_n_kwbreak
)
7319 redef class AModuleName
7320 private init empty_init
do end
7322 init init_amodulename
(
7323 n_quad
: nullable TQuad,
7324 n_path
: Collection[Object], # Should be Collection[TId]
7330 if n_quad
!= null then
7331 n_quad
.parent
= self
7338 _n_id
= n_id
.as(not null)
7342 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7344 if _n_quad
== old_child
then
7345 if new_child
!= null then
7346 new_child
.parent
= self
7347 assert new_child
isa TQuad
7354 for i
in [0.._n_path
.length
[ do
7355 if _n_path
[i
] == old_child
then
7356 if new_child
!= null then
7357 assert new_child
isa TId
7358 _n_path
[i
] = new_child
7359 new_child
.parent
= self
7361 _n_path
.remove_at
(i
)
7366 if _n_id
== old_child
then
7367 if new_child
!= null then
7368 new_child
.parent
= self
7369 assert new_child
isa TId
7378 redef fun visit_all
(v
: Visitor)
7380 if _n_quad
!= null then
7381 v
.enter_visit
(_n_quad
.as(not null))
7386 v
.enter_visit
(_n_id
)
7389 redef class AExternCalls
7390 private init empty_init
do end
7392 init init_aexterncalls
(
7393 n_kwimport
: nullable TKwimport,
7394 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7398 _n_kwimport
= n_kwimport
.as(not null)
7399 n_kwimport
.parent
= self
7400 for n
in n_extern_calls
do
7401 assert n
isa AExternCall
7402 _n_extern_calls
.add
(n
)
7407 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7409 if _n_kwimport
== old_child
then
7410 if new_child
!= null then
7411 new_child
.parent
= self
7412 assert new_child
isa TKwimport
7413 _n_kwimport
= new_child
7419 for i
in [0.._n_extern_calls
.length
[ do
7420 if _n_extern_calls
[i
] == old_child
then
7421 if new_child
!= null then
7422 assert new_child
isa AExternCall
7423 _n_extern_calls
[i
] = new_child
7424 new_child
.parent
= self
7426 _n_extern_calls
.remove_at
(i
)
7433 redef fun visit_all
(v
: Visitor)
7435 v
.enter_visit
(_n_kwimport
)
7436 for n
in _n_extern_calls
do
7441 redef class AExternCall
7442 private init empty_init
do end
7444 init init_aexterncall
7449 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7453 redef fun visit_all
(v
: Visitor)
7457 redef class ASuperExternCall
7458 private init empty_init
do end
7460 init init_asuperexterncall
(
7461 n_kwsuper
: nullable TKwsuper
7465 _n_kwsuper
= n_kwsuper
.as(not null)
7466 n_kwsuper
.parent
= self
7469 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7471 if _n_kwsuper
== old_child
then
7472 if new_child
!= null then
7473 new_child
.parent
= self
7474 assert new_child
isa TKwsuper
7475 _n_kwsuper
= new_child
7483 redef fun visit_all
(v
: Visitor)
7485 v
.enter_visit
(_n_kwsuper
)
7488 redef class ALocalPropExternCall
7489 private init empty_init
do end
7491 init init_alocalpropexterncall
(
7492 n_methid
: nullable AMethid
7496 _n_methid
= n_methid
.as(not null)
7497 n_methid
.parent
= self
7500 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7502 if _n_methid
== old_child
then
7503 if new_child
!= null then
7504 new_child
.parent
= self
7505 assert new_child
isa AMethid
7506 _n_methid
= new_child
7514 redef fun visit_all
(v
: Visitor)
7516 v
.enter_visit
(_n_methid
)
7519 redef class AFullPropExternCall
7520 private init empty_init
do end
7522 init init_afullpropexterncall
(
7523 n_classid
: nullable TClassid,
7524 n_quad
: nullable TQuad,
7525 n_methid
: nullable AMethid
7529 _n_classid
= n_classid
.as(not null)
7530 n_classid
.parent
= self
7532 if n_quad
!= null then
7533 n_quad
.parent
= self
7535 _n_methid
= n_methid
.as(not null)
7536 n_methid
.parent
= self
7539 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7541 if _n_classid
== old_child
then
7542 if new_child
!= null then
7543 new_child
.parent
= self
7544 assert new_child
isa TClassid
7545 _n_classid
= new_child
7551 if _n_quad
== old_child
then
7552 if new_child
!= null then
7553 new_child
.parent
= self
7554 assert new_child
isa TQuad
7561 if _n_methid
== old_child
then
7562 if new_child
!= null then
7563 new_child
.parent
= self
7564 assert new_child
isa AMethid
7565 _n_methid
= new_child
7573 redef fun visit_all
(v
: Visitor)
7575 v
.enter_visit
(_n_classid
)
7576 if _n_quad
!= null then
7577 v
.enter_visit
(_n_quad
.as(not null))
7579 v
.enter_visit
(_n_methid
)
7582 redef class AInitPropExternCall
7583 private init empty_init
do end
7585 init init_ainitpropexterncall
(
7586 n_classid
: nullable TClassid
7590 _n_classid
= n_classid
.as(not null)
7591 n_classid
.parent
= self
7594 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7596 if _n_classid
== old_child
then
7597 if new_child
!= null then
7598 new_child
.parent
= self
7599 assert new_child
isa TClassid
7600 _n_classid
= new_child
7608 redef fun visit_all
(v
: Visitor)
7610 v
.enter_visit
(_n_classid
)
7613 redef class ACastAsExternCall
7614 private init empty_init
do end
7616 init init_acastasexterncall
(
7617 n_from_type
: nullable AType,
7618 n_kwas
: nullable TKwas,
7619 n_to_type
: nullable AType
7623 _n_from_type
= n_from_type
.as(not null)
7624 n_from_type
.parent
= self
7625 _n_kwas
= n_kwas
.as(not null)
7626 n_kwas
.parent
= self
7627 _n_to_type
= n_to_type
.as(not null)
7628 n_to_type
.parent
= self
7631 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7633 if _n_from_type
== old_child
then
7634 if new_child
!= null then
7635 new_child
.parent
= self
7636 assert new_child
isa AType
7637 _n_from_type
= new_child
7643 if _n_kwas
== old_child
then
7644 if new_child
!= null then
7645 new_child
.parent
= self
7646 assert new_child
isa TKwas
7653 if _n_to_type
== old_child
then
7654 if new_child
!= null then
7655 new_child
.parent
= self
7656 assert new_child
isa AType
7657 _n_to_type
= new_child
7665 redef fun visit_all
(v
: Visitor)
7667 v
.enter_visit
(_n_from_type
)
7668 v
.enter_visit
(_n_kwas
)
7669 v
.enter_visit
(_n_to_type
)
7672 redef class AAsNullableExternCall
7673 private init empty_init
do end
7675 init init_aasnullableexterncall
(
7676 n_type
: nullable AType,
7677 n_kwas
: nullable TKwas,
7678 n_kwnullable
: nullable TKwnullable
7682 _n_type
= n_type
.as(not null)
7683 n_type
.parent
= self
7684 _n_kwas
= n_kwas
.as(not null)
7685 n_kwas
.parent
= self
7686 _n_kwnullable
= n_kwnullable
.as(not null)
7687 n_kwnullable
.parent
= self
7690 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7692 if _n_type
== old_child
then
7693 if new_child
!= null then
7694 new_child
.parent
= self
7695 assert new_child
isa AType
7702 if _n_kwas
== old_child
then
7703 if new_child
!= null then
7704 new_child
.parent
= self
7705 assert new_child
isa TKwas
7712 if _n_kwnullable
== old_child
then
7713 if new_child
!= null then
7714 new_child
.parent
= self
7715 assert new_child
isa TKwnullable
7716 _n_kwnullable
= new_child
7724 redef fun visit_all
(v
: Visitor)
7726 v
.enter_visit
(_n_type
)
7727 v
.enter_visit
(_n_kwas
)
7728 v
.enter_visit
(_n_kwnullable
)
7731 redef class AAsNotNullableExternCall
7732 private init empty_init
do end
7734 init init_aasnotnullableexterncall
(
7735 n_type
: nullable AType,
7736 n_kwas
: nullable TKwas,
7737 n_kwnot
: nullable TKwnot,
7738 n_kwnullable
: nullable TKwnullable
7742 _n_type
= n_type
.as(not null)
7743 n_type
.parent
= self
7744 _n_kwas
= n_kwas
.as(not null)
7745 n_kwas
.parent
= self
7746 _n_kwnot
= n_kwnot
.as(not null)
7747 n_kwnot
.parent
= self
7748 _n_kwnullable
= n_kwnullable
.as(not null)
7749 n_kwnullable
.parent
= self
7752 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7754 if _n_type
== old_child
then
7755 if new_child
!= null then
7756 new_child
.parent
= self
7757 assert new_child
isa AType
7764 if _n_kwas
== old_child
then
7765 if new_child
!= null then
7766 new_child
.parent
= self
7767 assert new_child
isa TKwas
7774 if _n_kwnot
== old_child
then
7775 if new_child
!= null then
7776 new_child
.parent
= self
7777 assert new_child
isa TKwnot
7778 _n_kwnot
= new_child
7784 if _n_kwnullable
== old_child
then
7785 if new_child
!= null then
7786 new_child
.parent
= self
7787 assert new_child
isa TKwnullable
7788 _n_kwnullable
= new_child
7796 redef fun visit_all
(v
: Visitor)
7798 v
.enter_visit
(_n_type
)
7799 v
.enter_visit
(_n_kwas
)
7800 v
.enter_visit
(_n_kwnot
)
7801 v
.enter_visit
(_n_kwnullable
)
7804 redef class AQualified
7805 private init empty_init
do end
7807 init init_aqualified
(
7808 n_id
: Collection[Object], # Should be Collection[TId]
7809 n_classid
: nullable TClassid
7818 _n_classid
= n_classid
7819 if n_classid
!= null then
7820 n_classid
.parent
= self
7824 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7826 for i
in [0.._n_id
.length
[ do
7827 if _n_id
[i
] == old_child
then
7828 if new_child
!= null then
7829 assert new_child
isa TId
7830 _n_id
[i
] = new_child
7831 new_child
.parent
= self
7838 if _n_classid
== old_child
then
7839 if new_child
!= null then
7840 new_child
.parent
= self
7841 assert new_child
isa TClassid
7842 _n_classid
= new_child
7850 redef fun visit_all
(v
: Visitor)
7855 if _n_classid
!= null then
7856 v
.enter_visit
(_n_classid
.as(not null))
7861 private init empty_init
do end
7864 n_comment
: Collection[Object] # Should be Collection[TComment]
7868 for n
in n_comment
do
7869 assert n
isa TComment
7875 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7877 for i
in [0.._n_comment
.length
[ do
7878 if _n_comment
[i
] == old_child
then
7879 if new_child
!= null then
7880 assert new_child
isa TComment
7881 _n_comment
[i
] = new_child
7882 new_child
.parent
= self
7884 _n_comment
.remove_at
(i
)
7891 redef fun visit_all
(v
: Visitor)
7893 for n
in _n_comment
do
7901 n_base
: nullable AModule,
7908 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7910 if _n_base
== old_child
then
7911 if new_child
== null then
7913 new_child
.parent
= self
7914 assert new_child
isa AModule
7917 old_child
.parent
= null
7922 redef fun visit_all
(v
: Visitor)
7924 if _n_base
!= null then
7925 v
.enter_visit
(_n_base
.as(not null))
7927 v
.enter_visit
(_n_eof
)