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 AFormaldef
814 private init empty_init
do end
816 init init_aformaldef
(
817 n_id
: nullable TClassid,
818 n_type
: nullable AType
822 _n_id
= n_id
.as(not null)
825 if n_type
!= null then
830 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
832 if _n_id
== old_child
then
833 if new_child
!= null then
834 new_child
.parent
= self
835 assert new_child
isa TClassid
842 if _n_type
== old_child
then
843 if new_child
!= null then
844 new_child
.parent
= self
845 assert new_child
isa AType
854 redef fun visit_all
(v
: Visitor)
857 if _n_type
!= null then
858 v
.enter_visit
(_n_type
.as(not null))
862 redef class ASuperclass
863 private init empty_init
do end
865 init init_asuperclass
(
866 n_kwspecial
: nullable TKwspecial,
867 n_kwsuper
: nullable TKwsuper,
868 n_type
: nullable AType
872 _n_kwspecial
= n_kwspecial
873 if n_kwspecial
!= null then
874 n_kwspecial
.parent
= self
876 _n_kwsuper
= n_kwsuper
877 if n_kwsuper
!= null then
878 n_kwsuper
.parent
= self
880 _n_type
= n_type
.as(not null)
884 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
886 if _n_kwspecial
== old_child
then
887 if new_child
!= null then
888 new_child
.parent
= self
889 assert new_child
isa TKwspecial
890 _n_kwspecial
= new_child
896 if _n_kwsuper
== old_child
then
897 if new_child
!= null then
898 new_child
.parent
= self
899 assert new_child
isa TKwsuper
900 _n_kwsuper
= new_child
906 if _n_type
== old_child
then
907 if new_child
!= null then
908 new_child
.parent
= self
909 assert new_child
isa AType
918 redef fun visit_all
(v
: Visitor)
920 if _n_kwspecial
!= null then
921 v
.enter_visit
(_n_kwspecial
.as(not null))
923 if _n_kwsuper
!= null then
924 v
.enter_visit
(_n_kwsuper
.as(not null))
926 v
.enter_visit
(_n_type
)
929 redef class AAttrPropdef
930 private init empty_init
do end
932 init init_aattrpropdef
(
933 n_doc
: nullable ADoc,
934 n_readable
: nullable AAble,
935 n_writable
: nullable AAble,
936 n_kwredef
: nullable TKwredef,
937 n_visibility
: nullable AVisibility,
938 n_kwvar
: nullable TKwvar,
939 n_id
: nullable TAttrid,
941 n_type
: nullable AType,
942 n_expr
: nullable AExpr
947 if n_doc
!= null then
950 _n_readable
= n_readable
951 if n_readable
!= null then
952 n_readable
.parent
= self
954 _n_writable
= n_writable
955 if n_writable
!= null then
956 n_writable
.parent
= self
958 _n_kwredef
= n_kwredef
959 if n_kwredef
!= null then
960 n_kwredef
.parent
= self
962 _n_visibility
= n_visibility
.as(not null)
963 n_visibility
.parent
= self
964 _n_kwvar
= n_kwvar
.as(not null)
965 n_kwvar
.parent
= self
971 if n_id2
!= null then
975 if n_type
!= null then
979 if n_expr
!= null then
984 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
986 if _n_doc
== old_child
then
987 if new_child
!= null then
988 new_child
.parent
= self
989 assert new_child
isa ADoc
996 if _n_readable
== old_child
then
997 if new_child
!= null then
998 new_child
.parent
= self
999 assert new_child
isa AAble
1000 _n_readable
= new_child
1006 if _n_writable
== old_child
then
1007 if new_child
!= null then
1008 new_child
.parent
= self
1009 assert new_child
isa AAble
1010 _n_writable
= new_child
1016 if _n_kwredef
== old_child
then
1017 if new_child
!= null then
1018 new_child
.parent
= self
1019 assert new_child
isa TKwredef
1020 _n_kwredef
= new_child
1026 if _n_visibility
== old_child
then
1027 if new_child
!= null then
1028 new_child
.parent
= self
1029 assert new_child
isa AVisibility
1030 _n_visibility
= new_child
1036 if _n_kwvar
== old_child
then
1037 if new_child
!= null then
1038 new_child
.parent
= self
1039 assert new_child
isa TKwvar
1040 _n_kwvar
= new_child
1046 if _n_id
== old_child
then
1047 if new_child
!= null then
1048 new_child
.parent
= self
1049 assert new_child
isa TAttrid
1056 if _n_id2
== old_child
then
1057 if new_child
!= null then
1058 new_child
.parent
= self
1059 assert new_child
isa TId
1066 if _n_type
== old_child
then
1067 if new_child
!= null then
1068 new_child
.parent
= self
1069 assert new_child
isa AType
1076 if _n_expr
== old_child
then
1077 if new_child
!= null then
1078 new_child
.parent
= self
1079 assert new_child
isa AExpr
1088 redef fun visit_all
(v
: Visitor)
1090 if _n_doc
!= null then
1091 v
.enter_visit
(_n_doc
.as(not null))
1093 if _n_readable
!= null then
1094 v
.enter_visit
(_n_readable
.as(not null))
1096 if _n_writable
!= null then
1097 v
.enter_visit
(_n_writable
.as(not null))
1099 if _n_kwredef
!= null then
1100 v
.enter_visit
(_n_kwredef
.as(not null))
1102 v
.enter_visit
(_n_visibility
)
1103 v
.enter_visit
(_n_kwvar
)
1104 if _n_id
!= null then
1105 v
.enter_visit
(_n_id
.as(not null))
1107 if _n_id2
!= null then
1108 v
.enter_visit
(_n_id2
.as(not null))
1110 if _n_type
!= null then
1111 v
.enter_visit
(_n_type
.as(not null))
1113 if _n_expr
!= null then
1114 v
.enter_visit
(_n_expr
.as(not null))
1118 redef class AMethPropdef
1119 private init empty_init
do end
1121 init init_amethpropdef
(
1122 n_doc
: nullable ADoc,
1123 n_kwredef
: nullable TKwredef,
1124 n_visibility
: nullable AVisibility,
1125 n_methid
: nullable AMethid,
1126 n_signature
: nullable ASignature
1131 if n_doc
!= null then
1134 _n_kwredef
= n_kwredef
1135 if n_kwredef
!= null then
1136 n_kwredef
.parent
= self
1138 _n_visibility
= n_visibility
.as(not null)
1139 n_visibility
.parent
= self
1140 _n_methid
= n_methid
.as(not null)
1141 n_methid
.parent
= self
1142 _n_signature
= n_signature
.as(not null)
1143 n_signature
.parent
= self
1146 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1148 if _n_doc
== old_child
then
1149 if new_child
!= null then
1150 new_child
.parent
= self
1151 assert new_child
isa ADoc
1158 if _n_kwredef
== old_child
then
1159 if new_child
!= null then
1160 new_child
.parent
= self
1161 assert new_child
isa TKwredef
1162 _n_kwredef
= new_child
1168 if _n_visibility
== old_child
then
1169 if new_child
!= null then
1170 new_child
.parent
= self
1171 assert new_child
isa AVisibility
1172 _n_visibility
= new_child
1178 if _n_methid
== old_child
then
1179 if new_child
!= null then
1180 new_child
.parent
= self
1181 assert new_child
isa AMethid
1182 _n_methid
= new_child
1188 if _n_signature
== old_child
then
1189 if new_child
!= null then
1190 new_child
.parent
= self
1191 assert new_child
isa ASignature
1192 _n_signature
= new_child
1200 redef fun visit_all
(v
: Visitor)
1202 if _n_doc
!= null then
1203 v
.enter_visit
(_n_doc
.as(not null))
1205 if _n_kwredef
!= null then
1206 v
.enter_visit
(_n_kwredef
.as(not null))
1208 v
.enter_visit
(_n_visibility
)
1209 v
.enter_visit
(_n_methid
)
1210 v
.enter_visit
(_n_signature
)
1213 redef class ADeferredMethPropdef
1214 private init empty_init
do end
1216 init init_adeferredmethpropdef
(
1217 n_doc
: nullable ADoc,
1218 n_kwredef
: nullable TKwredef,
1219 n_visibility
: nullable AVisibility,
1220 n_kwmeth
: nullable TKwmeth,
1221 n_methid
: nullable AMethid,
1222 n_signature
: nullable ASignature
1227 if n_doc
!= null then
1230 _n_kwredef
= n_kwredef
1231 if n_kwredef
!= null then
1232 n_kwredef
.parent
= self
1234 _n_visibility
= n_visibility
.as(not null)
1235 n_visibility
.parent
= self
1236 _n_kwmeth
= n_kwmeth
.as(not null)
1237 n_kwmeth
.parent
= self
1238 _n_methid
= n_methid
.as(not null)
1239 n_methid
.parent
= self
1240 _n_signature
= n_signature
.as(not null)
1241 n_signature
.parent
= self
1244 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1246 if _n_doc
== old_child
then
1247 if new_child
!= null then
1248 new_child
.parent
= self
1249 assert new_child
isa ADoc
1256 if _n_kwredef
== old_child
then
1257 if new_child
!= null then
1258 new_child
.parent
= self
1259 assert new_child
isa TKwredef
1260 _n_kwredef
= new_child
1266 if _n_visibility
== old_child
then
1267 if new_child
!= null then
1268 new_child
.parent
= self
1269 assert new_child
isa AVisibility
1270 _n_visibility
= new_child
1276 if _n_kwmeth
== old_child
then
1277 if new_child
!= null then
1278 new_child
.parent
= self
1279 assert new_child
isa TKwmeth
1280 _n_kwmeth
= new_child
1286 if _n_methid
== old_child
then
1287 if new_child
!= null then
1288 new_child
.parent
= self
1289 assert new_child
isa AMethid
1290 _n_methid
= new_child
1296 if _n_signature
== old_child
then
1297 if new_child
!= null then
1298 new_child
.parent
= self
1299 assert new_child
isa ASignature
1300 _n_signature
= new_child
1308 redef fun visit_all
(v
: Visitor)
1310 if _n_doc
!= null then
1311 v
.enter_visit
(_n_doc
.as(not null))
1313 if _n_kwredef
!= null then
1314 v
.enter_visit
(_n_kwredef
.as(not null))
1316 v
.enter_visit
(_n_visibility
)
1317 v
.enter_visit
(_n_kwmeth
)
1318 v
.enter_visit
(_n_methid
)
1319 v
.enter_visit
(_n_signature
)
1322 redef class AInternMethPropdef
1323 private init empty_init
do end
1325 init init_ainternmethpropdef
(
1326 n_doc
: nullable ADoc,
1327 n_kwredef
: nullable TKwredef,
1328 n_visibility
: nullable AVisibility,
1329 n_kwmeth
: nullable TKwmeth,
1330 n_methid
: nullable AMethid,
1331 n_signature
: nullable ASignature
1336 if n_doc
!= null then
1339 _n_kwredef
= n_kwredef
1340 if n_kwredef
!= null then
1341 n_kwredef
.parent
= self
1343 _n_visibility
= n_visibility
.as(not null)
1344 n_visibility
.parent
= self
1345 _n_kwmeth
= n_kwmeth
.as(not null)
1346 n_kwmeth
.parent
= self
1347 _n_methid
= n_methid
.as(not null)
1348 n_methid
.parent
= self
1349 _n_signature
= n_signature
.as(not null)
1350 n_signature
.parent
= self
1353 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1355 if _n_doc
== old_child
then
1356 if new_child
!= null then
1357 new_child
.parent
= self
1358 assert new_child
isa ADoc
1365 if _n_kwredef
== old_child
then
1366 if new_child
!= null then
1367 new_child
.parent
= self
1368 assert new_child
isa TKwredef
1369 _n_kwredef
= new_child
1375 if _n_visibility
== old_child
then
1376 if new_child
!= null then
1377 new_child
.parent
= self
1378 assert new_child
isa AVisibility
1379 _n_visibility
= new_child
1385 if _n_kwmeth
== old_child
then
1386 if new_child
!= null then
1387 new_child
.parent
= self
1388 assert new_child
isa TKwmeth
1389 _n_kwmeth
= new_child
1395 if _n_methid
== old_child
then
1396 if new_child
!= null then
1397 new_child
.parent
= self
1398 assert new_child
isa AMethid
1399 _n_methid
= new_child
1405 if _n_signature
== old_child
then
1406 if new_child
!= null then
1407 new_child
.parent
= self
1408 assert new_child
isa ASignature
1409 _n_signature
= new_child
1417 redef fun visit_all
(v
: Visitor)
1419 if _n_doc
!= null then
1420 v
.enter_visit
(_n_doc
.as(not null))
1422 if _n_kwredef
!= null then
1423 v
.enter_visit
(_n_kwredef
.as(not null))
1425 v
.enter_visit
(_n_visibility
)
1426 v
.enter_visit
(_n_kwmeth
)
1427 v
.enter_visit
(_n_methid
)
1428 v
.enter_visit
(_n_signature
)
1431 redef class AExternMethPropdef
1432 private init empty_init
do end
1434 init init_aexternmethpropdef
(
1435 n_doc
: nullable ADoc,
1436 n_kwredef
: nullable TKwredef,
1437 n_visibility
: nullable AVisibility,
1438 n_kwmeth
: nullable TKwmeth,
1439 n_methid
: nullable AMethid,
1440 n_signature
: nullable ASignature,
1441 n_extern
: nullable TString,
1442 n_extern_calls
: nullable AExternCalls
1447 if n_doc
!= null then
1450 _n_kwredef
= n_kwredef
1451 if n_kwredef
!= null then
1452 n_kwredef
.parent
= self
1454 _n_visibility
= n_visibility
.as(not null)
1455 n_visibility
.parent
= self
1456 _n_kwmeth
= n_kwmeth
.as(not null)
1457 n_kwmeth
.parent
= self
1458 _n_methid
= n_methid
.as(not null)
1459 n_methid
.parent
= self
1460 _n_signature
= n_signature
.as(not null)
1461 n_signature
.parent
= self
1462 _n_extern
= n_extern
1463 if n_extern
!= null then
1464 n_extern
.parent
= self
1466 _n_extern_calls
= n_extern_calls
1467 if n_extern_calls
!= null then
1468 n_extern_calls
.parent
= self
1472 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1474 if _n_doc
== old_child
then
1475 if new_child
!= null then
1476 new_child
.parent
= self
1477 assert new_child
isa ADoc
1484 if _n_kwredef
== old_child
then
1485 if new_child
!= null then
1486 new_child
.parent
= self
1487 assert new_child
isa TKwredef
1488 _n_kwredef
= new_child
1494 if _n_visibility
== old_child
then
1495 if new_child
!= null then
1496 new_child
.parent
= self
1497 assert new_child
isa AVisibility
1498 _n_visibility
= new_child
1504 if _n_kwmeth
== old_child
then
1505 if new_child
!= null then
1506 new_child
.parent
= self
1507 assert new_child
isa TKwmeth
1508 _n_kwmeth
= new_child
1514 if _n_methid
== old_child
then
1515 if new_child
!= null then
1516 new_child
.parent
= self
1517 assert new_child
isa AMethid
1518 _n_methid
= new_child
1524 if _n_signature
== old_child
then
1525 if new_child
!= null then
1526 new_child
.parent
= self
1527 assert new_child
isa ASignature
1528 _n_signature
= new_child
1534 if _n_extern
== old_child
then
1535 if new_child
!= null then
1536 new_child
.parent
= self
1537 assert new_child
isa TString
1538 _n_extern
= new_child
1544 if _n_extern_calls
== old_child
then
1545 if new_child
!= null then
1546 new_child
.parent
= self
1547 assert new_child
isa AExternCalls
1548 _n_extern_calls
= new_child
1550 _n_extern_calls
= null
1556 redef fun visit_all
(v
: Visitor)
1558 if _n_doc
!= null then
1559 v
.enter_visit
(_n_doc
.as(not null))
1561 if _n_kwredef
!= null then
1562 v
.enter_visit
(_n_kwredef
.as(not null))
1564 v
.enter_visit
(_n_visibility
)
1565 v
.enter_visit
(_n_kwmeth
)
1566 v
.enter_visit
(_n_methid
)
1567 v
.enter_visit
(_n_signature
)
1568 if _n_extern
!= null then
1569 v
.enter_visit
(_n_extern
.as(not null))
1571 if _n_extern_calls
!= null then
1572 v
.enter_visit
(_n_extern_calls
.as(not null))
1576 redef class AConcreteMethPropdef
1577 private init empty_init
do end
1579 init init_aconcretemethpropdef
(
1580 n_doc
: nullable ADoc,
1581 n_kwredef
: nullable TKwredef,
1582 n_visibility
: nullable AVisibility,
1583 n_kwmeth
: nullable TKwmeth,
1584 n_methid
: nullable AMethid,
1585 n_signature
: nullable ASignature,
1586 n_block
: nullable AExpr
1591 if n_doc
!= null then
1594 _n_kwredef
= n_kwredef
1595 if n_kwredef
!= null then
1596 n_kwredef
.parent
= self
1598 _n_visibility
= n_visibility
.as(not null)
1599 n_visibility
.parent
= self
1600 _n_kwmeth
= n_kwmeth
.as(not null)
1601 n_kwmeth
.parent
= self
1602 _n_methid
= n_methid
.as(not null)
1603 n_methid
.parent
= self
1604 _n_signature
= n_signature
.as(not null)
1605 n_signature
.parent
= self
1607 if n_block
!= null then
1608 n_block
.parent
= self
1612 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1614 if _n_doc
== old_child
then
1615 if new_child
!= null then
1616 new_child
.parent
= self
1617 assert new_child
isa ADoc
1624 if _n_kwredef
== old_child
then
1625 if new_child
!= null then
1626 new_child
.parent
= self
1627 assert new_child
isa TKwredef
1628 _n_kwredef
= new_child
1634 if _n_visibility
== old_child
then
1635 if new_child
!= null then
1636 new_child
.parent
= self
1637 assert new_child
isa AVisibility
1638 _n_visibility
= new_child
1644 if _n_kwmeth
== old_child
then
1645 if new_child
!= null then
1646 new_child
.parent
= self
1647 assert new_child
isa TKwmeth
1648 _n_kwmeth
= new_child
1654 if _n_methid
== old_child
then
1655 if new_child
!= null then
1656 new_child
.parent
= self
1657 assert new_child
isa AMethid
1658 _n_methid
= new_child
1664 if _n_signature
== old_child
then
1665 if new_child
!= null then
1666 new_child
.parent
= self
1667 assert new_child
isa ASignature
1668 _n_signature
= new_child
1674 if _n_block
== old_child
then
1675 if new_child
!= null then
1676 new_child
.parent
= self
1677 assert new_child
isa AExpr
1678 _n_block
= new_child
1686 redef fun visit_all
(v
: Visitor)
1688 if _n_doc
!= null then
1689 v
.enter_visit
(_n_doc
.as(not null))
1691 if _n_kwredef
!= null then
1692 v
.enter_visit
(_n_kwredef
.as(not null))
1694 v
.enter_visit
(_n_visibility
)
1695 v
.enter_visit
(_n_kwmeth
)
1696 v
.enter_visit
(_n_methid
)
1697 v
.enter_visit
(_n_signature
)
1698 if _n_block
!= null then
1699 v
.enter_visit
(_n_block
.as(not null))
1703 redef class AConcreteInitPropdef
1704 private init empty_init
do end
1706 init init_aconcreteinitpropdef
(
1707 n_doc
: nullable ADoc,
1708 n_kwredef
: nullable TKwredef,
1709 n_visibility
: nullable AVisibility,
1710 n_kwinit
: nullable TKwinit,
1711 n_methid
: nullable AMethid,
1712 n_signature
: nullable ASignature,
1713 n_block
: nullable AExpr
1718 if n_doc
!= null then
1721 _n_kwredef
= n_kwredef
1722 if n_kwredef
!= null then
1723 n_kwredef
.parent
= self
1725 _n_visibility
= n_visibility
.as(not null)
1726 n_visibility
.parent
= self
1727 _n_kwinit
= n_kwinit
.as(not null)
1728 n_kwinit
.parent
= self
1729 _n_methid
= n_methid
1730 if n_methid
!= null then
1731 n_methid
.parent
= self
1733 _n_signature
= n_signature
.as(not null)
1734 n_signature
.parent
= self
1736 if n_block
!= null then
1737 n_block
.parent
= self
1741 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1743 if _n_doc
== old_child
then
1744 if new_child
!= null then
1745 new_child
.parent
= self
1746 assert new_child
isa ADoc
1753 if _n_kwredef
== old_child
then
1754 if new_child
!= null then
1755 new_child
.parent
= self
1756 assert new_child
isa TKwredef
1757 _n_kwredef
= new_child
1763 if _n_visibility
== old_child
then
1764 if new_child
!= null then
1765 new_child
.parent
= self
1766 assert new_child
isa AVisibility
1767 _n_visibility
= new_child
1773 if _n_kwinit
== old_child
then
1774 if new_child
!= null then
1775 new_child
.parent
= self
1776 assert new_child
isa TKwinit
1777 _n_kwinit
= new_child
1783 if _n_methid
== old_child
then
1784 if new_child
!= null then
1785 new_child
.parent
= self
1786 assert new_child
isa AMethid
1787 _n_methid
= new_child
1793 if _n_signature
== old_child
then
1794 if new_child
!= null then
1795 new_child
.parent
= self
1796 assert new_child
isa ASignature
1797 _n_signature
= new_child
1803 if _n_block
== old_child
then
1804 if new_child
!= null then
1805 new_child
.parent
= self
1806 assert new_child
isa AExpr
1807 _n_block
= new_child
1815 redef fun visit_all
(v
: Visitor)
1817 if _n_doc
!= null then
1818 v
.enter_visit
(_n_doc
.as(not null))
1820 if _n_kwredef
!= null then
1821 v
.enter_visit
(_n_kwredef
.as(not null))
1823 v
.enter_visit
(_n_visibility
)
1824 v
.enter_visit
(_n_kwinit
)
1825 if _n_methid
!= null then
1826 v
.enter_visit
(_n_methid
.as(not null))
1828 v
.enter_visit
(_n_signature
)
1829 if _n_block
!= null then
1830 v
.enter_visit
(_n_block
.as(not null))
1834 redef class AMainMethPropdef
1835 private init empty_init
do end
1837 init init_amainmethpropdef
(
1838 n_kwredef
: nullable TKwredef,
1839 n_block
: nullable AExpr
1843 _n_kwredef
= n_kwredef
1844 if n_kwredef
!= null then
1845 n_kwredef
.parent
= self
1848 if n_block
!= null then
1849 n_block
.parent
= self
1853 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1855 if _n_kwredef
== old_child
then
1856 if new_child
!= null then
1857 new_child
.parent
= self
1858 assert new_child
isa TKwredef
1859 _n_kwredef
= new_child
1865 if _n_block
== old_child
then
1866 if new_child
!= null then
1867 new_child
.parent
= self
1868 assert new_child
isa AExpr
1869 _n_block
= new_child
1877 redef fun visit_all
(v
: Visitor)
1879 if _n_kwredef
!= null then
1880 v
.enter_visit
(_n_kwredef
.as(not null))
1882 if _n_block
!= null then
1883 v
.enter_visit
(_n_block
.as(not null))
1887 redef class ATypePropdef
1888 private init empty_init
do end
1890 init init_atypepropdef
(
1891 n_doc
: nullable ADoc,
1892 n_kwredef
: nullable TKwredef,
1893 n_visibility
: nullable AVisibility,
1894 n_kwtype
: nullable TKwtype,
1895 n_id
: nullable TClassid,
1896 n_type
: nullable AType
1901 if n_doc
!= null then
1904 _n_kwredef
= n_kwredef
1905 if n_kwredef
!= null then
1906 n_kwredef
.parent
= self
1908 _n_visibility
= n_visibility
.as(not null)
1909 n_visibility
.parent
= self
1910 _n_kwtype
= n_kwtype
.as(not null)
1911 n_kwtype
.parent
= self
1912 _n_id
= n_id
.as(not null)
1914 _n_type
= n_type
.as(not null)
1915 n_type
.parent
= self
1918 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1920 if _n_doc
== old_child
then
1921 if new_child
!= null then
1922 new_child
.parent
= self
1923 assert new_child
isa ADoc
1930 if _n_kwredef
== old_child
then
1931 if new_child
!= null then
1932 new_child
.parent
= self
1933 assert new_child
isa TKwredef
1934 _n_kwredef
= new_child
1940 if _n_visibility
== old_child
then
1941 if new_child
!= null then
1942 new_child
.parent
= self
1943 assert new_child
isa AVisibility
1944 _n_visibility
= new_child
1950 if _n_kwtype
== old_child
then
1951 if new_child
!= null then
1952 new_child
.parent
= self
1953 assert new_child
isa TKwtype
1954 _n_kwtype
= new_child
1960 if _n_id
== old_child
then
1961 if new_child
!= null then
1962 new_child
.parent
= self
1963 assert new_child
isa TClassid
1970 if _n_type
== old_child
then
1971 if new_child
!= null then
1972 new_child
.parent
= self
1973 assert new_child
isa AType
1982 redef fun visit_all
(v
: Visitor)
1984 if _n_doc
!= null then
1985 v
.enter_visit
(_n_doc
.as(not null))
1987 if _n_kwredef
!= null then
1988 v
.enter_visit
(_n_kwredef
.as(not null))
1990 v
.enter_visit
(_n_visibility
)
1991 v
.enter_visit
(_n_kwtype
)
1992 v
.enter_visit
(_n_id
)
1993 v
.enter_visit
(_n_type
)
1996 redef class AReadAble
1997 private init empty_init
do end
1999 init init_areadable
(
2000 n_kwredef
: nullable TKwredef,
2001 n_kwreadable
: nullable TKwreadable
2005 _n_kwredef
= n_kwredef
2006 if n_kwredef
!= null then
2007 n_kwredef
.parent
= self
2009 _n_kwreadable
= n_kwreadable
.as(not null)
2010 n_kwreadable
.parent
= self
2013 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2015 if _n_kwredef
== old_child
then
2016 if new_child
!= null then
2017 new_child
.parent
= self
2018 assert new_child
isa TKwredef
2019 _n_kwredef
= new_child
2025 if _n_kwreadable
== old_child
then
2026 if new_child
!= null then
2027 new_child
.parent
= self
2028 assert new_child
isa TKwreadable
2029 _n_kwreadable
= new_child
2037 redef fun visit_all
(v
: Visitor)
2039 if _n_kwredef
!= null then
2040 v
.enter_visit
(_n_kwredef
.as(not null))
2042 v
.enter_visit
(_n_kwreadable
)
2045 redef class AWriteAble
2046 private init empty_init
do end
2048 init init_awriteable
(
2049 n_kwredef
: nullable TKwredef,
2050 n_visibility
: nullable AVisibility,
2051 n_kwwritable
: nullable TKwwritable
2055 _n_kwredef
= n_kwredef
2056 if n_kwredef
!= null then
2057 n_kwredef
.parent
= self
2059 _n_visibility
= n_visibility
2060 if n_visibility
!= null then
2061 n_visibility
.parent
= self
2063 _n_kwwritable
= n_kwwritable
.as(not null)
2064 n_kwwritable
.parent
= self
2067 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2069 if _n_kwredef
== old_child
then
2070 if new_child
!= null then
2071 new_child
.parent
= self
2072 assert new_child
isa TKwredef
2073 _n_kwredef
= new_child
2079 if _n_visibility
== old_child
then
2080 if new_child
!= null then
2081 new_child
.parent
= self
2082 assert new_child
isa AVisibility
2083 _n_visibility
= new_child
2085 _n_visibility
= null
2089 if _n_kwwritable
== old_child
then
2090 if new_child
!= null then
2091 new_child
.parent
= self
2092 assert new_child
isa TKwwritable
2093 _n_kwwritable
= new_child
2101 redef fun visit_all
(v
: Visitor)
2103 if _n_kwredef
!= null then
2104 v
.enter_visit
(_n_kwredef
.as(not null))
2106 if _n_visibility
!= null then
2107 v
.enter_visit
(_n_visibility
.as(not null))
2109 v
.enter_visit
(_n_kwwritable
)
2112 redef class AIdMethid
2113 private init empty_init
do end
2115 init init_aidmethid
(
2120 _n_id
= n_id
.as(not null)
2124 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2126 if _n_id
== old_child
then
2127 if new_child
!= null then
2128 new_child
.parent
= self
2129 assert new_child
isa TId
2138 redef fun visit_all
(v
: Visitor)
2140 v
.enter_visit
(_n_id
)
2143 redef class APlusMethid
2144 private init empty_init
do end
2146 init init_aplusmethid
(
2147 n_plus
: nullable TPlus
2151 _n_plus
= n_plus
.as(not null)
2152 n_plus
.parent
= self
2155 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2157 if _n_plus
== old_child
then
2158 if new_child
!= null then
2159 new_child
.parent
= self
2160 assert new_child
isa TPlus
2169 redef fun visit_all
(v
: Visitor)
2171 v
.enter_visit
(_n_plus
)
2174 redef class AMinusMethid
2175 private init empty_init
do end
2177 init init_aminusmethid
(
2178 n_minus
: nullable TMinus
2182 _n_minus
= n_minus
.as(not null)
2183 n_minus
.parent
= self
2186 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2188 if _n_minus
== old_child
then
2189 if new_child
!= null then
2190 new_child
.parent
= self
2191 assert new_child
isa TMinus
2192 _n_minus
= new_child
2200 redef fun visit_all
(v
: Visitor)
2202 v
.enter_visit
(_n_minus
)
2205 redef class AStarMethid
2206 private init empty_init
do end
2208 init init_astarmethid
(
2209 n_star
: nullable TStar
2213 _n_star
= n_star
.as(not null)
2214 n_star
.parent
= self
2217 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2219 if _n_star
== old_child
then
2220 if new_child
!= null then
2221 new_child
.parent
= self
2222 assert new_child
isa TStar
2231 redef fun visit_all
(v
: Visitor)
2233 v
.enter_visit
(_n_star
)
2236 redef class ASlashMethid
2237 private init empty_init
do end
2239 init init_aslashmethid
(
2240 n_slash
: nullable TSlash
2244 _n_slash
= n_slash
.as(not null)
2245 n_slash
.parent
= self
2248 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2250 if _n_slash
== old_child
then
2251 if new_child
!= null then
2252 new_child
.parent
= self
2253 assert new_child
isa TSlash
2254 _n_slash
= new_child
2262 redef fun visit_all
(v
: Visitor)
2264 v
.enter_visit
(_n_slash
)
2267 redef class APercentMethid
2268 private init empty_init
do end
2270 init init_apercentmethid
(
2271 n_percent
: nullable TPercent
2275 _n_percent
= n_percent
.as(not null)
2276 n_percent
.parent
= self
2279 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2281 if _n_percent
== old_child
then
2282 if new_child
!= null then
2283 new_child
.parent
= self
2284 assert new_child
isa TPercent
2285 _n_percent
= new_child
2293 redef fun visit_all
(v
: Visitor)
2295 v
.enter_visit
(_n_percent
)
2298 redef class AEqMethid
2299 private init empty_init
do end
2301 init init_aeqmethid
(
2306 _n_eq
= n_eq
.as(not null)
2310 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2312 if _n_eq
== old_child
then
2313 if new_child
!= null then
2314 new_child
.parent
= self
2315 assert new_child
isa TEq
2324 redef fun visit_all
(v
: Visitor)
2326 v
.enter_visit
(_n_eq
)
2329 redef class ANeMethid
2330 private init empty_init
do end
2332 init init_anemethid
(
2337 _n_ne
= n_ne
.as(not null)
2341 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2343 if _n_ne
== old_child
then
2344 if new_child
!= null then
2345 new_child
.parent
= self
2346 assert new_child
isa TNe
2355 redef fun visit_all
(v
: Visitor)
2357 v
.enter_visit
(_n_ne
)
2360 redef class ALeMethid
2361 private init empty_init
do end
2363 init init_alemethid
(
2368 _n_le
= n_le
.as(not null)
2372 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2374 if _n_le
== old_child
then
2375 if new_child
!= null then
2376 new_child
.parent
= self
2377 assert new_child
isa TLe
2386 redef fun visit_all
(v
: Visitor)
2388 v
.enter_visit
(_n_le
)
2391 redef class AGeMethid
2392 private init empty_init
do end
2394 init init_agemethid
(
2399 _n_ge
= n_ge
.as(not null)
2403 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2405 if _n_ge
== old_child
then
2406 if new_child
!= null then
2407 new_child
.parent
= self
2408 assert new_child
isa TGe
2417 redef fun visit_all
(v
: Visitor)
2419 v
.enter_visit
(_n_ge
)
2422 redef class ALtMethid
2423 private init empty_init
do end
2425 init init_altmethid
(
2430 _n_lt
= n_lt
.as(not null)
2434 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2436 if _n_lt
== old_child
then
2437 if new_child
!= null then
2438 new_child
.parent
= self
2439 assert new_child
isa TLt
2448 redef fun visit_all
(v
: Visitor)
2450 v
.enter_visit
(_n_lt
)
2453 redef class AGtMethid
2454 private init empty_init
do end
2456 init init_agtmethid
(
2461 _n_gt
= n_gt
.as(not null)
2465 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2467 if _n_gt
== old_child
then
2468 if new_child
!= null then
2469 new_child
.parent
= self
2470 assert new_child
isa TGt
2479 redef fun visit_all
(v
: Visitor)
2481 v
.enter_visit
(_n_gt
)
2484 redef class ALlMethid
2485 private init empty_init
do end
2487 init init_allmethid
(
2492 _n_ll
= n_ll
.as(not null)
2496 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2498 if _n_ll
== old_child
then
2499 if new_child
!= null then
2500 new_child
.parent
= self
2501 assert new_child
isa TLl
2510 redef fun visit_all
(v
: Visitor)
2512 v
.enter_visit
(_n_ll
)
2515 redef class AGgMethid
2516 private init empty_init
do end
2518 init init_aggmethid
(
2523 _n_gg
= n_gg
.as(not null)
2527 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2529 if _n_gg
== old_child
then
2530 if new_child
!= null then
2531 new_child
.parent
= self
2532 assert new_child
isa TGg
2541 redef fun visit_all
(v
: Visitor)
2543 v
.enter_visit
(_n_gg
)
2546 redef class ABraMethid
2547 private init empty_init
do end
2549 init init_abramethid
(
2550 n_obra
: nullable TObra,
2551 n_cbra
: nullable TCbra
2555 _n_obra
= n_obra
.as(not null)
2556 n_obra
.parent
= self
2557 _n_cbra
= n_cbra
.as(not null)
2558 n_cbra
.parent
= self
2561 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2563 if _n_obra
== old_child
then
2564 if new_child
!= null then
2565 new_child
.parent
= self
2566 assert new_child
isa TObra
2573 if _n_cbra
== old_child
then
2574 if new_child
!= null then
2575 new_child
.parent
= self
2576 assert new_child
isa TCbra
2585 redef fun visit_all
(v
: Visitor)
2587 v
.enter_visit
(_n_obra
)
2588 v
.enter_visit
(_n_cbra
)
2591 redef class AStarshipMethid
2592 private init empty_init
do end
2594 init init_astarshipmethid
(
2595 n_starship
: nullable TStarship
2599 _n_starship
= n_starship
.as(not null)
2600 n_starship
.parent
= self
2603 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2605 if _n_starship
== old_child
then
2606 if new_child
!= null then
2607 new_child
.parent
= self
2608 assert new_child
isa TStarship
2609 _n_starship
= new_child
2617 redef fun visit_all
(v
: Visitor)
2619 v
.enter_visit
(_n_starship
)
2622 redef class AAssignMethid
2623 private init empty_init
do end
2625 init init_aassignmethid
(
2627 n_assign
: nullable TAssign
2631 _n_id
= n_id
.as(not null)
2633 _n_assign
= n_assign
.as(not null)
2634 n_assign
.parent
= self
2637 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2639 if _n_id
== old_child
then
2640 if new_child
!= null then
2641 new_child
.parent
= self
2642 assert new_child
isa TId
2649 if _n_assign
== old_child
then
2650 if new_child
!= null then
2651 new_child
.parent
= self
2652 assert new_child
isa TAssign
2653 _n_assign
= new_child
2661 redef fun visit_all
(v
: Visitor)
2663 v
.enter_visit
(_n_id
)
2664 v
.enter_visit
(_n_assign
)
2667 redef class ABraassignMethid
2668 private init empty_init
do end
2670 init init_abraassignmethid
(
2671 n_obra
: nullable TObra,
2672 n_cbra
: nullable TCbra,
2673 n_assign
: nullable TAssign
2677 _n_obra
= n_obra
.as(not null)
2678 n_obra
.parent
= self
2679 _n_cbra
= n_cbra
.as(not null)
2680 n_cbra
.parent
= self
2681 _n_assign
= n_assign
.as(not null)
2682 n_assign
.parent
= self
2685 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2687 if _n_obra
== old_child
then
2688 if new_child
!= null then
2689 new_child
.parent
= self
2690 assert new_child
isa TObra
2697 if _n_cbra
== old_child
then
2698 if new_child
!= null then
2699 new_child
.parent
= self
2700 assert new_child
isa TCbra
2707 if _n_assign
== old_child
then
2708 if new_child
!= null then
2709 new_child
.parent
= self
2710 assert new_child
isa TAssign
2711 _n_assign
= new_child
2719 redef fun visit_all
(v
: Visitor)
2721 v
.enter_visit
(_n_obra
)
2722 v
.enter_visit
(_n_cbra
)
2723 v
.enter_visit
(_n_assign
)
2726 redef class ASignature
2727 private init empty_init
do end
2729 init init_asignature
(
2730 n_params
: Collection[Object], # Should be Collection[AParam]
2731 n_type
: nullable AType,
2732 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2736 for n
in n_params
do
2742 if n_type
!= null then
2743 n_type
.parent
= self
2745 for n
in n_closure_decls
do
2746 assert n
isa AClosureDecl
2747 _n_closure_decls
.add
(n
)
2752 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2754 for i
in [0.._n_params
.length
[ do
2755 if _n_params
[i
] == old_child
then
2756 if new_child
!= null then
2757 assert new_child
isa AParam
2758 _n_params
[i
] = new_child
2759 new_child
.parent
= self
2761 _n_params
.remove_at
(i
)
2766 if _n_type
== old_child
then
2767 if new_child
!= null then
2768 new_child
.parent
= self
2769 assert new_child
isa AType
2776 for i
in [0.._n_closure_decls
.length
[ do
2777 if _n_closure_decls
[i
] == old_child
then
2778 if new_child
!= null then
2779 assert new_child
isa AClosureDecl
2780 _n_closure_decls
[i
] = new_child
2781 new_child
.parent
= self
2783 _n_closure_decls
.remove_at
(i
)
2790 redef fun visit_all
(v
: Visitor)
2792 for n
in _n_params
do
2795 if _n_type
!= null then
2796 v
.enter_visit
(_n_type
.as(not null))
2798 for n
in _n_closure_decls
do
2804 private init empty_init
do end
2808 n_type
: nullable AType,
2809 n_dotdotdot
: nullable TDotdotdot
2813 _n_id
= n_id
.as(not null)
2816 if n_type
!= null then
2817 n_type
.parent
= self
2819 _n_dotdotdot
= n_dotdotdot
2820 if n_dotdotdot
!= null then
2821 n_dotdotdot
.parent
= self
2825 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2827 if _n_id
== old_child
then
2828 if new_child
!= null then
2829 new_child
.parent
= self
2830 assert new_child
isa TId
2837 if _n_type
== old_child
then
2838 if new_child
!= null then
2839 new_child
.parent
= self
2840 assert new_child
isa AType
2847 if _n_dotdotdot
== old_child
then
2848 if new_child
!= null then
2849 new_child
.parent
= self
2850 assert new_child
isa TDotdotdot
2851 _n_dotdotdot
= new_child
2859 redef fun visit_all
(v
: Visitor)
2861 v
.enter_visit
(_n_id
)
2862 if _n_type
!= null then
2863 v
.enter_visit
(_n_type
.as(not null))
2865 if _n_dotdotdot
!= null then
2866 v
.enter_visit
(_n_dotdotdot
.as(not null))
2870 redef class AClosureDecl
2871 private init empty_init
do end
2873 init init_aclosuredecl
(
2874 n_kwbreak
: nullable TKwbreak,
2875 n_bang
: nullable TBang,
2877 n_signature
: nullable ASignature,
2878 n_expr
: nullable AExpr
2882 _n_kwbreak
= n_kwbreak
2883 if n_kwbreak
!= null then
2884 n_kwbreak
.parent
= self
2886 _n_bang
= n_bang
.as(not null)
2887 n_bang
.parent
= self
2888 _n_id
= n_id
.as(not null)
2890 _n_signature
= n_signature
.as(not null)
2891 n_signature
.parent
= self
2893 if n_expr
!= null then
2894 n_expr
.parent
= self
2898 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2900 if _n_kwbreak
== old_child
then
2901 if new_child
!= null then
2902 new_child
.parent
= self
2903 assert new_child
isa TKwbreak
2904 _n_kwbreak
= new_child
2910 if _n_bang
== old_child
then
2911 if new_child
!= null then
2912 new_child
.parent
= self
2913 assert new_child
isa TBang
2920 if _n_id
== old_child
then
2921 if new_child
!= null then
2922 new_child
.parent
= self
2923 assert new_child
isa TId
2930 if _n_signature
== old_child
then
2931 if new_child
!= null then
2932 new_child
.parent
= self
2933 assert new_child
isa ASignature
2934 _n_signature
= new_child
2940 if _n_expr
== old_child
then
2941 if new_child
!= null then
2942 new_child
.parent
= self
2943 assert new_child
isa AExpr
2952 redef fun visit_all
(v
: Visitor)
2954 if _n_kwbreak
!= null then
2955 v
.enter_visit
(_n_kwbreak
.as(not null))
2957 v
.enter_visit
(_n_bang
)
2958 v
.enter_visit
(_n_id
)
2959 v
.enter_visit
(_n_signature
)
2960 if _n_expr
!= null then
2961 v
.enter_visit
(_n_expr
.as(not null))
2966 private init empty_init
do end
2969 n_kwnullable
: nullable TKwnullable,
2970 n_id
: nullable TClassid,
2971 n_types
: Collection[Object] # Should be Collection[AType]
2975 _n_kwnullable
= n_kwnullable
2976 if n_kwnullable
!= null then
2977 n_kwnullable
.parent
= self
2979 _n_id
= n_id
.as(not null)
2988 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2990 if _n_kwnullable
== old_child
then
2991 if new_child
!= null then
2992 new_child
.parent
= self
2993 assert new_child
isa TKwnullable
2994 _n_kwnullable
= new_child
2996 _n_kwnullable
= null
3000 if _n_id
== old_child
then
3001 if new_child
!= null then
3002 new_child
.parent
= self
3003 assert new_child
isa TClassid
3010 for i
in [0.._n_types
.length
[ do
3011 if _n_types
[i
] == old_child
then
3012 if new_child
!= null then
3013 assert new_child
isa AType
3014 _n_types
[i
] = new_child
3015 new_child
.parent
= self
3017 _n_types
.remove_at
(i
)
3024 redef fun visit_all
(v
: Visitor)
3026 if _n_kwnullable
!= null then
3027 v
.enter_visit
(_n_kwnullable
.as(not null))
3029 v
.enter_visit
(_n_id
)
3030 for n
in _n_types
do
3036 private init empty_init
do end
3039 n_kwlabel
: nullable TKwlabel,
3044 _n_kwlabel
= n_kwlabel
.as(not null)
3045 n_kwlabel
.parent
= self
3046 _n_id
= n_id
.as(not null)
3050 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3052 if _n_kwlabel
== old_child
then
3053 if new_child
!= null then
3054 new_child
.parent
= self
3055 assert new_child
isa TKwlabel
3056 _n_kwlabel
= new_child
3062 if _n_id
== old_child
then
3063 if new_child
!= null then
3064 new_child
.parent
= self
3065 assert new_child
isa TId
3074 redef fun visit_all
(v
: Visitor)
3076 v
.enter_visit
(_n_kwlabel
)
3077 v
.enter_visit
(_n_id
)
3080 redef class ABlockExpr
3081 private init empty_init
do end
3083 init init_ablockexpr
(
3084 n_expr
: Collection[Object] # Should be Collection[AExpr]
3095 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3097 for i
in [0.._n_expr
.length
[ do
3098 if _n_expr
[i
] == old_child
then
3099 if new_child
!= null then
3100 assert new_child
isa AExpr
3101 _n_expr
[i
] = new_child
3102 new_child
.parent
= self
3104 _n_expr
.remove_at
(i
)
3111 redef fun visit_all
(v
: Visitor)
3118 redef class AVardeclExpr
3119 private init empty_init
do end
3121 init init_avardeclexpr
(
3122 n_kwvar
: nullable TKwvar,
3124 n_type
: nullable AType,
3125 n_assign
: nullable TAssign,
3126 n_expr
: nullable AExpr
3130 _n_kwvar
= n_kwvar
.as(not null)
3131 n_kwvar
.parent
= self
3132 _n_id
= n_id
.as(not null)
3135 if n_type
!= null then
3136 n_type
.parent
= self
3138 _n_assign
= n_assign
3139 if n_assign
!= null then
3140 n_assign
.parent
= self
3143 if n_expr
!= null then
3144 n_expr
.parent
= self
3148 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3150 if _n_kwvar
== old_child
then
3151 if new_child
!= null then
3152 new_child
.parent
= self
3153 assert new_child
isa TKwvar
3154 _n_kwvar
= new_child
3160 if _n_id
== old_child
then
3161 if new_child
!= null then
3162 new_child
.parent
= self
3163 assert new_child
isa TId
3170 if _n_type
== old_child
then
3171 if new_child
!= null then
3172 new_child
.parent
= self
3173 assert new_child
isa AType
3180 if _n_assign
== old_child
then
3181 if new_child
!= null then
3182 new_child
.parent
= self
3183 assert new_child
isa TAssign
3184 _n_assign
= new_child
3190 if _n_expr
== old_child
then
3191 if new_child
!= null then
3192 new_child
.parent
= self
3193 assert new_child
isa AExpr
3202 redef fun visit_all
(v
: Visitor)
3204 v
.enter_visit
(_n_kwvar
)
3205 v
.enter_visit
(_n_id
)
3206 if _n_type
!= null then
3207 v
.enter_visit
(_n_type
.as(not null))
3209 if _n_assign
!= null then
3210 v
.enter_visit
(_n_assign
.as(not null))
3212 if _n_expr
!= null then
3213 v
.enter_visit
(_n_expr
.as(not null))
3217 redef class AReturnExpr
3218 private init empty_init
do end
3220 init init_areturnexpr
(
3221 n_kwreturn
: nullable TKwreturn,
3222 n_expr
: nullable AExpr
3226 _n_kwreturn
= n_kwreturn
3227 if n_kwreturn
!= null then
3228 n_kwreturn
.parent
= self
3231 if n_expr
!= null then
3232 n_expr
.parent
= self
3236 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3238 if _n_kwreturn
== old_child
then
3239 if new_child
!= null then
3240 new_child
.parent
= self
3241 assert new_child
isa TKwreturn
3242 _n_kwreturn
= new_child
3248 if _n_expr
== old_child
then
3249 if new_child
!= null then
3250 new_child
.parent
= self
3251 assert new_child
isa AExpr
3260 redef fun visit_all
(v
: Visitor)
3262 if _n_kwreturn
!= null then
3263 v
.enter_visit
(_n_kwreturn
.as(not null))
3265 if _n_expr
!= null then
3266 v
.enter_visit
(_n_expr
.as(not null))
3270 redef class ABreakExpr
3271 private init empty_init
do end
3273 init init_abreakexpr
(
3274 n_kwbreak
: nullable TKwbreak,
3275 n_label
: nullable ALabel,
3276 n_expr
: nullable AExpr
3280 _n_kwbreak
= n_kwbreak
.as(not null)
3281 n_kwbreak
.parent
= self
3283 if n_label
!= null then
3284 n_label
.parent
= self
3287 if n_expr
!= null then
3288 n_expr
.parent
= self
3292 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3294 if _n_kwbreak
== old_child
then
3295 if new_child
!= null then
3296 new_child
.parent
= self
3297 assert new_child
isa TKwbreak
3298 _n_kwbreak
= new_child
3304 if _n_label
== old_child
then
3305 if new_child
!= null then
3306 new_child
.parent
= self
3307 assert new_child
isa ALabel
3308 _n_label
= new_child
3314 if _n_expr
== old_child
then
3315 if new_child
!= null then
3316 new_child
.parent
= self
3317 assert new_child
isa AExpr
3326 redef fun visit_all
(v
: Visitor)
3328 v
.enter_visit
(_n_kwbreak
)
3329 if _n_label
!= null then
3330 v
.enter_visit
(_n_label
.as(not null))
3332 if _n_expr
!= null then
3333 v
.enter_visit
(_n_expr
.as(not null))
3337 redef class AAbortExpr
3338 private init empty_init
do end
3340 init init_aabortexpr
(
3341 n_kwabort
: nullable TKwabort
3345 _n_kwabort
= n_kwabort
.as(not null)
3346 n_kwabort
.parent
= self
3349 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3351 if _n_kwabort
== old_child
then
3352 if new_child
!= null then
3353 new_child
.parent
= self
3354 assert new_child
isa TKwabort
3355 _n_kwabort
= new_child
3363 redef fun visit_all
(v
: Visitor)
3365 v
.enter_visit
(_n_kwabort
)
3368 redef class AContinueExpr
3369 private init empty_init
do end
3371 init init_acontinueexpr
(
3372 n_kwcontinue
: nullable TKwcontinue,
3373 n_label
: nullable ALabel,
3374 n_expr
: nullable AExpr
3378 _n_kwcontinue
= n_kwcontinue
3379 if n_kwcontinue
!= null then
3380 n_kwcontinue
.parent
= self
3383 if n_label
!= null then
3384 n_label
.parent
= self
3387 if n_expr
!= null then
3388 n_expr
.parent
= self
3392 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3394 if _n_kwcontinue
== old_child
then
3395 if new_child
!= null then
3396 new_child
.parent
= self
3397 assert new_child
isa TKwcontinue
3398 _n_kwcontinue
= new_child
3400 _n_kwcontinue
= null
3404 if _n_label
== old_child
then
3405 if new_child
!= null then
3406 new_child
.parent
= self
3407 assert new_child
isa ALabel
3408 _n_label
= new_child
3414 if _n_expr
== old_child
then
3415 if new_child
!= null then
3416 new_child
.parent
= self
3417 assert new_child
isa AExpr
3426 redef fun visit_all
(v
: Visitor)
3428 if _n_kwcontinue
!= null then
3429 v
.enter_visit
(_n_kwcontinue
.as(not null))
3431 if _n_label
!= null then
3432 v
.enter_visit
(_n_label
.as(not null))
3434 if _n_expr
!= null then
3435 v
.enter_visit
(_n_expr
.as(not null))
3440 private init empty_init
do end
3443 n_kwdo
: nullable TKwdo,
3444 n_block
: nullable AExpr,
3445 n_label
: nullable ALabel
3449 _n_kwdo
= n_kwdo
.as(not null)
3450 n_kwdo
.parent
= self
3452 if n_block
!= null then
3453 n_block
.parent
= self
3456 if n_label
!= null then
3457 n_label
.parent
= self
3461 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3463 if _n_kwdo
== old_child
then
3464 if new_child
!= null then
3465 new_child
.parent
= self
3466 assert new_child
isa TKwdo
3473 if _n_block
== old_child
then
3474 if new_child
!= null then
3475 new_child
.parent
= self
3476 assert new_child
isa AExpr
3477 _n_block
= new_child
3483 if _n_label
== old_child
then
3484 if new_child
!= null then
3485 new_child
.parent
= self
3486 assert new_child
isa ALabel
3487 _n_label
= new_child
3495 redef fun visit_all
(v
: Visitor)
3497 v
.enter_visit
(_n_kwdo
)
3498 if _n_block
!= null then
3499 v
.enter_visit
(_n_block
.as(not null))
3501 if _n_label
!= null then
3502 v
.enter_visit
(_n_label
.as(not null))
3507 private init empty_init
do end
3510 n_kwif
: nullable TKwif,
3511 n_expr
: nullable AExpr,
3512 n_then
: nullable AExpr,
3513 n_else
: nullable AExpr
3517 _n_kwif
= n_kwif
.as(not null)
3518 n_kwif
.parent
= self
3519 _n_expr
= n_expr
.as(not null)
3520 n_expr
.parent
= self
3522 if n_then
!= null then
3523 n_then
.parent
= self
3526 if n_else
!= null then
3527 n_else
.parent
= self
3531 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3533 if _n_kwif
== old_child
then
3534 if new_child
!= null then
3535 new_child
.parent
= self
3536 assert new_child
isa TKwif
3543 if _n_expr
== old_child
then
3544 if new_child
!= null then
3545 new_child
.parent
= self
3546 assert new_child
isa AExpr
3553 if _n_then
== old_child
then
3554 if new_child
!= null then
3555 new_child
.parent
= self
3556 assert new_child
isa AExpr
3563 if _n_else
== old_child
then
3564 if new_child
!= null then
3565 new_child
.parent
= self
3566 assert new_child
isa AExpr
3575 redef fun visit_all
(v
: Visitor)
3577 v
.enter_visit
(_n_kwif
)
3578 v
.enter_visit
(_n_expr
)
3579 if _n_then
!= null then
3580 v
.enter_visit
(_n_then
.as(not null))
3582 if _n_else
!= null then
3583 v
.enter_visit
(_n_else
.as(not null))
3587 redef class AIfexprExpr
3588 private init empty_init
do end
3590 init init_aifexprexpr
(
3591 n_kwif
: nullable TKwif,
3592 n_expr
: nullable AExpr,
3593 n_kwthen
: nullable TKwthen,
3594 n_then
: nullable AExpr,
3595 n_kwelse
: nullable TKwelse,
3596 n_else
: nullable AExpr
3600 _n_kwif
= n_kwif
.as(not null)
3601 n_kwif
.parent
= self
3602 _n_expr
= n_expr
.as(not null)
3603 n_expr
.parent
= self
3604 _n_kwthen
= n_kwthen
.as(not null)
3605 n_kwthen
.parent
= self
3606 _n_then
= n_then
.as(not null)
3607 n_then
.parent
= self
3608 _n_kwelse
= n_kwelse
.as(not null)
3609 n_kwelse
.parent
= self
3610 _n_else
= n_else
.as(not null)
3611 n_else
.parent
= self
3614 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3616 if _n_kwif
== old_child
then
3617 if new_child
!= null then
3618 new_child
.parent
= self
3619 assert new_child
isa TKwif
3626 if _n_expr
== old_child
then
3627 if new_child
!= null then
3628 new_child
.parent
= self
3629 assert new_child
isa AExpr
3636 if _n_kwthen
== old_child
then
3637 if new_child
!= null then
3638 new_child
.parent
= self
3639 assert new_child
isa TKwthen
3640 _n_kwthen
= new_child
3646 if _n_then
== old_child
then
3647 if new_child
!= null then
3648 new_child
.parent
= self
3649 assert new_child
isa AExpr
3656 if _n_kwelse
== old_child
then
3657 if new_child
!= null then
3658 new_child
.parent
= self
3659 assert new_child
isa TKwelse
3660 _n_kwelse
= new_child
3666 if _n_else
== old_child
then
3667 if new_child
!= null then
3668 new_child
.parent
= self
3669 assert new_child
isa AExpr
3678 redef fun visit_all
(v
: Visitor)
3680 v
.enter_visit
(_n_kwif
)
3681 v
.enter_visit
(_n_expr
)
3682 v
.enter_visit
(_n_kwthen
)
3683 v
.enter_visit
(_n_then
)
3684 v
.enter_visit
(_n_kwelse
)
3685 v
.enter_visit
(_n_else
)
3688 redef class AWhileExpr
3689 private init empty_init
do end
3691 init init_awhileexpr
(
3692 n_kwwhile
: nullable TKwwhile,
3693 n_expr
: nullable AExpr,
3694 n_kwdo
: nullable TKwdo,
3695 n_block
: nullable AExpr,
3696 n_label
: nullable ALabel
3700 _n_kwwhile
= n_kwwhile
.as(not null)
3701 n_kwwhile
.parent
= self
3702 _n_expr
= n_expr
.as(not null)
3703 n_expr
.parent
= self
3704 _n_kwdo
= n_kwdo
.as(not null)
3705 n_kwdo
.parent
= self
3707 if n_block
!= null then
3708 n_block
.parent
= self
3711 if n_label
!= null then
3712 n_label
.parent
= self
3716 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3718 if _n_kwwhile
== old_child
then
3719 if new_child
!= null then
3720 new_child
.parent
= self
3721 assert new_child
isa TKwwhile
3722 _n_kwwhile
= new_child
3728 if _n_expr
== old_child
then
3729 if new_child
!= null then
3730 new_child
.parent
= self
3731 assert new_child
isa AExpr
3738 if _n_kwdo
== old_child
then
3739 if new_child
!= null then
3740 new_child
.parent
= self
3741 assert new_child
isa TKwdo
3748 if _n_block
== old_child
then
3749 if new_child
!= null then
3750 new_child
.parent
= self
3751 assert new_child
isa AExpr
3752 _n_block
= new_child
3758 if _n_label
== old_child
then
3759 if new_child
!= null then
3760 new_child
.parent
= self
3761 assert new_child
isa ALabel
3762 _n_label
= new_child
3770 redef fun visit_all
(v
: Visitor)
3772 v
.enter_visit
(_n_kwwhile
)
3773 v
.enter_visit
(_n_expr
)
3774 v
.enter_visit
(_n_kwdo
)
3775 if _n_block
!= null then
3776 v
.enter_visit
(_n_block
.as(not null))
3778 if _n_label
!= null then
3779 v
.enter_visit
(_n_label
.as(not null))
3783 redef class ALoopExpr
3784 private init empty_init
do end
3786 init init_aloopexpr
(
3787 n_kwloop
: nullable TKwloop,
3788 n_block
: nullable AExpr,
3789 n_label
: nullable ALabel
3793 _n_kwloop
= n_kwloop
.as(not null)
3794 n_kwloop
.parent
= self
3796 if n_block
!= null then
3797 n_block
.parent
= self
3800 if n_label
!= null then
3801 n_label
.parent
= self
3805 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3807 if _n_kwloop
== old_child
then
3808 if new_child
!= null then
3809 new_child
.parent
= self
3810 assert new_child
isa TKwloop
3811 _n_kwloop
= new_child
3817 if _n_block
== old_child
then
3818 if new_child
!= null then
3819 new_child
.parent
= self
3820 assert new_child
isa AExpr
3821 _n_block
= new_child
3827 if _n_label
== old_child
then
3828 if new_child
!= null then
3829 new_child
.parent
= self
3830 assert new_child
isa ALabel
3831 _n_label
= new_child
3839 redef fun visit_all
(v
: Visitor)
3841 v
.enter_visit
(_n_kwloop
)
3842 if _n_block
!= null then
3843 v
.enter_visit
(_n_block
.as(not null))
3845 if _n_label
!= null then
3846 v
.enter_visit
(_n_label
.as(not null))
3850 redef class AForExpr
3851 private init empty_init
do end
3853 init init_aforexpr
(
3854 n_kwfor
: nullable TKwfor,
3855 n_ids
: Collection[Object], # Should be Collection[TId]
3856 n_expr
: nullable AExpr,
3857 n_kwdo
: nullable TKwdo,
3858 n_block
: nullable AExpr,
3859 n_label
: nullable ALabel
3863 _n_kwfor
= n_kwfor
.as(not null)
3864 n_kwfor
.parent
= self
3870 _n_expr
= n_expr
.as(not null)
3871 n_expr
.parent
= self
3872 _n_kwdo
= n_kwdo
.as(not null)
3873 n_kwdo
.parent
= self
3875 if n_block
!= null then
3876 n_block
.parent
= self
3879 if n_label
!= null then
3880 n_label
.parent
= self
3884 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3886 if _n_kwfor
== old_child
then
3887 if new_child
!= null then
3888 new_child
.parent
= self
3889 assert new_child
isa TKwfor
3890 _n_kwfor
= new_child
3896 for i
in [0.._n_ids
.length
[ do
3897 if _n_ids
[i
] == old_child
then
3898 if new_child
!= null then
3899 assert new_child
isa TId
3900 _n_ids
[i
] = new_child
3901 new_child
.parent
= self
3908 if _n_expr
== old_child
then
3909 if new_child
!= null then
3910 new_child
.parent
= self
3911 assert new_child
isa AExpr
3918 if _n_kwdo
== old_child
then
3919 if new_child
!= null then
3920 new_child
.parent
= self
3921 assert new_child
isa TKwdo
3928 if _n_block
== old_child
then
3929 if new_child
!= null then
3930 new_child
.parent
= self
3931 assert new_child
isa AExpr
3932 _n_block
= new_child
3938 if _n_label
== old_child
then
3939 if new_child
!= null then
3940 new_child
.parent
= self
3941 assert new_child
isa ALabel
3942 _n_label
= new_child
3950 redef fun visit_all
(v
: Visitor)
3952 v
.enter_visit
(_n_kwfor
)
3956 v
.enter_visit
(_n_expr
)
3957 v
.enter_visit
(_n_kwdo
)
3958 if _n_block
!= null then
3959 v
.enter_visit
(_n_block
.as(not null))
3961 if _n_label
!= null then
3962 v
.enter_visit
(_n_label
.as(not null))
3966 redef class AAssertExpr
3967 private init empty_init
do end
3969 init init_aassertexpr
(
3970 n_kwassert
: nullable TKwassert,
3972 n_expr
: nullable AExpr,
3973 n_else
: nullable AExpr
3977 _n_kwassert
= n_kwassert
.as(not null)
3978 n_kwassert
.parent
= self
3980 if n_id
!= null then
3983 _n_expr
= n_expr
.as(not null)
3984 n_expr
.parent
= self
3986 if n_else
!= null then
3987 n_else
.parent
= self
3991 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3993 if _n_kwassert
== old_child
then
3994 if new_child
!= null then
3995 new_child
.parent
= self
3996 assert new_child
isa TKwassert
3997 _n_kwassert
= new_child
4003 if _n_id
== old_child
then
4004 if new_child
!= null then
4005 new_child
.parent
= self
4006 assert new_child
isa TId
4013 if _n_expr
== old_child
then
4014 if new_child
!= null then
4015 new_child
.parent
= self
4016 assert new_child
isa AExpr
4023 if _n_else
== old_child
then
4024 if new_child
!= null then
4025 new_child
.parent
= self
4026 assert new_child
isa AExpr
4035 redef fun visit_all
(v
: Visitor)
4037 v
.enter_visit
(_n_kwassert
)
4038 if _n_id
!= null then
4039 v
.enter_visit
(_n_id
.as(not null))
4041 v
.enter_visit
(_n_expr
)
4042 if _n_else
!= null then
4043 v
.enter_visit
(_n_else
.as(not null))
4047 redef class AOnceExpr
4048 private init empty_init
do end
4050 init init_aonceexpr
(
4051 n_kwonce
: nullable TKwonce,
4052 n_expr
: nullable AExpr
4056 _n_kwonce
= n_kwonce
.as(not null)
4057 n_kwonce
.parent
= self
4058 _n_expr
= n_expr
.as(not null)
4059 n_expr
.parent
= self
4062 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4064 if _n_kwonce
== old_child
then
4065 if new_child
!= null then
4066 new_child
.parent
= self
4067 assert new_child
isa TKwonce
4068 _n_kwonce
= new_child
4074 if _n_expr
== old_child
then
4075 if new_child
!= null then
4076 new_child
.parent
= self
4077 assert new_child
isa AExpr
4086 redef fun visit_all
(v
: Visitor)
4088 v
.enter_visit
(_n_kwonce
)
4089 v
.enter_visit
(_n_expr
)
4092 redef class ASendExpr
4093 private init empty_init
do end
4095 init init_asendexpr
(
4096 n_expr
: nullable AExpr
4100 _n_expr
= n_expr
.as(not null)
4101 n_expr
.parent
= self
4104 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4106 if _n_expr
== old_child
then
4107 if new_child
!= null then
4108 new_child
.parent
= self
4109 assert new_child
isa AExpr
4118 redef fun visit_all
(v
: Visitor)
4120 v
.enter_visit
(_n_expr
)
4123 redef class ABinopExpr
4124 private init empty_init
do end
4126 init init_abinopexpr
(
4127 n_expr
: nullable AExpr,
4128 n_expr2
: nullable AExpr
4132 _n_expr
= n_expr
.as(not null)
4133 n_expr
.parent
= self
4134 _n_expr2
= n_expr2
.as(not null)
4135 n_expr2
.parent
= self
4138 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4140 if _n_expr
== old_child
then
4141 if new_child
!= null then
4142 new_child
.parent
= self
4143 assert new_child
isa AExpr
4150 if _n_expr2
== old_child
then
4151 if new_child
!= null then
4152 new_child
.parent
= self
4153 assert new_child
isa AExpr
4154 _n_expr2
= new_child
4162 redef fun visit_all
(v
: Visitor)
4164 v
.enter_visit
(_n_expr
)
4165 v
.enter_visit
(_n_expr2
)
4169 private init empty_init
do end
4172 n_expr
: nullable AExpr,
4173 n_expr2
: nullable AExpr
4177 _n_expr
= n_expr
.as(not null)
4178 n_expr
.parent
= self
4179 _n_expr2
= n_expr2
.as(not null)
4180 n_expr2
.parent
= self
4183 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4185 if _n_expr
== old_child
then
4186 if new_child
!= null then
4187 new_child
.parent
= self
4188 assert new_child
isa AExpr
4195 if _n_expr2
== old_child
then
4196 if new_child
!= null then
4197 new_child
.parent
= self
4198 assert new_child
isa AExpr
4199 _n_expr2
= new_child
4207 redef fun visit_all
(v
: Visitor)
4209 v
.enter_visit
(_n_expr
)
4210 v
.enter_visit
(_n_expr2
)
4213 redef class AAndExpr
4214 private init empty_init
do end
4216 init init_aandexpr
(
4217 n_expr
: nullable AExpr,
4218 n_expr2
: nullable AExpr
4222 _n_expr
= n_expr
.as(not null)
4223 n_expr
.parent
= self
4224 _n_expr2
= n_expr2
.as(not null)
4225 n_expr2
.parent
= self
4228 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4230 if _n_expr
== old_child
then
4231 if new_child
!= null then
4232 new_child
.parent
= self
4233 assert new_child
isa AExpr
4240 if _n_expr2
== old_child
then
4241 if new_child
!= null then
4242 new_child
.parent
= self
4243 assert new_child
isa AExpr
4244 _n_expr2
= new_child
4252 redef fun visit_all
(v
: Visitor)
4254 v
.enter_visit
(_n_expr
)
4255 v
.enter_visit
(_n_expr2
)
4258 redef class AOrElseExpr
4259 private init empty_init
do end
4261 init init_aorelseexpr
(
4262 n_expr
: nullable AExpr,
4263 n_expr2
: nullable AExpr
4267 _n_expr
= n_expr
.as(not null)
4268 n_expr
.parent
= self
4269 _n_expr2
= n_expr2
.as(not null)
4270 n_expr2
.parent
= self
4273 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4275 if _n_expr
== old_child
then
4276 if new_child
!= null then
4277 new_child
.parent
= self
4278 assert new_child
isa AExpr
4285 if _n_expr2
== old_child
then
4286 if new_child
!= null then
4287 new_child
.parent
= self
4288 assert new_child
isa AExpr
4289 _n_expr2
= new_child
4297 redef fun visit_all
(v
: Visitor)
4299 v
.enter_visit
(_n_expr
)
4300 v
.enter_visit
(_n_expr2
)
4303 redef class ANotExpr
4304 private init empty_init
do end
4306 init init_anotexpr
(
4307 n_kwnot
: nullable TKwnot,
4308 n_expr
: nullable AExpr
4312 _n_kwnot
= n_kwnot
.as(not null)
4313 n_kwnot
.parent
= self
4314 _n_expr
= n_expr
.as(not null)
4315 n_expr
.parent
= self
4318 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4320 if _n_kwnot
== old_child
then
4321 if new_child
!= null then
4322 new_child
.parent
= self
4323 assert new_child
isa TKwnot
4324 _n_kwnot
= new_child
4330 if _n_expr
== old_child
then
4331 if new_child
!= null then
4332 new_child
.parent
= self
4333 assert new_child
isa AExpr
4342 redef fun visit_all
(v
: Visitor)
4344 v
.enter_visit
(_n_kwnot
)
4345 v
.enter_visit
(_n_expr
)
4349 private init empty_init
do end
4352 n_expr
: nullable AExpr,
4353 n_expr2
: nullable AExpr
4357 _n_expr
= n_expr
.as(not null)
4358 n_expr
.parent
= self
4359 _n_expr2
= n_expr2
.as(not null)
4360 n_expr2
.parent
= self
4363 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4365 if _n_expr
== old_child
then
4366 if new_child
!= null then
4367 new_child
.parent
= self
4368 assert new_child
isa AExpr
4375 if _n_expr2
== old_child
then
4376 if new_child
!= null then
4377 new_child
.parent
= self
4378 assert new_child
isa AExpr
4379 _n_expr2
= new_child
4387 redef fun visit_all
(v
: Visitor)
4389 v
.enter_visit
(_n_expr
)
4390 v
.enter_visit
(_n_expr2
)
4394 private init empty_init
do end
4397 n_expr
: nullable AExpr,
4398 n_expr2
: nullable AExpr
4402 _n_expr
= n_expr
.as(not null)
4403 n_expr
.parent
= self
4404 _n_expr2
= n_expr2
.as(not null)
4405 n_expr2
.parent
= self
4408 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4410 if _n_expr
== old_child
then
4411 if new_child
!= null then
4412 new_child
.parent
= self
4413 assert new_child
isa AExpr
4420 if _n_expr2
== old_child
then
4421 if new_child
!= null then
4422 new_child
.parent
= self
4423 assert new_child
isa AExpr
4424 _n_expr2
= new_child
4432 redef fun visit_all
(v
: Visitor)
4434 v
.enter_visit
(_n_expr
)
4435 v
.enter_visit
(_n_expr2
)
4439 private init empty_init
do end
4442 n_expr
: nullable AExpr,
4443 n_expr2
: nullable AExpr
4447 _n_expr
= n_expr
.as(not null)
4448 n_expr
.parent
= self
4449 _n_expr2
= n_expr2
.as(not null)
4450 n_expr2
.parent
= self
4453 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4455 if _n_expr
== old_child
then
4456 if new_child
!= null then
4457 new_child
.parent
= self
4458 assert new_child
isa AExpr
4465 if _n_expr2
== old_child
then
4466 if new_child
!= null then
4467 new_child
.parent
= self
4468 assert new_child
isa AExpr
4469 _n_expr2
= new_child
4477 redef fun visit_all
(v
: Visitor)
4479 v
.enter_visit
(_n_expr
)
4480 v
.enter_visit
(_n_expr2
)
4484 private init empty_init
do end
4487 n_expr
: nullable AExpr,
4488 n_expr2
: nullable AExpr
4492 _n_expr
= n_expr
.as(not null)
4493 n_expr
.parent
= self
4494 _n_expr2
= n_expr2
.as(not null)
4495 n_expr2
.parent
= self
4498 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4500 if _n_expr
== old_child
then
4501 if new_child
!= null then
4502 new_child
.parent
= self
4503 assert new_child
isa AExpr
4510 if _n_expr2
== old_child
then
4511 if new_child
!= null then
4512 new_child
.parent
= self
4513 assert new_child
isa AExpr
4514 _n_expr2
= new_child
4522 redef fun visit_all
(v
: Visitor)
4524 v
.enter_visit
(_n_expr
)
4525 v
.enter_visit
(_n_expr2
)
4529 private init empty_init
do end
4532 n_expr
: nullable AExpr,
4533 n_expr2
: nullable AExpr
4537 _n_expr
= n_expr
.as(not null)
4538 n_expr
.parent
= self
4539 _n_expr2
= n_expr2
.as(not null)
4540 n_expr2
.parent
= self
4543 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4545 if _n_expr
== old_child
then
4546 if new_child
!= null then
4547 new_child
.parent
= self
4548 assert new_child
isa AExpr
4555 if _n_expr2
== old_child
then
4556 if new_child
!= null then
4557 new_child
.parent
= self
4558 assert new_child
isa AExpr
4559 _n_expr2
= new_child
4567 redef fun visit_all
(v
: Visitor)
4569 v
.enter_visit
(_n_expr
)
4570 v
.enter_visit
(_n_expr2
)
4574 private init empty_init
do end
4577 n_expr
: nullable AExpr,
4578 n_expr2
: nullable AExpr
4582 _n_expr
= n_expr
.as(not null)
4583 n_expr
.parent
= self
4584 _n_expr2
= n_expr2
.as(not null)
4585 n_expr2
.parent
= self
4588 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4590 if _n_expr
== old_child
then
4591 if new_child
!= null then
4592 new_child
.parent
= self
4593 assert new_child
isa AExpr
4600 if _n_expr2
== old_child
then
4601 if new_child
!= null then
4602 new_child
.parent
= self
4603 assert new_child
isa AExpr
4604 _n_expr2
= new_child
4612 redef fun visit_all
(v
: Visitor)
4614 v
.enter_visit
(_n_expr
)
4615 v
.enter_visit
(_n_expr2
)
4619 private init empty_init
do end
4622 n_expr
: nullable AExpr,
4623 n_expr2
: nullable AExpr
4627 _n_expr
= n_expr
.as(not null)
4628 n_expr
.parent
= self
4629 _n_expr2
= n_expr2
.as(not null)
4630 n_expr2
.parent
= self
4633 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4635 if _n_expr
== old_child
then
4636 if new_child
!= null then
4637 new_child
.parent
= self
4638 assert new_child
isa AExpr
4645 if _n_expr2
== old_child
then
4646 if new_child
!= null then
4647 new_child
.parent
= self
4648 assert new_child
isa AExpr
4649 _n_expr2
= new_child
4657 redef fun visit_all
(v
: Visitor)
4659 v
.enter_visit
(_n_expr
)
4660 v
.enter_visit
(_n_expr2
)
4664 private init empty_init
do end
4667 n_expr
: nullable AExpr,
4668 n_expr2
: nullable AExpr
4672 _n_expr
= n_expr
.as(not null)
4673 n_expr
.parent
= self
4674 _n_expr2
= n_expr2
.as(not null)
4675 n_expr2
.parent
= self
4678 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4680 if _n_expr
== old_child
then
4681 if new_child
!= null then
4682 new_child
.parent
= self
4683 assert new_child
isa AExpr
4690 if _n_expr2
== old_child
then
4691 if new_child
!= null then
4692 new_child
.parent
= self
4693 assert new_child
isa AExpr
4694 _n_expr2
= new_child
4702 redef fun visit_all
(v
: Visitor)
4704 v
.enter_visit
(_n_expr
)
4705 v
.enter_visit
(_n_expr2
)
4709 private init empty_init
do end
4712 n_expr
: nullable AExpr,
4713 n_expr2
: nullable AExpr
4717 _n_expr
= n_expr
.as(not null)
4718 n_expr
.parent
= self
4719 _n_expr2
= n_expr2
.as(not null)
4720 n_expr2
.parent
= self
4723 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4725 if _n_expr
== old_child
then
4726 if new_child
!= null then
4727 new_child
.parent
= self
4728 assert new_child
isa AExpr
4735 if _n_expr2
== old_child
then
4736 if new_child
!= null then
4737 new_child
.parent
= self
4738 assert new_child
isa AExpr
4739 _n_expr2
= new_child
4747 redef fun visit_all
(v
: Visitor)
4749 v
.enter_visit
(_n_expr
)
4750 v
.enter_visit
(_n_expr2
)
4753 redef class AIsaExpr
4754 private init empty_init
do end
4756 init init_aisaexpr
(
4757 n_expr
: nullable AExpr,
4758 n_type
: nullable AType
4762 _n_expr
= n_expr
.as(not null)
4763 n_expr
.parent
= self
4764 _n_type
= n_type
.as(not null)
4765 n_type
.parent
= self
4768 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4770 if _n_expr
== old_child
then
4771 if new_child
!= null then
4772 new_child
.parent
= self
4773 assert new_child
isa AExpr
4780 if _n_type
== old_child
then
4781 if new_child
!= null then
4782 new_child
.parent
= self
4783 assert new_child
isa AType
4792 redef fun visit_all
(v
: Visitor)
4794 v
.enter_visit
(_n_expr
)
4795 v
.enter_visit
(_n_type
)
4798 redef class APlusExpr
4799 private init empty_init
do end
4801 init init_aplusexpr
(
4802 n_expr
: nullable AExpr,
4803 n_expr2
: nullable AExpr
4807 _n_expr
= n_expr
.as(not null)
4808 n_expr
.parent
= self
4809 _n_expr2
= n_expr2
.as(not null)
4810 n_expr2
.parent
= self
4813 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4815 if _n_expr
== old_child
then
4816 if new_child
!= null then
4817 new_child
.parent
= self
4818 assert new_child
isa AExpr
4825 if _n_expr2
== old_child
then
4826 if new_child
!= null then
4827 new_child
.parent
= self
4828 assert new_child
isa AExpr
4829 _n_expr2
= new_child
4837 redef fun visit_all
(v
: Visitor)
4839 v
.enter_visit
(_n_expr
)
4840 v
.enter_visit
(_n_expr2
)
4843 redef class AMinusExpr
4844 private init empty_init
do end
4846 init init_aminusexpr
(
4847 n_expr
: nullable AExpr,
4848 n_expr2
: nullable AExpr
4852 _n_expr
= n_expr
.as(not null)
4853 n_expr
.parent
= self
4854 _n_expr2
= n_expr2
.as(not null)
4855 n_expr2
.parent
= self
4858 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4860 if _n_expr
== old_child
then
4861 if new_child
!= null then
4862 new_child
.parent
= self
4863 assert new_child
isa AExpr
4870 if _n_expr2
== old_child
then
4871 if new_child
!= null then
4872 new_child
.parent
= self
4873 assert new_child
isa AExpr
4874 _n_expr2
= new_child
4882 redef fun visit_all
(v
: Visitor)
4884 v
.enter_visit
(_n_expr
)
4885 v
.enter_visit
(_n_expr2
)
4888 redef class AStarshipExpr
4889 private init empty_init
do end
4891 init init_astarshipexpr
(
4892 n_expr
: nullable AExpr,
4893 n_expr2
: nullable AExpr
4897 _n_expr
= n_expr
.as(not null)
4898 n_expr
.parent
= self
4899 _n_expr2
= n_expr2
.as(not null)
4900 n_expr2
.parent
= self
4903 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4905 if _n_expr
== old_child
then
4906 if new_child
!= null then
4907 new_child
.parent
= self
4908 assert new_child
isa AExpr
4915 if _n_expr2
== old_child
then
4916 if new_child
!= null then
4917 new_child
.parent
= self
4918 assert new_child
isa AExpr
4919 _n_expr2
= new_child
4927 redef fun visit_all
(v
: Visitor)
4929 v
.enter_visit
(_n_expr
)
4930 v
.enter_visit
(_n_expr2
)
4933 redef class AStarExpr
4934 private init empty_init
do end
4936 init init_astarexpr
(
4937 n_expr
: nullable AExpr,
4938 n_expr2
: nullable AExpr
4942 _n_expr
= n_expr
.as(not null)
4943 n_expr
.parent
= self
4944 _n_expr2
= n_expr2
.as(not null)
4945 n_expr2
.parent
= self
4948 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4950 if _n_expr
== old_child
then
4951 if new_child
!= null then
4952 new_child
.parent
= self
4953 assert new_child
isa AExpr
4960 if _n_expr2
== old_child
then
4961 if new_child
!= null then
4962 new_child
.parent
= self
4963 assert new_child
isa AExpr
4964 _n_expr2
= new_child
4972 redef fun visit_all
(v
: Visitor)
4974 v
.enter_visit
(_n_expr
)
4975 v
.enter_visit
(_n_expr2
)
4978 redef class ASlashExpr
4979 private init empty_init
do end
4981 init init_aslashexpr
(
4982 n_expr
: nullable AExpr,
4983 n_expr2
: nullable AExpr
4987 _n_expr
= n_expr
.as(not null)
4988 n_expr
.parent
= self
4989 _n_expr2
= n_expr2
.as(not null)
4990 n_expr2
.parent
= self
4993 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4995 if _n_expr
== old_child
then
4996 if new_child
!= null then
4997 new_child
.parent
= self
4998 assert new_child
isa AExpr
5005 if _n_expr2
== old_child
then
5006 if new_child
!= null then
5007 new_child
.parent
= self
5008 assert new_child
isa AExpr
5009 _n_expr2
= new_child
5017 redef fun visit_all
(v
: Visitor)
5019 v
.enter_visit
(_n_expr
)
5020 v
.enter_visit
(_n_expr2
)
5023 redef class APercentExpr
5024 private init empty_init
do end
5026 init init_apercentexpr
(
5027 n_expr
: nullable AExpr,
5028 n_expr2
: nullable AExpr
5032 _n_expr
= n_expr
.as(not null)
5033 n_expr
.parent
= self
5034 _n_expr2
= n_expr2
.as(not null)
5035 n_expr2
.parent
= self
5038 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5040 if _n_expr
== old_child
then
5041 if new_child
!= null then
5042 new_child
.parent
= self
5043 assert new_child
isa AExpr
5050 if _n_expr2
== old_child
then
5051 if new_child
!= null then
5052 new_child
.parent
= self
5053 assert new_child
isa AExpr
5054 _n_expr2
= new_child
5062 redef fun visit_all
(v
: Visitor)
5064 v
.enter_visit
(_n_expr
)
5065 v
.enter_visit
(_n_expr2
)
5068 redef class AUminusExpr
5069 private init empty_init
do end
5071 init init_auminusexpr
(
5072 n_minus
: nullable TMinus,
5073 n_expr
: nullable AExpr
5077 _n_minus
= n_minus
.as(not null)
5078 n_minus
.parent
= self
5079 _n_expr
= n_expr
.as(not null)
5080 n_expr
.parent
= self
5083 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5085 if _n_minus
== old_child
then
5086 if new_child
!= null then
5087 new_child
.parent
= self
5088 assert new_child
isa TMinus
5089 _n_minus
= new_child
5095 if _n_expr
== old_child
then
5096 if new_child
!= null then
5097 new_child
.parent
= self
5098 assert new_child
isa AExpr
5107 redef fun visit_all
(v
: Visitor)
5109 v
.enter_visit
(_n_minus
)
5110 v
.enter_visit
(_n_expr
)
5113 redef class ANewExpr
5114 private init empty_init
do end
5116 init init_anewexpr
(
5117 n_kwnew
: nullable TKwnew,
5118 n_type
: nullable AType,
5120 n_args
: Collection[Object] # Should be Collection[AExpr]
5124 _n_kwnew
= n_kwnew
.as(not null)
5125 n_kwnew
.parent
= self
5126 _n_type
= n_type
.as(not null)
5127 n_type
.parent
= self
5129 if n_id
!= null then
5139 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5141 if _n_kwnew
== old_child
then
5142 if new_child
!= null then
5143 new_child
.parent
= self
5144 assert new_child
isa TKwnew
5145 _n_kwnew
= new_child
5151 if _n_type
== old_child
then
5152 if new_child
!= null then
5153 new_child
.parent
= self
5154 assert new_child
isa AType
5161 if _n_id
== old_child
then
5162 if new_child
!= null then
5163 new_child
.parent
= self
5164 assert new_child
isa TId
5171 for i
in [0.._n_args
.length
[ do
5172 if _n_args
[i
] == old_child
then
5173 if new_child
!= null then
5174 assert new_child
isa AExpr
5175 _n_args
[i
] = new_child
5176 new_child
.parent
= self
5178 _n_args
.remove_at
(i
)
5185 redef fun visit_all
(v
: Visitor)
5187 v
.enter_visit
(_n_kwnew
)
5188 v
.enter_visit
(_n_type
)
5189 if _n_id
!= null then
5190 v
.enter_visit
(_n_id
.as(not null))
5197 redef class AAttrExpr
5198 private init empty_init
do end
5200 init init_aattrexpr
(
5201 n_expr
: nullable AExpr,
5202 n_id
: nullable TAttrid
5206 _n_expr
= n_expr
.as(not null)
5207 n_expr
.parent
= self
5208 _n_id
= n_id
.as(not null)
5212 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5214 if _n_expr
== old_child
then
5215 if new_child
!= null then
5216 new_child
.parent
= self
5217 assert new_child
isa AExpr
5224 if _n_id
== old_child
then
5225 if new_child
!= null then
5226 new_child
.parent
= self
5227 assert new_child
isa TAttrid
5236 redef fun visit_all
(v
: Visitor)
5238 v
.enter_visit
(_n_expr
)
5239 v
.enter_visit
(_n_id
)
5242 redef class AAttrAssignExpr
5243 private init empty_init
do end
5245 init init_aattrassignexpr
(
5246 n_expr
: nullable AExpr,
5247 n_id
: nullable TAttrid,
5248 n_assign
: nullable TAssign,
5249 n_value
: nullable AExpr
5253 _n_expr
= n_expr
.as(not null)
5254 n_expr
.parent
= self
5255 _n_id
= n_id
.as(not null)
5257 _n_assign
= n_assign
.as(not null)
5258 n_assign
.parent
= self
5259 _n_value
= n_value
.as(not null)
5260 n_value
.parent
= self
5263 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5265 if _n_expr
== old_child
then
5266 if new_child
!= null then
5267 new_child
.parent
= self
5268 assert new_child
isa AExpr
5275 if _n_id
== old_child
then
5276 if new_child
!= null then
5277 new_child
.parent
= self
5278 assert new_child
isa TAttrid
5285 if _n_assign
== old_child
then
5286 if new_child
!= null then
5287 new_child
.parent
= self
5288 assert new_child
isa TAssign
5289 _n_assign
= new_child
5295 if _n_value
== old_child
then
5296 if new_child
!= null then
5297 new_child
.parent
= self
5298 assert new_child
isa AExpr
5299 _n_value
= new_child
5307 redef fun visit_all
(v
: Visitor)
5309 v
.enter_visit
(_n_expr
)
5310 v
.enter_visit
(_n_id
)
5311 v
.enter_visit
(_n_assign
)
5312 v
.enter_visit
(_n_value
)
5315 redef class AAttrReassignExpr
5316 private init empty_init
do end
5318 init init_aattrreassignexpr
(
5319 n_expr
: nullable AExpr,
5320 n_id
: nullable TAttrid,
5321 n_assign_op
: nullable AAssignOp,
5322 n_value
: nullable AExpr
5326 _n_expr
= n_expr
.as(not null)
5327 n_expr
.parent
= self
5328 _n_id
= n_id
.as(not null)
5330 _n_assign_op
= n_assign_op
.as(not null)
5331 n_assign_op
.parent
= self
5332 _n_value
= n_value
.as(not null)
5333 n_value
.parent
= self
5336 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5338 if _n_expr
== old_child
then
5339 if new_child
!= null then
5340 new_child
.parent
= self
5341 assert new_child
isa AExpr
5348 if _n_id
== old_child
then
5349 if new_child
!= null then
5350 new_child
.parent
= self
5351 assert new_child
isa TAttrid
5358 if _n_assign_op
== old_child
then
5359 if new_child
!= null then
5360 new_child
.parent
= self
5361 assert new_child
isa AAssignOp
5362 _n_assign_op
= new_child
5368 if _n_value
== old_child
then
5369 if new_child
!= null then
5370 new_child
.parent
= self
5371 assert new_child
isa AExpr
5372 _n_value
= new_child
5380 redef fun visit_all
(v
: Visitor)
5382 v
.enter_visit
(_n_expr
)
5383 v
.enter_visit
(_n_id
)
5384 v
.enter_visit
(_n_assign_op
)
5385 v
.enter_visit
(_n_value
)
5388 redef class ACallExpr
5389 private init empty_init
do end
5391 init init_acallexpr
(
5392 n_expr
: nullable AExpr,
5394 n_args
: Collection[Object], # Should be Collection[AExpr]
5395 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5399 _n_expr
= n_expr
.as(not null)
5400 n_expr
.parent
= self
5401 _n_id
= n_id
.as(not null)
5408 for n
in n_closure_defs
do
5409 assert n
isa AClosureDef
5410 _n_closure_defs
.add
(n
)
5415 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5417 if _n_expr
== old_child
then
5418 if new_child
!= null then
5419 new_child
.parent
= self
5420 assert new_child
isa AExpr
5427 if _n_id
== old_child
then
5428 if new_child
!= null then
5429 new_child
.parent
= self
5430 assert new_child
isa TId
5437 for i
in [0.._n_args
.length
[ do
5438 if _n_args
[i
] == old_child
then
5439 if new_child
!= null then
5440 assert new_child
isa AExpr
5441 _n_args
[i
] = new_child
5442 new_child
.parent
= self
5444 _n_args
.remove_at
(i
)
5449 for i
in [0.._n_closure_defs
.length
[ do
5450 if _n_closure_defs
[i
] == old_child
then
5451 if new_child
!= null then
5452 assert new_child
isa AClosureDef
5453 _n_closure_defs
[i
] = new_child
5454 new_child
.parent
= self
5456 _n_closure_defs
.remove_at
(i
)
5463 redef fun visit_all
(v
: Visitor)
5465 v
.enter_visit
(_n_expr
)
5466 v
.enter_visit
(_n_id
)
5470 for n
in _n_closure_defs
do
5475 redef class ACallAssignExpr
5476 private init empty_init
do end
5478 init init_acallassignexpr
(
5479 n_expr
: nullable AExpr,
5481 n_args
: Collection[Object], # Should be Collection[AExpr]
5482 n_assign
: nullable TAssign,
5483 n_value
: nullable AExpr
5487 _n_expr
= n_expr
.as(not null)
5488 n_expr
.parent
= self
5489 _n_id
= n_id
.as(not null)
5496 _n_assign
= n_assign
.as(not null)
5497 n_assign
.parent
= self
5498 _n_value
= n_value
.as(not null)
5499 n_value
.parent
= self
5502 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5504 if _n_expr
== old_child
then
5505 if new_child
!= null then
5506 new_child
.parent
= self
5507 assert new_child
isa AExpr
5514 if _n_id
== old_child
then
5515 if new_child
!= null then
5516 new_child
.parent
= self
5517 assert new_child
isa TId
5524 for i
in [0.._n_args
.length
[ do
5525 if _n_args
[i
] == old_child
then
5526 if new_child
!= null then
5527 assert new_child
isa AExpr
5528 _n_args
[i
] = new_child
5529 new_child
.parent
= self
5531 _n_args
.remove_at
(i
)
5536 if _n_assign
== old_child
then
5537 if new_child
!= null then
5538 new_child
.parent
= self
5539 assert new_child
isa TAssign
5540 _n_assign
= new_child
5546 if _n_value
== old_child
then
5547 if new_child
!= null then
5548 new_child
.parent
= self
5549 assert new_child
isa AExpr
5550 _n_value
= new_child
5558 redef fun visit_all
(v
: Visitor)
5560 v
.enter_visit
(_n_expr
)
5561 v
.enter_visit
(_n_id
)
5565 v
.enter_visit
(_n_assign
)
5566 v
.enter_visit
(_n_value
)
5569 redef class ACallReassignExpr
5570 private init empty_init
do end
5572 init init_acallreassignexpr
(
5573 n_expr
: nullable AExpr,
5575 n_args
: Collection[Object], # Should be Collection[AExpr]
5576 n_assign_op
: nullable AAssignOp,
5577 n_value
: nullable AExpr
5581 _n_expr
= n_expr
.as(not null)
5582 n_expr
.parent
= self
5583 _n_id
= n_id
.as(not null)
5590 _n_assign_op
= n_assign_op
.as(not null)
5591 n_assign_op
.parent
= self
5592 _n_value
= n_value
.as(not null)
5593 n_value
.parent
= self
5596 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5598 if _n_expr
== old_child
then
5599 if new_child
!= null then
5600 new_child
.parent
= self
5601 assert new_child
isa AExpr
5608 if _n_id
== old_child
then
5609 if new_child
!= null then
5610 new_child
.parent
= self
5611 assert new_child
isa TId
5618 for i
in [0.._n_args
.length
[ do
5619 if _n_args
[i
] == old_child
then
5620 if new_child
!= null then
5621 assert new_child
isa AExpr
5622 _n_args
[i
] = new_child
5623 new_child
.parent
= self
5625 _n_args
.remove_at
(i
)
5630 if _n_assign_op
== old_child
then
5631 if new_child
!= null then
5632 new_child
.parent
= self
5633 assert new_child
isa AAssignOp
5634 _n_assign_op
= new_child
5640 if _n_value
== old_child
then
5641 if new_child
!= null then
5642 new_child
.parent
= self
5643 assert new_child
isa AExpr
5644 _n_value
= new_child
5652 redef fun visit_all
(v
: Visitor)
5654 v
.enter_visit
(_n_expr
)
5655 v
.enter_visit
(_n_id
)
5659 v
.enter_visit
(_n_assign_op
)
5660 v
.enter_visit
(_n_value
)
5663 redef class ASuperExpr
5664 private init empty_init
do end
5666 init init_asuperexpr
(
5667 n_qualified
: nullable AQualified,
5668 n_kwsuper
: nullable TKwsuper,
5669 n_args
: Collection[Object] # Should be Collection[AExpr]
5673 _n_qualified
= n_qualified
5674 if n_qualified
!= null then
5675 n_qualified
.parent
= self
5677 _n_kwsuper
= n_kwsuper
.as(not null)
5678 n_kwsuper
.parent
= self
5686 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5688 if _n_qualified
== old_child
then
5689 if new_child
!= null then
5690 new_child
.parent
= self
5691 assert new_child
isa AQualified
5692 _n_qualified
= new_child
5698 if _n_kwsuper
== old_child
then
5699 if new_child
!= null then
5700 new_child
.parent
= self
5701 assert new_child
isa TKwsuper
5702 _n_kwsuper
= new_child
5708 for i
in [0.._n_args
.length
[ do
5709 if _n_args
[i
] == old_child
then
5710 if new_child
!= null then
5711 assert new_child
isa AExpr
5712 _n_args
[i
] = new_child
5713 new_child
.parent
= self
5715 _n_args
.remove_at
(i
)
5722 redef fun visit_all
(v
: Visitor)
5724 if _n_qualified
!= null then
5725 v
.enter_visit
(_n_qualified
.as(not null))
5727 v
.enter_visit
(_n_kwsuper
)
5733 redef class AInitExpr
5734 private init empty_init
do end
5736 init init_ainitexpr
(
5737 n_expr
: nullable AExpr,
5738 n_kwinit
: nullable TKwinit,
5739 n_args
: Collection[Object] # Should be Collection[AExpr]
5743 _n_expr
= n_expr
.as(not null)
5744 n_expr
.parent
= self
5745 _n_kwinit
= n_kwinit
.as(not null)
5746 n_kwinit
.parent
= self
5754 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5756 if _n_expr
== old_child
then
5757 if new_child
!= null then
5758 new_child
.parent
= self
5759 assert new_child
isa AExpr
5766 if _n_kwinit
== old_child
then
5767 if new_child
!= null then
5768 new_child
.parent
= self
5769 assert new_child
isa TKwinit
5770 _n_kwinit
= new_child
5776 for i
in [0.._n_args
.length
[ do
5777 if _n_args
[i
] == old_child
then
5778 if new_child
!= null then
5779 assert new_child
isa AExpr
5780 _n_args
[i
] = new_child
5781 new_child
.parent
= self
5783 _n_args
.remove_at
(i
)
5790 redef fun visit_all
(v
: Visitor)
5792 v
.enter_visit
(_n_expr
)
5793 v
.enter_visit
(_n_kwinit
)
5799 redef class ABraExpr
5800 private init empty_init
do end
5802 init init_abraexpr
(
5803 n_expr
: nullable AExpr,
5804 n_args
: Collection[Object], # Should be Collection[AExpr]
5805 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5809 _n_expr
= n_expr
.as(not null)
5810 n_expr
.parent
= self
5816 for n
in n_closure_defs
do
5817 assert n
isa AClosureDef
5818 _n_closure_defs
.add
(n
)
5823 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5825 if _n_expr
== old_child
then
5826 if new_child
!= null then
5827 new_child
.parent
= self
5828 assert new_child
isa AExpr
5835 for i
in [0.._n_args
.length
[ do
5836 if _n_args
[i
] == old_child
then
5837 if new_child
!= null then
5838 assert new_child
isa AExpr
5839 _n_args
[i
] = new_child
5840 new_child
.parent
= self
5842 _n_args
.remove_at
(i
)
5847 for i
in [0.._n_closure_defs
.length
[ do
5848 if _n_closure_defs
[i
] == old_child
then
5849 if new_child
!= null then
5850 assert new_child
isa AClosureDef
5851 _n_closure_defs
[i
] = new_child
5852 new_child
.parent
= self
5854 _n_closure_defs
.remove_at
(i
)
5861 redef fun visit_all
(v
: Visitor)
5863 v
.enter_visit
(_n_expr
)
5867 for n
in _n_closure_defs
do
5872 redef class ABraAssignExpr
5873 private init empty_init
do end
5875 init init_abraassignexpr
(
5876 n_expr
: nullable AExpr,
5877 n_args
: Collection[Object], # Should be Collection[AExpr]
5878 n_assign
: nullable TAssign,
5879 n_value
: nullable AExpr
5883 _n_expr
= n_expr
.as(not null)
5884 n_expr
.parent
= self
5890 _n_assign
= n_assign
.as(not null)
5891 n_assign
.parent
= self
5892 _n_value
= n_value
.as(not null)
5893 n_value
.parent
= self
5896 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5898 if _n_expr
== old_child
then
5899 if new_child
!= null then
5900 new_child
.parent
= self
5901 assert new_child
isa AExpr
5908 for i
in [0.._n_args
.length
[ do
5909 if _n_args
[i
] == old_child
then
5910 if new_child
!= null then
5911 assert new_child
isa AExpr
5912 _n_args
[i
] = new_child
5913 new_child
.parent
= self
5915 _n_args
.remove_at
(i
)
5920 if _n_assign
== old_child
then
5921 if new_child
!= null then
5922 new_child
.parent
= self
5923 assert new_child
isa TAssign
5924 _n_assign
= new_child
5930 if _n_value
== old_child
then
5931 if new_child
!= null then
5932 new_child
.parent
= self
5933 assert new_child
isa AExpr
5934 _n_value
= new_child
5942 redef fun visit_all
(v
: Visitor)
5944 v
.enter_visit
(_n_expr
)
5948 v
.enter_visit
(_n_assign
)
5949 v
.enter_visit
(_n_value
)
5952 redef class ABraReassignExpr
5953 private init empty_init
do end
5955 init init_abrareassignexpr
(
5956 n_expr
: nullable AExpr,
5957 n_args
: Collection[Object], # Should be Collection[AExpr]
5958 n_assign_op
: nullable AAssignOp,
5959 n_value
: nullable AExpr
5963 _n_expr
= n_expr
.as(not null)
5964 n_expr
.parent
= self
5970 _n_assign_op
= n_assign_op
.as(not null)
5971 n_assign_op
.parent
= self
5972 _n_value
= n_value
.as(not null)
5973 n_value
.parent
= self
5976 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5978 if _n_expr
== old_child
then
5979 if new_child
!= null then
5980 new_child
.parent
= self
5981 assert new_child
isa AExpr
5988 for i
in [0.._n_args
.length
[ do
5989 if _n_args
[i
] == old_child
then
5990 if new_child
!= null then
5991 assert new_child
isa AExpr
5992 _n_args
[i
] = new_child
5993 new_child
.parent
= self
5995 _n_args
.remove_at
(i
)
6000 if _n_assign_op
== old_child
then
6001 if new_child
!= null then
6002 new_child
.parent
= self
6003 assert new_child
isa AAssignOp
6004 _n_assign_op
= new_child
6010 if _n_value
== old_child
then
6011 if new_child
!= null then
6012 new_child
.parent
= self
6013 assert new_child
isa AExpr
6014 _n_value
= new_child
6022 redef fun visit_all
(v
: Visitor)
6024 v
.enter_visit
(_n_expr
)
6028 v
.enter_visit
(_n_assign_op
)
6029 v
.enter_visit
(_n_value
)
6032 redef class AClosureCallExpr
6033 private init empty_init
do end
6035 init init_aclosurecallexpr
(
6037 n_args
: Collection[Object], # Should be Collection[AExpr]
6038 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6042 _n_id
= n_id
.as(not null)
6049 for n
in n_closure_defs
do
6050 assert n
isa AClosureDef
6051 _n_closure_defs
.add
(n
)
6056 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6058 if _n_id
== old_child
then
6059 if new_child
!= null then
6060 new_child
.parent
= self
6061 assert new_child
isa TId
6068 for i
in [0.._n_args
.length
[ do
6069 if _n_args
[i
] == old_child
then
6070 if new_child
!= null then
6071 assert new_child
isa AExpr
6072 _n_args
[i
] = new_child
6073 new_child
.parent
= self
6075 _n_args
.remove_at
(i
)
6080 for i
in [0.._n_closure_defs
.length
[ do
6081 if _n_closure_defs
[i
] == old_child
then
6082 if new_child
!= null then
6083 assert new_child
isa AClosureDef
6084 _n_closure_defs
[i
] = new_child
6085 new_child
.parent
= self
6087 _n_closure_defs
.remove_at
(i
)
6094 redef fun visit_all
(v
: Visitor)
6096 v
.enter_visit
(_n_id
)
6100 for n
in _n_closure_defs
do
6105 redef class AVarExpr
6106 private init empty_init
do end
6108 init init_avarexpr
(
6113 _n_id
= n_id
.as(not null)
6117 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6119 if _n_id
== old_child
then
6120 if new_child
!= null then
6121 new_child
.parent
= self
6122 assert new_child
isa TId
6131 redef fun visit_all
(v
: Visitor)
6133 v
.enter_visit
(_n_id
)
6136 redef class AVarAssignExpr
6137 private init empty_init
do end
6139 init init_avarassignexpr
(
6141 n_assign
: nullable TAssign,
6142 n_value
: nullable AExpr
6146 _n_id
= n_id
.as(not null)
6148 _n_assign
= n_assign
.as(not null)
6149 n_assign
.parent
= self
6150 _n_value
= n_value
.as(not null)
6151 n_value
.parent
= self
6154 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6156 if _n_id
== old_child
then
6157 if new_child
!= null then
6158 new_child
.parent
= self
6159 assert new_child
isa TId
6166 if _n_assign
== old_child
then
6167 if new_child
!= null then
6168 new_child
.parent
= self
6169 assert new_child
isa TAssign
6170 _n_assign
= new_child
6176 if _n_value
== old_child
then
6177 if new_child
!= null then
6178 new_child
.parent
= self
6179 assert new_child
isa AExpr
6180 _n_value
= new_child
6188 redef fun visit_all
(v
: Visitor)
6190 v
.enter_visit
(_n_id
)
6191 v
.enter_visit
(_n_assign
)
6192 v
.enter_visit
(_n_value
)
6195 redef class AVarReassignExpr
6196 private init empty_init
do end
6198 init init_avarreassignexpr
(
6200 n_assign_op
: nullable AAssignOp,
6201 n_value
: nullable AExpr
6205 _n_id
= n_id
.as(not null)
6207 _n_assign_op
= n_assign_op
.as(not null)
6208 n_assign_op
.parent
= self
6209 _n_value
= n_value
.as(not null)
6210 n_value
.parent
= self
6213 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6215 if _n_id
== old_child
then
6216 if new_child
!= null then
6217 new_child
.parent
= self
6218 assert new_child
isa TId
6225 if _n_assign_op
== old_child
then
6226 if new_child
!= null then
6227 new_child
.parent
= self
6228 assert new_child
isa AAssignOp
6229 _n_assign_op
= new_child
6235 if _n_value
== old_child
then
6236 if new_child
!= null then
6237 new_child
.parent
= self
6238 assert new_child
isa AExpr
6239 _n_value
= new_child
6247 redef fun visit_all
(v
: Visitor)
6249 v
.enter_visit
(_n_id
)
6250 v
.enter_visit
(_n_assign_op
)
6251 v
.enter_visit
(_n_value
)
6254 redef class ARangeExpr
6255 private init empty_init
do end
6257 init init_arangeexpr
(
6258 n_expr
: nullable AExpr,
6259 n_expr2
: nullable AExpr
6263 _n_expr
= n_expr
.as(not null)
6264 n_expr
.parent
= self
6265 _n_expr2
= n_expr2
.as(not null)
6266 n_expr2
.parent
= self
6269 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6271 if _n_expr
== old_child
then
6272 if new_child
!= null then
6273 new_child
.parent
= self
6274 assert new_child
isa AExpr
6281 if _n_expr2
== old_child
then
6282 if new_child
!= null then
6283 new_child
.parent
= self
6284 assert new_child
isa AExpr
6285 _n_expr2
= new_child
6293 redef fun visit_all
(v
: Visitor)
6295 v
.enter_visit
(_n_expr
)
6296 v
.enter_visit
(_n_expr2
)
6299 redef class ACrangeExpr
6300 private init empty_init
do end
6302 init init_acrangeexpr
(
6303 n_expr
: nullable AExpr,
6304 n_expr2
: nullable AExpr
6308 _n_expr
= n_expr
.as(not null)
6309 n_expr
.parent
= self
6310 _n_expr2
= n_expr2
.as(not null)
6311 n_expr2
.parent
= self
6314 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6316 if _n_expr
== old_child
then
6317 if new_child
!= null then
6318 new_child
.parent
= self
6319 assert new_child
isa AExpr
6326 if _n_expr2
== old_child
then
6327 if new_child
!= null then
6328 new_child
.parent
= self
6329 assert new_child
isa AExpr
6330 _n_expr2
= new_child
6338 redef fun visit_all
(v
: Visitor)
6340 v
.enter_visit
(_n_expr
)
6341 v
.enter_visit
(_n_expr2
)
6344 redef class AOrangeExpr
6345 private init empty_init
do end
6347 init init_aorangeexpr
(
6348 n_expr
: nullable AExpr,
6349 n_expr2
: nullable AExpr
6353 _n_expr
= n_expr
.as(not null)
6354 n_expr
.parent
= self
6355 _n_expr2
= n_expr2
.as(not null)
6356 n_expr2
.parent
= self
6359 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6361 if _n_expr
== old_child
then
6362 if new_child
!= null then
6363 new_child
.parent
= self
6364 assert new_child
isa AExpr
6371 if _n_expr2
== old_child
then
6372 if new_child
!= null then
6373 new_child
.parent
= self
6374 assert new_child
isa AExpr
6375 _n_expr2
= new_child
6383 redef fun visit_all
(v
: Visitor)
6385 v
.enter_visit
(_n_expr
)
6386 v
.enter_visit
(_n_expr2
)
6389 redef class AArrayExpr
6390 private init empty_init
do end
6392 init init_aarrayexpr
(
6393 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6404 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6406 for i
in [0.._n_exprs
.length
[ do
6407 if _n_exprs
[i
] == old_child
then
6408 if new_child
!= null then
6409 assert new_child
isa AExpr
6410 _n_exprs
[i
] = new_child
6411 new_child
.parent
= self
6413 _n_exprs
.remove_at
(i
)
6420 redef fun visit_all
(v
: Visitor)
6422 for n
in _n_exprs
do
6427 redef class ASelfExpr
6428 private init empty_init
do end
6430 init init_aselfexpr
(
6431 n_kwself
: nullable TKwself
6435 _n_kwself
= n_kwself
.as(not null)
6436 n_kwself
.parent
= self
6439 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6441 if _n_kwself
== old_child
then
6442 if new_child
!= null then
6443 new_child
.parent
= self
6444 assert new_child
isa TKwself
6445 _n_kwself
= new_child
6453 redef fun visit_all
(v
: Visitor)
6455 v
.enter_visit
(_n_kwself
)
6458 redef class AImplicitSelfExpr
6459 private init empty_init
do end
6461 init init_aimplicitselfexpr
6466 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6470 redef fun visit_all
(v
: Visitor)
6474 redef class ATrueExpr
6475 private init empty_init
do end
6477 init init_atrueexpr
(
6478 n_kwtrue
: nullable TKwtrue
6482 _n_kwtrue
= n_kwtrue
.as(not null)
6483 n_kwtrue
.parent
= self
6486 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6488 if _n_kwtrue
== old_child
then
6489 if new_child
!= null then
6490 new_child
.parent
= self
6491 assert new_child
isa TKwtrue
6492 _n_kwtrue
= new_child
6500 redef fun visit_all
(v
: Visitor)
6502 v
.enter_visit
(_n_kwtrue
)
6505 redef class AFalseExpr
6506 private init empty_init
do end
6508 init init_afalseexpr
(
6509 n_kwfalse
: nullable TKwfalse
6513 _n_kwfalse
= n_kwfalse
.as(not null)
6514 n_kwfalse
.parent
= self
6517 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6519 if _n_kwfalse
== old_child
then
6520 if new_child
!= null then
6521 new_child
.parent
= self
6522 assert new_child
isa TKwfalse
6523 _n_kwfalse
= new_child
6531 redef fun visit_all
(v
: Visitor)
6533 v
.enter_visit
(_n_kwfalse
)
6536 redef class ANullExpr
6537 private init empty_init
do end
6539 init init_anullexpr
(
6540 n_kwnull
: nullable TKwnull
6544 _n_kwnull
= n_kwnull
.as(not null)
6545 n_kwnull
.parent
= self
6548 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6550 if _n_kwnull
== old_child
then
6551 if new_child
!= null then
6552 new_child
.parent
= self
6553 assert new_child
isa TKwnull
6554 _n_kwnull
= new_child
6562 redef fun visit_all
(v
: Visitor)
6564 v
.enter_visit
(_n_kwnull
)
6567 redef class AIntExpr
6568 private init empty_init
do end
6570 init init_aintexpr
(
6571 n_number
: nullable TNumber
6575 _n_number
= n_number
.as(not null)
6576 n_number
.parent
= self
6579 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6581 if _n_number
== old_child
then
6582 if new_child
!= null then
6583 new_child
.parent
= self
6584 assert new_child
isa TNumber
6585 _n_number
= new_child
6593 redef fun visit_all
(v
: Visitor)
6595 v
.enter_visit
(_n_number
)
6598 redef class AFloatExpr
6599 private init empty_init
do end
6601 init init_afloatexpr
(
6602 n_float
: nullable TFloat
6606 _n_float
= n_float
.as(not null)
6607 n_float
.parent
= self
6610 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6612 if _n_float
== old_child
then
6613 if new_child
!= null then
6614 new_child
.parent
= self
6615 assert new_child
isa TFloat
6616 _n_float
= new_child
6624 redef fun visit_all
(v
: Visitor)
6626 v
.enter_visit
(_n_float
)
6629 redef class ACharExpr
6630 private init empty_init
do end
6632 init init_acharexpr
(
6633 n_char
: nullable TChar
6637 _n_char
= n_char
.as(not null)
6638 n_char
.parent
= self
6641 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6643 if _n_char
== old_child
then
6644 if new_child
!= null then
6645 new_child
.parent
= self
6646 assert new_child
isa TChar
6655 redef fun visit_all
(v
: Visitor)
6657 v
.enter_visit
(_n_char
)
6660 redef class AStringExpr
6661 private init empty_init
do end
6663 init init_astringexpr
(
6664 n_string
: nullable TString
6668 _n_string
= n_string
.as(not null)
6669 n_string
.parent
= self
6672 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6674 if _n_string
== old_child
then
6675 if new_child
!= null then
6676 new_child
.parent
= self
6677 assert new_child
isa TString
6678 _n_string
= new_child
6686 redef fun visit_all
(v
: Visitor)
6688 v
.enter_visit
(_n_string
)
6691 redef class AStartStringExpr
6692 private init empty_init
do end
6694 init init_astartstringexpr
(
6695 n_string
: nullable TStartString
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 TStartString
6709 _n_string
= new_child
6717 redef fun visit_all
(v
: Visitor)
6719 v
.enter_visit
(_n_string
)
6722 redef class AMidStringExpr
6723 private init empty_init
do end
6725 init init_amidstringexpr
(
6726 n_string
: nullable TMidString
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 TMidString
6740 _n_string
= new_child
6748 redef fun visit_all
(v
: Visitor)
6750 v
.enter_visit
(_n_string
)
6753 redef class AEndStringExpr
6754 private init empty_init
do end
6756 init init_aendstringexpr
(
6757 n_string
: nullable TEndString
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 TEndString
6771 _n_string
= new_child
6779 redef fun visit_all
(v
: Visitor)
6781 v
.enter_visit
(_n_string
)
6784 redef class ASuperstringExpr
6785 private init empty_init
do end
6787 init init_asuperstringexpr
(
6788 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6799 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6801 for i
in [0.._n_exprs
.length
[ do
6802 if _n_exprs
[i
] == old_child
then
6803 if new_child
!= null then
6804 assert new_child
isa AExpr
6805 _n_exprs
[i
] = new_child
6806 new_child
.parent
= self
6808 _n_exprs
.remove_at
(i
)
6815 redef fun visit_all
(v
: Visitor)
6817 for n
in _n_exprs
do
6822 redef class AParExpr
6823 private init empty_init
do end
6825 init init_aparexpr
(
6826 n_expr
: nullable AExpr
6830 _n_expr
= n_expr
.as(not null)
6831 n_expr
.parent
= self
6834 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6836 if _n_expr
== old_child
then
6837 if new_child
!= null then
6838 new_child
.parent
= self
6839 assert new_child
isa AExpr
6848 redef fun visit_all
(v
: Visitor)
6850 v
.enter_visit
(_n_expr
)
6853 redef class AAsCastExpr
6854 private init empty_init
do end
6856 init init_aascastexpr
(
6857 n_expr
: nullable AExpr,
6858 n_kwas
: nullable TKwas,
6859 n_type
: nullable AType
6863 _n_expr
= n_expr
.as(not null)
6864 n_expr
.parent
= self
6865 _n_kwas
= n_kwas
.as(not null)
6866 n_kwas
.parent
= self
6867 _n_type
= n_type
.as(not null)
6868 n_type
.parent
= self
6871 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6873 if _n_expr
== old_child
then
6874 if new_child
!= null then
6875 new_child
.parent
= self
6876 assert new_child
isa AExpr
6883 if _n_kwas
== old_child
then
6884 if new_child
!= null then
6885 new_child
.parent
= self
6886 assert new_child
isa TKwas
6893 if _n_type
== old_child
then
6894 if new_child
!= null then
6895 new_child
.parent
= self
6896 assert new_child
isa AType
6905 redef fun visit_all
(v
: Visitor)
6907 v
.enter_visit
(_n_expr
)
6908 v
.enter_visit
(_n_kwas
)
6909 v
.enter_visit
(_n_type
)
6912 redef class AAsNotnullExpr
6913 private init empty_init
do end
6915 init init_aasnotnullexpr
(
6916 n_expr
: nullable AExpr,
6917 n_kwas
: nullable TKwas,
6918 n_kwnot
: nullable TKwnot,
6919 n_kwnull
: nullable TKwnull
6923 _n_expr
= n_expr
.as(not null)
6924 n_expr
.parent
= self
6925 _n_kwas
= n_kwas
.as(not null)
6926 n_kwas
.parent
= self
6927 _n_kwnot
= n_kwnot
.as(not null)
6928 n_kwnot
.parent
= self
6929 _n_kwnull
= n_kwnull
.as(not null)
6930 n_kwnull
.parent
= self
6933 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6935 if _n_expr
== old_child
then
6936 if new_child
!= null then
6937 new_child
.parent
= self
6938 assert new_child
isa AExpr
6945 if _n_kwas
== old_child
then
6946 if new_child
!= null then
6947 new_child
.parent
= self
6948 assert new_child
isa TKwas
6955 if _n_kwnot
== old_child
then
6956 if new_child
!= null then
6957 new_child
.parent
= self
6958 assert new_child
isa TKwnot
6959 _n_kwnot
= new_child
6965 if _n_kwnull
== old_child
then
6966 if new_child
!= null then
6967 new_child
.parent
= self
6968 assert new_child
isa TKwnull
6969 _n_kwnull
= new_child
6977 redef fun visit_all
(v
: Visitor)
6979 v
.enter_visit
(_n_expr
)
6980 v
.enter_visit
(_n_kwas
)
6981 v
.enter_visit
(_n_kwnot
)
6982 v
.enter_visit
(_n_kwnull
)
6985 redef class AIssetAttrExpr
6986 private init empty_init
do end
6988 init init_aissetattrexpr
(
6989 n_kwisset
: nullable TKwisset,
6990 n_expr
: nullable AExpr,
6991 n_id
: nullable TAttrid
6995 _n_kwisset
= n_kwisset
.as(not null)
6996 n_kwisset
.parent
= self
6997 _n_expr
= n_expr
.as(not null)
6998 n_expr
.parent
= self
6999 _n_id
= n_id
.as(not null)
7003 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7005 if _n_kwisset
== old_child
then
7006 if new_child
!= null then
7007 new_child
.parent
= self
7008 assert new_child
isa TKwisset
7009 _n_kwisset
= new_child
7015 if _n_expr
== old_child
then
7016 if new_child
!= null then
7017 new_child
.parent
= self
7018 assert new_child
isa AExpr
7025 if _n_id
== old_child
then
7026 if new_child
!= null then
7027 new_child
.parent
= self
7028 assert new_child
isa TAttrid
7037 redef fun visit_all
(v
: Visitor)
7039 v
.enter_visit
(_n_kwisset
)
7040 v
.enter_visit
(_n_expr
)
7041 v
.enter_visit
(_n_id
)
7044 redef class APlusAssignOp
7045 private init empty_init
do end
7047 init init_aplusassignop
(
7048 n_pluseq
: nullable TPluseq
7052 _n_pluseq
= n_pluseq
.as(not null)
7053 n_pluseq
.parent
= self
7056 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7058 if _n_pluseq
== old_child
then
7059 if new_child
!= null then
7060 new_child
.parent
= self
7061 assert new_child
isa TPluseq
7062 _n_pluseq
= new_child
7070 redef fun visit_all
(v
: Visitor)
7072 v
.enter_visit
(_n_pluseq
)
7075 redef class AMinusAssignOp
7076 private init empty_init
do end
7078 init init_aminusassignop
(
7079 n_minuseq
: nullable TMinuseq
7083 _n_minuseq
= n_minuseq
.as(not null)
7084 n_minuseq
.parent
= self
7087 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7089 if _n_minuseq
== old_child
then
7090 if new_child
!= null then
7091 new_child
.parent
= self
7092 assert new_child
isa TMinuseq
7093 _n_minuseq
= new_child
7101 redef fun visit_all
(v
: Visitor)
7103 v
.enter_visit
(_n_minuseq
)
7106 redef class AClosureDef
7107 private init empty_init
do end
7109 init init_aclosuredef
(
7110 n_bang
: nullable TBang,
7111 n_id
: nullable AClosureId,
7112 n_ids
: Collection[Object], # Should be Collection[TId]
7113 n_kwdo
: nullable TKwdo,
7114 n_expr
: nullable AExpr,
7115 n_label
: nullable ALabel
7119 _n_bang
= n_bang
.as(not null)
7120 n_bang
.parent
= self
7121 _n_id
= n_id
.as(not null)
7129 if n_kwdo
!= null then
7130 n_kwdo
.parent
= self
7133 if n_expr
!= null then
7134 n_expr
.parent
= self
7137 if n_label
!= null then
7138 n_label
.parent
= self
7142 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7144 if _n_bang
== old_child
then
7145 if new_child
!= null then
7146 new_child
.parent
= self
7147 assert new_child
isa TBang
7154 if _n_id
== old_child
then
7155 if new_child
!= null then
7156 new_child
.parent
= self
7157 assert new_child
isa AClosureId
7164 for i
in [0.._n_ids
.length
[ do
7165 if _n_ids
[i
] == old_child
then
7166 if new_child
!= null then
7167 assert new_child
isa TId
7168 _n_ids
[i
] = new_child
7169 new_child
.parent
= self
7176 if _n_kwdo
== old_child
then
7177 if new_child
!= null then
7178 new_child
.parent
= self
7179 assert new_child
isa TKwdo
7186 if _n_expr
== old_child
then
7187 if new_child
!= null then
7188 new_child
.parent
= self
7189 assert new_child
isa AExpr
7196 if _n_label
== old_child
then
7197 if new_child
!= null then
7198 new_child
.parent
= self
7199 assert new_child
isa ALabel
7200 _n_label
= new_child
7208 redef fun visit_all
(v
: Visitor)
7210 v
.enter_visit
(_n_bang
)
7211 v
.enter_visit
(_n_id
)
7215 if _n_kwdo
!= null then
7216 v
.enter_visit
(_n_kwdo
.as(not null))
7218 if _n_expr
!= null then
7219 v
.enter_visit
(_n_expr
.as(not null))
7221 if _n_label
!= null then
7222 v
.enter_visit
(_n_label
.as(not null))
7226 redef class ASimpleClosureId
7227 private init empty_init
do end
7229 init init_asimpleclosureid
(
7234 _n_id
= n_id
.as(not null)
7238 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7240 if _n_id
== old_child
then
7241 if new_child
!= null then
7242 new_child
.parent
= self
7243 assert new_child
isa TId
7252 redef fun visit_all
(v
: Visitor)
7254 v
.enter_visit
(_n_id
)
7257 redef class ABreakClosureId
7258 private init empty_init
do end
7260 init init_abreakclosureid
(
7261 n_kwbreak
: nullable TKwbreak
7265 _n_kwbreak
= n_kwbreak
.as(not null)
7266 n_kwbreak
.parent
= self
7269 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7271 if _n_kwbreak
== old_child
then
7272 if new_child
!= null then
7273 new_child
.parent
= self
7274 assert new_child
isa TKwbreak
7275 _n_kwbreak
= new_child
7283 redef fun visit_all
(v
: Visitor)
7285 v
.enter_visit
(_n_kwbreak
)
7288 redef class AModuleName
7289 private init empty_init
do end
7291 init init_amodulename
(
7292 n_quad
: nullable TQuad,
7293 n_path
: Collection[Object], # Should be Collection[TId]
7299 if n_quad
!= null then
7300 n_quad
.parent
= self
7307 _n_id
= n_id
.as(not null)
7311 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7313 if _n_quad
== old_child
then
7314 if new_child
!= null then
7315 new_child
.parent
= self
7316 assert new_child
isa TQuad
7323 for i
in [0.._n_path
.length
[ do
7324 if _n_path
[i
] == old_child
then
7325 if new_child
!= null then
7326 assert new_child
isa TId
7327 _n_path
[i
] = new_child
7328 new_child
.parent
= self
7330 _n_path
.remove_at
(i
)
7335 if _n_id
== old_child
then
7336 if new_child
!= null then
7337 new_child
.parent
= self
7338 assert new_child
isa TId
7347 redef fun visit_all
(v
: Visitor)
7349 if _n_quad
!= null then
7350 v
.enter_visit
(_n_quad
.as(not null))
7355 v
.enter_visit
(_n_id
)
7358 redef class AExternCalls
7359 private init empty_init
do end
7361 init init_aexterncalls
(
7362 n_kwimport
: nullable TKwimport,
7363 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7367 _n_kwimport
= n_kwimport
.as(not null)
7368 n_kwimport
.parent
= self
7369 for n
in n_extern_calls
do
7370 assert n
isa AExternCall
7371 _n_extern_calls
.add
(n
)
7376 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7378 if _n_kwimport
== old_child
then
7379 if new_child
!= null then
7380 new_child
.parent
= self
7381 assert new_child
isa TKwimport
7382 _n_kwimport
= new_child
7388 for i
in [0.._n_extern_calls
.length
[ do
7389 if _n_extern_calls
[i
] == old_child
then
7390 if new_child
!= null then
7391 assert new_child
isa AExternCall
7392 _n_extern_calls
[i
] = new_child
7393 new_child
.parent
= self
7395 _n_extern_calls
.remove_at
(i
)
7402 redef fun visit_all
(v
: Visitor)
7404 v
.enter_visit
(_n_kwimport
)
7405 for n
in _n_extern_calls
do
7410 redef class AExternCall
7411 private init empty_init
do end
7413 init init_aexterncall
7418 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7422 redef fun visit_all
(v
: Visitor)
7426 redef class ASuperExternCall
7427 private init empty_init
do end
7429 init init_asuperexterncall
(
7430 n_kwsuper
: nullable TKwsuper
7434 _n_kwsuper
= n_kwsuper
.as(not null)
7435 n_kwsuper
.parent
= self
7438 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7440 if _n_kwsuper
== old_child
then
7441 if new_child
!= null then
7442 new_child
.parent
= self
7443 assert new_child
isa TKwsuper
7444 _n_kwsuper
= new_child
7452 redef fun visit_all
(v
: Visitor)
7454 v
.enter_visit
(_n_kwsuper
)
7457 redef class ALocalPropExternCall
7458 private init empty_init
do end
7460 init init_alocalpropexterncall
(
7461 n_methid
: nullable AMethid
7465 _n_methid
= n_methid
.as(not null)
7466 n_methid
.parent
= self
7469 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7471 if _n_methid
== old_child
then
7472 if new_child
!= null then
7473 new_child
.parent
= self
7474 assert new_child
isa AMethid
7475 _n_methid
= new_child
7483 redef fun visit_all
(v
: Visitor)
7485 v
.enter_visit
(_n_methid
)
7488 redef class AFullPropExternCall
7489 private init empty_init
do end
7491 init init_afullpropexterncall
(
7492 n_classid
: nullable TClassid,
7493 n_quad
: nullable TQuad,
7494 n_methid
: nullable AMethid
7498 _n_classid
= n_classid
.as(not null)
7499 n_classid
.parent
= self
7501 if n_quad
!= null then
7502 n_quad
.parent
= self
7504 _n_methid
= n_methid
.as(not null)
7505 n_methid
.parent
= self
7508 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7510 if _n_classid
== old_child
then
7511 if new_child
!= null then
7512 new_child
.parent
= self
7513 assert new_child
isa TClassid
7514 _n_classid
= new_child
7520 if _n_quad
== old_child
then
7521 if new_child
!= null then
7522 new_child
.parent
= self
7523 assert new_child
isa TQuad
7530 if _n_methid
== old_child
then
7531 if new_child
!= null then
7532 new_child
.parent
= self
7533 assert new_child
isa AMethid
7534 _n_methid
= new_child
7542 redef fun visit_all
(v
: Visitor)
7544 v
.enter_visit
(_n_classid
)
7545 if _n_quad
!= null then
7546 v
.enter_visit
(_n_quad
.as(not null))
7548 v
.enter_visit
(_n_methid
)
7551 redef class AInitPropExternCall
7552 private init empty_init
do end
7554 init init_ainitpropexterncall
(
7555 n_classid
: nullable TClassid
7559 _n_classid
= n_classid
.as(not null)
7560 n_classid
.parent
= self
7563 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7565 if _n_classid
== old_child
then
7566 if new_child
!= null then
7567 new_child
.parent
= self
7568 assert new_child
isa TClassid
7569 _n_classid
= new_child
7577 redef fun visit_all
(v
: Visitor)
7579 v
.enter_visit
(_n_classid
)
7582 redef class ACastAsExternCall
7583 private init empty_init
do end
7585 init init_acastasexterncall
(
7586 n_from_type
: nullable AType,
7587 n_kwas
: nullable TKwas,
7588 n_to_type
: nullable AType
7592 _n_from_type
= n_from_type
.as(not null)
7593 n_from_type
.parent
= self
7594 _n_kwas
= n_kwas
.as(not null)
7595 n_kwas
.parent
= self
7596 _n_to_type
= n_to_type
.as(not null)
7597 n_to_type
.parent
= self
7600 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7602 if _n_from_type
== old_child
then
7603 if new_child
!= null then
7604 new_child
.parent
= self
7605 assert new_child
isa AType
7606 _n_from_type
= new_child
7612 if _n_kwas
== old_child
then
7613 if new_child
!= null then
7614 new_child
.parent
= self
7615 assert new_child
isa TKwas
7622 if _n_to_type
== old_child
then
7623 if new_child
!= null then
7624 new_child
.parent
= self
7625 assert new_child
isa AType
7626 _n_to_type
= new_child
7634 redef fun visit_all
(v
: Visitor)
7636 v
.enter_visit
(_n_from_type
)
7637 v
.enter_visit
(_n_kwas
)
7638 v
.enter_visit
(_n_to_type
)
7641 redef class AAsNullableExternCall
7642 private init empty_init
do end
7644 init init_aasnullableexterncall
(
7645 n_type
: nullable AType,
7646 n_kwas
: nullable TKwas,
7647 n_kwnullable
: nullable TKwnullable
7651 _n_type
= n_type
.as(not null)
7652 n_type
.parent
= self
7653 _n_kwas
= n_kwas
.as(not null)
7654 n_kwas
.parent
= self
7655 _n_kwnullable
= n_kwnullable
.as(not null)
7656 n_kwnullable
.parent
= self
7659 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7661 if _n_type
== old_child
then
7662 if new_child
!= null then
7663 new_child
.parent
= self
7664 assert new_child
isa AType
7671 if _n_kwas
== old_child
then
7672 if new_child
!= null then
7673 new_child
.parent
= self
7674 assert new_child
isa TKwas
7681 if _n_kwnullable
== old_child
then
7682 if new_child
!= null then
7683 new_child
.parent
= self
7684 assert new_child
isa TKwnullable
7685 _n_kwnullable
= new_child
7693 redef fun visit_all
(v
: Visitor)
7695 v
.enter_visit
(_n_type
)
7696 v
.enter_visit
(_n_kwas
)
7697 v
.enter_visit
(_n_kwnullable
)
7700 redef class AAsNotNullableExternCall
7701 private init empty_init
do end
7703 init init_aasnotnullableexterncall
(
7704 n_type
: nullable AType,
7705 n_kwas
: nullable TKwas,
7706 n_kwnot
: nullable TKwnot,
7707 n_kwnullable
: nullable TKwnullable
7711 _n_type
= n_type
.as(not null)
7712 n_type
.parent
= self
7713 _n_kwas
= n_kwas
.as(not null)
7714 n_kwas
.parent
= self
7715 _n_kwnot
= n_kwnot
.as(not null)
7716 n_kwnot
.parent
= self
7717 _n_kwnullable
= n_kwnullable
.as(not null)
7718 n_kwnullable
.parent
= self
7721 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7723 if _n_type
== old_child
then
7724 if new_child
!= null then
7725 new_child
.parent
= self
7726 assert new_child
isa AType
7733 if _n_kwas
== old_child
then
7734 if new_child
!= null then
7735 new_child
.parent
= self
7736 assert new_child
isa TKwas
7743 if _n_kwnot
== old_child
then
7744 if new_child
!= null then
7745 new_child
.parent
= self
7746 assert new_child
isa TKwnot
7747 _n_kwnot
= new_child
7753 if _n_kwnullable
== old_child
then
7754 if new_child
!= null then
7755 new_child
.parent
= self
7756 assert new_child
isa TKwnullable
7757 _n_kwnullable
= new_child
7765 redef fun visit_all
(v
: Visitor)
7767 v
.enter_visit
(_n_type
)
7768 v
.enter_visit
(_n_kwas
)
7769 v
.enter_visit
(_n_kwnot
)
7770 v
.enter_visit
(_n_kwnullable
)
7773 redef class AQualified
7774 private init empty_init
do end
7776 init init_aqualified
(
7777 n_id
: Collection[Object], # Should be Collection[TId]
7778 n_classid
: nullable TClassid
7787 _n_classid
= n_classid
7788 if n_classid
!= null then
7789 n_classid
.parent
= self
7793 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7795 for i
in [0.._n_id
.length
[ do
7796 if _n_id
[i
] == old_child
then
7797 if new_child
!= null then
7798 assert new_child
isa TId
7799 _n_id
[i
] = new_child
7800 new_child
.parent
= self
7807 if _n_classid
== old_child
then
7808 if new_child
!= null then
7809 new_child
.parent
= self
7810 assert new_child
isa TClassid
7811 _n_classid
= new_child
7819 redef fun visit_all
(v
: Visitor)
7824 if _n_classid
!= null then
7825 v
.enter_visit
(_n_classid
.as(not null))
7830 private init empty_init
do end
7833 n_comment
: Collection[Object] # Should be Collection[TComment]
7837 for n
in n_comment
do
7838 assert n
isa TComment
7844 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7846 for i
in [0.._n_comment
.length
[ do
7847 if _n_comment
[i
] == old_child
then
7848 if new_child
!= null then
7849 assert new_child
isa TComment
7850 _n_comment
[i
] = new_child
7851 new_child
.parent
= self
7853 _n_comment
.remove_at
(i
)
7860 redef fun visit_all
(v
: Visitor)
7862 for n
in _n_comment
do
7870 n_base
: nullable AModule,
7877 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7879 if _n_base
== old_child
then
7880 if new_child
== null then
7882 new_child
.parent
= self
7883 assert new_child
isa AModule
7886 old_child
.parent
= null
7891 redef fun visit_all
(v
: Visitor)
7893 if _n_base
!= null then
7894 v
.enter_visit
(_n_base
.as(not null))
7896 v
.enter_visit
(_n_eof
)