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]
449 n_kwend
: nullable TKwend
454 if n_doc
!= null then
457 _n_kwredef
= n_kwredef
458 if n_kwredef
!= null then
459 n_kwredef
.parent
= self
461 _n_visibility
= n_visibility
.as(not null)
462 n_visibility
.parent
= self
463 _n_classkind
= n_classkind
.as(not null)
464 n_classkind
.parent
= self
469 for n
in n_formaldefs
do
470 assert n
isa AFormaldef
474 for n
in n_superclasses
do
475 assert n
isa ASuperclass
476 _n_superclasses
.add
(n
)
479 for n
in n_propdefs
do
480 assert n
isa APropdef
484 _n_kwend
= n_kwend
.as(not null)
485 n_kwend
.parent
= self
488 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
490 if _n_doc
== old_child
then
491 if new_child
!= null then
492 new_child
.parent
= self
493 assert new_child
isa ADoc
500 if _n_kwredef
== old_child
then
501 if new_child
!= null then
502 new_child
.parent
= self
503 assert new_child
isa TKwredef
504 _n_kwredef
= new_child
510 if _n_visibility
== old_child
then
511 if new_child
!= null then
512 new_child
.parent
= self
513 assert new_child
isa AVisibility
514 _n_visibility
= new_child
520 if _n_classkind
== old_child
then
521 if new_child
!= null then
522 new_child
.parent
= self
523 assert new_child
isa AClasskind
524 _n_classkind
= new_child
530 if _n_id
== old_child
then
531 if new_child
!= null then
532 new_child
.parent
= self
533 assert new_child
isa TClassid
540 for i
in [0.._n_formaldefs
.length
[ do
541 if _n_formaldefs
[i
] == old_child
then
542 if new_child
!= null then
543 assert new_child
isa AFormaldef
544 _n_formaldefs
[i
] = new_child
545 new_child
.parent
= self
547 _n_formaldefs
.remove_at
(i
)
552 for i
in [0.._n_superclasses
.length
[ do
553 if _n_superclasses
[i
] == old_child
then
554 if new_child
!= null then
555 assert new_child
isa ASuperclass
556 _n_superclasses
[i
] = new_child
557 new_child
.parent
= self
559 _n_superclasses
.remove_at
(i
)
564 for i
in [0.._n_propdefs
.length
[ do
565 if _n_propdefs
[i
] == old_child
then
566 if new_child
!= null then
567 assert new_child
isa APropdef
568 _n_propdefs
[i
] = new_child
569 new_child
.parent
= self
571 _n_propdefs
.remove_at
(i
)
576 if _n_kwend
== old_child
then
577 if new_child
!= null then
578 new_child
.parent
= self
579 assert new_child
isa TKwend
588 redef fun visit_all
(v
: Visitor)
590 if _n_doc
!= null then
591 v
.enter_visit
(_n_doc
.as(not null))
593 if _n_kwredef
!= null then
594 v
.enter_visit
(_n_kwredef
.as(not null))
596 v
.enter_visit
(_n_visibility
)
597 v
.enter_visit
(_n_classkind
)
598 if _n_id
!= null then
599 v
.enter_visit
(_n_id
.as(not null))
601 for n
in _n_formaldefs
do
604 for n
in _n_superclasses
do
607 for n
in _n_propdefs
do
610 v
.enter_visit
(_n_kwend
)
613 redef class ATopClassdef
614 private init empty_init
do end
616 init init_atopclassdef
(
617 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
621 for n
in n_propdefs
do
622 assert n
isa APropdef
628 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
630 for i
in [0.._n_propdefs
.length
[ do
631 if _n_propdefs
[i
] == old_child
then
632 if new_child
!= null then
633 assert new_child
isa APropdef
634 _n_propdefs
[i
] = new_child
635 new_child
.parent
= self
637 _n_propdefs
.remove_at
(i
)
644 redef fun visit_all
(v
: Visitor)
646 for n
in _n_propdefs
do
651 redef class AMainClassdef
652 private init empty_init
do end
654 init init_amainclassdef
(
655 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
659 for n
in n_propdefs
do
660 assert n
isa APropdef
666 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
668 for i
in [0.._n_propdefs
.length
[ do
669 if _n_propdefs
[i
] == old_child
then
670 if new_child
!= null then
671 assert new_child
isa APropdef
672 _n_propdefs
[i
] = new_child
673 new_child
.parent
= self
675 _n_propdefs
.remove_at
(i
)
682 redef fun visit_all
(v
: Visitor)
684 for n
in _n_propdefs
do
689 redef class AConcreteClasskind
690 private init empty_init
do end
692 init init_aconcreteclasskind
(
693 n_kwclass
: nullable TKwclass
697 _n_kwclass
= n_kwclass
.as(not null)
698 n_kwclass
.parent
= self
701 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
703 if _n_kwclass
== old_child
then
704 if new_child
!= null then
705 new_child
.parent
= self
706 assert new_child
isa TKwclass
707 _n_kwclass
= new_child
715 redef fun visit_all
(v
: Visitor)
717 v
.enter_visit
(_n_kwclass
)
720 redef class AAbstractClasskind
721 private init empty_init
do end
723 init init_aabstractclasskind
(
724 n_kwabstract
: nullable TKwabstract,
725 n_kwclass
: nullable TKwclass
729 _n_kwabstract
= n_kwabstract
.as(not null)
730 n_kwabstract
.parent
= self
731 _n_kwclass
= n_kwclass
.as(not null)
732 n_kwclass
.parent
= self
735 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
737 if _n_kwabstract
== old_child
then
738 if new_child
!= null then
739 new_child
.parent
= self
740 assert new_child
isa TKwabstract
741 _n_kwabstract
= new_child
747 if _n_kwclass
== old_child
then
748 if new_child
!= null then
749 new_child
.parent
= self
750 assert new_child
isa TKwclass
751 _n_kwclass
= new_child
759 redef fun visit_all
(v
: Visitor)
761 v
.enter_visit
(_n_kwabstract
)
762 v
.enter_visit
(_n_kwclass
)
765 redef class AInterfaceClasskind
766 private init empty_init
do end
768 init init_ainterfaceclasskind
(
769 n_kwinterface
: nullable TKwinterface
773 _n_kwinterface
= n_kwinterface
.as(not null)
774 n_kwinterface
.parent
= self
777 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
779 if _n_kwinterface
== old_child
then
780 if new_child
!= null then
781 new_child
.parent
= self
782 assert new_child
isa TKwinterface
783 _n_kwinterface
= new_child
791 redef fun visit_all
(v
: Visitor)
793 v
.enter_visit
(_n_kwinterface
)
796 redef class AEnumClasskind
797 private init empty_init
do end
799 init init_aenumclasskind
(
800 n_kwenum
: nullable TKwenum
804 _n_kwenum
= n_kwenum
.as(not null)
805 n_kwenum
.parent
= self
808 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
810 if _n_kwenum
== old_child
then
811 if new_child
!= null then
812 new_child
.parent
= self
813 assert new_child
isa TKwenum
814 _n_kwenum
= new_child
822 redef fun visit_all
(v
: Visitor)
824 v
.enter_visit
(_n_kwenum
)
827 redef class AExternClasskind
828 private init empty_init
do end
830 init init_aexternclasskind
(
831 n_kwextern
: nullable TKwextern
835 _n_kwextern
= n_kwextern
.as(not null)
836 n_kwextern
.parent
= self
839 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
841 if _n_kwextern
== old_child
then
842 if new_child
!= null then
843 new_child
.parent
= self
844 assert new_child
isa TKwextern
845 _n_kwextern
= new_child
853 redef fun visit_all
(v
: Visitor)
855 v
.enter_visit
(_n_kwextern
)
858 redef class AFormaldef
859 private init empty_init
do end
861 init init_aformaldef
(
862 n_id
: nullable TClassid,
863 n_type
: nullable AType
867 _n_id
= n_id
.as(not null)
870 if n_type
!= null then
875 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
877 if _n_id
== old_child
then
878 if new_child
!= null then
879 new_child
.parent
= self
880 assert new_child
isa TClassid
887 if _n_type
== old_child
then
888 if new_child
!= null then
889 new_child
.parent
= self
890 assert new_child
isa AType
899 redef fun visit_all
(v
: Visitor)
902 if _n_type
!= null then
903 v
.enter_visit
(_n_type
.as(not null))
907 redef class ASuperclass
908 private init empty_init
do end
910 init init_asuperclass
(
911 n_kwspecial
: nullable TKwspecial,
912 n_kwsuper
: nullable TKwsuper,
913 n_type
: nullable AType
917 _n_kwspecial
= n_kwspecial
918 if n_kwspecial
!= null then
919 n_kwspecial
.parent
= self
921 _n_kwsuper
= n_kwsuper
922 if n_kwsuper
!= null then
923 n_kwsuper
.parent
= self
925 _n_type
= n_type
.as(not null)
929 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
931 if _n_kwspecial
== old_child
then
932 if new_child
!= null then
933 new_child
.parent
= self
934 assert new_child
isa TKwspecial
935 _n_kwspecial
= new_child
941 if _n_kwsuper
== old_child
then
942 if new_child
!= null then
943 new_child
.parent
= self
944 assert new_child
isa TKwsuper
945 _n_kwsuper
= new_child
951 if _n_type
== old_child
then
952 if new_child
!= null then
953 new_child
.parent
= self
954 assert new_child
isa AType
963 redef fun visit_all
(v
: Visitor)
965 if _n_kwspecial
!= null then
966 v
.enter_visit
(_n_kwspecial
.as(not null))
968 if _n_kwsuper
!= null then
969 v
.enter_visit
(_n_kwsuper
.as(not null))
971 v
.enter_visit
(_n_type
)
974 redef class AAttrPropdef
975 private init empty_init
do end
977 init init_aattrpropdef
(
978 n_doc
: nullable ADoc,
979 n_readable
: nullable AAble,
980 n_writable
: nullable AAble,
981 n_kwredef
: nullable TKwredef,
982 n_visibility
: nullable AVisibility,
983 n_kwvar
: nullable TKwvar,
984 n_id
: nullable TAttrid,
986 n_type
: nullable AType,
987 n_expr
: nullable AExpr
992 if n_doc
!= null then
995 _n_readable
= n_readable
996 if n_readable
!= null then
997 n_readable
.parent
= self
999 _n_writable
= n_writable
1000 if n_writable
!= null then
1001 n_writable
.parent
= self
1003 _n_kwredef
= n_kwredef
1004 if n_kwredef
!= null then
1005 n_kwredef
.parent
= self
1007 _n_visibility
= n_visibility
.as(not null)
1008 n_visibility
.parent
= self
1009 _n_kwvar
= n_kwvar
.as(not null)
1010 n_kwvar
.parent
= self
1012 if n_id
!= null then
1016 if n_id2
!= null then
1020 if n_type
!= null then
1021 n_type
.parent
= self
1024 if n_expr
!= null then
1025 n_expr
.parent
= self
1029 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1031 if _n_doc
== old_child
then
1032 if new_child
!= null then
1033 new_child
.parent
= self
1034 assert new_child
isa ADoc
1041 if _n_readable
== old_child
then
1042 if new_child
!= null then
1043 new_child
.parent
= self
1044 assert new_child
isa AAble
1045 _n_readable
= new_child
1051 if _n_writable
== old_child
then
1052 if new_child
!= null then
1053 new_child
.parent
= self
1054 assert new_child
isa AAble
1055 _n_writable
= new_child
1061 if _n_kwredef
== old_child
then
1062 if new_child
!= null then
1063 new_child
.parent
= self
1064 assert new_child
isa TKwredef
1065 _n_kwredef
= new_child
1071 if _n_visibility
== old_child
then
1072 if new_child
!= null then
1073 new_child
.parent
= self
1074 assert new_child
isa AVisibility
1075 _n_visibility
= new_child
1081 if _n_kwvar
== old_child
then
1082 if new_child
!= null then
1083 new_child
.parent
= self
1084 assert new_child
isa TKwvar
1085 _n_kwvar
= new_child
1091 if _n_id
== old_child
then
1092 if new_child
!= null then
1093 new_child
.parent
= self
1094 assert new_child
isa TAttrid
1101 if _n_id2
== old_child
then
1102 if new_child
!= null then
1103 new_child
.parent
= self
1104 assert new_child
isa TId
1111 if _n_type
== old_child
then
1112 if new_child
!= null then
1113 new_child
.parent
= self
1114 assert new_child
isa AType
1121 if _n_expr
== old_child
then
1122 if new_child
!= null then
1123 new_child
.parent
= self
1124 assert new_child
isa AExpr
1133 redef fun visit_all
(v
: Visitor)
1135 if _n_doc
!= null then
1136 v
.enter_visit
(_n_doc
.as(not null))
1138 if _n_readable
!= null then
1139 v
.enter_visit
(_n_readable
.as(not null))
1141 if _n_writable
!= null then
1142 v
.enter_visit
(_n_writable
.as(not null))
1144 if _n_kwredef
!= null then
1145 v
.enter_visit
(_n_kwredef
.as(not null))
1147 v
.enter_visit
(_n_visibility
)
1148 v
.enter_visit
(_n_kwvar
)
1149 if _n_id
!= null then
1150 v
.enter_visit
(_n_id
.as(not null))
1152 if _n_id2
!= null then
1153 v
.enter_visit
(_n_id2
.as(not null))
1155 if _n_type
!= null then
1156 v
.enter_visit
(_n_type
.as(not null))
1158 if _n_expr
!= null then
1159 v
.enter_visit
(_n_expr
.as(not null))
1163 redef class AMethPropdef
1164 private init empty_init
do end
1166 init init_amethpropdef
(
1167 n_doc
: nullable ADoc,
1168 n_kwredef
: nullable TKwredef,
1169 n_visibility
: nullable AVisibility,
1170 n_methid
: nullable AMethid,
1171 n_signature
: nullable ASignature
1176 if n_doc
!= null then
1179 _n_kwredef
= n_kwredef
1180 if n_kwredef
!= null then
1181 n_kwredef
.parent
= self
1183 _n_visibility
= n_visibility
.as(not null)
1184 n_visibility
.parent
= self
1185 _n_methid
= n_methid
.as(not null)
1186 n_methid
.parent
= self
1187 _n_signature
= n_signature
.as(not null)
1188 n_signature
.parent
= self
1191 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1193 if _n_doc
== old_child
then
1194 if new_child
!= null then
1195 new_child
.parent
= self
1196 assert new_child
isa ADoc
1203 if _n_kwredef
== old_child
then
1204 if new_child
!= null then
1205 new_child
.parent
= self
1206 assert new_child
isa TKwredef
1207 _n_kwredef
= new_child
1213 if _n_visibility
== old_child
then
1214 if new_child
!= null then
1215 new_child
.parent
= self
1216 assert new_child
isa AVisibility
1217 _n_visibility
= new_child
1223 if _n_methid
== old_child
then
1224 if new_child
!= null then
1225 new_child
.parent
= self
1226 assert new_child
isa AMethid
1227 _n_methid
= new_child
1233 if _n_signature
== old_child
then
1234 if new_child
!= null then
1235 new_child
.parent
= self
1236 assert new_child
isa ASignature
1237 _n_signature
= new_child
1245 redef fun visit_all
(v
: Visitor)
1247 if _n_doc
!= null then
1248 v
.enter_visit
(_n_doc
.as(not null))
1250 if _n_kwredef
!= null then
1251 v
.enter_visit
(_n_kwredef
.as(not null))
1253 v
.enter_visit
(_n_visibility
)
1254 v
.enter_visit
(_n_methid
)
1255 v
.enter_visit
(_n_signature
)
1258 redef class ADeferredMethPropdef
1259 private init empty_init
do end
1261 init init_adeferredmethpropdef
(
1262 n_doc
: nullable ADoc,
1263 n_kwredef
: nullable TKwredef,
1264 n_visibility
: nullable AVisibility,
1265 n_kwmeth
: nullable TKwmeth,
1266 n_methid
: nullable AMethid,
1267 n_signature
: nullable ASignature
1272 if n_doc
!= null then
1275 _n_kwredef
= n_kwredef
1276 if n_kwredef
!= null then
1277 n_kwredef
.parent
= self
1279 _n_visibility
= n_visibility
.as(not null)
1280 n_visibility
.parent
= self
1281 _n_kwmeth
= n_kwmeth
.as(not null)
1282 n_kwmeth
.parent
= self
1283 _n_methid
= n_methid
.as(not null)
1284 n_methid
.parent
= self
1285 _n_signature
= n_signature
.as(not null)
1286 n_signature
.parent
= self
1289 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1291 if _n_doc
== old_child
then
1292 if new_child
!= null then
1293 new_child
.parent
= self
1294 assert new_child
isa ADoc
1301 if _n_kwredef
== old_child
then
1302 if new_child
!= null then
1303 new_child
.parent
= self
1304 assert new_child
isa TKwredef
1305 _n_kwredef
= new_child
1311 if _n_visibility
== old_child
then
1312 if new_child
!= null then
1313 new_child
.parent
= self
1314 assert new_child
isa AVisibility
1315 _n_visibility
= new_child
1321 if _n_kwmeth
== old_child
then
1322 if new_child
!= null then
1323 new_child
.parent
= self
1324 assert new_child
isa TKwmeth
1325 _n_kwmeth
= new_child
1331 if _n_methid
== old_child
then
1332 if new_child
!= null then
1333 new_child
.parent
= self
1334 assert new_child
isa AMethid
1335 _n_methid
= new_child
1341 if _n_signature
== old_child
then
1342 if new_child
!= null then
1343 new_child
.parent
= self
1344 assert new_child
isa ASignature
1345 _n_signature
= new_child
1353 redef fun visit_all
(v
: Visitor)
1355 if _n_doc
!= null then
1356 v
.enter_visit
(_n_doc
.as(not null))
1358 if _n_kwredef
!= null then
1359 v
.enter_visit
(_n_kwredef
.as(not null))
1361 v
.enter_visit
(_n_visibility
)
1362 v
.enter_visit
(_n_kwmeth
)
1363 v
.enter_visit
(_n_methid
)
1364 v
.enter_visit
(_n_signature
)
1367 redef class AInternMethPropdef
1368 private init empty_init
do end
1370 init init_ainternmethpropdef
(
1371 n_doc
: nullable ADoc,
1372 n_kwredef
: nullable TKwredef,
1373 n_visibility
: nullable AVisibility,
1374 n_kwmeth
: nullable TKwmeth,
1375 n_methid
: nullable AMethid,
1376 n_signature
: nullable ASignature
1381 if n_doc
!= null then
1384 _n_kwredef
= n_kwredef
1385 if n_kwredef
!= null then
1386 n_kwredef
.parent
= self
1388 _n_visibility
= n_visibility
.as(not null)
1389 n_visibility
.parent
= self
1390 _n_kwmeth
= n_kwmeth
.as(not null)
1391 n_kwmeth
.parent
= self
1392 _n_methid
= n_methid
.as(not null)
1393 n_methid
.parent
= self
1394 _n_signature
= n_signature
.as(not null)
1395 n_signature
.parent
= self
1398 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1400 if _n_doc
== old_child
then
1401 if new_child
!= null then
1402 new_child
.parent
= self
1403 assert new_child
isa ADoc
1410 if _n_kwredef
== old_child
then
1411 if new_child
!= null then
1412 new_child
.parent
= self
1413 assert new_child
isa TKwredef
1414 _n_kwredef
= new_child
1420 if _n_visibility
== old_child
then
1421 if new_child
!= null then
1422 new_child
.parent
= self
1423 assert new_child
isa AVisibility
1424 _n_visibility
= new_child
1430 if _n_kwmeth
== old_child
then
1431 if new_child
!= null then
1432 new_child
.parent
= self
1433 assert new_child
isa TKwmeth
1434 _n_kwmeth
= new_child
1440 if _n_methid
== old_child
then
1441 if new_child
!= null then
1442 new_child
.parent
= self
1443 assert new_child
isa AMethid
1444 _n_methid
= new_child
1450 if _n_signature
== old_child
then
1451 if new_child
!= null then
1452 new_child
.parent
= self
1453 assert new_child
isa ASignature
1454 _n_signature
= new_child
1462 redef fun visit_all
(v
: Visitor)
1464 if _n_doc
!= null then
1465 v
.enter_visit
(_n_doc
.as(not null))
1467 if _n_kwredef
!= null then
1468 v
.enter_visit
(_n_kwredef
.as(not null))
1470 v
.enter_visit
(_n_visibility
)
1471 v
.enter_visit
(_n_kwmeth
)
1472 v
.enter_visit
(_n_methid
)
1473 v
.enter_visit
(_n_signature
)
1476 redef class AExternMethPropdef
1477 private init empty_init
do end
1479 init init_aexternmethpropdef
(
1480 n_doc
: nullable ADoc,
1481 n_kwredef
: nullable TKwredef,
1482 n_visibility
: nullable AVisibility,
1483 n_kwmeth
: nullable TKwmeth,
1484 n_methid
: nullable AMethid,
1485 n_signature
: nullable ASignature,
1486 n_extern
: nullable TString,
1487 n_extern_calls
: nullable AExternCalls
1492 if n_doc
!= null then
1495 _n_kwredef
= n_kwredef
1496 if n_kwredef
!= null then
1497 n_kwredef
.parent
= self
1499 _n_visibility
= n_visibility
.as(not null)
1500 n_visibility
.parent
= self
1501 _n_kwmeth
= n_kwmeth
.as(not null)
1502 n_kwmeth
.parent
= self
1503 _n_methid
= n_methid
.as(not null)
1504 n_methid
.parent
= self
1505 _n_signature
= n_signature
.as(not null)
1506 n_signature
.parent
= self
1507 _n_extern
= n_extern
1508 if n_extern
!= null then
1509 n_extern
.parent
= self
1511 _n_extern_calls
= n_extern_calls
1512 if n_extern_calls
!= null then
1513 n_extern_calls
.parent
= self
1517 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1519 if _n_doc
== old_child
then
1520 if new_child
!= null then
1521 new_child
.parent
= self
1522 assert new_child
isa ADoc
1529 if _n_kwredef
== old_child
then
1530 if new_child
!= null then
1531 new_child
.parent
= self
1532 assert new_child
isa TKwredef
1533 _n_kwredef
= new_child
1539 if _n_visibility
== old_child
then
1540 if new_child
!= null then
1541 new_child
.parent
= self
1542 assert new_child
isa AVisibility
1543 _n_visibility
= new_child
1549 if _n_kwmeth
== old_child
then
1550 if new_child
!= null then
1551 new_child
.parent
= self
1552 assert new_child
isa TKwmeth
1553 _n_kwmeth
= new_child
1559 if _n_methid
== old_child
then
1560 if new_child
!= null then
1561 new_child
.parent
= self
1562 assert new_child
isa AMethid
1563 _n_methid
= new_child
1569 if _n_signature
== old_child
then
1570 if new_child
!= null then
1571 new_child
.parent
= self
1572 assert new_child
isa ASignature
1573 _n_signature
= new_child
1579 if _n_extern
== old_child
then
1580 if new_child
!= null then
1581 new_child
.parent
= self
1582 assert new_child
isa TString
1583 _n_extern
= new_child
1589 if _n_extern_calls
== old_child
then
1590 if new_child
!= null then
1591 new_child
.parent
= self
1592 assert new_child
isa AExternCalls
1593 _n_extern_calls
= new_child
1595 _n_extern_calls
= null
1601 redef fun visit_all
(v
: Visitor)
1603 if _n_doc
!= null then
1604 v
.enter_visit
(_n_doc
.as(not null))
1606 if _n_kwredef
!= null then
1607 v
.enter_visit
(_n_kwredef
.as(not null))
1609 v
.enter_visit
(_n_visibility
)
1610 v
.enter_visit
(_n_kwmeth
)
1611 v
.enter_visit
(_n_methid
)
1612 v
.enter_visit
(_n_signature
)
1613 if _n_extern
!= null then
1614 v
.enter_visit
(_n_extern
.as(not null))
1616 if _n_extern_calls
!= null then
1617 v
.enter_visit
(_n_extern_calls
.as(not null))
1621 redef class AConcreteMethPropdef
1622 private init empty_init
do end
1624 init init_aconcretemethpropdef
(
1625 n_doc
: nullable ADoc,
1626 n_kwredef
: nullable TKwredef,
1627 n_visibility
: nullable AVisibility,
1628 n_kwmeth
: nullable TKwmeth,
1629 n_methid
: nullable AMethid,
1630 n_signature
: nullable ASignature,
1631 n_block
: nullable AExpr
1636 if n_doc
!= null then
1639 _n_kwredef
= n_kwredef
1640 if n_kwredef
!= null then
1641 n_kwredef
.parent
= self
1643 _n_visibility
= n_visibility
.as(not null)
1644 n_visibility
.parent
= self
1645 _n_kwmeth
= n_kwmeth
.as(not null)
1646 n_kwmeth
.parent
= self
1647 _n_methid
= n_methid
.as(not null)
1648 n_methid
.parent
= self
1649 _n_signature
= n_signature
.as(not null)
1650 n_signature
.parent
= self
1652 if n_block
!= null then
1653 n_block
.parent
= self
1657 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1659 if _n_doc
== old_child
then
1660 if new_child
!= null then
1661 new_child
.parent
= self
1662 assert new_child
isa ADoc
1669 if _n_kwredef
== old_child
then
1670 if new_child
!= null then
1671 new_child
.parent
= self
1672 assert new_child
isa TKwredef
1673 _n_kwredef
= new_child
1679 if _n_visibility
== old_child
then
1680 if new_child
!= null then
1681 new_child
.parent
= self
1682 assert new_child
isa AVisibility
1683 _n_visibility
= new_child
1689 if _n_kwmeth
== old_child
then
1690 if new_child
!= null then
1691 new_child
.parent
= self
1692 assert new_child
isa TKwmeth
1693 _n_kwmeth
= new_child
1699 if _n_methid
== old_child
then
1700 if new_child
!= null then
1701 new_child
.parent
= self
1702 assert new_child
isa AMethid
1703 _n_methid
= new_child
1709 if _n_signature
== old_child
then
1710 if new_child
!= null then
1711 new_child
.parent
= self
1712 assert new_child
isa ASignature
1713 _n_signature
= new_child
1719 if _n_block
== old_child
then
1720 if new_child
!= null then
1721 new_child
.parent
= self
1722 assert new_child
isa AExpr
1723 _n_block
= new_child
1731 redef fun visit_all
(v
: Visitor)
1733 if _n_doc
!= null then
1734 v
.enter_visit
(_n_doc
.as(not null))
1736 if _n_kwredef
!= null then
1737 v
.enter_visit
(_n_kwredef
.as(not null))
1739 v
.enter_visit
(_n_visibility
)
1740 v
.enter_visit
(_n_kwmeth
)
1741 v
.enter_visit
(_n_methid
)
1742 v
.enter_visit
(_n_signature
)
1743 if _n_block
!= null then
1744 v
.enter_visit
(_n_block
.as(not null))
1748 redef class AConcreteInitPropdef
1749 private init empty_init
do end
1751 init init_aconcreteinitpropdef
(
1752 n_doc
: nullable ADoc,
1753 n_kwredef
: nullable TKwredef,
1754 n_visibility
: nullable AVisibility,
1755 n_kwinit
: nullable TKwinit,
1756 n_methid
: nullable AMethid,
1757 n_signature
: nullable ASignature,
1758 n_block
: nullable AExpr
1763 if n_doc
!= null then
1766 _n_kwredef
= n_kwredef
1767 if n_kwredef
!= null then
1768 n_kwredef
.parent
= self
1770 _n_visibility
= n_visibility
.as(not null)
1771 n_visibility
.parent
= self
1772 _n_kwinit
= n_kwinit
.as(not null)
1773 n_kwinit
.parent
= self
1774 _n_methid
= n_methid
1775 if n_methid
!= null then
1776 n_methid
.parent
= self
1778 _n_signature
= n_signature
.as(not null)
1779 n_signature
.parent
= self
1781 if n_block
!= null then
1782 n_block
.parent
= self
1786 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1788 if _n_doc
== old_child
then
1789 if new_child
!= null then
1790 new_child
.parent
= self
1791 assert new_child
isa ADoc
1798 if _n_kwredef
== old_child
then
1799 if new_child
!= null then
1800 new_child
.parent
= self
1801 assert new_child
isa TKwredef
1802 _n_kwredef
= new_child
1808 if _n_visibility
== old_child
then
1809 if new_child
!= null then
1810 new_child
.parent
= self
1811 assert new_child
isa AVisibility
1812 _n_visibility
= new_child
1818 if _n_kwinit
== old_child
then
1819 if new_child
!= null then
1820 new_child
.parent
= self
1821 assert new_child
isa TKwinit
1822 _n_kwinit
= new_child
1828 if _n_methid
== old_child
then
1829 if new_child
!= null then
1830 new_child
.parent
= self
1831 assert new_child
isa AMethid
1832 _n_methid
= new_child
1838 if _n_signature
== old_child
then
1839 if new_child
!= null then
1840 new_child
.parent
= self
1841 assert new_child
isa ASignature
1842 _n_signature
= new_child
1848 if _n_block
== old_child
then
1849 if new_child
!= null then
1850 new_child
.parent
= self
1851 assert new_child
isa AExpr
1852 _n_block
= new_child
1860 redef fun visit_all
(v
: Visitor)
1862 if _n_doc
!= null then
1863 v
.enter_visit
(_n_doc
.as(not null))
1865 if _n_kwredef
!= null then
1866 v
.enter_visit
(_n_kwredef
.as(not null))
1868 v
.enter_visit
(_n_visibility
)
1869 v
.enter_visit
(_n_kwinit
)
1870 if _n_methid
!= null then
1871 v
.enter_visit
(_n_methid
.as(not null))
1873 v
.enter_visit
(_n_signature
)
1874 if _n_block
!= null then
1875 v
.enter_visit
(_n_block
.as(not null))
1879 redef class AExternInitPropdef
1880 private init empty_init
do end
1882 init init_aexterninitpropdef
(
1883 n_doc
: nullable ADoc,
1884 n_kwredef
: nullable TKwredef,
1885 n_visibility
: nullable AVisibility,
1886 n_kwnew
: nullable TKwnew,
1887 n_methid
: nullable AMethid,
1888 n_signature
: nullable ASignature,
1889 n_extern
: nullable TString,
1890 n_extern_calls
: nullable AExternCalls
1895 if n_doc
!= null then
1898 _n_kwredef
= n_kwredef
1899 if n_kwredef
!= null then
1900 n_kwredef
.parent
= self
1902 _n_visibility
= n_visibility
.as(not null)
1903 n_visibility
.parent
= self
1904 _n_kwnew
= n_kwnew
.as(not null)
1905 n_kwnew
.parent
= self
1906 _n_methid
= n_methid
1907 if n_methid
!= null then
1908 n_methid
.parent
= self
1910 _n_signature
= n_signature
.as(not null)
1911 n_signature
.parent
= self
1912 _n_extern
= n_extern
1913 if n_extern
!= null then
1914 n_extern
.parent
= self
1916 _n_extern_calls
= n_extern_calls
1917 if n_extern_calls
!= null then
1918 n_extern_calls
.parent
= self
1922 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1924 if _n_doc
== old_child
then
1925 if new_child
!= null then
1926 new_child
.parent
= self
1927 assert new_child
isa ADoc
1934 if _n_kwredef
== old_child
then
1935 if new_child
!= null then
1936 new_child
.parent
= self
1937 assert new_child
isa TKwredef
1938 _n_kwredef
= new_child
1944 if _n_visibility
== old_child
then
1945 if new_child
!= null then
1946 new_child
.parent
= self
1947 assert new_child
isa AVisibility
1948 _n_visibility
= new_child
1954 if _n_kwnew
== old_child
then
1955 if new_child
!= null then
1956 new_child
.parent
= self
1957 assert new_child
isa TKwnew
1958 _n_kwnew
= new_child
1964 if _n_methid
== old_child
then
1965 if new_child
!= null then
1966 new_child
.parent
= self
1967 assert new_child
isa AMethid
1968 _n_methid
= new_child
1974 if _n_signature
== old_child
then
1975 if new_child
!= null then
1976 new_child
.parent
= self
1977 assert new_child
isa ASignature
1978 _n_signature
= new_child
1984 if _n_extern
== old_child
then
1985 if new_child
!= null then
1986 new_child
.parent
= self
1987 assert new_child
isa TString
1988 _n_extern
= new_child
1994 if _n_extern_calls
== old_child
then
1995 if new_child
!= null then
1996 new_child
.parent
= self
1997 assert new_child
isa AExternCalls
1998 _n_extern_calls
= new_child
2000 _n_extern_calls
= null
2006 redef fun visit_all
(v
: Visitor)
2008 if _n_doc
!= null then
2009 v
.enter_visit
(_n_doc
.as(not null))
2011 if _n_kwredef
!= null then
2012 v
.enter_visit
(_n_kwredef
.as(not null))
2014 v
.enter_visit
(_n_visibility
)
2015 v
.enter_visit
(_n_kwnew
)
2016 if _n_methid
!= null then
2017 v
.enter_visit
(_n_methid
.as(not null))
2019 v
.enter_visit
(_n_signature
)
2020 if _n_extern
!= null then
2021 v
.enter_visit
(_n_extern
.as(not null))
2023 if _n_extern_calls
!= null then
2024 v
.enter_visit
(_n_extern_calls
.as(not null))
2028 redef class AMainMethPropdef
2029 private init empty_init
do end
2031 init init_amainmethpropdef
(
2032 n_kwredef
: nullable TKwredef,
2033 n_block
: nullable AExpr
2037 _n_kwredef
= n_kwredef
2038 if n_kwredef
!= null then
2039 n_kwredef
.parent
= self
2042 if n_block
!= null then
2043 n_block
.parent
= self
2047 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2049 if _n_kwredef
== old_child
then
2050 if new_child
!= null then
2051 new_child
.parent
= self
2052 assert new_child
isa TKwredef
2053 _n_kwredef
= new_child
2059 if _n_block
== old_child
then
2060 if new_child
!= null then
2061 new_child
.parent
= self
2062 assert new_child
isa AExpr
2063 _n_block
= new_child
2071 redef fun visit_all
(v
: Visitor)
2073 if _n_kwredef
!= null then
2074 v
.enter_visit
(_n_kwredef
.as(not null))
2076 if _n_block
!= null then
2077 v
.enter_visit
(_n_block
.as(not null))
2081 redef class ATypePropdef
2082 private init empty_init
do end
2084 init init_atypepropdef
(
2085 n_doc
: nullable ADoc,
2086 n_kwredef
: nullable TKwredef,
2087 n_visibility
: nullable AVisibility,
2088 n_kwtype
: nullable TKwtype,
2089 n_id
: nullable TClassid,
2090 n_type
: nullable AType
2095 if n_doc
!= null then
2098 _n_kwredef
= n_kwredef
2099 if n_kwredef
!= null then
2100 n_kwredef
.parent
= self
2102 _n_visibility
= n_visibility
.as(not null)
2103 n_visibility
.parent
= self
2104 _n_kwtype
= n_kwtype
.as(not null)
2105 n_kwtype
.parent
= self
2106 _n_id
= n_id
.as(not null)
2108 _n_type
= n_type
.as(not null)
2109 n_type
.parent
= self
2112 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2114 if _n_doc
== old_child
then
2115 if new_child
!= null then
2116 new_child
.parent
= self
2117 assert new_child
isa ADoc
2124 if _n_kwredef
== old_child
then
2125 if new_child
!= null then
2126 new_child
.parent
= self
2127 assert new_child
isa TKwredef
2128 _n_kwredef
= new_child
2134 if _n_visibility
== old_child
then
2135 if new_child
!= null then
2136 new_child
.parent
= self
2137 assert new_child
isa AVisibility
2138 _n_visibility
= new_child
2144 if _n_kwtype
== old_child
then
2145 if new_child
!= null then
2146 new_child
.parent
= self
2147 assert new_child
isa TKwtype
2148 _n_kwtype
= new_child
2154 if _n_id
== old_child
then
2155 if new_child
!= null then
2156 new_child
.parent
= self
2157 assert new_child
isa TClassid
2164 if _n_type
== old_child
then
2165 if new_child
!= null then
2166 new_child
.parent
= self
2167 assert new_child
isa AType
2176 redef fun visit_all
(v
: Visitor)
2178 if _n_doc
!= null then
2179 v
.enter_visit
(_n_doc
.as(not null))
2181 if _n_kwredef
!= null then
2182 v
.enter_visit
(_n_kwredef
.as(not null))
2184 v
.enter_visit
(_n_visibility
)
2185 v
.enter_visit
(_n_kwtype
)
2186 v
.enter_visit
(_n_id
)
2187 v
.enter_visit
(_n_type
)
2190 redef class AReadAble
2191 private init empty_init
do end
2193 init init_areadable
(
2194 n_kwredef
: nullable TKwredef,
2195 n_kwreadable
: nullable TKwreadable
2199 _n_kwredef
= n_kwredef
2200 if n_kwredef
!= null then
2201 n_kwredef
.parent
= self
2203 _n_kwreadable
= n_kwreadable
.as(not null)
2204 n_kwreadable
.parent
= self
2207 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2209 if _n_kwredef
== old_child
then
2210 if new_child
!= null then
2211 new_child
.parent
= self
2212 assert new_child
isa TKwredef
2213 _n_kwredef
= new_child
2219 if _n_kwreadable
== old_child
then
2220 if new_child
!= null then
2221 new_child
.parent
= self
2222 assert new_child
isa TKwreadable
2223 _n_kwreadable
= new_child
2231 redef fun visit_all
(v
: Visitor)
2233 if _n_kwredef
!= null then
2234 v
.enter_visit
(_n_kwredef
.as(not null))
2236 v
.enter_visit
(_n_kwreadable
)
2239 redef class AWriteAble
2240 private init empty_init
do end
2242 init init_awriteable
(
2243 n_kwredef
: nullable TKwredef,
2244 n_visibility
: nullable AVisibility,
2245 n_kwwritable
: nullable TKwwritable
2249 _n_kwredef
= n_kwredef
2250 if n_kwredef
!= null then
2251 n_kwredef
.parent
= self
2253 _n_visibility
= n_visibility
2254 if n_visibility
!= null then
2255 n_visibility
.parent
= self
2257 _n_kwwritable
= n_kwwritable
.as(not null)
2258 n_kwwritable
.parent
= self
2261 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2263 if _n_kwredef
== old_child
then
2264 if new_child
!= null then
2265 new_child
.parent
= self
2266 assert new_child
isa TKwredef
2267 _n_kwredef
= new_child
2273 if _n_visibility
== old_child
then
2274 if new_child
!= null then
2275 new_child
.parent
= self
2276 assert new_child
isa AVisibility
2277 _n_visibility
= new_child
2279 _n_visibility
= null
2283 if _n_kwwritable
== old_child
then
2284 if new_child
!= null then
2285 new_child
.parent
= self
2286 assert new_child
isa TKwwritable
2287 _n_kwwritable
= new_child
2295 redef fun visit_all
(v
: Visitor)
2297 if _n_kwredef
!= null then
2298 v
.enter_visit
(_n_kwredef
.as(not null))
2300 if _n_visibility
!= null then
2301 v
.enter_visit
(_n_visibility
.as(not null))
2303 v
.enter_visit
(_n_kwwritable
)
2306 redef class AIdMethid
2307 private init empty_init
do end
2309 init init_aidmethid
(
2314 _n_id
= n_id
.as(not null)
2318 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2320 if _n_id
== old_child
then
2321 if new_child
!= null then
2322 new_child
.parent
= self
2323 assert new_child
isa TId
2332 redef fun visit_all
(v
: Visitor)
2334 v
.enter_visit
(_n_id
)
2337 redef class APlusMethid
2338 private init empty_init
do end
2340 init init_aplusmethid
(
2341 n_plus
: nullable TPlus
2345 _n_plus
= n_plus
.as(not null)
2346 n_plus
.parent
= self
2349 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2351 if _n_plus
== old_child
then
2352 if new_child
!= null then
2353 new_child
.parent
= self
2354 assert new_child
isa TPlus
2363 redef fun visit_all
(v
: Visitor)
2365 v
.enter_visit
(_n_plus
)
2368 redef class AMinusMethid
2369 private init empty_init
do end
2371 init init_aminusmethid
(
2372 n_minus
: nullable TMinus
2376 _n_minus
= n_minus
.as(not null)
2377 n_minus
.parent
= self
2380 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2382 if _n_minus
== old_child
then
2383 if new_child
!= null then
2384 new_child
.parent
= self
2385 assert new_child
isa TMinus
2386 _n_minus
= new_child
2394 redef fun visit_all
(v
: Visitor)
2396 v
.enter_visit
(_n_minus
)
2399 redef class AStarMethid
2400 private init empty_init
do end
2402 init init_astarmethid
(
2403 n_star
: nullable TStar
2407 _n_star
= n_star
.as(not null)
2408 n_star
.parent
= self
2411 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2413 if _n_star
== old_child
then
2414 if new_child
!= null then
2415 new_child
.parent
= self
2416 assert new_child
isa TStar
2425 redef fun visit_all
(v
: Visitor)
2427 v
.enter_visit
(_n_star
)
2430 redef class ASlashMethid
2431 private init empty_init
do end
2433 init init_aslashmethid
(
2434 n_slash
: nullable TSlash
2438 _n_slash
= n_slash
.as(not null)
2439 n_slash
.parent
= self
2442 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2444 if _n_slash
== old_child
then
2445 if new_child
!= null then
2446 new_child
.parent
= self
2447 assert new_child
isa TSlash
2448 _n_slash
= new_child
2456 redef fun visit_all
(v
: Visitor)
2458 v
.enter_visit
(_n_slash
)
2461 redef class APercentMethid
2462 private init empty_init
do end
2464 init init_apercentmethid
(
2465 n_percent
: nullable TPercent
2469 _n_percent
= n_percent
.as(not null)
2470 n_percent
.parent
= self
2473 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2475 if _n_percent
== old_child
then
2476 if new_child
!= null then
2477 new_child
.parent
= self
2478 assert new_child
isa TPercent
2479 _n_percent
= new_child
2487 redef fun visit_all
(v
: Visitor)
2489 v
.enter_visit
(_n_percent
)
2492 redef class AEqMethid
2493 private init empty_init
do end
2495 init init_aeqmethid
(
2500 _n_eq
= n_eq
.as(not null)
2504 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2506 if _n_eq
== old_child
then
2507 if new_child
!= null then
2508 new_child
.parent
= self
2509 assert new_child
isa TEq
2518 redef fun visit_all
(v
: Visitor)
2520 v
.enter_visit
(_n_eq
)
2523 redef class ANeMethid
2524 private init empty_init
do end
2526 init init_anemethid
(
2531 _n_ne
= n_ne
.as(not null)
2535 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2537 if _n_ne
== old_child
then
2538 if new_child
!= null then
2539 new_child
.parent
= self
2540 assert new_child
isa TNe
2549 redef fun visit_all
(v
: Visitor)
2551 v
.enter_visit
(_n_ne
)
2554 redef class ALeMethid
2555 private init empty_init
do end
2557 init init_alemethid
(
2562 _n_le
= n_le
.as(not null)
2566 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2568 if _n_le
== old_child
then
2569 if new_child
!= null then
2570 new_child
.parent
= self
2571 assert new_child
isa TLe
2580 redef fun visit_all
(v
: Visitor)
2582 v
.enter_visit
(_n_le
)
2585 redef class AGeMethid
2586 private init empty_init
do end
2588 init init_agemethid
(
2593 _n_ge
= n_ge
.as(not null)
2597 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2599 if _n_ge
== old_child
then
2600 if new_child
!= null then
2601 new_child
.parent
= self
2602 assert new_child
isa TGe
2611 redef fun visit_all
(v
: Visitor)
2613 v
.enter_visit
(_n_ge
)
2616 redef class ALtMethid
2617 private init empty_init
do end
2619 init init_altmethid
(
2624 _n_lt
= n_lt
.as(not null)
2628 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2630 if _n_lt
== old_child
then
2631 if new_child
!= null then
2632 new_child
.parent
= self
2633 assert new_child
isa TLt
2642 redef fun visit_all
(v
: Visitor)
2644 v
.enter_visit
(_n_lt
)
2647 redef class AGtMethid
2648 private init empty_init
do end
2650 init init_agtmethid
(
2655 _n_gt
= n_gt
.as(not null)
2659 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2661 if _n_gt
== old_child
then
2662 if new_child
!= null then
2663 new_child
.parent
= self
2664 assert new_child
isa TGt
2673 redef fun visit_all
(v
: Visitor)
2675 v
.enter_visit
(_n_gt
)
2678 redef class ALlMethid
2679 private init empty_init
do end
2681 init init_allmethid
(
2686 _n_ll
= n_ll
.as(not null)
2690 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2692 if _n_ll
== old_child
then
2693 if new_child
!= null then
2694 new_child
.parent
= self
2695 assert new_child
isa TLl
2704 redef fun visit_all
(v
: Visitor)
2706 v
.enter_visit
(_n_ll
)
2709 redef class AGgMethid
2710 private init empty_init
do end
2712 init init_aggmethid
(
2717 _n_gg
= n_gg
.as(not null)
2721 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2723 if _n_gg
== old_child
then
2724 if new_child
!= null then
2725 new_child
.parent
= self
2726 assert new_child
isa TGg
2735 redef fun visit_all
(v
: Visitor)
2737 v
.enter_visit
(_n_gg
)
2740 redef class ABraMethid
2741 private init empty_init
do end
2743 init init_abramethid
(
2744 n_obra
: nullable TObra,
2745 n_cbra
: nullable TCbra
2749 _n_obra
= n_obra
.as(not null)
2750 n_obra
.parent
= self
2751 _n_cbra
= n_cbra
.as(not null)
2752 n_cbra
.parent
= self
2755 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2757 if _n_obra
== old_child
then
2758 if new_child
!= null then
2759 new_child
.parent
= self
2760 assert new_child
isa TObra
2767 if _n_cbra
== old_child
then
2768 if new_child
!= null then
2769 new_child
.parent
= self
2770 assert new_child
isa TCbra
2779 redef fun visit_all
(v
: Visitor)
2781 v
.enter_visit
(_n_obra
)
2782 v
.enter_visit
(_n_cbra
)
2785 redef class AStarshipMethid
2786 private init empty_init
do end
2788 init init_astarshipmethid
(
2789 n_starship
: nullable TStarship
2793 _n_starship
= n_starship
.as(not null)
2794 n_starship
.parent
= self
2797 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2799 if _n_starship
== old_child
then
2800 if new_child
!= null then
2801 new_child
.parent
= self
2802 assert new_child
isa TStarship
2803 _n_starship
= new_child
2811 redef fun visit_all
(v
: Visitor)
2813 v
.enter_visit
(_n_starship
)
2816 redef class AAssignMethid
2817 private init empty_init
do end
2819 init init_aassignmethid
(
2821 n_assign
: nullable TAssign
2825 _n_id
= n_id
.as(not null)
2827 _n_assign
= n_assign
.as(not null)
2828 n_assign
.parent
= self
2831 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2833 if _n_id
== old_child
then
2834 if new_child
!= null then
2835 new_child
.parent
= self
2836 assert new_child
isa TId
2843 if _n_assign
== old_child
then
2844 if new_child
!= null then
2845 new_child
.parent
= self
2846 assert new_child
isa TAssign
2847 _n_assign
= new_child
2855 redef fun visit_all
(v
: Visitor)
2857 v
.enter_visit
(_n_id
)
2858 v
.enter_visit
(_n_assign
)
2861 redef class ABraassignMethid
2862 private init empty_init
do end
2864 init init_abraassignmethid
(
2865 n_obra
: nullable TObra,
2866 n_cbra
: nullable TCbra,
2867 n_assign
: nullable TAssign
2871 _n_obra
= n_obra
.as(not null)
2872 n_obra
.parent
= self
2873 _n_cbra
= n_cbra
.as(not null)
2874 n_cbra
.parent
= self
2875 _n_assign
= n_assign
.as(not null)
2876 n_assign
.parent
= self
2879 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2881 if _n_obra
== old_child
then
2882 if new_child
!= null then
2883 new_child
.parent
= self
2884 assert new_child
isa TObra
2891 if _n_cbra
== old_child
then
2892 if new_child
!= null then
2893 new_child
.parent
= self
2894 assert new_child
isa TCbra
2901 if _n_assign
== old_child
then
2902 if new_child
!= null then
2903 new_child
.parent
= self
2904 assert new_child
isa TAssign
2905 _n_assign
= new_child
2913 redef fun visit_all
(v
: Visitor)
2915 v
.enter_visit
(_n_obra
)
2916 v
.enter_visit
(_n_cbra
)
2917 v
.enter_visit
(_n_assign
)
2920 redef class ASignature
2921 private init empty_init
do end
2923 init init_asignature
(
2924 n_params
: Collection[Object], # Should be Collection[AParam]
2925 n_type
: nullable AType,
2926 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2930 for n
in n_params
do
2936 if n_type
!= null then
2937 n_type
.parent
= self
2939 for n
in n_closure_decls
do
2940 assert n
isa AClosureDecl
2941 _n_closure_decls
.add
(n
)
2946 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2948 for i
in [0.._n_params
.length
[ do
2949 if _n_params
[i
] == old_child
then
2950 if new_child
!= null then
2951 assert new_child
isa AParam
2952 _n_params
[i
] = new_child
2953 new_child
.parent
= self
2955 _n_params
.remove_at
(i
)
2960 if _n_type
== old_child
then
2961 if new_child
!= null then
2962 new_child
.parent
= self
2963 assert new_child
isa AType
2970 for i
in [0.._n_closure_decls
.length
[ do
2971 if _n_closure_decls
[i
] == old_child
then
2972 if new_child
!= null then
2973 assert new_child
isa AClosureDecl
2974 _n_closure_decls
[i
] = new_child
2975 new_child
.parent
= self
2977 _n_closure_decls
.remove_at
(i
)
2984 redef fun visit_all
(v
: Visitor)
2986 for n
in _n_params
do
2989 if _n_type
!= null then
2990 v
.enter_visit
(_n_type
.as(not null))
2992 for n
in _n_closure_decls
do
2998 private init empty_init
do end
3002 n_type
: nullable AType,
3003 n_dotdotdot
: nullable TDotdotdot
3007 _n_id
= n_id
.as(not null)
3010 if n_type
!= null then
3011 n_type
.parent
= self
3013 _n_dotdotdot
= n_dotdotdot
3014 if n_dotdotdot
!= null then
3015 n_dotdotdot
.parent
= self
3019 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3021 if _n_id
== old_child
then
3022 if new_child
!= null then
3023 new_child
.parent
= self
3024 assert new_child
isa TId
3031 if _n_type
== old_child
then
3032 if new_child
!= null then
3033 new_child
.parent
= self
3034 assert new_child
isa AType
3041 if _n_dotdotdot
== old_child
then
3042 if new_child
!= null then
3043 new_child
.parent
= self
3044 assert new_child
isa TDotdotdot
3045 _n_dotdotdot
= new_child
3053 redef fun visit_all
(v
: Visitor)
3055 v
.enter_visit
(_n_id
)
3056 if _n_type
!= null then
3057 v
.enter_visit
(_n_type
.as(not null))
3059 if _n_dotdotdot
!= null then
3060 v
.enter_visit
(_n_dotdotdot
.as(not null))
3064 redef class AClosureDecl
3065 private init empty_init
do end
3067 init init_aclosuredecl
(
3068 n_kwbreak
: nullable TKwbreak,
3069 n_bang
: nullable TBang,
3071 n_signature
: nullable ASignature,
3072 n_expr
: nullable AExpr
3076 _n_kwbreak
= n_kwbreak
3077 if n_kwbreak
!= null then
3078 n_kwbreak
.parent
= self
3080 _n_bang
= n_bang
.as(not null)
3081 n_bang
.parent
= self
3082 _n_id
= n_id
.as(not null)
3084 _n_signature
= n_signature
.as(not null)
3085 n_signature
.parent
= self
3087 if n_expr
!= null then
3088 n_expr
.parent
= self
3092 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3094 if _n_kwbreak
== old_child
then
3095 if new_child
!= null then
3096 new_child
.parent
= self
3097 assert new_child
isa TKwbreak
3098 _n_kwbreak
= new_child
3104 if _n_bang
== old_child
then
3105 if new_child
!= null then
3106 new_child
.parent
= self
3107 assert new_child
isa TBang
3114 if _n_id
== old_child
then
3115 if new_child
!= null then
3116 new_child
.parent
= self
3117 assert new_child
isa TId
3124 if _n_signature
== old_child
then
3125 if new_child
!= null then
3126 new_child
.parent
= self
3127 assert new_child
isa ASignature
3128 _n_signature
= new_child
3134 if _n_expr
== old_child
then
3135 if new_child
!= null then
3136 new_child
.parent
= self
3137 assert new_child
isa AExpr
3146 redef fun visit_all
(v
: Visitor)
3148 if _n_kwbreak
!= null then
3149 v
.enter_visit
(_n_kwbreak
.as(not null))
3151 v
.enter_visit
(_n_bang
)
3152 v
.enter_visit
(_n_id
)
3153 v
.enter_visit
(_n_signature
)
3154 if _n_expr
!= null then
3155 v
.enter_visit
(_n_expr
.as(not null))
3160 private init empty_init
do end
3163 n_kwnullable
: nullable TKwnullable,
3164 n_id
: nullable TClassid,
3165 n_types
: Collection[Object] # Should be Collection[AType]
3169 _n_kwnullable
= n_kwnullable
3170 if n_kwnullable
!= null then
3171 n_kwnullable
.parent
= self
3173 _n_id
= n_id
.as(not null)
3182 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3184 if _n_kwnullable
== old_child
then
3185 if new_child
!= null then
3186 new_child
.parent
= self
3187 assert new_child
isa TKwnullable
3188 _n_kwnullable
= new_child
3190 _n_kwnullable
= null
3194 if _n_id
== old_child
then
3195 if new_child
!= null then
3196 new_child
.parent
= self
3197 assert new_child
isa TClassid
3204 for i
in [0.._n_types
.length
[ do
3205 if _n_types
[i
] == old_child
then
3206 if new_child
!= null then
3207 assert new_child
isa AType
3208 _n_types
[i
] = new_child
3209 new_child
.parent
= self
3211 _n_types
.remove_at
(i
)
3218 redef fun visit_all
(v
: Visitor)
3220 if _n_kwnullable
!= null then
3221 v
.enter_visit
(_n_kwnullable
.as(not null))
3223 v
.enter_visit
(_n_id
)
3224 for n
in _n_types
do
3230 private init empty_init
do end
3233 n_kwlabel
: nullable TKwlabel,
3238 _n_kwlabel
= n_kwlabel
.as(not null)
3239 n_kwlabel
.parent
= self
3240 _n_id
= n_id
.as(not null)
3244 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3246 if _n_kwlabel
== old_child
then
3247 if new_child
!= null then
3248 new_child
.parent
= self
3249 assert new_child
isa TKwlabel
3250 _n_kwlabel
= new_child
3256 if _n_id
== old_child
then
3257 if new_child
!= null then
3258 new_child
.parent
= self
3259 assert new_child
isa TId
3268 redef fun visit_all
(v
: Visitor)
3270 v
.enter_visit
(_n_kwlabel
)
3271 v
.enter_visit
(_n_id
)
3274 redef class ABlockExpr
3275 private init empty_init
do end
3277 init init_ablockexpr
(
3278 n_expr
: Collection[Object], # Should be Collection[AExpr]
3279 n_kwend
: nullable TKwend
3289 if n_kwend
!= null then
3290 n_kwend
.parent
= self
3294 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3296 for i
in [0.._n_expr
.length
[ do
3297 if _n_expr
[i
] == old_child
then
3298 if new_child
!= null then
3299 assert new_child
isa AExpr
3300 _n_expr
[i
] = new_child
3301 new_child
.parent
= self
3303 _n_expr
.remove_at
(i
)
3308 if _n_kwend
== old_child
then
3309 if new_child
!= null then
3310 new_child
.parent
= self
3311 assert new_child
isa TKwend
3312 _n_kwend
= new_child
3320 redef fun visit_all
(v
: Visitor)
3325 if _n_kwend
!= null then
3326 v
.enter_visit
(_n_kwend
.as(not null))
3330 redef class AVardeclExpr
3331 private init empty_init
do end
3333 init init_avardeclexpr
(
3334 n_kwvar
: nullable TKwvar,
3336 n_type
: nullable AType,
3337 n_assign
: nullable TAssign,
3338 n_expr
: nullable AExpr
3342 _n_kwvar
= n_kwvar
.as(not null)
3343 n_kwvar
.parent
= self
3344 _n_id
= n_id
.as(not null)
3347 if n_type
!= null then
3348 n_type
.parent
= self
3350 _n_assign
= n_assign
3351 if n_assign
!= null then
3352 n_assign
.parent
= self
3355 if n_expr
!= null then
3356 n_expr
.parent
= self
3360 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3362 if _n_kwvar
== old_child
then
3363 if new_child
!= null then
3364 new_child
.parent
= self
3365 assert new_child
isa TKwvar
3366 _n_kwvar
= new_child
3372 if _n_id
== old_child
then
3373 if new_child
!= null then
3374 new_child
.parent
= self
3375 assert new_child
isa TId
3382 if _n_type
== old_child
then
3383 if new_child
!= null then
3384 new_child
.parent
= self
3385 assert new_child
isa AType
3392 if _n_assign
== old_child
then
3393 if new_child
!= null then
3394 new_child
.parent
= self
3395 assert new_child
isa TAssign
3396 _n_assign
= new_child
3402 if _n_expr
== old_child
then
3403 if new_child
!= null then
3404 new_child
.parent
= self
3405 assert new_child
isa AExpr
3414 redef fun visit_all
(v
: Visitor)
3416 v
.enter_visit
(_n_kwvar
)
3417 v
.enter_visit
(_n_id
)
3418 if _n_type
!= null then
3419 v
.enter_visit
(_n_type
.as(not null))
3421 if _n_assign
!= null then
3422 v
.enter_visit
(_n_assign
.as(not null))
3424 if _n_expr
!= null then
3425 v
.enter_visit
(_n_expr
.as(not null))
3429 redef class AReturnExpr
3430 private init empty_init
do end
3432 init init_areturnexpr
(
3433 n_kwreturn
: nullable TKwreturn,
3434 n_expr
: nullable AExpr
3438 _n_kwreturn
= n_kwreturn
3439 if n_kwreturn
!= null then
3440 n_kwreturn
.parent
= self
3443 if n_expr
!= null then
3444 n_expr
.parent
= self
3448 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3450 if _n_kwreturn
== old_child
then
3451 if new_child
!= null then
3452 new_child
.parent
= self
3453 assert new_child
isa TKwreturn
3454 _n_kwreturn
= new_child
3460 if _n_expr
== old_child
then
3461 if new_child
!= null then
3462 new_child
.parent
= self
3463 assert new_child
isa AExpr
3472 redef fun visit_all
(v
: Visitor)
3474 if _n_kwreturn
!= null then
3475 v
.enter_visit
(_n_kwreturn
.as(not null))
3477 if _n_expr
!= null then
3478 v
.enter_visit
(_n_expr
.as(not null))
3482 redef class ABreakExpr
3483 private init empty_init
do end
3485 init init_abreakexpr
(
3486 n_kwbreak
: nullable TKwbreak,
3487 n_label
: nullable ALabel,
3488 n_expr
: nullable AExpr
3492 _n_kwbreak
= n_kwbreak
.as(not null)
3493 n_kwbreak
.parent
= self
3495 if n_label
!= null then
3496 n_label
.parent
= self
3499 if n_expr
!= null then
3500 n_expr
.parent
= self
3504 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3506 if _n_kwbreak
== old_child
then
3507 if new_child
!= null then
3508 new_child
.parent
= self
3509 assert new_child
isa TKwbreak
3510 _n_kwbreak
= new_child
3516 if _n_label
== old_child
then
3517 if new_child
!= null then
3518 new_child
.parent
= self
3519 assert new_child
isa ALabel
3520 _n_label
= new_child
3526 if _n_expr
== old_child
then
3527 if new_child
!= null then
3528 new_child
.parent
= self
3529 assert new_child
isa AExpr
3538 redef fun visit_all
(v
: Visitor)
3540 v
.enter_visit
(_n_kwbreak
)
3541 if _n_label
!= null then
3542 v
.enter_visit
(_n_label
.as(not null))
3544 if _n_expr
!= null then
3545 v
.enter_visit
(_n_expr
.as(not null))
3549 redef class AAbortExpr
3550 private init empty_init
do end
3552 init init_aabortexpr
(
3553 n_kwabort
: nullable TKwabort
3557 _n_kwabort
= n_kwabort
.as(not null)
3558 n_kwabort
.parent
= self
3561 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3563 if _n_kwabort
== old_child
then
3564 if new_child
!= null then
3565 new_child
.parent
= self
3566 assert new_child
isa TKwabort
3567 _n_kwabort
= new_child
3575 redef fun visit_all
(v
: Visitor)
3577 v
.enter_visit
(_n_kwabort
)
3580 redef class AContinueExpr
3581 private init empty_init
do end
3583 init init_acontinueexpr
(
3584 n_kwcontinue
: nullable TKwcontinue,
3585 n_label
: nullable ALabel,
3586 n_expr
: nullable AExpr
3590 _n_kwcontinue
= n_kwcontinue
3591 if n_kwcontinue
!= null then
3592 n_kwcontinue
.parent
= self
3595 if n_label
!= null then
3596 n_label
.parent
= self
3599 if n_expr
!= null then
3600 n_expr
.parent
= self
3604 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3606 if _n_kwcontinue
== old_child
then
3607 if new_child
!= null then
3608 new_child
.parent
= self
3609 assert new_child
isa TKwcontinue
3610 _n_kwcontinue
= new_child
3612 _n_kwcontinue
= null
3616 if _n_label
== old_child
then
3617 if new_child
!= null then
3618 new_child
.parent
= self
3619 assert new_child
isa ALabel
3620 _n_label
= new_child
3626 if _n_expr
== old_child
then
3627 if new_child
!= null then
3628 new_child
.parent
= self
3629 assert new_child
isa AExpr
3638 redef fun visit_all
(v
: Visitor)
3640 if _n_kwcontinue
!= null then
3641 v
.enter_visit
(_n_kwcontinue
.as(not null))
3643 if _n_label
!= null then
3644 v
.enter_visit
(_n_label
.as(not null))
3646 if _n_expr
!= null then
3647 v
.enter_visit
(_n_expr
.as(not null))
3652 private init empty_init
do end
3655 n_kwdo
: nullable TKwdo,
3656 n_block
: nullable AExpr,
3657 n_label
: nullable ALabel
3661 _n_kwdo
= n_kwdo
.as(not null)
3662 n_kwdo
.parent
= self
3664 if n_block
!= null then
3665 n_block
.parent
= self
3668 if n_label
!= null then
3669 n_label
.parent
= self
3673 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3675 if _n_kwdo
== old_child
then
3676 if new_child
!= null then
3677 new_child
.parent
= self
3678 assert new_child
isa TKwdo
3685 if _n_block
== old_child
then
3686 if new_child
!= null then
3687 new_child
.parent
= self
3688 assert new_child
isa AExpr
3689 _n_block
= new_child
3695 if _n_label
== old_child
then
3696 if new_child
!= null then
3697 new_child
.parent
= self
3698 assert new_child
isa ALabel
3699 _n_label
= new_child
3707 redef fun visit_all
(v
: Visitor)
3709 v
.enter_visit
(_n_kwdo
)
3710 if _n_block
!= null then
3711 v
.enter_visit
(_n_block
.as(not null))
3713 if _n_label
!= null then
3714 v
.enter_visit
(_n_label
.as(not null))
3719 private init empty_init
do end
3722 n_kwif
: nullable TKwif,
3723 n_expr
: nullable AExpr,
3724 n_then
: nullable AExpr,
3725 n_else
: nullable AExpr
3729 _n_kwif
= n_kwif
.as(not null)
3730 n_kwif
.parent
= self
3731 _n_expr
= n_expr
.as(not null)
3732 n_expr
.parent
= self
3734 if n_then
!= null then
3735 n_then
.parent
= self
3738 if n_else
!= null then
3739 n_else
.parent
= self
3743 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3745 if _n_kwif
== old_child
then
3746 if new_child
!= null then
3747 new_child
.parent
= self
3748 assert new_child
isa TKwif
3755 if _n_expr
== old_child
then
3756 if new_child
!= null then
3757 new_child
.parent
= self
3758 assert new_child
isa AExpr
3765 if _n_then
== old_child
then
3766 if new_child
!= null then
3767 new_child
.parent
= self
3768 assert new_child
isa AExpr
3775 if _n_else
== old_child
then
3776 if new_child
!= null then
3777 new_child
.parent
= self
3778 assert new_child
isa AExpr
3787 redef fun visit_all
(v
: Visitor)
3789 v
.enter_visit
(_n_kwif
)
3790 v
.enter_visit
(_n_expr
)
3791 if _n_then
!= null then
3792 v
.enter_visit
(_n_then
.as(not null))
3794 if _n_else
!= null then
3795 v
.enter_visit
(_n_else
.as(not null))
3799 redef class AIfexprExpr
3800 private init empty_init
do end
3802 init init_aifexprexpr
(
3803 n_kwif
: nullable TKwif,
3804 n_expr
: nullable AExpr,
3805 n_kwthen
: nullable TKwthen,
3806 n_then
: nullable AExpr,
3807 n_kwelse
: nullable TKwelse,
3808 n_else
: nullable AExpr
3812 _n_kwif
= n_kwif
.as(not null)
3813 n_kwif
.parent
= self
3814 _n_expr
= n_expr
.as(not null)
3815 n_expr
.parent
= self
3816 _n_kwthen
= n_kwthen
.as(not null)
3817 n_kwthen
.parent
= self
3818 _n_then
= n_then
.as(not null)
3819 n_then
.parent
= self
3820 _n_kwelse
= n_kwelse
.as(not null)
3821 n_kwelse
.parent
= self
3822 _n_else
= n_else
.as(not null)
3823 n_else
.parent
= self
3826 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3828 if _n_kwif
== old_child
then
3829 if new_child
!= null then
3830 new_child
.parent
= self
3831 assert new_child
isa TKwif
3838 if _n_expr
== old_child
then
3839 if new_child
!= null then
3840 new_child
.parent
= self
3841 assert new_child
isa AExpr
3848 if _n_kwthen
== old_child
then
3849 if new_child
!= null then
3850 new_child
.parent
= self
3851 assert new_child
isa TKwthen
3852 _n_kwthen
= new_child
3858 if _n_then
== old_child
then
3859 if new_child
!= null then
3860 new_child
.parent
= self
3861 assert new_child
isa AExpr
3868 if _n_kwelse
== old_child
then
3869 if new_child
!= null then
3870 new_child
.parent
= self
3871 assert new_child
isa TKwelse
3872 _n_kwelse
= new_child
3878 if _n_else
== old_child
then
3879 if new_child
!= null then
3880 new_child
.parent
= self
3881 assert new_child
isa AExpr
3890 redef fun visit_all
(v
: Visitor)
3892 v
.enter_visit
(_n_kwif
)
3893 v
.enter_visit
(_n_expr
)
3894 v
.enter_visit
(_n_kwthen
)
3895 v
.enter_visit
(_n_then
)
3896 v
.enter_visit
(_n_kwelse
)
3897 v
.enter_visit
(_n_else
)
3900 redef class AWhileExpr
3901 private init empty_init
do end
3903 init init_awhileexpr
(
3904 n_kwwhile
: nullable TKwwhile,
3905 n_expr
: nullable AExpr,
3906 n_kwdo
: nullable TKwdo,
3907 n_block
: nullable AExpr,
3908 n_label
: nullable ALabel
3912 _n_kwwhile
= n_kwwhile
.as(not null)
3913 n_kwwhile
.parent
= self
3914 _n_expr
= n_expr
.as(not null)
3915 n_expr
.parent
= self
3916 _n_kwdo
= n_kwdo
.as(not null)
3917 n_kwdo
.parent
= self
3919 if n_block
!= null then
3920 n_block
.parent
= self
3923 if n_label
!= null then
3924 n_label
.parent
= self
3928 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3930 if _n_kwwhile
== old_child
then
3931 if new_child
!= null then
3932 new_child
.parent
= self
3933 assert new_child
isa TKwwhile
3934 _n_kwwhile
= new_child
3940 if _n_expr
== old_child
then
3941 if new_child
!= null then
3942 new_child
.parent
= self
3943 assert new_child
isa AExpr
3950 if _n_kwdo
== old_child
then
3951 if new_child
!= null then
3952 new_child
.parent
= self
3953 assert new_child
isa TKwdo
3960 if _n_block
== old_child
then
3961 if new_child
!= null then
3962 new_child
.parent
= self
3963 assert new_child
isa AExpr
3964 _n_block
= new_child
3970 if _n_label
== old_child
then
3971 if new_child
!= null then
3972 new_child
.parent
= self
3973 assert new_child
isa ALabel
3974 _n_label
= new_child
3982 redef fun visit_all
(v
: Visitor)
3984 v
.enter_visit
(_n_kwwhile
)
3985 v
.enter_visit
(_n_expr
)
3986 v
.enter_visit
(_n_kwdo
)
3987 if _n_block
!= null then
3988 v
.enter_visit
(_n_block
.as(not null))
3990 if _n_label
!= null then
3991 v
.enter_visit
(_n_label
.as(not null))
3995 redef class ALoopExpr
3996 private init empty_init
do end
3998 init init_aloopexpr
(
3999 n_kwloop
: nullable TKwloop,
4000 n_block
: nullable AExpr,
4001 n_label
: nullable ALabel
4005 _n_kwloop
= n_kwloop
.as(not null)
4006 n_kwloop
.parent
= self
4008 if n_block
!= null then
4009 n_block
.parent
= self
4012 if n_label
!= null then
4013 n_label
.parent
= self
4017 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4019 if _n_kwloop
== old_child
then
4020 if new_child
!= null then
4021 new_child
.parent
= self
4022 assert new_child
isa TKwloop
4023 _n_kwloop
= new_child
4029 if _n_block
== old_child
then
4030 if new_child
!= null then
4031 new_child
.parent
= self
4032 assert new_child
isa AExpr
4033 _n_block
= new_child
4039 if _n_label
== old_child
then
4040 if new_child
!= null then
4041 new_child
.parent
= self
4042 assert new_child
isa ALabel
4043 _n_label
= new_child
4051 redef fun visit_all
(v
: Visitor)
4053 v
.enter_visit
(_n_kwloop
)
4054 if _n_block
!= null then
4055 v
.enter_visit
(_n_block
.as(not null))
4057 if _n_label
!= null then
4058 v
.enter_visit
(_n_label
.as(not null))
4062 redef class AForExpr
4063 private init empty_init
do end
4065 init init_aforexpr
(
4066 n_kwfor
: nullable TKwfor,
4067 n_ids
: Collection[Object], # Should be Collection[TId]
4068 n_expr
: nullable AExpr,
4069 n_kwdo
: nullable TKwdo,
4070 n_block
: nullable AExpr,
4071 n_label
: nullable ALabel
4075 _n_kwfor
= n_kwfor
.as(not null)
4076 n_kwfor
.parent
= self
4082 _n_expr
= n_expr
.as(not null)
4083 n_expr
.parent
= self
4084 _n_kwdo
= n_kwdo
.as(not null)
4085 n_kwdo
.parent
= self
4087 if n_block
!= null then
4088 n_block
.parent
= self
4091 if n_label
!= null then
4092 n_label
.parent
= self
4096 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4098 if _n_kwfor
== old_child
then
4099 if new_child
!= null then
4100 new_child
.parent
= self
4101 assert new_child
isa TKwfor
4102 _n_kwfor
= new_child
4108 for i
in [0.._n_ids
.length
[ do
4109 if _n_ids
[i
] == old_child
then
4110 if new_child
!= null then
4111 assert new_child
isa TId
4112 _n_ids
[i
] = new_child
4113 new_child
.parent
= self
4120 if _n_expr
== old_child
then
4121 if new_child
!= null then
4122 new_child
.parent
= self
4123 assert new_child
isa AExpr
4130 if _n_kwdo
== old_child
then
4131 if new_child
!= null then
4132 new_child
.parent
= self
4133 assert new_child
isa TKwdo
4140 if _n_block
== old_child
then
4141 if new_child
!= null then
4142 new_child
.parent
= self
4143 assert new_child
isa AExpr
4144 _n_block
= new_child
4150 if _n_label
== old_child
then
4151 if new_child
!= null then
4152 new_child
.parent
= self
4153 assert new_child
isa ALabel
4154 _n_label
= new_child
4162 redef fun visit_all
(v
: Visitor)
4164 v
.enter_visit
(_n_kwfor
)
4168 v
.enter_visit
(_n_expr
)
4169 v
.enter_visit
(_n_kwdo
)
4170 if _n_block
!= null then
4171 v
.enter_visit
(_n_block
.as(not null))
4173 if _n_label
!= null then
4174 v
.enter_visit
(_n_label
.as(not null))
4178 redef class AAssertExpr
4179 private init empty_init
do end
4181 init init_aassertexpr
(
4182 n_kwassert
: nullable TKwassert,
4184 n_expr
: nullable AExpr,
4185 n_else
: nullable AExpr
4189 _n_kwassert
= n_kwassert
.as(not null)
4190 n_kwassert
.parent
= self
4192 if n_id
!= null then
4195 _n_expr
= n_expr
.as(not null)
4196 n_expr
.parent
= self
4198 if n_else
!= null then
4199 n_else
.parent
= self
4203 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4205 if _n_kwassert
== old_child
then
4206 if new_child
!= null then
4207 new_child
.parent
= self
4208 assert new_child
isa TKwassert
4209 _n_kwassert
= new_child
4215 if _n_id
== old_child
then
4216 if new_child
!= null then
4217 new_child
.parent
= self
4218 assert new_child
isa TId
4225 if _n_expr
== old_child
then
4226 if new_child
!= null then
4227 new_child
.parent
= self
4228 assert new_child
isa AExpr
4235 if _n_else
== old_child
then
4236 if new_child
!= null then
4237 new_child
.parent
= self
4238 assert new_child
isa AExpr
4247 redef fun visit_all
(v
: Visitor)
4249 v
.enter_visit
(_n_kwassert
)
4250 if _n_id
!= null then
4251 v
.enter_visit
(_n_id
.as(not null))
4253 v
.enter_visit
(_n_expr
)
4254 if _n_else
!= null then
4255 v
.enter_visit
(_n_else
.as(not null))
4259 redef class AOnceExpr
4260 private init empty_init
do end
4262 init init_aonceexpr
(
4263 n_kwonce
: nullable TKwonce,
4264 n_expr
: nullable AExpr
4268 _n_kwonce
= n_kwonce
.as(not null)
4269 n_kwonce
.parent
= self
4270 _n_expr
= n_expr
.as(not null)
4271 n_expr
.parent
= self
4274 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4276 if _n_kwonce
== old_child
then
4277 if new_child
!= null then
4278 new_child
.parent
= self
4279 assert new_child
isa TKwonce
4280 _n_kwonce
= new_child
4286 if _n_expr
== old_child
then
4287 if new_child
!= null then
4288 new_child
.parent
= self
4289 assert new_child
isa AExpr
4298 redef fun visit_all
(v
: Visitor)
4300 v
.enter_visit
(_n_kwonce
)
4301 v
.enter_visit
(_n_expr
)
4304 redef class ASendExpr
4305 private init empty_init
do end
4307 init init_asendexpr
(
4308 n_expr
: nullable AExpr
4312 _n_expr
= n_expr
.as(not null)
4313 n_expr
.parent
= self
4316 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4318 if _n_expr
== old_child
then
4319 if new_child
!= null then
4320 new_child
.parent
= self
4321 assert new_child
isa AExpr
4330 redef fun visit_all
(v
: Visitor)
4332 v
.enter_visit
(_n_expr
)
4335 redef class ABinopExpr
4336 private init empty_init
do end
4338 init init_abinopexpr
(
4339 n_expr
: nullable AExpr,
4340 n_expr2
: nullable AExpr
4344 _n_expr
= n_expr
.as(not null)
4345 n_expr
.parent
= self
4346 _n_expr2
= n_expr2
.as(not null)
4347 n_expr2
.parent
= self
4350 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4352 if _n_expr
== old_child
then
4353 if new_child
!= null then
4354 new_child
.parent
= self
4355 assert new_child
isa AExpr
4362 if _n_expr2
== old_child
then
4363 if new_child
!= null then
4364 new_child
.parent
= self
4365 assert new_child
isa AExpr
4366 _n_expr2
= new_child
4374 redef fun visit_all
(v
: Visitor)
4376 v
.enter_visit
(_n_expr
)
4377 v
.enter_visit
(_n_expr2
)
4381 private init empty_init
do end
4384 n_expr
: nullable AExpr,
4385 n_expr2
: nullable AExpr
4389 _n_expr
= n_expr
.as(not null)
4390 n_expr
.parent
= self
4391 _n_expr2
= n_expr2
.as(not null)
4392 n_expr2
.parent
= self
4395 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4397 if _n_expr
== old_child
then
4398 if new_child
!= null then
4399 new_child
.parent
= self
4400 assert new_child
isa AExpr
4407 if _n_expr2
== old_child
then
4408 if new_child
!= null then
4409 new_child
.parent
= self
4410 assert new_child
isa AExpr
4411 _n_expr2
= new_child
4419 redef fun visit_all
(v
: Visitor)
4421 v
.enter_visit
(_n_expr
)
4422 v
.enter_visit
(_n_expr2
)
4425 redef class AAndExpr
4426 private init empty_init
do end
4428 init init_aandexpr
(
4429 n_expr
: nullable AExpr,
4430 n_expr2
: nullable AExpr
4434 _n_expr
= n_expr
.as(not null)
4435 n_expr
.parent
= self
4436 _n_expr2
= n_expr2
.as(not null)
4437 n_expr2
.parent
= self
4440 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4442 if _n_expr
== old_child
then
4443 if new_child
!= null then
4444 new_child
.parent
= self
4445 assert new_child
isa AExpr
4452 if _n_expr2
== old_child
then
4453 if new_child
!= null then
4454 new_child
.parent
= self
4455 assert new_child
isa AExpr
4456 _n_expr2
= new_child
4464 redef fun visit_all
(v
: Visitor)
4466 v
.enter_visit
(_n_expr
)
4467 v
.enter_visit
(_n_expr2
)
4470 redef class AOrElseExpr
4471 private init empty_init
do end
4473 init init_aorelseexpr
(
4474 n_expr
: nullable AExpr,
4475 n_expr2
: nullable AExpr
4479 _n_expr
= n_expr
.as(not null)
4480 n_expr
.parent
= self
4481 _n_expr2
= n_expr2
.as(not null)
4482 n_expr2
.parent
= self
4485 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4487 if _n_expr
== old_child
then
4488 if new_child
!= null then
4489 new_child
.parent
= self
4490 assert new_child
isa AExpr
4497 if _n_expr2
== old_child
then
4498 if new_child
!= null then
4499 new_child
.parent
= self
4500 assert new_child
isa AExpr
4501 _n_expr2
= new_child
4509 redef fun visit_all
(v
: Visitor)
4511 v
.enter_visit
(_n_expr
)
4512 v
.enter_visit
(_n_expr2
)
4515 redef class ANotExpr
4516 private init empty_init
do end
4518 init init_anotexpr
(
4519 n_kwnot
: nullable TKwnot,
4520 n_expr
: nullable AExpr
4524 _n_kwnot
= n_kwnot
.as(not null)
4525 n_kwnot
.parent
= self
4526 _n_expr
= n_expr
.as(not null)
4527 n_expr
.parent
= self
4530 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4532 if _n_kwnot
== old_child
then
4533 if new_child
!= null then
4534 new_child
.parent
= self
4535 assert new_child
isa TKwnot
4536 _n_kwnot
= new_child
4542 if _n_expr
== old_child
then
4543 if new_child
!= null then
4544 new_child
.parent
= self
4545 assert new_child
isa AExpr
4554 redef fun visit_all
(v
: Visitor)
4556 v
.enter_visit
(_n_kwnot
)
4557 v
.enter_visit
(_n_expr
)
4561 private init empty_init
do end
4564 n_expr
: nullable AExpr,
4565 n_expr2
: nullable AExpr
4569 _n_expr
= n_expr
.as(not null)
4570 n_expr
.parent
= self
4571 _n_expr2
= n_expr2
.as(not null)
4572 n_expr2
.parent
= self
4575 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4577 if _n_expr
== old_child
then
4578 if new_child
!= null then
4579 new_child
.parent
= self
4580 assert new_child
isa AExpr
4587 if _n_expr2
== old_child
then
4588 if new_child
!= null then
4589 new_child
.parent
= self
4590 assert new_child
isa AExpr
4591 _n_expr2
= new_child
4599 redef fun visit_all
(v
: Visitor)
4601 v
.enter_visit
(_n_expr
)
4602 v
.enter_visit
(_n_expr2
)
4606 private init empty_init
do end
4609 n_expr
: nullable AExpr,
4610 n_expr2
: nullable AExpr
4614 _n_expr
= n_expr
.as(not null)
4615 n_expr
.parent
= self
4616 _n_expr2
= n_expr2
.as(not null)
4617 n_expr2
.parent
= self
4620 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4622 if _n_expr
== old_child
then
4623 if new_child
!= null then
4624 new_child
.parent
= self
4625 assert new_child
isa AExpr
4632 if _n_expr2
== old_child
then
4633 if new_child
!= null then
4634 new_child
.parent
= self
4635 assert new_child
isa AExpr
4636 _n_expr2
= new_child
4644 redef fun visit_all
(v
: Visitor)
4646 v
.enter_visit
(_n_expr
)
4647 v
.enter_visit
(_n_expr2
)
4651 private init empty_init
do end
4654 n_expr
: nullable AExpr,
4655 n_expr2
: nullable AExpr
4659 _n_expr
= n_expr
.as(not null)
4660 n_expr
.parent
= self
4661 _n_expr2
= n_expr2
.as(not null)
4662 n_expr2
.parent
= self
4665 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4667 if _n_expr
== old_child
then
4668 if new_child
!= null then
4669 new_child
.parent
= self
4670 assert new_child
isa AExpr
4677 if _n_expr2
== old_child
then
4678 if new_child
!= null then
4679 new_child
.parent
= self
4680 assert new_child
isa AExpr
4681 _n_expr2
= new_child
4689 redef fun visit_all
(v
: Visitor)
4691 v
.enter_visit
(_n_expr
)
4692 v
.enter_visit
(_n_expr2
)
4696 private init empty_init
do end
4699 n_expr
: nullable AExpr,
4700 n_expr2
: nullable AExpr
4704 _n_expr
= n_expr
.as(not null)
4705 n_expr
.parent
= self
4706 _n_expr2
= n_expr2
.as(not null)
4707 n_expr2
.parent
= self
4710 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4712 if _n_expr
== old_child
then
4713 if new_child
!= null then
4714 new_child
.parent
= self
4715 assert new_child
isa AExpr
4722 if _n_expr2
== old_child
then
4723 if new_child
!= null then
4724 new_child
.parent
= self
4725 assert new_child
isa AExpr
4726 _n_expr2
= new_child
4734 redef fun visit_all
(v
: Visitor)
4736 v
.enter_visit
(_n_expr
)
4737 v
.enter_visit
(_n_expr2
)
4741 private init empty_init
do end
4744 n_expr
: nullable AExpr,
4745 n_expr2
: nullable AExpr
4749 _n_expr
= n_expr
.as(not null)
4750 n_expr
.parent
= self
4751 _n_expr2
= n_expr2
.as(not null)
4752 n_expr2
.parent
= self
4755 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4757 if _n_expr
== old_child
then
4758 if new_child
!= null then
4759 new_child
.parent
= self
4760 assert new_child
isa AExpr
4767 if _n_expr2
== old_child
then
4768 if new_child
!= null then
4769 new_child
.parent
= self
4770 assert new_child
isa AExpr
4771 _n_expr2
= new_child
4779 redef fun visit_all
(v
: Visitor)
4781 v
.enter_visit
(_n_expr
)
4782 v
.enter_visit
(_n_expr2
)
4786 private init empty_init
do end
4789 n_expr
: nullable AExpr,
4790 n_expr2
: nullable AExpr
4794 _n_expr
= n_expr
.as(not null)
4795 n_expr
.parent
= self
4796 _n_expr2
= n_expr2
.as(not null)
4797 n_expr2
.parent
= self
4800 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4802 if _n_expr
== old_child
then
4803 if new_child
!= null then
4804 new_child
.parent
= self
4805 assert new_child
isa AExpr
4812 if _n_expr2
== old_child
then
4813 if new_child
!= null then
4814 new_child
.parent
= self
4815 assert new_child
isa AExpr
4816 _n_expr2
= new_child
4824 redef fun visit_all
(v
: Visitor)
4826 v
.enter_visit
(_n_expr
)
4827 v
.enter_visit
(_n_expr2
)
4831 private init empty_init
do end
4834 n_expr
: nullable AExpr,
4835 n_expr2
: nullable AExpr
4839 _n_expr
= n_expr
.as(not null)
4840 n_expr
.parent
= self
4841 _n_expr2
= n_expr2
.as(not null)
4842 n_expr2
.parent
= self
4845 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4847 if _n_expr
== old_child
then
4848 if new_child
!= null then
4849 new_child
.parent
= self
4850 assert new_child
isa AExpr
4857 if _n_expr2
== old_child
then
4858 if new_child
!= null then
4859 new_child
.parent
= self
4860 assert new_child
isa AExpr
4861 _n_expr2
= new_child
4869 redef fun visit_all
(v
: Visitor)
4871 v
.enter_visit
(_n_expr
)
4872 v
.enter_visit
(_n_expr2
)
4876 private init empty_init
do end
4879 n_expr
: nullable AExpr,
4880 n_expr2
: nullable AExpr
4884 _n_expr
= n_expr
.as(not null)
4885 n_expr
.parent
= self
4886 _n_expr2
= n_expr2
.as(not null)
4887 n_expr2
.parent
= self
4890 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4892 if _n_expr
== old_child
then
4893 if new_child
!= null then
4894 new_child
.parent
= self
4895 assert new_child
isa AExpr
4902 if _n_expr2
== old_child
then
4903 if new_child
!= null then
4904 new_child
.parent
= self
4905 assert new_child
isa AExpr
4906 _n_expr2
= new_child
4914 redef fun visit_all
(v
: Visitor)
4916 v
.enter_visit
(_n_expr
)
4917 v
.enter_visit
(_n_expr2
)
4921 private init empty_init
do end
4924 n_expr
: nullable AExpr,
4925 n_expr2
: nullable AExpr
4929 _n_expr
= n_expr
.as(not null)
4930 n_expr
.parent
= self
4931 _n_expr2
= n_expr2
.as(not null)
4932 n_expr2
.parent
= self
4935 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4937 if _n_expr
== old_child
then
4938 if new_child
!= null then
4939 new_child
.parent
= self
4940 assert new_child
isa AExpr
4947 if _n_expr2
== old_child
then
4948 if new_child
!= null then
4949 new_child
.parent
= self
4950 assert new_child
isa AExpr
4951 _n_expr2
= new_child
4959 redef fun visit_all
(v
: Visitor)
4961 v
.enter_visit
(_n_expr
)
4962 v
.enter_visit
(_n_expr2
)
4965 redef class AIsaExpr
4966 private init empty_init
do end
4968 init init_aisaexpr
(
4969 n_expr
: nullable AExpr,
4970 n_type
: nullable AType
4974 _n_expr
= n_expr
.as(not null)
4975 n_expr
.parent
= self
4976 _n_type
= n_type
.as(not null)
4977 n_type
.parent
= self
4980 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4982 if _n_expr
== old_child
then
4983 if new_child
!= null then
4984 new_child
.parent
= self
4985 assert new_child
isa AExpr
4992 if _n_type
== old_child
then
4993 if new_child
!= null then
4994 new_child
.parent
= self
4995 assert new_child
isa AType
5004 redef fun visit_all
(v
: Visitor)
5006 v
.enter_visit
(_n_expr
)
5007 v
.enter_visit
(_n_type
)
5010 redef class APlusExpr
5011 private init empty_init
do end
5013 init init_aplusexpr
(
5014 n_expr
: nullable AExpr,
5015 n_expr2
: nullable AExpr
5019 _n_expr
= n_expr
.as(not null)
5020 n_expr
.parent
= self
5021 _n_expr2
= n_expr2
.as(not null)
5022 n_expr2
.parent
= self
5025 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5027 if _n_expr
== old_child
then
5028 if new_child
!= null then
5029 new_child
.parent
= self
5030 assert new_child
isa AExpr
5037 if _n_expr2
== old_child
then
5038 if new_child
!= null then
5039 new_child
.parent
= self
5040 assert new_child
isa AExpr
5041 _n_expr2
= new_child
5049 redef fun visit_all
(v
: Visitor)
5051 v
.enter_visit
(_n_expr
)
5052 v
.enter_visit
(_n_expr2
)
5055 redef class AMinusExpr
5056 private init empty_init
do end
5058 init init_aminusexpr
(
5059 n_expr
: nullable AExpr,
5060 n_expr2
: nullable AExpr
5064 _n_expr
= n_expr
.as(not null)
5065 n_expr
.parent
= self
5066 _n_expr2
= n_expr2
.as(not null)
5067 n_expr2
.parent
= self
5070 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5072 if _n_expr
== old_child
then
5073 if new_child
!= null then
5074 new_child
.parent
= self
5075 assert new_child
isa AExpr
5082 if _n_expr2
== old_child
then
5083 if new_child
!= null then
5084 new_child
.parent
= self
5085 assert new_child
isa AExpr
5086 _n_expr2
= new_child
5094 redef fun visit_all
(v
: Visitor)
5096 v
.enter_visit
(_n_expr
)
5097 v
.enter_visit
(_n_expr2
)
5100 redef class AStarshipExpr
5101 private init empty_init
do end
5103 init init_astarshipexpr
(
5104 n_expr
: nullable AExpr,
5105 n_expr2
: nullable AExpr
5109 _n_expr
= n_expr
.as(not null)
5110 n_expr
.parent
= self
5111 _n_expr2
= n_expr2
.as(not null)
5112 n_expr2
.parent
= self
5115 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5117 if _n_expr
== old_child
then
5118 if new_child
!= null then
5119 new_child
.parent
= self
5120 assert new_child
isa AExpr
5127 if _n_expr2
== old_child
then
5128 if new_child
!= null then
5129 new_child
.parent
= self
5130 assert new_child
isa AExpr
5131 _n_expr2
= new_child
5139 redef fun visit_all
(v
: Visitor)
5141 v
.enter_visit
(_n_expr
)
5142 v
.enter_visit
(_n_expr2
)
5145 redef class AStarExpr
5146 private init empty_init
do end
5148 init init_astarexpr
(
5149 n_expr
: nullable AExpr,
5150 n_expr2
: nullable AExpr
5154 _n_expr
= n_expr
.as(not null)
5155 n_expr
.parent
= self
5156 _n_expr2
= n_expr2
.as(not null)
5157 n_expr2
.parent
= self
5160 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5162 if _n_expr
== old_child
then
5163 if new_child
!= null then
5164 new_child
.parent
= self
5165 assert new_child
isa AExpr
5172 if _n_expr2
== old_child
then
5173 if new_child
!= null then
5174 new_child
.parent
= self
5175 assert new_child
isa AExpr
5176 _n_expr2
= new_child
5184 redef fun visit_all
(v
: Visitor)
5186 v
.enter_visit
(_n_expr
)
5187 v
.enter_visit
(_n_expr2
)
5190 redef class ASlashExpr
5191 private init empty_init
do end
5193 init init_aslashexpr
(
5194 n_expr
: nullable AExpr,
5195 n_expr2
: nullable AExpr
5199 _n_expr
= n_expr
.as(not null)
5200 n_expr
.parent
= self
5201 _n_expr2
= n_expr2
.as(not null)
5202 n_expr2
.parent
= self
5205 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5207 if _n_expr
== old_child
then
5208 if new_child
!= null then
5209 new_child
.parent
= self
5210 assert new_child
isa AExpr
5217 if _n_expr2
== old_child
then
5218 if new_child
!= null then
5219 new_child
.parent
= self
5220 assert new_child
isa AExpr
5221 _n_expr2
= new_child
5229 redef fun visit_all
(v
: Visitor)
5231 v
.enter_visit
(_n_expr
)
5232 v
.enter_visit
(_n_expr2
)
5235 redef class APercentExpr
5236 private init empty_init
do end
5238 init init_apercentexpr
(
5239 n_expr
: nullable AExpr,
5240 n_expr2
: nullable AExpr
5244 _n_expr
= n_expr
.as(not null)
5245 n_expr
.parent
= self
5246 _n_expr2
= n_expr2
.as(not null)
5247 n_expr2
.parent
= self
5250 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5252 if _n_expr
== old_child
then
5253 if new_child
!= null then
5254 new_child
.parent
= self
5255 assert new_child
isa AExpr
5262 if _n_expr2
== old_child
then
5263 if new_child
!= null then
5264 new_child
.parent
= self
5265 assert new_child
isa AExpr
5266 _n_expr2
= new_child
5274 redef fun visit_all
(v
: Visitor)
5276 v
.enter_visit
(_n_expr
)
5277 v
.enter_visit
(_n_expr2
)
5280 redef class AUminusExpr
5281 private init empty_init
do end
5283 init init_auminusexpr
(
5284 n_minus
: nullable TMinus,
5285 n_expr
: nullable AExpr
5289 _n_minus
= n_minus
.as(not null)
5290 n_minus
.parent
= self
5291 _n_expr
= n_expr
.as(not null)
5292 n_expr
.parent
= self
5295 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5297 if _n_minus
== old_child
then
5298 if new_child
!= null then
5299 new_child
.parent
= self
5300 assert new_child
isa TMinus
5301 _n_minus
= new_child
5307 if _n_expr
== old_child
then
5308 if new_child
!= null then
5309 new_child
.parent
= self
5310 assert new_child
isa AExpr
5319 redef fun visit_all
(v
: Visitor)
5321 v
.enter_visit
(_n_minus
)
5322 v
.enter_visit
(_n_expr
)
5325 redef class ANewExpr
5326 private init empty_init
do end
5328 init init_anewexpr
(
5329 n_kwnew
: nullable TKwnew,
5330 n_type
: nullable AType,
5332 n_args
: nullable AExprs
5336 _n_kwnew
= n_kwnew
.as(not null)
5337 n_kwnew
.parent
= self
5338 _n_type
= n_type
.as(not null)
5339 n_type
.parent
= self
5341 if n_id
!= null then
5344 _n_args
= n_args
.as(not null)
5345 n_args
.parent
= self
5348 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5350 if _n_kwnew
== old_child
then
5351 if new_child
!= null then
5352 new_child
.parent
= self
5353 assert new_child
isa TKwnew
5354 _n_kwnew
= new_child
5360 if _n_type
== old_child
then
5361 if new_child
!= null then
5362 new_child
.parent
= self
5363 assert new_child
isa AType
5370 if _n_id
== old_child
then
5371 if new_child
!= null then
5372 new_child
.parent
= self
5373 assert new_child
isa TId
5380 if _n_args
== old_child
then
5381 if new_child
!= null then
5382 new_child
.parent
= self
5383 assert new_child
isa AExprs
5392 redef fun visit_all
(v
: Visitor)
5394 v
.enter_visit
(_n_kwnew
)
5395 v
.enter_visit
(_n_type
)
5396 if _n_id
!= null then
5397 v
.enter_visit
(_n_id
.as(not null))
5399 v
.enter_visit
(_n_args
)
5402 redef class AAttrExpr
5403 private init empty_init
do end
5405 init init_aattrexpr
(
5406 n_expr
: nullable AExpr,
5407 n_id
: nullable TAttrid
5411 _n_expr
= n_expr
.as(not null)
5412 n_expr
.parent
= self
5413 _n_id
= n_id
.as(not null)
5417 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5419 if _n_expr
== old_child
then
5420 if new_child
!= null then
5421 new_child
.parent
= self
5422 assert new_child
isa AExpr
5429 if _n_id
== old_child
then
5430 if new_child
!= null then
5431 new_child
.parent
= self
5432 assert new_child
isa TAttrid
5441 redef fun visit_all
(v
: Visitor)
5443 v
.enter_visit
(_n_expr
)
5444 v
.enter_visit
(_n_id
)
5447 redef class AAttrAssignExpr
5448 private init empty_init
do end
5450 init init_aattrassignexpr
(
5451 n_expr
: nullable AExpr,
5452 n_id
: nullable TAttrid,
5453 n_assign
: nullable TAssign,
5454 n_value
: nullable AExpr
5458 _n_expr
= n_expr
.as(not null)
5459 n_expr
.parent
= self
5460 _n_id
= n_id
.as(not null)
5462 _n_assign
= n_assign
.as(not null)
5463 n_assign
.parent
= self
5464 _n_value
= n_value
.as(not null)
5465 n_value
.parent
= self
5468 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5470 if _n_expr
== old_child
then
5471 if new_child
!= null then
5472 new_child
.parent
= self
5473 assert new_child
isa AExpr
5480 if _n_id
== old_child
then
5481 if new_child
!= null then
5482 new_child
.parent
= self
5483 assert new_child
isa TAttrid
5490 if _n_assign
== old_child
then
5491 if new_child
!= null then
5492 new_child
.parent
= self
5493 assert new_child
isa TAssign
5494 _n_assign
= new_child
5500 if _n_value
== old_child
then
5501 if new_child
!= null then
5502 new_child
.parent
= self
5503 assert new_child
isa AExpr
5504 _n_value
= new_child
5512 redef fun visit_all
(v
: Visitor)
5514 v
.enter_visit
(_n_expr
)
5515 v
.enter_visit
(_n_id
)
5516 v
.enter_visit
(_n_assign
)
5517 v
.enter_visit
(_n_value
)
5520 redef class AAttrReassignExpr
5521 private init empty_init
do end
5523 init init_aattrreassignexpr
(
5524 n_expr
: nullable AExpr,
5525 n_id
: nullable TAttrid,
5526 n_assign_op
: nullable AAssignOp,
5527 n_value
: nullable AExpr
5531 _n_expr
= n_expr
.as(not null)
5532 n_expr
.parent
= self
5533 _n_id
= n_id
.as(not null)
5535 _n_assign_op
= n_assign_op
.as(not null)
5536 n_assign_op
.parent
= self
5537 _n_value
= n_value
.as(not null)
5538 n_value
.parent
= self
5541 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5543 if _n_expr
== old_child
then
5544 if new_child
!= null then
5545 new_child
.parent
= self
5546 assert new_child
isa AExpr
5553 if _n_id
== old_child
then
5554 if new_child
!= null then
5555 new_child
.parent
= self
5556 assert new_child
isa TAttrid
5563 if _n_assign_op
== old_child
then
5564 if new_child
!= null then
5565 new_child
.parent
= self
5566 assert new_child
isa AAssignOp
5567 _n_assign_op
= new_child
5573 if _n_value
== old_child
then
5574 if new_child
!= null then
5575 new_child
.parent
= self
5576 assert new_child
isa AExpr
5577 _n_value
= new_child
5585 redef fun visit_all
(v
: Visitor)
5587 v
.enter_visit
(_n_expr
)
5588 v
.enter_visit
(_n_id
)
5589 v
.enter_visit
(_n_assign_op
)
5590 v
.enter_visit
(_n_value
)
5593 redef class ACallExpr
5594 private init empty_init
do end
5596 init init_acallexpr
(
5597 n_expr
: nullable AExpr,
5599 n_args
: nullable AExprs,
5600 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5604 _n_expr
= n_expr
.as(not null)
5605 n_expr
.parent
= self
5606 _n_id
= n_id
.as(not null)
5608 _n_args
= n_args
.as(not null)
5609 n_args
.parent
= self
5610 for n
in n_closure_defs
do
5611 assert n
isa AClosureDef
5612 _n_closure_defs
.add
(n
)
5617 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5619 if _n_expr
== old_child
then
5620 if new_child
!= null then
5621 new_child
.parent
= self
5622 assert new_child
isa AExpr
5629 if _n_id
== old_child
then
5630 if new_child
!= null then
5631 new_child
.parent
= self
5632 assert new_child
isa TId
5639 if _n_args
== old_child
then
5640 if new_child
!= null then
5641 new_child
.parent
= self
5642 assert new_child
isa AExprs
5649 for i
in [0.._n_closure_defs
.length
[ do
5650 if _n_closure_defs
[i
] == old_child
then
5651 if new_child
!= null then
5652 assert new_child
isa AClosureDef
5653 _n_closure_defs
[i
] = new_child
5654 new_child
.parent
= self
5656 _n_closure_defs
.remove_at
(i
)
5663 redef fun visit_all
(v
: Visitor)
5665 v
.enter_visit
(_n_expr
)
5666 v
.enter_visit
(_n_id
)
5667 v
.enter_visit
(_n_args
)
5668 for n
in _n_closure_defs
do
5673 redef class ACallAssignExpr
5674 private init empty_init
do end
5676 init init_acallassignexpr
(
5677 n_expr
: nullable AExpr,
5679 n_args
: nullable AExprs,
5680 n_assign
: nullable TAssign,
5681 n_value
: nullable AExpr
5685 _n_expr
= n_expr
.as(not null)
5686 n_expr
.parent
= self
5687 _n_id
= n_id
.as(not null)
5689 _n_args
= n_args
.as(not null)
5690 n_args
.parent
= self
5691 _n_assign
= n_assign
.as(not null)
5692 n_assign
.parent
= self
5693 _n_value
= n_value
.as(not null)
5694 n_value
.parent
= self
5697 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5699 if _n_expr
== old_child
then
5700 if new_child
!= null then
5701 new_child
.parent
= self
5702 assert new_child
isa AExpr
5709 if _n_id
== old_child
then
5710 if new_child
!= null then
5711 new_child
.parent
= self
5712 assert new_child
isa TId
5719 if _n_args
== old_child
then
5720 if new_child
!= null then
5721 new_child
.parent
= self
5722 assert new_child
isa AExprs
5729 if _n_assign
== old_child
then
5730 if new_child
!= null then
5731 new_child
.parent
= self
5732 assert new_child
isa TAssign
5733 _n_assign
= new_child
5739 if _n_value
== old_child
then
5740 if new_child
!= null then
5741 new_child
.parent
= self
5742 assert new_child
isa AExpr
5743 _n_value
= new_child
5751 redef fun visit_all
(v
: Visitor)
5753 v
.enter_visit
(_n_expr
)
5754 v
.enter_visit
(_n_id
)
5755 v
.enter_visit
(_n_args
)
5756 v
.enter_visit
(_n_assign
)
5757 v
.enter_visit
(_n_value
)
5760 redef class ACallReassignExpr
5761 private init empty_init
do end
5763 init init_acallreassignexpr
(
5764 n_expr
: nullable AExpr,
5766 n_args
: nullable AExprs,
5767 n_assign_op
: nullable AAssignOp,
5768 n_value
: nullable AExpr
5772 _n_expr
= n_expr
.as(not null)
5773 n_expr
.parent
= self
5774 _n_id
= n_id
.as(not null)
5776 _n_args
= n_args
.as(not null)
5777 n_args
.parent
= self
5778 _n_assign_op
= n_assign_op
.as(not null)
5779 n_assign_op
.parent
= self
5780 _n_value
= n_value
.as(not null)
5781 n_value
.parent
= self
5784 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5786 if _n_expr
== old_child
then
5787 if new_child
!= null then
5788 new_child
.parent
= self
5789 assert new_child
isa AExpr
5796 if _n_id
== old_child
then
5797 if new_child
!= null then
5798 new_child
.parent
= self
5799 assert new_child
isa TId
5806 if _n_args
== old_child
then
5807 if new_child
!= null then
5808 new_child
.parent
= self
5809 assert new_child
isa AExprs
5816 if _n_assign_op
== old_child
then
5817 if new_child
!= null then
5818 new_child
.parent
= self
5819 assert new_child
isa AAssignOp
5820 _n_assign_op
= new_child
5826 if _n_value
== old_child
then
5827 if new_child
!= null then
5828 new_child
.parent
= self
5829 assert new_child
isa AExpr
5830 _n_value
= new_child
5838 redef fun visit_all
(v
: Visitor)
5840 v
.enter_visit
(_n_expr
)
5841 v
.enter_visit
(_n_id
)
5842 v
.enter_visit
(_n_args
)
5843 v
.enter_visit
(_n_assign_op
)
5844 v
.enter_visit
(_n_value
)
5847 redef class ASuperExpr
5848 private init empty_init
do end
5850 init init_asuperexpr
(
5851 n_qualified
: nullable AQualified,
5852 n_kwsuper
: nullable TKwsuper,
5853 n_args
: nullable AExprs
5857 _n_qualified
= n_qualified
5858 if n_qualified
!= null then
5859 n_qualified
.parent
= self
5861 _n_kwsuper
= n_kwsuper
.as(not null)
5862 n_kwsuper
.parent
= self
5863 _n_args
= n_args
.as(not null)
5864 n_args
.parent
= self
5867 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5869 if _n_qualified
== old_child
then
5870 if new_child
!= null then
5871 new_child
.parent
= self
5872 assert new_child
isa AQualified
5873 _n_qualified
= new_child
5879 if _n_kwsuper
== old_child
then
5880 if new_child
!= null then
5881 new_child
.parent
= self
5882 assert new_child
isa TKwsuper
5883 _n_kwsuper
= new_child
5889 if _n_args
== old_child
then
5890 if new_child
!= null then
5891 new_child
.parent
= self
5892 assert new_child
isa AExprs
5901 redef fun visit_all
(v
: Visitor)
5903 if _n_qualified
!= null then
5904 v
.enter_visit
(_n_qualified
.as(not null))
5906 v
.enter_visit
(_n_kwsuper
)
5907 v
.enter_visit
(_n_args
)
5910 redef class AInitExpr
5911 private init empty_init
do end
5913 init init_ainitexpr
(
5914 n_expr
: nullable AExpr,
5915 n_kwinit
: nullable TKwinit,
5916 n_args
: nullable AExprs
5920 _n_expr
= n_expr
.as(not null)
5921 n_expr
.parent
= self
5922 _n_kwinit
= n_kwinit
.as(not null)
5923 n_kwinit
.parent
= self
5924 _n_args
= n_args
.as(not null)
5925 n_args
.parent
= self
5928 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5930 if _n_expr
== old_child
then
5931 if new_child
!= null then
5932 new_child
.parent
= self
5933 assert new_child
isa AExpr
5940 if _n_kwinit
== old_child
then
5941 if new_child
!= null then
5942 new_child
.parent
= self
5943 assert new_child
isa TKwinit
5944 _n_kwinit
= new_child
5950 if _n_args
== old_child
then
5951 if new_child
!= null then
5952 new_child
.parent
= self
5953 assert new_child
isa AExprs
5962 redef fun visit_all
(v
: Visitor)
5964 v
.enter_visit
(_n_expr
)
5965 v
.enter_visit
(_n_kwinit
)
5966 v
.enter_visit
(_n_args
)
5969 redef class ABraExpr
5970 private init empty_init
do end
5972 init init_abraexpr
(
5973 n_expr
: nullable AExpr,
5974 n_args
: nullable AExprs,
5975 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5979 _n_expr
= n_expr
.as(not null)
5980 n_expr
.parent
= self
5981 _n_args
= n_args
.as(not null)
5982 n_args
.parent
= self
5983 for n
in n_closure_defs
do
5984 assert n
isa AClosureDef
5985 _n_closure_defs
.add
(n
)
5990 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5992 if _n_expr
== old_child
then
5993 if new_child
!= null then
5994 new_child
.parent
= self
5995 assert new_child
isa AExpr
6002 if _n_args
== old_child
then
6003 if new_child
!= null then
6004 new_child
.parent
= self
6005 assert new_child
isa AExprs
6012 for i
in [0.._n_closure_defs
.length
[ do
6013 if _n_closure_defs
[i
] == old_child
then
6014 if new_child
!= null then
6015 assert new_child
isa AClosureDef
6016 _n_closure_defs
[i
] = new_child
6017 new_child
.parent
= self
6019 _n_closure_defs
.remove_at
(i
)
6026 redef fun visit_all
(v
: Visitor)
6028 v
.enter_visit
(_n_expr
)
6029 v
.enter_visit
(_n_args
)
6030 for n
in _n_closure_defs
do
6035 redef class ABraAssignExpr
6036 private init empty_init
do end
6038 init init_abraassignexpr
(
6039 n_expr
: nullable AExpr,
6040 n_args
: nullable AExprs,
6041 n_assign
: nullable TAssign,
6042 n_value
: nullable AExpr
6046 _n_expr
= n_expr
.as(not null)
6047 n_expr
.parent
= self
6048 _n_args
= n_args
.as(not null)
6049 n_args
.parent
= self
6050 _n_assign
= n_assign
.as(not null)
6051 n_assign
.parent
= self
6052 _n_value
= n_value
.as(not null)
6053 n_value
.parent
= self
6056 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6058 if _n_expr
== old_child
then
6059 if new_child
!= null then
6060 new_child
.parent
= self
6061 assert new_child
isa AExpr
6068 if _n_args
== old_child
then
6069 if new_child
!= null then
6070 new_child
.parent
= self
6071 assert new_child
isa AExprs
6078 if _n_assign
== old_child
then
6079 if new_child
!= null then
6080 new_child
.parent
= self
6081 assert new_child
isa TAssign
6082 _n_assign
= new_child
6088 if _n_value
== old_child
then
6089 if new_child
!= null then
6090 new_child
.parent
= self
6091 assert new_child
isa AExpr
6092 _n_value
= new_child
6100 redef fun visit_all
(v
: Visitor)
6102 v
.enter_visit
(_n_expr
)
6103 v
.enter_visit
(_n_args
)
6104 v
.enter_visit
(_n_assign
)
6105 v
.enter_visit
(_n_value
)
6108 redef class ABraReassignExpr
6109 private init empty_init
do end
6111 init init_abrareassignexpr
(
6112 n_expr
: nullable AExpr,
6113 n_args
: nullable AExprs,
6114 n_assign_op
: nullable AAssignOp,
6115 n_value
: nullable AExpr
6119 _n_expr
= n_expr
.as(not null)
6120 n_expr
.parent
= self
6121 _n_args
= n_args
.as(not null)
6122 n_args
.parent
= self
6123 _n_assign_op
= n_assign_op
.as(not null)
6124 n_assign_op
.parent
= self
6125 _n_value
= n_value
.as(not null)
6126 n_value
.parent
= self
6129 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6131 if _n_expr
== old_child
then
6132 if new_child
!= null then
6133 new_child
.parent
= self
6134 assert new_child
isa AExpr
6141 if _n_args
== old_child
then
6142 if new_child
!= null then
6143 new_child
.parent
= self
6144 assert new_child
isa AExprs
6151 if _n_assign_op
== old_child
then
6152 if new_child
!= null then
6153 new_child
.parent
= self
6154 assert new_child
isa AAssignOp
6155 _n_assign_op
= new_child
6161 if _n_value
== old_child
then
6162 if new_child
!= null then
6163 new_child
.parent
= self
6164 assert new_child
isa AExpr
6165 _n_value
= new_child
6173 redef fun visit_all
(v
: Visitor)
6175 v
.enter_visit
(_n_expr
)
6176 v
.enter_visit
(_n_args
)
6177 v
.enter_visit
(_n_assign_op
)
6178 v
.enter_visit
(_n_value
)
6181 redef class AClosureCallExpr
6182 private init empty_init
do end
6184 init init_aclosurecallexpr
(
6186 n_args
: nullable AExprs,
6187 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6191 _n_id
= n_id
.as(not null)
6193 _n_args
= n_args
.as(not null)
6194 n_args
.parent
= self
6195 for n
in n_closure_defs
do
6196 assert n
isa AClosureDef
6197 _n_closure_defs
.add
(n
)
6202 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6204 if _n_id
== old_child
then
6205 if new_child
!= null then
6206 new_child
.parent
= self
6207 assert new_child
isa TId
6214 if _n_args
== old_child
then
6215 if new_child
!= null then
6216 new_child
.parent
= self
6217 assert new_child
isa AExprs
6224 for i
in [0.._n_closure_defs
.length
[ do
6225 if _n_closure_defs
[i
] == old_child
then
6226 if new_child
!= null then
6227 assert new_child
isa AClosureDef
6228 _n_closure_defs
[i
] = new_child
6229 new_child
.parent
= self
6231 _n_closure_defs
.remove_at
(i
)
6238 redef fun visit_all
(v
: Visitor)
6240 v
.enter_visit
(_n_id
)
6241 v
.enter_visit
(_n_args
)
6242 for n
in _n_closure_defs
do
6247 redef class AVarExpr
6248 private init empty_init
do end
6250 init init_avarexpr
(
6255 _n_id
= n_id
.as(not null)
6259 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6261 if _n_id
== old_child
then
6262 if new_child
!= null then
6263 new_child
.parent
= self
6264 assert new_child
isa TId
6273 redef fun visit_all
(v
: Visitor)
6275 v
.enter_visit
(_n_id
)
6278 redef class AVarAssignExpr
6279 private init empty_init
do end
6281 init init_avarassignexpr
(
6283 n_assign
: nullable TAssign,
6284 n_value
: nullable AExpr
6288 _n_id
= n_id
.as(not null)
6290 _n_assign
= n_assign
.as(not null)
6291 n_assign
.parent
= self
6292 _n_value
= n_value
.as(not null)
6293 n_value
.parent
= self
6296 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6298 if _n_id
== old_child
then
6299 if new_child
!= null then
6300 new_child
.parent
= self
6301 assert new_child
isa TId
6308 if _n_assign
== old_child
then
6309 if new_child
!= null then
6310 new_child
.parent
= self
6311 assert new_child
isa TAssign
6312 _n_assign
= new_child
6318 if _n_value
== old_child
then
6319 if new_child
!= null then
6320 new_child
.parent
= self
6321 assert new_child
isa AExpr
6322 _n_value
= new_child
6330 redef fun visit_all
(v
: Visitor)
6332 v
.enter_visit
(_n_id
)
6333 v
.enter_visit
(_n_assign
)
6334 v
.enter_visit
(_n_value
)
6337 redef class AVarReassignExpr
6338 private init empty_init
do end
6340 init init_avarreassignexpr
(
6342 n_assign_op
: nullable AAssignOp,
6343 n_value
: nullable AExpr
6347 _n_id
= n_id
.as(not null)
6349 _n_assign_op
= n_assign_op
.as(not null)
6350 n_assign_op
.parent
= self
6351 _n_value
= n_value
.as(not null)
6352 n_value
.parent
= self
6355 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6357 if _n_id
== old_child
then
6358 if new_child
!= null then
6359 new_child
.parent
= self
6360 assert new_child
isa TId
6367 if _n_assign_op
== old_child
then
6368 if new_child
!= null then
6369 new_child
.parent
= self
6370 assert new_child
isa AAssignOp
6371 _n_assign_op
= new_child
6377 if _n_value
== old_child
then
6378 if new_child
!= null then
6379 new_child
.parent
= self
6380 assert new_child
isa AExpr
6381 _n_value
= new_child
6389 redef fun visit_all
(v
: Visitor)
6391 v
.enter_visit
(_n_id
)
6392 v
.enter_visit
(_n_assign_op
)
6393 v
.enter_visit
(_n_value
)
6396 redef class ARangeExpr
6397 private init empty_init
do end
6399 init init_arangeexpr
(
6400 n_expr
: nullable AExpr,
6401 n_expr2
: nullable AExpr
6405 _n_expr
= n_expr
.as(not null)
6406 n_expr
.parent
= self
6407 _n_expr2
= n_expr2
.as(not null)
6408 n_expr2
.parent
= self
6411 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6413 if _n_expr
== old_child
then
6414 if new_child
!= null then
6415 new_child
.parent
= self
6416 assert new_child
isa AExpr
6423 if _n_expr2
== old_child
then
6424 if new_child
!= null then
6425 new_child
.parent
= self
6426 assert new_child
isa AExpr
6427 _n_expr2
= new_child
6435 redef fun visit_all
(v
: Visitor)
6437 v
.enter_visit
(_n_expr
)
6438 v
.enter_visit
(_n_expr2
)
6441 redef class ACrangeExpr
6442 private init empty_init
do end
6444 init init_acrangeexpr
(
6445 n_obra
: nullable TObra,
6446 n_expr
: nullable AExpr,
6447 n_expr2
: nullable AExpr,
6448 n_cbra
: nullable TCbra
6452 _n_obra
= n_obra
.as(not null)
6453 n_obra
.parent
= self
6454 _n_expr
= n_expr
.as(not null)
6455 n_expr
.parent
= self
6456 _n_expr2
= n_expr2
.as(not null)
6457 n_expr2
.parent
= self
6458 _n_cbra
= n_cbra
.as(not null)
6459 n_cbra
.parent
= self
6462 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6464 if _n_obra
== old_child
then
6465 if new_child
!= null then
6466 new_child
.parent
= self
6467 assert new_child
isa TObra
6474 if _n_expr
== old_child
then
6475 if new_child
!= null then
6476 new_child
.parent
= self
6477 assert new_child
isa AExpr
6484 if _n_expr2
== old_child
then
6485 if new_child
!= null then
6486 new_child
.parent
= self
6487 assert new_child
isa AExpr
6488 _n_expr2
= new_child
6494 if _n_cbra
== old_child
then
6495 if new_child
!= null then
6496 new_child
.parent
= self
6497 assert new_child
isa TCbra
6506 redef fun visit_all
(v
: Visitor)
6508 v
.enter_visit
(_n_obra
)
6509 v
.enter_visit
(_n_expr
)
6510 v
.enter_visit
(_n_expr2
)
6511 v
.enter_visit
(_n_cbra
)
6514 redef class AOrangeExpr
6515 private init empty_init
do end
6517 init init_aorangeexpr
(
6518 n_obra
: nullable TObra,
6519 n_expr
: nullable AExpr,
6520 n_expr2
: nullable AExpr,
6521 n_cbra
: nullable TObra
6525 _n_obra
= n_obra
.as(not null)
6526 n_obra
.parent
= self
6527 _n_expr
= n_expr
.as(not null)
6528 n_expr
.parent
= self
6529 _n_expr2
= n_expr2
.as(not null)
6530 n_expr2
.parent
= self
6531 _n_cbra
= n_cbra
.as(not null)
6532 n_cbra
.parent
= self
6535 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6537 if _n_obra
== old_child
then
6538 if new_child
!= null then
6539 new_child
.parent
= self
6540 assert new_child
isa TObra
6547 if _n_expr
== old_child
then
6548 if new_child
!= null then
6549 new_child
.parent
= self
6550 assert new_child
isa AExpr
6557 if _n_expr2
== old_child
then
6558 if new_child
!= null then
6559 new_child
.parent
= self
6560 assert new_child
isa AExpr
6561 _n_expr2
= new_child
6567 if _n_cbra
== old_child
then
6568 if new_child
!= null then
6569 new_child
.parent
= self
6570 assert new_child
isa TObra
6579 redef fun visit_all
(v
: Visitor)
6581 v
.enter_visit
(_n_obra
)
6582 v
.enter_visit
(_n_expr
)
6583 v
.enter_visit
(_n_expr2
)
6584 v
.enter_visit
(_n_cbra
)
6587 redef class AArrayExpr
6588 private init empty_init
do end
6590 init init_aarrayexpr
(
6591 n_exprs
: nullable AExprs
6595 _n_exprs
= n_exprs
.as(not null)
6596 n_exprs
.parent
= self
6599 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6601 if _n_exprs
== old_child
then
6602 if new_child
!= null then
6603 new_child
.parent
= self
6604 assert new_child
isa AExprs
6605 _n_exprs
= new_child
6613 redef fun visit_all
(v
: Visitor)
6615 v
.enter_visit
(_n_exprs
)
6618 redef class ASelfExpr
6619 private init empty_init
do end
6621 init init_aselfexpr
(
6622 n_kwself
: nullable TKwself
6626 _n_kwself
= n_kwself
.as(not null)
6627 n_kwself
.parent
= self
6630 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6632 if _n_kwself
== old_child
then
6633 if new_child
!= null then
6634 new_child
.parent
= self
6635 assert new_child
isa TKwself
6636 _n_kwself
= new_child
6644 redef fun visit_all
(v
: Visitor)
6646 v
.enter_visit
(_n_kwself
)
6649 redef class AImplicitSelfExpr
6650 private init empty_init
do end
6652 init init_aimplicitselfexpr
6657 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6661 redef fun visit_all
(v
: Visitor)
6665 redef class ATrueExpr
6666 private init empty_init
do end
6668 init init_atrueexpr
(
6669 n_kwtrue
: nullable TKwtrue
6673 _n_kwtrue
= n_kwtrue
.as(not null)
6674 n_kwtrue
.parent
= self
6677 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6679 if _n_kwtrue
== old_child
then
6680 if new_child
!= null then
6681 new_child
.parent
= self
6682 assert new_child
isa TKwtrue
6683 _n_kwtrue
= new_child
6691 redef fun visit_all
(v
: Visitor)
6693 v
.enter_visit
(_n_kwtrue
)
6696 redef class AFalseExpr
6697 private init empty_init
do end
6699 init init_afalseexpr
(
6700 n_kwfalse
: nullable TKwfalse
6704 _n_kwfalse
= n_kwfalse
.as(not null)
6705 n_kwfalse
.parent
= self
6708 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6710 if _n_kwfalse
== old_child
then
6711 if new_child
!= null then
6712 new_child
.parent
= self
6713 assert new_child
isa TKwfalse
6714 _n_kwfalse
= new_child
6722 redef fun visit_all
(v
: Visitor)
6724 v
.enter_visit
(_n_kwfalse
)
6727 redef class ANullExpr
6728 private init empty_init
do end
6730 init init_anullexpr
(
6731 n_kwnull
: nullable TKwnull
6735 _n_kwnull
= n_kwnull
.as(not null)
6736 n_kwnull
.parent
= self
6739 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6741 if _n_kwnull
== old_child
then
6742 if new_child
!= null then
6743 new_child
.parent
= self
6744 assert new_child
isa TKwnull
6745 _n_kwnull
= new_child
6753 redef fun visit_all
(v
: Visitor)
6755 v
.enter_visit
(_n_kwnull
)
6758 redef class AIntExpr
6759 private init empty_init
do end
6761 init init_aintexpr
(
6762 n_number
: nullable TNumber
6766 _n_number
= n_number
.as(not null)
6767 n_number
.parent
= self
6770 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6772 if _n_number
== old_child
then
6773 if new_child
!= null then
6774 new_child
.parent
= self
6775 assert new_child
isa TNumber
6776 _n_number
= new_child
6784 redef fun visit_all
(v
: Visitor)
6786 v
.enter_visit
(_n_number
)
6789 redef class AFloatExpr
6790 private init empty_init
do end
6792 init init_afloatexpr
(
6793 n_float
: nullable TFloat
6797 _n_float
= n_float
.as(not null)
6798 n_float
.parent
= self
6801 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6803 if _n_float
== old_child
then
6804 if new_child
!= null then
6805 new_child
.parent
= self
6806 assert new_child
isa TFloat
6807 _n_float
= new_child
6815 redef fun visit_all
(v
: Visitor)
6817 v
.enter_visit
(_n_float
)
6820 redef class ACharExpr
6821 private init empty_init
do end
6823 init init_acharexpr
(
6824 n_char
: nullable TChar
6828 _n_char
= n_char
.as(not null)
6829 n_char
.parent
= self
6832 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6834 if _n_char
== old_child
then
6835 if new_child
!= null then
6836 new_child
.parent
= self
6837 assert new_child
isa TChar
6846 redef fun visit_all
(v
: Visitor)
6848 v
.enter_visit
(_n_char
)
6851 redef class AStringExpr
6852 private init empty_init
do end
6854 init init_astringexpr
(
6855 n_string
: nullable TString
6859 _n_string
= n_string
.as(not null)
6860 n_string
.parent
= self
6863 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6865 if _n_string
== old_child
then
6866 if new_child
!= null then
6867 new_child
.parent
= self
6868 assert new_child
isa TString
6869 _n_string
= new_child
6877 redef fun visit_all
(v
: Visitor)
6879 v
.enter_visit
(_n_string
)
6882 redef class AStartStringExpr
6883 private init empty_init
do end
6885 init init_astartstringexpr
(
6886 n_string
: nullable TStartString
6890 _n_string
= n_string
.as(not null)
6891 n_string
.parent
= self
6894 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6896 if _n_string
== old_child
then
6897 if new_child
!= null then
6898 new_child
.parent
= self
6899 assert new_child
isa TStartString
6900 _n_string
= new_child
6908 redef fun visit_all
(v
: Visitor)
6910 v
.enter_visit
(_n_string
)
6913 redef class AMidStringExpr
6914 private init empty_init
do end
6916 init init_amidstringexpr
(
6917 n_string
: nullable TMidString
6921 _n_string
= n_string
.as(not null)
6922 n_string
.parent
= self
6925 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6927 if _n_string
== old_child
then
6928 if new_child
!= null then
6929 new_child
.parent
= self
6930 assert new_child
isa TMidString
6931 _n_string
= new_child
6939 redef fun visit_all
(v
: Visitor)
6941 v
.enter_visit
(_n_string
)
6944 redef class AEndStringExpr
6945 private init empty_init
do end
6947 init init_aendstringexpr
(
6948 n_string
: nullable TEndString
6952 _n_string
= n_string
.as(not null)
6953 n_string
.parent
= self
6956 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6958 if _n_string
== old_child
then
6959 if new_child
!= null then
6960 new_child
.parent
= self
6961 assert new_child
isa TEndString
6962 _n_string
= new_child
6970 redef fun visit_all
(v
: Visitor)
6972 v
.enter_visit
(_n_string
)
6975 redef class ASuperstringExpr
6976 private init empty_init
do end
6978 init init_asuperstringexpr
(
6979 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6990 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6992 for i
in [0.._n_exprs
.length
[ do
6993 if _n_exprs
[i
] == old_child
then
6994 if new_child
!= null then
6995 assert new_child
isa AExpr
6996 _n_exprs
[i
] = new_child
6997 new_child
.parent
= self
6999 _n_exprs
.remove_at
(i
)
7006 redef fun visit_all
(v
: Visitor)
7008 for n
in _n_exprs
do
7013 redef class AParExpr
7014 private init empty_init
do end
7016 init init_aparexpr
(
7017 n_opar
: nullable TOpar,
7018 n_expr
: nullable AExpr,
7019 n_cpar
: nullable TCpar
7023 _n_opar
= n_opar
.as(not null)
7024 n_opar
.parent
= self
7025 _n_expr
= n_expr
.as(not null)
7026 n_expr
.parent
= self
7027 _n_cpar
= n_cpar
.as(not null)
7028 n_cpar
.parent
= self
7031 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7033 if _n_opar
== old_child
then
7034 if new_child
!= null then
7035 new_child
.parent
= self
7036 assert new_child
isa TOpar
7043 if _n_expr
== old_child
then
7044 if new_child
!= null then
7045 new_child
.parent
= self
7046 assert new_child
isa AExpr
7053 if _n_cpar
== old_child
then
7054 if new_child
!= null then
7055 new_child
.parent
= self
7056 assert new_child
isa TCpar
7065 redef fun visit_all
(v
: Visitor)
7067 v
.enter_visit
(_n_opar
)
7068 v
.enter_visit
(_n_expr
)
7069 v
.enter_visit
(_n_cpar
)
7072 redef class AAsCastExpr
7073 private init empty_init
do end
7075 init init_aascastexpr
(
7076 n_expr
: nullable AExpr,
7077 n_kwas
: nullable TKwas,
7078 n_opar
: nullable TOpar,
7079 n_type
: nullable AType,
7080 n_cpar
: nullable TCpar
7084 _n_expr
= n_expr
.as(not null)
7085 n_expr
.parent
= self
7086 _n_kwas
= n_kwas
.as(not null)
7087 n_kwas
.parent
= self
7088 _n_opar
= n_opar
.as(not null)
7089 n_opar
.parent
= self
7090 _n_type
= n_type
.as(not null)
7091 n_type
.parent
= self
7092 _n_cpar
= n_cpar
.as(not null)
7093 n_cpar
.parent
= self
7096 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7098 if _n_expr
== old_child
then
7099 if new_child
!= null then
7100 new_child
.parent
= self
7101 assert new_child
isa AExpr
7108 if _n_kwas
== old_child
then
7109 if new_child
!= null then
7110 new_child
.parent
= self
7111 assert new_child
isa TKwas
7118 if _n_opar
== old_child
then
7119 if new_child
!= null then
7120 new_child
.parent
= self
7121 assert new_child
isa TOpar
7128 if _n_type
== old_child
then
7129 if new_child
!= null then
7130 new_child
.parent
= self
7131 assert new_child
isa AType
7138 if _n_cpar
== old_child
then
7139 if new_child
!= null then
7140 new_child
.parent
= self
7141 assert new_child
isa TCpar
7150 redef fun visit_all
(v
: Visitor)
7152 v
.enter_visit
(_n_expr
)
7153 v
.enter_visit
(_n_kwas
)
7154 v
.enter_visit
(_n_opar
)
7155 v
.enter_visit
(_n_type
)
7156 v
.enter_visit
(_n_cpar
)
7159 redef class AAsNotnullExpr
7160 private init empty_init
do end
7162 init init_aasnotnullexpr
(
7163 n_expr
: nullable AExpr,
7164 n_kwas
: nullable TKwas,
7165 n_opar
: nullable TOpar,
7166 n_kwnot
: nullable TKwnot,
7167 n_kwnull
: nullable TKwnull,
7168 n_cpar
: nullable TCpar
7172 _n_expr
= n_expr
.as(not null)
7173 n_expr
.parent
= self
7174 _n_kwas
= n_kwas
.as(not null)
7175 n_kwas
.parent
= self
7176 _n_opar
= n_opar
.as(not null)
7177 n_opar
.parent
= self
7178 _n_kwnot
= n_kwnot
.as(not null)
7179 n_kwnot
.parent
= self
7180 _n_kwnull
= n_kwnull
.as(not null)
7181 n_kwnull
.parent
= self
7182 _n_cpar
= n_cpar
.as(not null)
7183 n_cpar
.parent
= self
7186 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7188 if _n_expr
== old_child
then
7189 if new_child
!= null then
7190 new_child
.parent
= self
7191 assert new_child
isa AExpr
7198 if _n_kwas
== old_child
then
7199 if new_child
!= null then
7200 new_child
.parent
= self
7201 assert new_child
isa TKwas
7208 if _n_opar
== old_child
then
7209 if new_child
!= null then
7210 new_child
.parent
= self
7211 assert new_child
isa TOpar
7218 if _n_kwnot
== old_child
then
7219 if new_child
!= null then
7220 new_child
.parent
= self
7221 assert new_child
isa TKwnot
7222 _n_kwnot
= new_child
7228 if _n_kwnull
== old_child
then
7229 if new_child
!= null then
7230 new_child
.parent
= self
7231 assert new_child
isa TKwnull
7232 _n_kwnull
= new_child
7238 if _n_cpar
== old_child
then
7239 if new_child
!= null then
7240 new_child
.parent
= self
7241 assert new_child
isa TCpar
7250 redef fun visit_all
(v
: Visitor)
7252 v
.enter_visit
(_n_expr
)
7253 v
.enter_visit
(_n_kwas
)
7254 v
.enter_visit
(_n_opar
)
7255 v
.enter_visit
(_n_kwnot
)
7256 v
.enter_visit
(_n_kwnull
)
7257 v
.enter_visit
(_n_cpar
)
7260 redef class AIssetAttrExpr
7261 private init empty_init
do end
7263 init init_aissetattrexpr
(
7264 n_kwisset
: nullable TKwisset,
7265 n_expr
: nullable AExpr,
7266 n_id
: nullable TAttrid
7270 _n_kwisset
= n_kwisset
.as(not null)
7271 n_kwisset
.parent
= self
7272 _n_expr
= n_expr
.as(not null)
7273 n_expr
.parent
= self
7274 _n_id
= n_id
.as(not null)
7278 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7280 if _n_kwisset
== old_child
then
7281 if new_child
!= null then
7282 new_child
.parent
= self
7283 assert new_child
isa TKwisset
7284 _n_kwisset
= new_child
7290 if _n_expr
== old_child
then
7291 if new_child
!= null then
7292 new_child
.parent
= self
7293 assert new_child
isa AExpr
7300 if _n_id
== old_child
then
7301 if new_child
!= null then
7302 new_child
.parent
= self
7303 assert new_child
isa TAttrid
7312 redef fun visit_all
(v
: Visitor)
7314 v
.enter_visit
(_n_kwisset
)
7315 v
.enter_visit
(_n_expr
)
7316 v
.enter_visit
(_n_id
)
7319 redef class AListExprs
7320 private init empty_init
do end
7322 init init_alistexprs
(
7323 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7334 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7336 for i
in [0.._n_exprs
.length
[ do
7337 if _n_exprs
[i
] == old_child
then
7338 if new_child
!= null then
7339 assert new_child
isa AExpr
7340 _n_exprs
[i
] = new_child
7341 new_child
.parent
= self
7343 _n_exprs
.remove_at
(i
)
7350 redef fun visit_all
(v
: Visitor)
7352 for n
in _n_exprs
do
7357 redef class AParExprs
7358 private init empty_init
do end
7360 init init_aparexprs
(
7361 n_opar
: nullable TOpar,
7362 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7363 n_cpar
: nullable TCpar
7367 _n_opar
= n_opar
.as(not null)
7368 n_opar
.parent
= self
7374 _n_cpar
= n_cpar
.as(not null)
7375 n_cpar
.parent
= self
7378 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7380 if _n_opar
== old_child
then
7381 if new_child
!= null then
7382 new_child
.parent
= self
7383 assert new_child
isa TOpar
7390 for i
in [0.._n_exprs
.length
[ do
7391 if _n_exprs
[i
] == old_child
then
7392 if new_child
!= null then
7393 assert new_child
isa AExpr
7394 _n_exprs
[i
] = new_child
7395 new_child
.parent
= self
7397 _n_exprs
.remove_at
(i
)
7402 if _n_cpar
== old_child
then
7403 if new_child
!= null then
7404 new_child
.parent
= self
7405 assert new_child
isa TCpar
7414 redef fun visit_all
(v
: Visitor)
7416 v
.enter_visit
(_n_opar
)
7417 for n
in _n_exprs
do
7420 v
.enter_visit
(_n_cpar
)
7423 redef class ABraExprs
7424 private init empty_init
do end
7426 init init_abraexprs
(
7427 n_obra
: nullable TObra,
7428 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7429 n_cbra
: nullable TCbra
7433 _n_obra
= n_obra
.as(not null)
7434 n_obra
.parent
= self
7440 _n_cbra
= n_cbra
.as(not null)
7441 n_cbra
.parent
= self
7444 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7446 if _n_obra
== old_child
then
7447 if new_child
!= null then
7448 new_child
.parent
= self
7449 assert new_child
isa TObra
7456 for i
in [0.._n_exprs
.length
[ do
7457 if _n_exprs
[i
] == old_child
then
7458 if new_child
!= null then
7459 assert new_child
isa AExpr
7460 _n_exprs
[i
] = new_child
7461 new_child
.parent
= self
7463 _n_exprs
.remove_at
(i
)
7468 if _n_cbra
== old_child
then
7469 if new_child
!= null then
7470 new_child
.parent
= self
7471 assert new_child
isa TCbra
7480 redef fun visit_all
(v
: Visitor)
7482 v
.enter_visit
(_n_obra
)
7483 for n
in _n_exprs
do
7486 v
.enter_visit
(_n_cbra
)
7489 redef class APlusAssignOp
7490 private init empty_init
do end
7492 init init_aplusassignop
(
7493 n_pluseq
: nullable TPluseq
7497 _n_pluseq
= n_pluseq
.as(not null)
7498 n_pluseq
.parent
= self
7501 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7503 if _n_pluseq
== old_child
then
7504 if new_child
!= null then
7505 new_child
.parent
= self
7506 assert new_child
isa TPluseq
7507 _n_pluseq
= new_child
7515 redef fun visit_all
(v
: Visitor)
7517 v
.enter_visit
(_n_pluseq
)
7520 redef class AMinusAssignOp
7521 private init empty_init
do end
7523 init init_aminusassignop
(
7524 n_minuseq
: nullable TMinuseq
7528 _n_minuseq
= n_minuseq
.as(not null)
7529 n_minuseq
.parent
= self
7532 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7534 if _n_minuseq
== old_child
then
7535 if new_child
!= null then
7536 new_child
.parent
= self
7537 assert new_child
isa TMinuseq
7538 _n_minuseq
= new_child
7546 redef fun visit_all
(v
: Visitor)
7548 v
.enter_visit
(_n_minuseq
)
7551 redef class AClosureDef
7552 private init empty_init
do end
7554 init init_aclosuredef
(
7555 n_bang
: nullable TBang,
7556 n_id
: nullable AClosureId,
7557 n_ids
: Collection[Object], # Should be Collection[TId]
7558 n_kwdo
: nullable TKwdo,
7559 n_expr
: nullable AExpr,
7560 n_label
: nullable ALabel
7564 _n_bang
= n_bang
.as(not null)
7565 n_bang
.parent
= self
7566 _n_id
= n_id
.as(not null)
7574 if n_kwdo
!= null then
7575 n_kwdo
.parent
= self
7578 if n_expr
!= null then
7579 n_expr
.parent
= self
7582 if n_label
!= null then
7583 n_label
.parent
= self
7587 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7589 if _n_bang
== old_child
then
7590 if new_child
!= null then
7591 new_child
.parent
= self
7592 assert new_child
isa TBang
7599 if _n_id
== old_child
then
7600 if new_child
!= null then
7601 new_child
.parent
= self
7602 assert new_child
isa AClosureId
7609 for i
in [0.._n_ids
.length
[ do
7610 if _n_ids
[i
] == old_child
then
7611 if new_child
!= null then
7612 assert new_child
isa TId
7613 _n_ids
[i
] = new_child
7614 new_child
.parent
= self
7621 if _n_kwdo
== old_child
then
7622 if new_child
!= null then
7623 new_child
.parent
= self
7624 assert new_child
isa TKwdo
7631 if _n_expr
== old_child
then
7632 if new_child
!= null then
7633 new_child
.parent
= self
7634 assert new_child
isa AExpr
7641 if _n_label
== old_child
then
7642 if new_child
!= null then
7643 new_child
.parent
= self
7644 assert new_child
isa ALabel
7645 _n_label
= new_child
7653 redef fun visit_all
(v
: Visitor)
7655 v
.enter_visit
(_n_bang
)
7656 v
.enter_visit
(_n_id
)
7660 if _n_kwdo
!= null then
7661 v
.enter_visit
(_n_kwdo
.as(not null))
7663 if _n_expr
!= null then
7664 v
.enter_visit
(_n_expr
.as(not null))
7666 if _n_label
!= null then
7667 v
.enter_visit
(_n_label
.as(not null))
7671 redef class ASimpleClosureId
7672 private init empty_init
do end
7674 init init_asimpleclosureid
(
7679 _n_id
= n_id
.as(not null)
7683 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7685 if _n_id
== old_child
then
7686 if new_child
!= null then
7687 new_child
.parent
= self
7688 assert new_child
isa TId
7697 redef fun visit_all
(v
: Visitor)
7699 v
.enter_visit
(_n_id
)
7702 redef class ABreakClosureId
7703 private init empty_init
do end
7705 init init_abreakclosureid
(
7706 n_kwbreak
: nullable TKwbreak
7710 _n_kwbreak
= n_kwbreak
.as(not null)
7711 n_kwbreak
.parent
= self
7714 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7716 if _n_kwbreak
== old_child
then
7717 if new_child
!= null then
7718 new_child
.parent
= self
7719 assert new_child
isa TKwbreak
7720 _n_kwbreak
= new_child
7728 redef fun visit_all
(v
: Visitor)
7730 v
.enter_visit
(_n_kwbreak
)
7733 redef class AModuleName
7734 private init empty_init
do end
7736 init init_amodulename
(
7737 n_quad
: nullable TQuad,
7738 n_path
: Collection[Object], # Should be Collection[TId]
7744 if n_quad
!= null then
7745 n_quad
.parent
= self
7752 _n_id
= n_id
.as(not null)
7756 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7758 if _n_quad
== old_child
then
7759 if new_child
!= null then
7760 new_child
.parent
= self
7761 assert new_child
isa TQuad
7768 for i
in [0.._n_path
.length
[ do
7769 if _n_path
[i
] == old_child
then
7770 if new_child
!= null then
7771 assert new_child
isa TId
7772 _n_path
[i
] = new_child
7773 new_child
.parent
= self
7775 _n_path
.remove_at
(i
)
7780 if _n_id
== old_child
then
7781 if new_child
!= null then
7782 new_child
.parent
= self
7783 assert new_child
isa TId
7792 redef fun visit_all
(v
: Visitor)
7794 if _n_quad
!= null then
7795 v
.enter_visit
(_n_quad
.as(not null))
7800 v
.enter_visit
(_n_id
)
7803 redef class AExternCalls
7804 private init empty_init
do end
7806 init init_aexterncalls
(
7807 n_kwimport
: nullable TKwimport,
7808 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7812 _n_kwimport
= n_kwimport
.as(not null)
7813 n_kwimport
.parent
= self
7814 for n
in n_extern_calls
do
7815 assert n
isa AExternCall
7816 _n_extern_calls
.add
(n
)
7821 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7823 if _n_kwimport
== old_child
then
7824 if new_child
!= null then
7825 new_child
.parent
= self
7826 assert new_child
isa TKwimport
7827 _n_kwimport
= new_child
7833 for i
in [0.._n_extern_calls
.length
[ do
7834 if _n_extern_calls
[i
] == old_child
then
7835 if new_child
!= null then
7836 assert new_child
isa AExternCall
7837 _n_extern_calls
[i
] = new_child
7838 new_child
.parent
= self
7840 _n_extern_calls
.remove_at
(i
)
7847 redef fun visit_all
(v
: Visitor)
7849 v
.enter_visit
(_n_kwimport
)
7850 for n
in _n_extern_calls
do
7855 redef class AExternCall
7856 private init empty_init
do end
7858 init init_aexterncall
7863 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7867 redef fun visit_all
(v
: Visitor)
7871 redef class ASuperExternCall
7872 private init empty_init
do end
7874 init init_asuperexterncall
(
7875 n_kwsuper
: nullable TKwsuper
7879 _n_kwsuper
= n_kwsuper
.as(not null)
7880 n_kwsuper
.parent
= self
7883 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7885 if _n_kwsuper
== old_child
then
7886 if new_child
!= null then
7887 new_child
.parent
= self
7888 assert new_child
isa TKwsuper
7889 _n_kwsuper
= new_child
7897 redef fun visit_all
(v
: Visitor)
7899 v
.enter_visit
(_n_kwsuper
)
7902 redef class ALocalPropExternCall
7903 private init empty_init
do end
7905 init init_alocalpropexterncall
(
7906 n_methid
: nullable AMethid
7910 _n_methid
= n_methid
.as(not null)
7911 n_methid
.parent
= self
7914 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7916 if _n_methid
== old_child
then
7917 if new_child
!= null then
7918 new_child
.parent
= self
7919 assert new_child
isa AMethid
7920 _n_methid
= new_child
7928 redef fun visit_all
(v
: Visitor)
7930 v
.enter_visit
(_n_methid
)
7933 redef class AFullPropExternCall
7934 private init empty_init
do end
7936 init init_afullpropexterncall
(
7937 n_classid
: nullable TClassid,
7938 n_quad
: nullable TQuad,
7939 n_methid
: nullable AMethid
7943 _n_classid
= n_classid
.as(not null)
7944 n_classid
.parent
= self
7946 if n_quad
!= null then
7947 n_quad
.parent
= self
7949 _n_methid
= n_methid
.as(not null)
7950 n_methid
.parent
= self
7953 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7955 if _n_classid
== old_child
then
7956 if new_child
!= null then
7957 new_child
.parent
= self
7958 assert new_child
isa TClassid
7959 _n_classid
= new_child
7965 if _n_quad
== old_child
then
7966 if new_child
!= null then
7967 new_child
.parent
= self
7968 assert new_child
isa TQuad
7975 if _n_methid
== old_child
then
7976 if new_child
!= null then
7977 new_child
.parent
= self
7978 assert new_child
isa AMethid
7979 _n_methid
= new_child
7987 redef fun visit_all
(v
: Visitor)
7989 v
.enter_visit
(_n_classid
)
7990 if _n_quad
!= null then
7991 v
.enter_visit
(_n_quad
.as(not null))
7993 v
.enter_visit
(_n_methid
)
7996 redef class AInitPropExternCall
7997 private init empty_init
do end
7999 init init_ainitpropexterncall
(
8000 n_classid
: nullable TClassid
8004 _n_classid
= n_classid
.as(not null)
8005 n_classid
.parent
= self
8008 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8010 if _n_classid
== old_child
then
8011 if new_child
!= null then
8012 new_child
.parent
= self
8013 assert new_child
isa TClassid
8014 _n_classid
= new_child
8022 redef fun visit_all
(v
: Visitor)
8024 v
.enter_visit
(_n_classid
)
8027 redef class ACastAsExternCall
8028 private init empty_init
do end
8030 init init_acastasexterncall
(
8031 n_from_type
: nullable AType,
8032 n_kwas
: nullable TKwas,
8033 n_to_type
: nullable AType
8037 _n_from_type
= n_from_type
.as(not null)
8038 n_from_type
.parent
= self
8039 _n_kwas
= n_kwas
.as(not null)
8040 n_kwas
.parent
= self
8041 _n_to_type
= n_to_type
.as(not null)
8042 n_to_type
.parent
= self
8045 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8047 if _n_from_type
== old_child
then
8048 if new_child
!= null then
8049 new_child
.parent
= self
8050 assert new_child
isa AType
8051 _n_from_type
= new_child
8057 if _n_kwas
== old_child
then
8058 if new_child
!= null then
8059 new_child
.parent
= self
8060 assert new_child
isa TKwas
8067 if _n_to_type
== old_child
then
8068 if new_child
!= null then
8069 new_child
.parent
= self
8070 assert new_child
isa AType
8071 _n_to_type
= new_child
8079 redef fun visit_all
(v
: Visitor)
8081 v
.enter_visit
(_n_from_type
)
8082 v
.enter_visit
(_n_kwas
)
8083 v
.enter_visit
(_n_to_type
)
8086 redef class AAsNullableExternCall
8087 private init empty_init
do end
8089 init init_aasnullableexterncall
(
8090 n_type
: nullable AType,
8091 n_kwas
: nullable TKwas,
8092 n_kwnullable
: nullable TKwnullable
8096 _n_type
= n_type
.as(not null)
8097 n_type
.parent
= self
8098 _n_kwas
= n_kwas
.as(not null)
8099 n_kwas
.parent
= self
8100 _n_kwnullable
= n_kwnullable
.as(not null)
8101 n_kwnullable
.parent
= self
8104 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8106 if _n_type
== old_child
then
8107 if new_child
!= null then
8108 new_child
.parent
= self
8109 assert new_child
isa AType
8116 if _n_kwas
== old_child
then
8117 if new_child
!= null then
8118 new_child
.parent
= self
8119 assert new_child
isa TKwas
8126 if _n_kwnullable
== old_child
then
8127 if new_child
!= null then
8128 new_child
.parent
= self
8129 assert new_child
isa TKwnullable
8130 _n_kwnullable
= new_child
8138 redef fun visit_all
(v
: Visitor)
8140 v
.enter_visit
(_n_type
)
8141 v
.enter_visit
(_n_kwas
)
8142 v
.enter_visit
(_n_kwnullable
)
8145 redef class AAsNotNullableExternCall
8146 private init empty_init
do end
8148 init init_aasnotnullableexterncall
(
8149 n_type
: nullable AType,
8150 n_kwas
: nullable TKwas,
8151 n_kwnot
: nullable TKwnot,
8152 n_kwnullable
: nullable TKwnullable
8156 _n_type
= n_type
.as(not null)
8157 n_type
.parent
= self
8158 _n_kwas
= n_kwas
.as(not null)
8159 n_kwas
.parent
= self
8160 _n_kwnot
= n_kwnot
.as(not null)
8161 n_kwnot
.parent
= self
8162 _n_kwnullable
= n_kwnullable
.as(not null)
8163 n_kwnullable
.parent
= self
8166 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8168 if _n_type
== old_child
then
8169 if new_child
!= null then
8170 new_child
.parent
= self
8171 assert new_child
isa AType
8178 if _n_kwas
== old_child
then
8179 if new_child
!= null then
8180 new_child
.parent
= self
8181 assert new_child
isa TKwas
8188 if _n_kwnot
== old_child
then
8189 if new_child
!= null then
8190 new_child
.parent
= self
8191 assert new_child
isa TKwnot
8192 _n_kwnot
= new_child
8198 if _n_kwnullable
== old_child
then
8199 if new_child
!= null then
8200 new_child
.parent
= self
8201 assert new_child
isa TKwnullable
8202 _n_kwnullable
= new_child
8210 redef fun visit_all
(v
: Visitor)
8212 v
.enter_visit
(_n_type
)
8213 v
.enter_visit
(_n_kwas
)
8214 v
.enter_visit
(_n_kwnot
)
8215 v
.enter_visit
(_n_kwnullable
)
8218 redef class AQualified
8219 private init empty_init
do end
8221 init init_aqualified
(
8222 n_id
: Collection[Object], # Should be Collection[TId]
8223 n_classid
: nullable TClassid
8232 _n_classid
= n_classid
8233 if n_classid
!= null then
8234 n_classid
.parent
= self
8238 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8240 for i
in [0.._n_id
.length
[ do
8241 if _n_id
[i
] == old_child
then
8242 if new_child
!= null then
8243 assert new_child
isa TId
8244 _n_id
[i
] = new_child
8245 new_child
.parent
= self
8252 if _n_classid
== old_child
then
8253 if new_child
!= null then
8254 new_child
.parent
= self
8255 assert new_child
isa TClassid
8256 _n_classid
= new_child
8264 redef fun visit_all
(v
: Visitor)
8269 if _n_classid
!= null then
8270 v
.enter_visit
(_n_classid
.as(not null))
8275 private init empty_init
do end
8278 n_comment
: Collection[Object] # Should be Collection[TComment]
8282 for n
in n_comment
do
8283 assert n
isa TComment
8289 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8291 for i
in [0.._n_comment
.length
[ do
8292 if _n_comment
[i
] == old_child
then
8293 if new_child
!= null then
8294 assert new_child
isa TComment
8295 _n_comment
[i
] = new_child
8296 new_child
.parent
= self
8298 _n_comment
.remove_at
(i
)
8305 redef fun visit_all
(v
: Visitor)
8307 for n
in _n_comment
do
8315 n_base
: nullable AModule,
8322 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8324 if _n_base
== old_child
then
8325 if new_child
== null then
8327 new_child
.parent
= self
8328 assert new_child
isa AModule
8331 old_child
.parent
= null
8336 redef fun visit_all
(v
: Visitor)
8338 if _n_base
!= null then
8339 v
.enter_visit
(_n_base
.as(not null))
8341 v
.enter_visit
(_n_eof
)