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
50 abstract class 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_opar
: nullable TOpar,
2925 n_params
: Collection[Object], # Should be Collection[AParam]
2926 n_cpar
: nullable TCpar,
2927 n_type
: nullable AType,
2928 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2933 if n_opar
!= null then
2934 n_opar
.parent
= self
2936 for n
in n_params
do
2942 if n_cpar
!= null then
2943 n_cpar
.parent
= self
2946 if n_type
!= null then
2947 n_type
.parent
= self
2949 for n
in n_closure_decls
do
2950 assert n
isa AClosureDecl
2951 _n_closure_decls
.add
(n
)
2956 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2958 if _n_opar
== old_child
then
2959 if new_child
!= null then
2960 new_child
.parent
= self
2961 assert new_child
isa TOpar
2968 for i
in [0.._n_params
.length
[ do
2969 if _n_params
[i
] == old_child
then
2970 if new_child
!= null then
2971 assert new_child
isa AParam
2972 _n_params
[i
] = new_child
2973 new_child
.parent
= self
2975 _n_params
.remove_at
(i
)
2980 if _n_cpar
== old_child
then
2981 if new_child
!= null then
2982 new_child
.parent
= self
2983 assert new_child
isa TCpar
2990 if _n_type
== old_child
then
2991 if new_child
!= null then
2992 new_child
.parent
= self
2993 assert new_child
isa AType
3000 for i
in [0.._n_closure_decls
.length
[ do
3001 if _n_closure_decls
[i
] == old_child
then
3002 if new_child
!= null then
3003 assert new_child
isa AClosureDecl
3004 _n_closure_decls
[i
] = new_child
3005 new_child
.parent
= self
3007 _n_closure_decls
.remove_at
(i
)
3014 redef fun visit_all
(v
: Visitor)
3016 if _n_opar
!= null then
3017 v
.enter_visit
(_n_opar
.as(not null))
3019 for n
in _n_params
do
3022 if _n_cpar
!= null then
3023 v
.enter_visit
(_n_cpar
.as(not null))
3025 if _n_type
!= null then
3026 v
.enter_visit
(_n_type
.as(not null))
3028 for n
in _n_closure_decls
do
3034 private init empty_init
do end
3038 n_type
: nullable AType,
3039 n_dotdotdot
: nullable TDotdotdot
3043 _n_id
= n_id
.as(not null)
3046 if n_type
!= null then
3047 n_type
.parent
= self
3049 _n_dotdotdot
= n_dotdotdot
3050 if n_dotdotdot
!= null then
3051 n_dotdotdot
.parent
= self
3055 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3057 if _n_id
== old_child
then
3058 if new_child
!= null then
3059 new_child
.parent
= self
3060 assert new_child
isa TId
3067 if _n_type
== old_child
then
3068 if new_child
!= null then
3069 new_child
.parent
= self
3070 assert new_child
isa AType
3077 if _n_dotdotdot
== old_child
then
3078 if new_child
!= null then
3079 new_child
.parent
= self
3080 assert new_child
isa TDotdotdot
3081 _n_dotdotdot
= new_child
3089 redef fun visit_all
(v
: Visitor)
3091 v
.enter_visit
(_n_id
)
3092 if _n_type
!= null then
3093 v
.enter_visit
(_n_type
.as(not null))
3095 if _n_dotdotdot
!= null then
3096 v
.enter_visit
(_n_dotdotdot
.as(not null))
3100 redef class AClosureDecl
3101 private init empty_init
do end
3103 init init_aclosuredecl
(
3104 n_kwbreak
: nullable TKwbreak,
3105 n_bang
: nullable TBang,
3107 n_signature
: nullable ASignature,
3108 n_expr
: nullable AExpr
3112 _n_kwbreak
= n_kwbreak
3113 if n_kwbreak
!= null then
3114 n_kwbreak
.parent
= self
3116 _n_bang
= n_bang
.as(not null)
3117 n_bang
.parent
= self
3118 _n_id
= n_id
.as(not null)
3120 _n_signature
= n_signature
.as(not null)
3121 n_signature
.parent
= self
3123 if n_expr
!= null then
3124 n_expr
.parent
= self
3128 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3130 if _n_kwbreak
== old_child
then
3131 if new_child
!= null then
3132 new_child
.parent
= self
3133 assert new_child
isa TKwbreak
3134 _n_kwbreak
= new_child
3140 if _n_bang
== old_child
then
3141 if new_child
!= null then
3142 new_child
.parent
= self
3143 assert new_child
isa TBang
3150 if _n_id
== old_child
then
3151 if new_child
!= null then
3152 new_child
.parent
= self
3153 assert new_child
isa TId
3160 if _n_signature
== old_child
then
3161 if new_child
!= null then
3162 new_child
.parent
= self
3163 assert new_child
isa ASignature
3164 _n_signature
= new_child
3170 if _n_expr
== old_child
then
3171 if new_child
!= null then
3172 new_child
.parent
= self
3173 assert new_child
isa AExpr
3182 redef fun visit_all
(v
: Visitor)
3184 if _n_kwbreak
!= null then
3185 v
.enter_visit
(_n_kwbreak
.as(not null))
3187 v
.enter_visit
(_n_bang
)
3188 v
.enter_visit
(_n_id
)
3189 v
.enter_visit
(_n_signature
)
3190 if _n_expr
!= null then
3191 v
.enter_visit
(_n_expr
.as(not null))
3196 private init empty_init
do end
3199 n_kwnullable
: nullable TKwnullable,
3200 n_id
: nullable TClassid,
3201 n_types
: Collection[Object] # Should be Collection[AType]
3205 _n_kwnullable
= n_kwnullable
3206 if n_kwnullable
!= null then
3207 n_kwnullable
.parent
= self
3209 _n_id
= n_id
.as(not null)
3218 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3220 if _n_kwnullable
== old_child
then
3221 if new_child
!= null then
3222 new_child
.parent
= self
3223 assert new_child
isa TKwnullable
3224 _n_kwnullable
= new_child
3226 _n_kwnullable
= null
3230 if _n_id
== old_child
then
3231 if new_child
!= null then
3232 new_child
.parent
= self
3233 assert new_child
isa TClassid
3240 for i
in [0.._n_types
.length
[ do
3241 if _n_types
[i
] == old_child
then
3242 if new_child
!= null then
3243 assert new_child
isa AType
3244 _n_types
[i
] = new_child
3245 new_child
.parent
= self
3247 _n_types
.remove_at
(i
)
3254 redef fun visit_all
(v
: Visitor)
3256 if _n_kwnullable
!= null then
3257 v
.enter_visit
(_n_kwnullable
.as(not null))
3259 v
.enter_visit
(_n_id
)
3260 for n
in _n_types
do
3266 private init empty_init
do end
3269 n_kwlabel
: nullable TKwlabel,
3274 _n_kwlabel
= n_kwlabel
.as(not null)
3275 n_kwlabel
.parent
= self
3276 _n_id
= n_id
.as(not null)
3280 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3282 if _n_kwlabel
== old_child
then
3283 if new_child
!= null then
3284 new_child
.parent
= self
3285 assert new_child
isa TKwlabel
3286 _n_kwlabel
= new_child
3292 if _n_id
== old_child
then
3293 if new_child
!= null then
3294 new_child
.parent
= self
3295 assert new_child
isa TId
3304 redef fun visit_all
(v
: Visitor)
3306 v
.enter_visit
(_n_kwlabel
)
3307 v
.enter_visit
(_n_id
)
3310 redef class ABlockExpr
3311 private init empty_init
do end
3313 init init_ablockexpr
(
3314 n_expr
: Collection[Object], # Should be Collection[AExpr]
3315 n_kwend
: nullable TKwend
3325 if n_kwend
!= null then
3326 n_kwend
.parent
= self
3330 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3332 for i
in [0.._n_expr
.length
[ do
3333 if _n_expr
[i
] == old_child
then
3334 if new_child
!= null then
3335 assert new_child
isa AExpr
3336 _n_expr
[i
] = new_child
3337 new_child
.parent
= self
3339 _n_expr
.remove_at
(i
)
3344 if _n_kwend
== old_child
then
3345 if new_child
!= null then
3346 new_child
.parent
= self
3347 assert new_child
isa TKwend
3348 _n_kwend
= new_child
3356 redef fun visit_all
(v
: Visitor)
3361 if _n_kwend
!= null then
3362 v
.enter_visit
(_n_kwend
.as(not null))
3366 redef class AVardeclExpr
3367 private init empty_init
do end
3369 init init_avardeclexpr
(
3370 n_kwvar
: nullable TKwvar,
3372 n_type
: nullable AType,
3373 n_assign
: nullable TAssign,
3374 n_expr
: nullable AExpr
3378 _n_kwvar
= n_kwvar
.as(not null)
3379 n_kwvar
.parent
= self
3380 _n_id
= n_id
.as(not null)
3383 if n_type
!= null then
3384 n_type
.parent
= self
3386 _n_assign
= n_assign
3387 if n_assign
!= null then
3388 n_assign
.parent
= self
3391 if n_expr
!= null then
3392 n_expr
.parent
= self
3396 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3398 if _n_kwvar
== old_child
then
3399 if new_child
!= null then
3400 new_child
.parent
= self
3401 assert new_child
isa TKwvar
3402 _n_kwvar
= new_child
3408 if _n_id
== old_child
then
3409 if new_child
!= null then
3410 new_child
.parent
= self
3411 assert new_child
isa TId
3418 if _n_type
== old_child
then
3419 if new_child
!= null then
3420 new_child
.parent
= self
3421 assert new_child
isa AType
3428 if _n_assign
== old_child
then
3429 if new_child
!= null then
3430 new_child
.parent
= self
3431 assert new_child
isa TAssign
3432 _n_assign
= new_child
3438 if _n_expr
== old_child
then
3439 if new_child
!= null then
3440 new_child
.parent
= self
3441 assert new_child
isa AExpr
3450 redef fun visit_all
(v
: Visitor)
3452 v
.enter_visit
(_n_kwvar
)
3453 v
.enter_visit
(_n_id
)
3454 if _n_type
!= null then
3455 v
.enter_visit
(_n_type
.as(not null))
3457 if _n_assign
!= null then
3458 v
.enter_visit
(_n_assign
.as(not null))
3460 if _n_expr
!= null then
3461 v
.enter_visit
(_n_expr
.as(not null))
3465 redef class AReturnExpr
3466 private init empty_init
do end
3468 init init_areturnexpr
(
3469 n_kwreturn
: nullable TKwreturn,
3470 n_expr
: nullable AExpr
3474 _n_kwreturn
= n_kwreturn
3475 if n_kwreturn
!= null then
3476 n_kwreturn
.parent
= self
3479 if n_expr
!= null then
3480 n_expr
.parent
= self
3484 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3486 if _n_kwreturn
== old_child
then
3487 if new_child
!= null then
3488 new_child
.parent
= self
3489 assert new_child
isa TKwreturn
3490 _n_kwreturn
= new_child
3496 if _n_expr
== old_child
then
3497 if new_child
!= null then
3498 new_child
.parent
= self
3499 assert new_child
isa AExpr
3508 redef fun visit_all
(v
: Visitor)
3510 if _n_kwreturn
!= null then
3511 v
.enter_visit
(_n_kwreturn
.as(not null))
3513 if _n_expr
!= null then
3514 v
.enter_visit
(_n_expr
.as(not null))
3518 redef class ABreakExpr
3519 private init empty_init
do end
3521 init init_abreakexpr
(
3522 n_kwbreak
: nullable TKwbreak,
3523 n_label
: nullable ALabel,
3524 n_expr
: nullable AExpr
3528 _n_kwbreak
= n_kwbreak
.as(not null)
3529 n_kwbreak
.parent
= self
3531 if n_label
!= null then
3532 n_label
.parent
= self
3535 if n_expr
!= null then
3536 n_expr
.parent
= self
3540 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3542 if _n_kwbreak
== old_child
then
3543 if new_child
!= null then
3544 new_child
.parent
= self
3545 assert new_child
isa TKwbreak
3546 _n_kwbreak
= new_child
3552 if _n_label
== old_child
then
3553 if new_child
!= null then
3554 new_child
.parent
= self
3555 assert new_child
isa ALabel
3556 _n_label
= new_child
3562 if _n_expr
== old_child
then
3563 if new_child
!= null then
3564 new_child
.parent
= self
3565 assert new_child
isa AExpr
3574 redef fun visit_all
(v
: Visitor)
3576 v
.enter_visit
(_n_kwbreak
)
3577 if _n_label
!= null then
3578 v
.enter_visit
(_n_label
.as(not null))
3580 if _n_expr
!= null then
3581 v
.enter_visit
(_n_expr
.as(not null))
3585 redef class AAbortExpr
3586 private init empty_init
do end
3588 init init_aabortexpr
(
3589 n_kwabort
: nullable TKwabort
3593 _n_kwabort
= n_kwabort
.as(not null)
3594 n_kwabort
.parent
= self
3597 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3599 if _n_kwabort
== old_child
then
3600 if new_child
!= null then
3601 new_child
.parent
= self
3602 assert new_child
isa TKwabort
3603 _n_kwabort
= new_child
3611 redef fun visit_all
(v
: Visitor)
3613 v
.enter_visit
(_n_kwabort
)
3616 redef class AContinueExpr
3617 private init empty_init
do end
3619 init init_acontinueexpr
(
3620 n_kwcontinue
: nullable TKwcontinue,
3621 n_label
: nullable ALabel,
3622 n_expr
: nullable AExpr
3626 _n_kwcontinue
= n_kwcontinue
3627 if n_kwcontinue
!= null then
3628 n_kwcontinue
.parent
= self
3631 if n_label
!= null then
3632 n_label
.parent
= self
3635 if n_expr
!= null then
3636 n_expr
.parent
= self
3640 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3642 if _n_kwcontinue
== old_child
then
3643 if new_child
!= null then
3644 new_child
.parent
= self
3645 assert new_child
isa TKwcontinue
3646 _n_kwcontinue
= new_child
3648 _n_kwcontinue
= null
3652 if _n_label
== old_child
then
3653 if new_child
!= null then
3654 new_child
.parent
= self
3655 assert new_child
isa ALabel
3656 _n_label
= new_child
3662 if _n_expr
== old_child
then
3663 if new_child
!= null then
3664 new_child
.parent
= self
3665 assert new_child
isa AExpr
3674 redef fun visit_all
(v
: Visitor)
3676 if _n_kwcontinue
!= null then
3677 v
.enter_visit
(_n_kwcontinue
.as(not null))
3679 if _n_label
!= null then
3680 v
.enter_visit
(_n_label
.as(not null))
3682 if _n_expr
!= null then
3683 v
.enter_visit
(_n_expr
.as(not null))
3688 private init empty_init
do end
3691 n_kwdo
: nullable TKwdo,
3692 n_block
: nullable AExpr,
3693 n_label
: nullable ALabel
3697 _n_kwdo
= n_kwdo
.as(not null)
3698 n_kwdo
.parent
= self
3700 if n_block
!= null then
3701 n_block
.parent
= self
3704 if n_label
!= null then
3705 n_label
.parent
= self
3709 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3711 if _n_kwdo
== old_child
then
3712 if new_child
!= null then
3713 new_child
.parent
= self
3714 assert new_child
isa TKwdo
3721 if _n_block
== old_child
then
3722 if new_child
!= null then
3723 new_child
.parent
= self
3724 assert new_child
isa AExpr
3725 _n_block
= new_child
3731 if _n_label
== old_child
then
3732 if new_child
!= null then
3733 new_child
.parent
= self
3734 assert new_child
isa ALabel
3735 _n_label
= new_child
3743 redef fun visit_all
(v
: Visitor)
3745 v
.enter_visit
(_n_kwdo
)
3746 if _n_block
!= null then
3747 v
.enter_visit
(_n_block
.as(not null))
3749 if _n_label
!= null then
3750 v
.enter_visit
(_n_label
.as(not null))
3755 private init empty_init
do end
3758 n_kwif
: nullable TKwif,
3759 n_expr
: nullable AExpr,
3760 n_then
: nullable AExpr,
3761 n_else
: nullable AExpr
3765 _n_kwif
= n_kwif
.as(not null)
3766 n_kwif
.parent
= self
3767 _n_expr
= n_expr
.as(not null)
3768 n_expr
.parent
= self
3770 if n_then
!= null then
3771 n_then
.parent
= self
3774 if n_else
!= null then
3775 n_else
.parent
= self
3779 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3781 if _n_kwif
== old_child
then
3782 if new_child
!= null then
3783 new_child
.parent
= self
3784 assert new_child
isa TKwif
3791 if _n_expr
== old_child
then
3792 if new_child
!= null then
3793 new_child
.parent
= self
3794 assert new_child
isa AExpr
3801 if _n_then
== old_child
then
3802 if new_child
!= null then
3803 new_child
.parent
= self
3804 assert new_child
isa AExpr
3811 if _n_else
== old_child
then
3812 if new_child
!= null then
3813 new_child
.parent
= self
3814 assert new_child
isa AExpr
3823 redef fun visit_all
(v
: Visitor)
3825 v
.enter_visit
(_n_kwif
)
3826 v
.enter_visit
(_n_expr
)
3827 if _n_then
!= null then
3828 v
.enter_visit
(_n_then
.as(not null))
3830 if _n_else
!= null then
3831 v
.enter_visit
(_n_else
.as(not null))
3835 redef class AIfexprExpr
3836 private init empty_init
do end
3838 init init_aifexprexpr
(
3839 n_kwif
: nullable TKwif,
3840 n_expr
: nullable AExpr,
3841 n_kwthen
: nullable TKwthen,
3842 n_then
: nullable AExpr,
3843 n_kwelse
: nullable TKwelse,
3844 n_else
: nullable AExpr
3848 _n_kwif
= n_kwif
.as(not null)
3849 n_kwif
.parent
= self
3850 _n_expr
= n_expr
.as(not null)
3851 n_expr
.parent
= self
3852 _n_kwthen
= n_kwthen
.as(not null)
3853 n_kwthen
.parent
= self
3854 _n_then
= n_then
.as(not null)
3855 n_then
.parent
= self
3856 _n_kwelse
= n_kwelse
.as(not null)
3857 n_kwelse
.parent
= self
3858 _n_else
= n_else
.as(not null)
3859 n_else
.parent
= self
3862 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3864 if _n_kwif
== old_child
then
3865 if new_child
!= null then
3866 new_child
.parent
= self
3867 assert new_child
isa TKwif
3874 if _n_expr
== old_child
then
3875 if new_child
!= null then
3876 new_child
.parent
= self
3877 assert new_child
isa AExpr
3884 if _n_kwthen
== old_child
then
3885 if new_child
!= null then
3886 new_child
.parent
= self
3887 assert new_child
isa TKwthen
3888 _n_kwthen
= new_child
3894 if _n_then
== old_child
then
3895 if new_child
!= null then
3896 new_child
.parent
= self
3897 assert new_child
isa AExpr
3904 if _n_kwelse
== old_child
then
3905 if new_child
!= null then
3906 new_child
.parent
= self
3907 assert new_child
isa TKwelse
3908 _n_kwelse
= new_child
3914 if _n_else
== old_child
then
3915 if new_child
!= null then
3916 new_child
.parent
= self
3917 assert new_child
isa AExpr
3926 redef fun visit_all
(v
: Visitor)
3928 v
.enter_visit
(_n_kwif
)
3929 v
.enter_visit
(_n_expr
)
3930 v
.enter_visit
(_n_kwthen
)
3931 v
.enter_visit
(_n_then
)
3932 v
.enter_visit
(_n_kwelse
)
3933 v
.enter_visit
(_n_else
)
3936 redef class AWhileExpr
3937 private init empty_init
do end
3939 init init_awhileexpr
(
3940 n_kwwhile
: nullable TKwwhile,
3941 n_expr
: nullable AExpr,
3942 n_kwdo
: nullable TKwdo,
3943 n_block
: nullable AExpr,
3944 n_label
: nullable ALabel
3948 _n_kwwhile
= n_kwwhile
.as(not null)
3949 n_kwwhile
.parent
= self
3950 _n_expr
= n_expr
.as(not null)
3951 n_expr
.parent
= self
3952 _n_kwdo
= n_kwdo
.as(not null)
3953 n_kwdo
.parent
= self
3955 if n_block
!= null then
3956 n_block
.parent
= self
3959 if n_label
!= null then
3960 n_label
.parent
= self
3964 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3966 if _n_kwwhile
== old_child
then
3967 if new_child
!= null then
3968 new_child
.parent
= self
3969 assert new_child
isa TKwwhile
3970 _n_kwwhile
= new_child
3976 if _n_expr
== old_child
then
3977 if new_child
!= null then
3978 new_child
.parent
= self
3979 assert new_child
isa AExpr
3986 if _n_kwdo
== old_child
then
3987 if new_child
!= null then
3988 new_child
.parent
= self
3989 assert new_child
isa TKwdo
3996 if _n_block
== old_child
then
3997 if new_child
!= null then
3998 new_child
.parent
= self
3999 assert new_child
isa AExpr
4000 _n_block
= new_child
4006 if _n_label
== old_child
then
4007 if new_child
!= null then
4008 new_child
.parent
= self
4009 assert new_child
isa ALabel
4010 _n_label
= new_child
4018 redef fun visit_all
(v
: Visitor)
4020 v
.enter_visit
(_n_kwwhile
)
4021 v
.enter_visit
(_n_expr
)
4022 v
.enter_visit
(_n_kwdo
)
4023 if _n_block
!= null then
4024 v
.enter_visit
(_n_block
.as(not null))
4026 if _n_label
!= null then
4027 v
.enter_visit
(_n_label
.as(not null))
4031 redef class ALoopExpr
4032 private init empty_init
do end
4034 init init_aloopexpr
(
4035 n_kwloop
: nullable TKwloop,
4036 n_block
: nullable AExpr,
4037 n_label
: nullable ALabel
4041 _n_kwloop
= n_kwloop
.as(not null)
4042 n_kwloop
.parent
= self
4044 if n_block
!= null then
4045 n_block
.parent
= self
4048 if n_label
!= null then
4049 n_label
.parent
= self
4053 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4055 if _n_kwloop
== old_child
then
4056 if new_child
!= null then
4057 new_child
.parent
= self
4058 assert new_child
isa TKwloop
4059 _n_kwloop
= new_child
4065 if _n_block
== old_child
then
4066 if new_child
!= null then
4067 new_child
.parent
= self
4068 assert new_child
isa AExpr
4069 _n_block
= new_child
4075 if _n_label
== old_child
then
4076 if new_child
!= null then
4077 new_child
.parent
= self
4078 assert new_child
isa ALabel
4079 _n_label
= new_child
4087 redef fun visit_all
(v
: Visitor)
4089 v
.enter_visit
(_n_kwloop
)
4090 if _n_block
!= null then
4091 v
.enter_visit
(_n_block
.as(not null))
4093 if _n_label
!= null then
4094 v
.enter_visit
(_n_label
.as(not null))
4098 redef class AForExpr
4099 private init empty_init
do end
4101 init init_aforexpr
(
4102 n_kwfor
: nullable TKwfor,
4103 n_ids
: Collection[Object], # Should be Collection[TId]
4104 n_expr
: nullable AExpr,
4105 n_kwdo
: nullable TKwdo,
4106 n_block
: nullable AExpr,
4107 n_label
: nullable ALabel
4111 _n_kwfor
= n_kwfor
.as(not null)
4112 n_kwfor
.parent
= self
4118 _n_expr
= n_expr
.as(not null)
4119 n_expr
.parent
= self
4120 _n_kwdo
= n_kwdo
.as(not null)
4121 n_kwdo
.parent
= self
4123 if n_block
!= null then
4124 n_block
.parent
= self
4127 if n_label
!= null then
4128 n_label
.parent
= self
4132 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4134 if _n_kwfor
== old_child
then
4135 if new_child
!= null then
4136 new_child
.parent
= self
4137 assert new_child
isa TKwfor
4138 _n_kwfor
= new_child
4144 for i
in [0.._n_ids
.length
[ do
4145 if _n_ids
[i
] == old_child
then
4146 if new_child
!= null then
4147 assert new_child
isa TId
4148 _n_ids
[i
] = new_child
4149 new_child
.parent
= self
4156 if _n_expr
== old_child
then
4157 if new_child
!= null then
4158 new_child
.parent
= self
4159 assert new_child
isa AExpr
4166 if _n_kwdo
== old_child
then
4167 if new_child
!= null then
4168 new_child
.parent
= self
4169 assert new_child
isa TKwdo
4176 if _n_block
== old_child
then
4177 if new_child
!= null then
4178 new_child
.parent
= self
4179 assert new_child
isa AExpr
4180 _n_block
= new_child
4186 if _n_label
== old_child
then
4187 if new_child
!= null then
4188 new_child
.parent
= self
4189 assert new_child
isa ALabel
4190 _n_label
= new_child
4198 redef fun visit_all
(v
: Visitor)
4200 v
.enter_visit
(_n_kwfor
)
4204 v
.enter_visit
(_n_expr
)
4205 v
.enter_visit
(_n_kwdo
)
4206 if _n_block
!= null then
4207 v
.enter_visit
(_n_block
.as(not null))
4209 if _n_label
!= null then
4210 v
.enter_visit
(_n_label
.as(not null))
4214 redef class AAssertExpr
4215 private init empty_init
do end
4217 init init_aassertexpr
(
4218 n_kwassert
: nullable TKwassert,
4220 n_expr
: nullable AExpr,
4221 n_else
: nullable AExpr
4225 _n_kwassert
= n_kwassert
.as(not null)
4226 n_kwassert
.parent
= self
4228 if n_id
!= null then
4231 _n_expr
= n_expr
.as(not null)
4232 n_expr
.parent
= self
4234 if n_else
!= null then
4235 n_else
.parent
= self
4239 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4241 if _n_kwassert
== old_child
then
4242 if new_child
!= null then
4243 new_child
.parent
= self
4244 assert new_child
isa TKwassert
4245 _n_kwassert
= new_child
4251 if _n_id
== old_child
then
4252 if new_child
!= null then
4253 new_child
.parent
= self
4254 assert new_child
isa TId
4261 if _n_expr
== old_child
then
4262 if new_child
!= null then
4263 new_child
.parent
= self
4264 assert new_child
isa AExpr
4271 if _n_else
== old_child
then
4272 if new_child
!= null then
4273 new_child
.parent
= self
4274 assert new_child
isa AExpr
4283 redef fun visit_all
(v
: Visitor)
4285 v
.enter_visit
(_n_kwassert
)
4286 if _n_id
!= null then
4287 v
.enter_visit
(_n_id
.as(not null))
4289 v
.enter_visit
(_n_expr
)
4290 if _n_else
!= null then
4291 v
.enter_visit
(_n_else
.as(not null))
4295 redef class AOnceExpr
4296 private init empty_init
do end
4298 init init_aonceexpr
(
4299 n_kwonce
: nullable TKwonce,
4300 n_expr
: nullable AExpr
4304 _n_kwonce
= n_kwonce
.as(not null)
4305 n_kwonce
.parent
= self
4306 _n_expr
= n_expr
.as(not null)
4307 n_expr
.parent
= self
4310 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4312 if _n_kwonce
== old_child
then
4313 if new_child
!= null then
4314 new_child
.parent
= self
4315 assert new_child
isa TKwonce
4316 _n_kwonce
= new_child
4322 if _n_expr
== old_child
then
4323 if new_child
!= null then
4324 new_child
.parent
= self
4325 assert new_child
isa AExpr
4334 redef fun visit_all
(v
: Visitor)
4336 v
.enter_visit
(_n_kwonce
)
4337 v
.enter_visit
(_n_expr
)
4340 redef class ASendExpr
4341 private init empty_init
do end
4343 init init_asendexpr
(
4344 n_expr
: nullable AExpr
4348 _n_expr
= n_expr
.as(not null)
4349 n_expr
.parent
= self
4352 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4354 if _n_expr
== old_child
then
4355 if new_child
!= null then
4356 new_child
.parent
= self
4357 assert new_child
isa AExpr
4366 redef fun visit_all
(v
: Visitor)
4368 v
.enter_visit
(_n_expr
)
4371 redef class ABinopExpr
4372 private init empty_init
do end
4374 init init_abinopexpr
(
4375 n_expr
: nullable AExpr,
4376 n_expr2
: nullable AExpr
4380 _n_expr
= n_expr
.as(not null)
4381 n_expr
.parent
= self
4382 _n_expr2
= n_expr2
.as(not null)
4383 n_expr2
.parent
= self
4386 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4388 if _n_expr
== old_child
then
4389 if new_child
!= null then
4390 new_child
.parent
= self
4391 assert new_child
isa AExpr
4398 if _n_expr2
== old_child
then
4399 if new_child
!= null then
4400 new_child
.parent
= self
4401 assert new_child
isa AExpr
4402 _n_expr2
= new_child
4410 redef fun visit_all
(v
: Visitor)
4412 v
.enter_visit
(_n_expr
)
4413 v
.enter_visit
(_n_expr2
)
4417 private init empty_init
do end
4420 n_expr
: nullable AExpr,
4421 n_expr2
: nullable AExpr
4425 _n_expr
= n_expr
.as(not null)
4426 n_expr
.parent
= self
4427 _n_expr2
= n_expr2
.as(not null)
4428 n_expr2
.parent
= self
4431 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4433 if _n_expr
== old_child
then
4434 if new_child
!= null then
4435 new_child
.parent
= self
4436 assert new_child
isa AExpr
4443 if _n_expr2
== old_child
then
4444 if new_child
!= null then
4445 new_child
.parent
= self
4446 assert new_child
isa AExpr
4447 _n_expr2
= new_child
4455 redef fun visit_all
(v
: Visitor)
4457 v
.enter_visit
(_n_expr
)
4458 v
.enter_visit
(_n_expr2
)
4461 redef class AAndExpr
4462 private init empty_init
do end
4464 init init_aandexpr
(
4465 n_expr
: nullable AExpr,
4466 n_expr2
: nullable AExpr
4470 _n_expr
= n_expr
.as(not null)
4471 n_expr
.parent
= self
4472 _n_expr2
= n_expr2
.as(not null)
4473 n_expr2
.parent
= self
4476 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4478 if _n_expr
== old_child
then
4479 if new_child
!= null then
4480 new_child
.parent
= self
4481 assert new_child
isa AExpr
4488 if _n_expr2
== old_child
then
4489 if new_child
!= null then
4490 new_child
.parent
= self
4491 assert new_child
isa AExpr
4492 _n_expr2
= new_child
4500 redef fun visit_all
(v
: Visitor)
4502 v
.enter_visit
(_n_expr
)
4503 v
.enter_visit
(_n_expr2
)
4506 redef class AOrElseExpr
4507 private init empty_init
do end
4509 init init_aorelseexpr
(
4510 n_expr
: nullable AExpr,
4511 n_expr2
: nullable AExpr
4515 _n_expr
= n_expr
.as(not null)
4516 n_expr
.parent
= self
4517 _n_expr2
= n_expr2
.as(not null)
4518 n_expr2
.parent
= self
4521 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4523 if _n_expr
== old_child
then
4524 if new_child
!= null then
4525 new_child
.parent
= self
4526 assert new_child
isa AExpr
4533 if _n_expr2
== old_child
then
4534 if new_child
!= null then
4535 new_child
.parent
= self
4536 assert new_child
isa AExpr
4537 _n_expr2
= new_child
4545 redef fun visit_all
(v
: Visitor)
4547 v
.enter_visit
(_n_expr
)
4548 v
.enter_visit
(_n_expr2
)
4551 redef class ANotExpr
4552 private init empty_init
do end
4554 init init_anotexpr
(
4555 n_kwnot
: nullable TKwnot,
4556 n_expr
: nullable AExpr
4560 _n_kwnot
= n_kwnot
.as(not null)
4561 n_kwnot
.parent
= self
4562 _n_expr
= n_expr
.as(not null)
4563 n_expr
.parent
= self
4566 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4568 if _n_kwnot
== old_child
then
4569 if new_child
!= null then
4570 new_child
.parent
= self
4571 assert new_child
isa TKwnot
4572 _n_kwnot
= new_child
4578 if _n_expr
== old_child
then
4579 if new_child
!= null then
4580 new_child
.parent
= self
4581 assert new_child
isa AExpr
4590 redef fun visit_all
(v
: Visitor)
4592 v
.enter_visit
(_n_kwnot
)
4593 v
.enter_visit
(_n_expr
)
4597 private init empty_init
do end
4600 n_expr
: nullable AExpr,
4601 n_expr2
: nullable AExpr
4605 _n_expr
= n_expr
.as(not null)
4606 n_expr
.parent
= self
4607 _n_expr2
= n_expr2
.as(not null)
4608 n_expr2
.parent
= self
4611 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4613 if _n_expr
== old_child
then
4614 if new_child
!= null then
4615 new_child
.parent
= self
4616 assert new_child
isa AExpr
4623 if _n_expr2
== old_child
then
4624 if new_child
!= null then
4625 new_child
.parent
= self
4626 assert new_child
isa AExpr
4627 _n_expr2
= new_child
4635 redef fun visit_all
(v
: Visitor)
4637 v
.enter_visit
(_n_expr
)
4638 v
.enter_visit
(_n_expr2
)
4642 private init empty_init
do end
4645 n_expr
: nullable AExpr,
4646 n_expr2
: nullable AExpr
4650 _n_expr
= n_expr
.as(not null)
4651 n_expr
.parent
= self
4652 _n_expr2
= n_expr2
.as(not null)
4653 n_expr2
.parent
= self
4656 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4658 if _n_expr
== old_child
then
4659 if new_child
!= null then
4660 new_child
.parent
= self
4661 assert new_child
isa AExpr
4668 if _n_expr2
== old_child
then
4669 if new_child
!= null then
4670 new_child
.parent
= self
4671 assert new_child
isa AExpr
4672 _n_expr2
= new_child
4680 redef fun visit_all
(v
: Visitor)
4682 v
.enter_visit
(_n_expr
)
4683 v
.enter_visit
(_n_expr2
)
4687 private init empty_init
do end
4690 n_expr
: nullable AExpr,
4691 n_expr2
: nullable AExpr
4695 _n_expr
= n_expr
.as(not null)
4696 n_expr
.parent
= self
4697 _n_expr2
= n_expr2
.as(not null)
4698 n_expr2
.parent
= self
4701 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4703 if _n_expr
== old_child
then
4704 if new_child
!= null then
4705 new_child
.parent
= self
4706 assert new_child
isa AExpr
4713 if _n_expr2
== old_child
then
4714 if new_child
!= null then
4715 new_child
.parent
= self
4716 assert new_child
isa AExpr
4717 _n_expr2
= new_child
4725 redef fun visit_all
(v
: Visitor)
4727 v
.enter_visit
(_n_expr
)
4728 v
.enter_visit
(_n_expr2
)
4732 private init empty_init
do end
4735 n_expr
: nullable AExpr,
4736 n_expr2
: nullable AExpr
4740 _n_expr
= n_expr
.as(not null)
4741 n_expr
.parent
= self
4742 _n_expr2
= n_expr2
.as(not null)
4743 n_expr2
.parent
= self
4746 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4748 if _n_expr
== old_child
then
4749 if new_child
!= null then
4750 new_child
.parent
= self
4751 assert new_child
isa AExpr
4758 if _n_expr2
== old_child
then
4759 if new_child
!= null then
4760 new_child
.parent
= self
4761 assert new_child
isa AExpr
4762 _n_expr2
= new_child
4770 redef fun visit_all
(v
: Visitor)
4772 v
.enter_visit
(_n_expr
)
4773 v
.enter_visit
(_n_expr2
)
4777 private init empty_init
do end
4780 n_expr
: nullable AExpr,
4781 n_expr2
: nullable AExpr
4785 _n_expr
= n_expr
.as(not null)
4786 n_expr
.parent
= self
4787 _n_expr2
= n_expr2
.as(not null)
4788 n_expr2
.parent
= self
4791 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4793 if _n_expr
== old_child
then
4794 if new_child
!= null then
4795 new_child
.parent
= self
4796 assert new_child
isa AExpr
4803 if _n_expr2
== old_child
then
4804 if new_child
!= null then
4805 new_child
.parent
= self
4806 assert new_child
isa AExpr
4807 _n_expr2
= new_child
4815 redef fun visit_all
(v
: Visitor)
4817 v
.enter_visit
(_n_expr
)
4818 v
.enter_visit
(_n_expr2
)
4822 private init empty_init
do end
4825 n_expr
: nullable AExpr,
4826 n_expr2
: nullable AExpr
4830 _n_expr
= n_expr
.as(not null)
4831 n_expr
.parent
= self
4832 _n_expr2
= n_expr2
.as(not null)
4833 n_expr2
.parent
= self
4836 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4838 if _n_expr
== old_child
then
4839 if new_child
!= null then
4840 new_child
.parent
= self
4841 assert new_child
isa AExpr
4848 if _n_expr2
== old_child
then
4849 if new_child
!= null then
4850 new_child
.parent
= self
4851 assert new_child
isa AExpr
4852 _n_expr2
= new_child
4860 redef fun visit_all
(v
: Visitor)
4862 v
.enter_visit
(_n_expr
)
4863 v
.enter_visit
(_n_expr2
)
4867 private init empty_init
do end
4870 n_expr
: nullable AExpr,
4871 n_expr2
: nullable AExpr
4875 _n_expr
= n_expr
.as(not null)
4876 n_expr
.parent
= self
4877 _n_expr2
= n_expr2
.as(not null)
4878 n_expr2
.parent
= self
4881 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4883 if _n_expr
== old_child
then
4884 if new_child
!= null then
4885 new_child
.parent
= self
4886 assert new_child
isa AExpr
4893 if _n_expr2
== old_child
then
4894 if new_child
!= null then
4895 new_child
.parent
= self
4896 assert new_child
isa AExpr
4897 _n_expr2
= new_child
4905 redef fun visit_all
(v
: Visitor)
4907 v
.enter_visit
(_n_expr
)
4908 v
.enter_visit
(_n_expr2
)
4912 private init empty_init
do end
4915 n_expr
: nullable AExpr,
4916 n_expr2
: nullable AExpr
4920 _n_expr
= n_expr
.as(not null)
4921 n_expr
.parent
= self
4922 _n_expr2
= n_expr2
.as(not null)
4923 n_expr2
.parent
= self
4926 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4928 if _n_expr
== old_child
then
4929 if new_child
!= null then
4930 new_child
.parent
= self
4931 assert new_child
isa AExpr
4938 if _n_expr2
== old_child
then
4939 if new_child
!= null then
4940 new_child
.parent
= self
4941 assert new_child
isa AExpr
4942 _n_expr2
= new_child
4950 redef fun visit_all
(v
: Visitor)
4952 v
.enter_visit
(_n_expr
)
4953 v
.enter_visit
(_n_expr2
)
4957 private init empty_init
do end
4960 n_expr
: nullable AExpr,
4961 n_expr2
: nullable AExpr
4965 _n_expr
= n_expr
.as(not null)
4966 n_expr
.parent
= self
4967 _n_expr2
= n_expr2
.as(not null)
4968 n_expr2
.parent
= self
4971 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4973 if _n_expr
== old_child
then
4974 if new_child
!= null then
4975 new_child
.parent
= self
4976 assert new_child
isa AExpr
4983 if _n_expr2
== old_child
then
4984 if new_child
!= null then
4985 new_child
.parent
= self
4986 assert new_child
isa AExpr
4987 _n_expr2
= new_child
4995 redef fun visit_all
(v
: Visitor)
4997 v
.enter_visit
(_n_expr
)
4998 v
.enter_visit
(_n_expr2
)
5001 redef class AIsaExpr
5002 private init empty_init
do end
5004 init init_aisaexpr
(
5005 n_expr
: nullable AExpr,
5006 n_type
: nullable AType
5010 _n_expr
= n_expr
.as(not null)
5011 n_expr
.parent
= self
5012 _n_type
= n_type
.as(not null)
5013 n_type
.parent
= self
5016 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5018 if _n_expr
== old_child
then
5019 if new_child
!= null then
5020 new_child
.parent
= self
5021 assert new_child
isa AExpr
5028 if _n_type
== old_child
then
5029 if new_child
!= null then
5030 new_child
.parent
= self
5031 assert new_child
isa AType
5040 redef fun visit_all
(v
: Visitor)
5042 v
.enter_visit
(_n_expr
)
5043 v
.enter_visit
(_n_type
)
5046 redef class APlusExpr
5047 private init empty_init
do end
5049 init init_aplusexpr
(
5050 n_expr
: nullable AExpr,
5051 n_expr2
: nullable AExpr
5055 _n_expr
= n_expr
.as(not null)
5056 n_expr
.parent
= self
5057 _n_expr2
= n_expr2
.as(not null)
5058 n_expr2
.parent
= self
5061 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5063 if _n_expr
== old_child
then
5064 if new_child
!= null then
5065 new_child
.parent
= self
5066 assert new_child
isa AExpr
5073 if _n_expr2
== old_child
then
5074 if new_child
!= null then
5075 new_child
.parent
= self
5076 assert new_child
isa AExpr
5077 _n_expr2
= new_child
5085 redef fun visit_all
(v
: Visitor)
5087 v
.enter_visit
(_n_expr
)
5088 v
.enter_visit
(_n_expr2
)
5091 redef class AMinusExpr
5092 private init empty_init
do end
5094 init init_aminusexpr
(
5095 n_expr
: nullable AExpr,
5096 n_expr2
: nullable AExpr
5100 _n_expr
= n_expr
.as(not null)
5101 n_expr
.parent
= self
5102 _n_expr2
= n_expr2
.as(not null)
5103 n_expr2
.parent
= self
5106 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5108 if _n_expr
== old_child
then
5109 if new_child
!= null then
5110 new_child
.parent
= self
5111 assert new_child
isa AExpr
5118 if _n_expr2
== old_child
then
5119 if new_child
!= null then
5120 new_child
.parent
= self
5121 assert new_child
isa AExpr
5122 _n_expr2
= new_child
5130 redef fun visit_all
(v
: Visitor)
5132 v
.enter_visit
(_n_expr
)
5133 v
.enter_visit
(_n_expr2
)
5136 redef class AStarshipExpr
5137 private init empty_init
do end
5139 init init_astarshipexpr
(
5140 n_expr
: nullable AExpr,
5141 n_expr2
: nullable AExpr
5145 _n_expr
= n_expr
.as(not null)
5146 n_expr
.parent
= self
5147 _n_expr2
= n_expr2
.as(not null)
5148 n_expr2
.parent
= self
5151 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5153 if _n_expr
== old_child
then
5154 if new_child
!= null then
5155 new_child
.parent
= self
5156 assert new_child
isa AExpr
5163 if _n_expr2
== old_child
then
5164 if new_child
!= null then
5165 new_child
.parent
= self
5166 assert new_child
isa AExpr
5167 _n_expr2
= new_child
5175 redef fun visit_all
(v
: Visitor)
5177 v
.enter_visit
(_n_expr
)
5178 v
.enter_visit
(_n_expr2
)
5181 redef class AStarExpr
5182 private init empty_init
do end
5184 init init_astarexpr
(
5185 n_expr
: nullable AExpr,
5186 n_expr2
: nullable AExpr
5190 _n_expr
= n_expr
.as(not null)
5191 n_expr
.parent
= self
5192 _n_expr2
= n_expr2
.as(not null)
5193 n_expr2
.parent
= self
5196 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5198 if _n_expr
== old_child
then
5199 if new_child
!= null then
5200 new_child
.parent
= self
5201 assert new_child
isa AExpr
5208 if _n_expr2
== old_child
then
5209 if new_child
!= null then
5210 new_child
.parent
= self
5211 assert new_child
isa AExpr
5212 _n_expr2
= new_child
5220 redef fun visit_all
(v
: Visitor)
5222 v
.enter_visit
(_n_expr
)
5223 v
.enter_visit
(_n_expr2
)
5226 redef class ASlashExpr
5227 private init empty_init
do end
5229 init init_aslashexpr
(
5230 n_expr
: nullable AExpr,
5231 n_expr2
: nullable AExpr
5235 _n_expr
= n_expr
.as(not null)
5236 n_expr
.parent
= self
5237 _n_expr2
= n_expr2
.as(not null)
5238 n_expr2
.parent
= self
5241 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5243 if _n_expr
== old_child
then
5244 if new_child
!= null then
5245 new_child
.parent
= self
5246 assert new_child
isa AExpr
5253 if _n_expr2
== old_child
then
5254 if new_child
!= null then
5255 new_child
.parent
= self
5256 assert new_child
isa AExpr
5257 _n_expr2
= new_child
5265 redef fun visit_all
(v
: Visitor)
5267 v
.enter_visit
(_n_expr
)
5268 v
.enter_visit
(_n_expr2
)
5271 redef class APercentExpr
5272 private init empty_init
do end
5274 init init_apercentexpr
(
5275 n_expr
: nullable AExpr,
5276 n_expr2
: nullable AExpr
5280 _n_expr
= n_expr
.as(not null)
5281 n_expr
.parent
= self
5282 _n_expr2
= n_expr2
.as(not null)
5283 n_expr2
.parent
= self
5286 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5288 if _n_expr
== old_child
then
5289 if new_child
!= null then
5290 new_child
.parent
= self
5291 assert new_child
isa AExpr
5298 if _n_expr2
== old_child
then
5299 if new_child
!= null then
5300 new_child
.parent
= self
5301 assert new_child
isa AExpr
5302 _n_expr2
= new_child
5310 redef fun visit_all
(v
: Visitor)
5312 v
.enter_visit
(_n_expr
)
5313 v
.enter_visit
(_n_expr2
)
5316 redef class AUminusExpr
5317 private init empty_init
do end
5319 init init_auminusexpr
(
5320 n_minus
: nullable TMinus,
5321 n_expr
: nullable AExpr
5325 _n_minus
= n_minus
.as(not null)
5326 n_minus
.parent
= self
5327 _n_expr
= n_expr
.as(not null)
5328 n_expr
.parent
= self
5331 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5333 if _n_minus
== old_child
then
5334 if new_child
!= null then
5335 new_child
.parent
= self
5336 assert new_child
isa TMinus
5337 _n_minus
= new_child
5343 if _n_expr
== old_child
then
5344 if new_child
!= null then
5345 new_child
.parent
= self
5346 assert new_child
isa AExpr
5355 redef fun visit_all
(v
: Visitor)
5357 v
.enter_visit
(_n_minus
)
5358 v
.enter_visit
(_n_expr
)
5361 redef class ANewExpr
5362 private init empty_init
do end
5364 init init_anewexpr
(
5365 n_kwnew
: nullable TKwnew,
5366 n_type
: nullable AType,
5368 n_args
: nullable AExprs
5372 _n_kwnew
= n_kwnew
.as(not null)
5373 n_kwnew
.parent
= self
5374 _n_type
= n_type
.as(not null)
5375 n_type
.parent
= self
5377 if n_id
!= null then
5380 _n_args
= n_args
.as(not null)
5381 n_args
.parent
= self
5384 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5386 if _n_kwnew
== old_child
then
5387 if new_child
!= null then
5388 new_child
.parent
= self
5389 assert new_child
isa TKwnew
5390 _n_kwnew
= new_child
5396 if _n_type
== old_child
then
5397 if new_child
!= null then
5398 new_child
.parent
= self
5399 assert new_child
isa AType
5406 if _n_id
== old_child
then
5407 if new_child
!= null then
5408 new_child
.parent
= self
5409 assert new_child
isa TId
5416 if _n_args
== old_child
then
5417 if new_child
!= null then
5418 new_child
.parent
= self
5419 assert new_child
isa AExprs
5428 redef fun visit_all
(v
: Visitor)
5430 v
.enter_visit
(_n_kwnew
)
5431 v
.enter_visit
(_n_type
)
5432 if _n_id
!= null then
5433 v
.enter_visit
(_n_id
.as(not null))
5435 v
.enter_visit
(_n_args
)
5438 redef class AAttrExpr
5439 private init empty_init
do end
5441 init init_aattrexpr
(
5442 n_expr
: nullable AExpr,
5443 n_id
: nullable TAttrid
5447 _n_expr
= n_expr
.as(not null)
5448 n_expr
.parent
= self
5449 _n_id
= n_id
.as(not null)
5453 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5455 if _n_expr
== old_child
then
5456 if new_child
!= null then
5457 new_child
.parent
= self
5458 assert new_child
isa AExpr
5465 if _n_id
== old_child
then
5466 if new_child
!= null then
5467 new_child
.parent
= self
5468 assert new_child
isa TAttrid
5477 redef fun visit_all
(v
: Visitor)
5479 v
.enter_visit
(_n_expr
)
5480 v
.enter_visit
(_n_id
)
5483 redef class AAttrAssignExpr
5484 private init empty_init
do end
5486 init init_aattrassignexpr
(
5487 n_expr
: nullable AExpr,
5488 n_id
: nullable TAttrid,
5489 n_assign
: nullable TAssign,
5490 n_value
: nullable AExpr
5494 _n_expr
= n_expr
.as(not null)
5495 n_expr
.parent
= self
5496 _n_id
= n_id
.as(not null)
5498 _n_assign
= n_assign
.as(not null)
5499 n_assign
.parent
= self
5500 _n_value
= n_value
.as(not null)
5501 n_value
.parent
= self
5504 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5506 if _n_expr
== old_child
then
5507 if new_child
!= null then
5508 new_child
.parent
= self
5509 assert new_child
isa AExpr
5516 if _n_id
== old_child
then
5517 if new_child
!= null then
5518 new_child
.parent
= self
5519 assert new_child
isa TAttrid
5526 if _n_assign
== old_child
then
5527 if new_child
!= null then
5528 new_child
.parent
= self
5529 assert new_child
isa TAssign
5530 _n_assign
= new_child
5536 if _n_value
== old_child
then
5537 if new_child
!= null then
5538 new_child
.parent
= self
5539 assert new_child
isa AExpr
5540 _n_value
= new_child
5548 redef fun visit_all
(v
: Visitor)
5550 v
.enter_visit
(_n_expr
)
5551 v
.enter_visit
(_n_id
)
5552 v
.enter_visit
(_n_assign
)
5553 v
.enter_visit
(_n_value
)
5556 redef class AAttrReassignExpr
5557 private init empty_init
do end
5559 init init_aattrreassignexpr
(
5560 n_expr
: nullable AExpr,
5561 n_id
: nullable TAttrid,
5562 n_assign_op
: nullable AAssignOp,
5563 n_value
: nullable AExpr
5567 _n_expr
= n_expr
.as(not null)
5568 n_expr
.parent
= self
5569 _n_id
= n_id
.as(not null)
5571 _n_assign_op
= n_assign_op
.as(not null)
5572 n_assign_op
.parent
= self
5573 _n_value
= n_value
.as(not null)
5574 n_value
.parent
= self
5577 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5579 if _n_expr
== old_child
then
5580 if new_child
!= null then
5581 new_child
.parent
= self
5582 assert new_child
isa AExpr
5589 if _n_id
== old_child
then
5590 if new_child
!= null then
5591 new_child
.parent
= self
5592 assert new_child
isa TAttrid
5599 if _n_assign_op
== old_child
then
5600 if new_child
!= null then
5601 new_child
.parent
= self
5602 assert new_child
isa AAssignOp
5603 _n_assign_op
= new_child
5609 if _n_value
== old_child
then
5610 if new_child
!= null then
5611 new_child
.parent
= self
5612 assert new_child
isa AExpr
5613 _n_value
= new_child
5621 redef fun visit_all
(v
: Visitor)
5623 v
.enter_visit
(_n_expr
)
5624 v
.enter_visit
(_n_id
)
5625 v
.enter_visit
(_n_assign_op
)
5626 v
.enter_visit
(_n_value
)
5629 redef class ACallExpr
5630 private init empty_init
do end
5632 init init_acallexpr
(
5633 n_expr
: nullable AExpr,
5635 n_args
: nullable AExprs,
5636 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5640 _n_expr
= n_expr
.as(not null)
5641 n_expr
.parent
= self
5642 _n_id
= n_id
.as(not null)
5644 _n_args
= n_args
.as(not null)
5645 n_args
.parent
= self
5646 for n
in n_closure_defs
do
5647 assert n
isa AClosureDef
5648 _n_closure_defs
.add
(n
)
5653 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5655 if _n_expr
== old_child
then
5656 if new_child
!= null then
5657 new_child
.parent
= self
5658 assert new_child
isa AExpr
5665 if _n_id
== old_child
then
5666 if new_child
!= null then
5667 new_child
.parent
= self
5668 assert new_child
isa TId
5675 if _n_args
== old_child
then
5676 if new_child
!= null then
5677 new_child
.parent
= self
5678 assert new_child
isa AExprs
5685 for i
in [0.._n_closure_defs
.length
[ do
5686 if _n_closure_defs
[i
] == old_child
then
5687 if new_child
!= null then
5688 assert new_child
isa AClosureDef
5689 _n_closure_defs
[i
] = new_child
5690 new_child
.parent
= self
5692 _n_closure_defs
.remove_at
(i
)
5699 redef fun visit_all
(v
: Visitor)
5701 v
.enter_visit
(_n_expr
)
5702 v
.enter_visit
(_n_id
)
5703 v
.enter_visit
(_n_args
)
5704 for n
in _n_closure_defs
do
5709 redef class ACallAssignExpr
5710 private init empty_init
do end
5712 init init_acallassignexpr
(
5713 n_expr
: nullable AExpr,
5715 n_args
: nullable AExprs,
5716 n_assign
: nullable TAssign,
5717 n_value
: nullable AExpr
5721 _n_expr
= n_expr
.as(not null)
5722 n_expr
.parent
= self
5723 _n_id
= n_id
.as(not null)
5725 _n_args
= n_args
.as(not null)
5726 n_args
.parent
= self
5727 _n_assign
= n_assign
.as(not null)
5728 n_assign
.parent
= self
5729 _n_value
= n_value
.as(not null)
5730 n_value
.parent
= self
5733 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5735 if _n_expr
== old_child
then
5736 if new_child
!= null then
5737 new_child
.parent
= self
5738 assert new_child
isa AExpr
5745 if _n_id
== old_child
then
5746 if new_child
!= null then
5747 new_child
.parent
= self
5748 assert new_child
isa TId
5755 if _n_args
== old_child
then
5756 if new_child
!= null then
5757 new_child
.parent
= self
5758 assert new_child
isa AExprs
5765 if _n_assign
== old_child
then
5766 if new_child
!= null then
5767 new_child
.parent
= self
5768 assert new_child
isa TAssign
5769 _n_assign
= new_child
5775 if _n_value
== old_child
then
5776 if new_child
!= null then
5777 new_child
.parent
= self
5778 assert new_child
isa AExpr
5779 _n_value
= new_child
5787 redef fun visit_all
(v
: Visitor)
5789 v
.enter_visit
(_n_expr
)
5790 v
.enter_visit
(_n_id
)
5791 v
.enter_visit
(_n_args
)
5792 v
.enter_visit
(_n_assign
)
5793 v
.enter_visit
(_n_value
)
5796 redef class ACallReassignExpr
5797 private init empty_init
do end
5799 init init_acallreassignexpr
(
5800 n_expr
: nullable AExpr,
5802 n_args
: nullable AExprs,
5803 n_assign_op
: nullable AAssignOp,
5804 n_value
: nullable AExpr
5808 _n_expr
= n_expr
.as(not null)
5809 n_expr
.parent
= self
5810 _n_id
= n_id
.as(not null)
5812 _n_args
= n_args
.as(not null)
5813 n_args
.parent
= self
5814 _n_assign_op
= n_assign_op
.as(not null)
5815 n_assign_op
.parent
= self
5816 _n_value
= n_value
.as(not null)
5817 n_value
.parent
= self
5820 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5822 if _n_expr
== old_child
then
5823 if new_child
!= null then
5824 new_child
.parent
= self
5825 assert new_child
isa AExpr
5832 if _n_id
== old_child
then
5833 if new_child
!= null then
5834 new_child
.parent
= self
5835 assert new_child
isa TId
5842 if _n_args
== old_child
then
5843 if new_child
!= null then
5844 new_child
.parent
= self
5845 assert new_child
isa AExprs
5852 if _n_assign_op
== old_child
then
5853 if new_child
!= null then
5854 new_child
.parent
= self
5855 assert new_child
isa AAssignOp
5856 _n_assign_op
= new_child
5862 if _n_value
== old_child
then
5863 if new_child
!= null then
5864 new_child
.parent
= self
5865 assert new_child
isa AExpr
5866 _n_value
= new_child
5874 redef fun visit_all
(v
: Visitor)
5876 v
.enter_visit
(_n_expr
)
5877 v
.enter_visit
(_n_id
)
5878 v
.enter_visit
(_n_args
)
5879 v
.enter_visit
(_n_assign_op
)
5880 v
.enter_visit
(_n_value
)
5883 redef class ASuperExpr
5884 private init empty_init
do end
5886 init init_asuperexpr
(
5887 n_qualified
: nullable AQualified,
5888 n_kwsuper
: nullable TKwsuper,
5889 n_args
: nullable AExprs
5893 _n_qualified
= n_qualified
5894 if n_qualified
!= null then
5895 n_qualified
.parent
= self
5897 _n_kwsuper
= n_kwsuper
.as(not null)
5898 n_kwsuper
.parent
= self
5899 _n_args
= n_args
.as(not null)
5900 n_args
.parent
= self
5903 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5905 if _n_qualified
== old_child
then
5906 if new_child
!= null then
5907 new_child
.parent
= self
5908 assert new_child
isa AQualified
5909 _n_qualified
= new_child
5915 if _n_kwsuper
== old_child
then
5916 if new_child
!= null then
5917 new_child
.parent
= self
5918 assert new_child
isa TKwsuper
5919 _n_kwsuper
= new_child
5925 if _n_args
== old_child
then
5926 if new_child
!= null then
5927 new_child
.parent
= self
5928 assert new_child
isa AExprs
5937 redef fun visit_all
(v
: Visitor)
5939 if _n_qualified
!= null then
5940 v
.enter_visit
(_n_qualified
.as(not null))
5942 v
.enter_visit
(_n_kwsuper
)
5943 v
.enter_visit
(_n_args
)
5946 redef class AInitExpr
5947 private init empty_init
do end
5949 init init_ainitexpr
(
5950 n_expr
: nullable AExpr,
5951 n_kwinit
: nullable TKwinit,
5952 n_args
: nullable AExprs
5956 _n_expr
= n_expr
.as(not null)
5957 n_expr
.parent
= self
5958 _n_kwinit
= n_kwinit
.as(not null)
5959 n_kwinit
.parent
= self
5960 _n_args
= n_args
.as(not null)
5961 n_args
.parent
= self
5964 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5966 if _n_expr
== old_child
then
5967 if new_child
!= null then
5968 new_child
.parent
= self
5969 assert new_child
isa AExpr
5976 if _n_kwinit
== old_child
then
5977 if new_child
!= null then
5978 new_child
.parent
= self
5979 assert new_child
isa TKwinit
5980 _n_kwinit
= new_child
5986 if _n_args
== old_child
then
5987 if new_child
!= null then
5988 new_child
.parent
= self
5989 assert new_child
isa AExprs
5998 redef fun visit_all
(v
: Visitor)
6000 v
.enter_visit
(_n_expr
)
6001 v
.enter_visit
(_n_kwinit
)
6002 v
.enter_visit
(_n_args
)
6005 redef class ABraExpr
6006 private init empty_init
do end
6008 init init_abraexpr
(
6009 n_expr
: nullable AExpr,
6010 n_args
: nullable AExprs,
6011 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6015 _n_expr
= n_expr
.as(not null)
6016 n_expr
.parent
= self
6017 _n_args
= n_args
.as(not null)
6018 n_args
.parent
= self
6019 for n
in n_closure_defs
do
6020 assert n
isa AClosureDef
6021 _n_closure_defs
.add
(n
)
6026 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6028 if _n_expr
== old_child
then
6029 if new_child
!= null then
6030 new_child
.parent
= self
6031 assert new_child
isa AExpr
6038 if _n_args
== old_child
then
6039 if new_child
!= null then
6040 new_child
.parent
= self
6041 assert new_child
isa AExprs
6048 for i
in [0.._n_closure_defs
.length
[ do
6049 if _n_closure_defs
[i
] == old_child
then
6050 if new_child
!= null then
6051 assert new_child
isa AClosureDef
6052 _n_closure_defs
[i
] = new_child
6053 new_child
.parent
= self
6055 _n_closure_defs
.remove_at
(i
)
6062 redef fun visit_all
(v
: Visitor)
6064 v
.enter_visit
(_n_expr
)
6065 v
.enter_visit
(_n_args
)
6066 for n
in _n_closure_defs
do
6071 redef class ABraAssignExpr
6072 private init empty_init
do end
6074 init init_abraassignexpr
(
6075 n_expr
: nullable AExpr,
6076 n_args
: nullable AExprs,
6077 n_assign
: nullable TAssign,
6078 n_value
: nullable AExpr
6082 _n_expr
= n_expr
.as(not null)
6083 n_expr
.parent
= self
6084 _n_args
= n_args
.as(not null)
6085 n_args
.parent
= self
6086 _n_assign
= n_assign
.as(not null)
6087 n_assign
.parent
= self
6088 _n_value
= n_value
.as(not null)
6089 n_value
.parent
= self
6092 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6094 if _n_expr
== old_child
then
6095 if new_child
!= null then
6096 new_child
.parent
= self
6097 assert new_child
isa AExpr
6104 if _n_args
== old_child
then
6105 if new_child
!= null then
6106 new_child
.parent
= self
6107 assert new_child
isa AExprs
6114 if _n_assign
== old_child
then
6115 if new_child
!= null then
6116 new_child
.parent
= self
6117 assert new_child
isa TAssign
6118 _n_assign
= new_child
6124 if _n_value
== old_child
then
6125 if new_child
!= null then
6126 new_child
.parent
= self
6127 assert new_child
isa AExpr
6128 _n_value
= new_child
6136 redef fun visit_all
(v
: Visitor)
6138 v
.enter_visit
(_n_expr
)
6139 v
.enter_visit
(_n_args
)
6140 v
.enter_visit
(_n_assign
)
6141 v
.enter_visit
(_n_value
)
6144 redef class ABraReassignExpr
6145 private init empty_init
do end
6147 init init_abrareassignexpr
(
6148 n_expr
: nullable AExpr,
6149 n_args
: nullable AExprs,
6150 n_assign_op
: nullable AAssignOp,
6151 n_value
: nullable AExpr
6155 _n_expr
= n_expr
.as(not null)
6156 n_expr
.parent
= self
6157 _n_args
= n_args
.as(not null)
6158 n_args
.parent
= self
6159 _n_assign_op
= n_assign_op
.as(not null)
6160 n_assign_op
.parent
= self
6161 _n_value
= n_value
.as(not null)
6162 n_value
.parent
= self
6165 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6167 if _n_expr
== old_child
then
6168 if new_child
!= null then
6169 new_child
.parent
= self
6170 assert new_child
isa AExpr
6177 if _n_args
== old_child
then
6178 if new_child
!= null then
6179 new_child
.parent
= self
6180 assert new_child
isa AExprs
6187 if _n_assign_op
== old_child
then
6188 if new_child
!= null then
6189 new_child
.parent
= self
6190 assert new_child
isa AAssignOp
6191 _n_assign_op
= new_child
6197 if _n_value
== old_child
then
6198 if new_child
!= null then
6199 new_child
.parent
= self
6200 assert new_child
isa AExpr
6201 _n_value
= new_child
6209 redef fun visit_all
(v
: Visitor)
6211 v
.enter_visit
(_n_expr
)
6212 v
.enter_visit
(_n_args
)
6213 v
.enter_visit
(_n_assign_op
)
6214 v
.enter_visit
(_n_value
)
6217 redef class AClosureCallExpr
6218 private init empty_init
do end
6220 init init_aclosurecallexpr
(
6222 n_args
: nullable AExprs,
6223 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6227 _n_id
= n_id
.as(not null)
6229 _n_args
= n_args
.as(not null)
6230 n_args
.parent
= self
6231 for n
in n_closure_defs
do
6232 assert n
isa AClosureDef
6233 _n_closure_defs
.add
(n
)
6238 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6240 if _n_id
== old_child
then
6241 if new_child
!= null then
6242 new_child
.parent
= self
6243 assert new_child
isa TId
6250 if _n_args
== old_child
then
6251 if new_child
!= null then
6252 new_child
.parent
= self
6253 assert new_child
isa AExprs
6260 for i
in [0.._n_closure_defs
.length
[ do
6261 if _n_closure_defs
[i
] == old_child
then
6262 if new_child
!= null then
6263 assert new_child
isa AClosureDef
6264 _n_closure_defs
[i
] = new_child
6265 new_child
.parent
= self
6267 _n_closure_defs
.remove_at
(i
)
6274 redef fun visit_all
(v
: Visitor)
6276 v
.enter_visit
(_n_id
)
6277 v
.enter_visit
(_n_args
)
6278 for n
in _n_closure_defs
do
6283 redef class AVarExpr
6284 private init empty_init
do end
6286 init init_avarexpr
(
6291 _n_id
= n_id
.as(not null)
6295 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6297 if _n_id
== old_child
then
6298 if new_child
!= null then
6299 new_child
.parent
= self
6300 assert new_child
isa TId
6309 redef fun visit_all
(v
: Visitor)
6311 v
.enter_visit
(_n_id
)
6314 redef class AVarAssignExpr
6315 private init empty_init
do end
6317 init init_avarassignexpr
(
6319 n_assign
: nullable TAssign,
6320 n_value
: nullable AExpr
6324 _n_id
= n_id
.as(not null)
6326 _n_assign
= n_assign
.as(not null)
6327 n_assign
.parent
= self
6328 _n_value
= n_value
.as(not null)
6329 n_value
.parent
= self
6332 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6334 if _n_id
== old_child
then
6335 if new_child
!= null then
6336 new_child
.parent
= self
6337 assert new_child
isa TId
6344 if _n_assign
== old_child
then
6345 if new_child
!= null then
6346 new_child
.parent
= self
6347 assert new_child
isa TAssign
6348 _n_assign
= new_child
6354 if _n_value
== old_child
then
6355 if new_child
!= null then
6356 new_child
.parent
= self
6357 assert new_child
isa AExpr
6358 _n_value
= new_child
6366 redef fun visit_all
(v
: Visitor)
6368 v
.enter_visit
(_n_id
)
6369 v
.enter_visit
(_n_assign
)
6370 v
.enter_visit
(_n_value
)
6373 redef class AVarReassignExpr
6374 private init empty_init
do end
6376 init init_avarreassignexpr
(
6378 n_assign_op
: nullable AAssignOp,
6379 n_value
: nullable AExpr
6383 _n_id
= n_id
.as(not null)
6385 _n_assign_op
= n_assign_op
.as(not null)
6386 n_assign_op
.parent
= self
6387 _n_value
= n_value
.as(not null)
6388 n_value
.parent
= self
6391 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6393 if _n_id
== old_child
then
6394 if new_child
!= null then
6395 new_child
.parent
= self
6396 assert new_child
isa TId
6403 if _n_assign_op
== old_child
then
6404 if new_child
!= null then
6405 new_child
.parent
= self
6406 assert new_child
isa AAssignOp
6407 _n_assign_op
= new_child
6413 if _n_value
== old_child
then
6414 if new_child
!= null then
6415 new_child
.parent
= self
6416 assert new_child
isa AExpr
6417 _n_value
= new_child
6425 redef fun visit_all
(v
: Visitor)
6427 v
.enter_visit
(_n_id
)
6428 v
.enter_visit
(_n_assign_op
)
6429 v
.enter_visit
(_n_value
)
6432 redef class ARangeExpr
6433 private init empty_init
do end
6435 init init_arangeexpr
(
6436 n_expr
: nullable AExpr,
6437 n_expr2
: nullable AExpr
6441 _n_expr
= n_expr
.as(not null)
6442 n_expr
.parent
= self
6443 _n_expr2
= n_expr2
.as(not null)
6444 n_expr2
.parent
= self
6447 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6449 if _n_expr
== old_child
then
6450 if new_child
!= null then
6451 new_child
.parent
= self
6452 assert new_child
isa AExpr
6459 if _n_expr2
== old_child
then
6460 if new_child
!= null then
6461 new_child
.parent
= self
6462 assert new_child
isa AExpr
6463 _n_expr2
= new_child
6471 redef fun visit_all
(v
: Visitor)
6473 v
.enter_visit
(_n_expr
)
6474 v
.enter_visit
(_n_expr2
)
6477 redef class ACrangeExpr
6478 private init empty_init
do end
6480 init init_acrangeexpr
(
6481 n_obra
: nullable TObra,
6482 n_expr
: nullable AExpr,
6483 n_expr2
: nullable AExpr,
6484 n_cbra
: nullable TCbra
6488 _n_obra
= n_obra
.as(not null)
6489 n_obra
.parent
= self
6490 _n_expr
= n_expr
.as(not null)
6491 n_expr
.parent
= self
6492 _n_expr2
= n_expr2
.as(not null)
6493 n_expr2
.parent
= self
6494 _n_cbra
= n_cbra
.as(not null)
6495 n_cbra
.parent
= self
6498 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6500 if _n_obra
== old_child
then
6501 if new_child
!= null then
6502 new_child
.parent
= self
6503 assert new_child
isa TObra
6510 if _n_expr
== old_child
then
6511 if new_child
!= null then
6512 new_child
.parent
= self
6513 assert new_child
isa AExpr
6520 if _n_expr2
== old_child
then
6521 if new_child
!= null then
6522 new_child
.parent
= self
6523 assert new_child
isa AExpr
6524 _n_expr2
= new_child
6530 if _n_cbra
== old_child
then
6531 if new_child
!= null then
6532 new_child
.parent
= self
6533 assert new_child
isa TCbra
6542 redef fun visit_all
(v
: Visitor)
6544 v
.enter_visit
(_n_obra
)
6545 v
.enter_visit
(_n_expr
)
6546 v
.enter_visit
(_n_expr2
)
6547 v
.enter_visit
(_n_cbra
)
6550 redef class AOrangeExpr
6551 private init empty_init
do end
6553 init init_aorangeexpr
(
6554 n_obra
: nullable TObra,
6555 n_expr
: nullable AExpr,
6556 n_expr2
: nullable AExpr,
6557 n_cbra
: nullable TObra
6561 _n_obra
= n_obra
.as(not null)
6562 n_obra
.parent
= self
6563 _n_expr
= n_expr
.as(not null)
6564 n_expr
.parent
= self
6565 _n_expr2
= n_expr2
.as(not null)
6566 n_expr2
.parent
= self
6567 _n_cbra
= n_cbra
.as(not null)
6568 n_cbra
.parent
= self
6571 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6573 if _n_obra
== old_child
then
6574 if new_child
!= null then
6575 new_child
.parent
= self
6576 assert new_child
isa TObra
6583 if _n_expr
== old_child
then
6584 if new_child
!= null then
6585 new_child
.parent
= self
6586 assert new_child
isa AExpr
6593 if _n_expr2
== old_child
then
6594 if new_child
!= null then
6595 new_child
.parent
= self
6596 assert new_child
isa AExpr
6597 _n_expr2
= new_child
6603 if _n_cbra
== old_child
then
6604 if new_child
!= null then
6605 new_child
.parent
= self
6606 assert new_child
isa TObra
6615 redef fun visit_all
(v
: Visitor)
6617 v
.enter_visit
(_n_obra
)
6618 v
.enter_visit
(_n_expr
)
6619 v
.enter_visit
(_n_expr2
)
6620 v
.enter_visit
(_n_cbra
)
6623 redef class AArrayExpr
6624 private init empty_init
do end
6626 init init_aarrayexpr
(
6627 n_exprs
: nullable AExprs
6631 _n_exprs
= n_exprs
.as(not null)
6632 n_exprs
.parent
= self
6635 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6637 if _n_exprs
== old_child
then
6638 if new_child
!= null then
6639 new_child
.parent
= self
6640 assert new_child
isa AExprs
6641 _n_exprs
= new_child
6649 redef fun visit_all
(v
: Visitor)
6651 v
.enter_visit
(_n_exprs
)
6654 redef class ASelfExpr
6655 private init empty_init
do end
6657 init init_aselfexpr
(
6658 n_kwself
: nullable TKwself
6662 _n_kwself
= n_kwself
.as(not null)
6663 n_kwself
.parent
= self
6666 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6668 if _n_kwself
== old_child
then
6669 if new_child
!= null then
6670 new_child
.parent
= self
6671 assert new_child
isa TKwself
6672 _n_kwself
= new_child
6680 redef fun visit_all
(v
: Visitor)
6682 v
.enter_visit
(_n_kwself
)
6685 redef class AImplicitSelfExpr
6686 private init empty_init
do end
6688 init init_aimplicitselfexpr
6693 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6697 redef fun visit_all
(v
: Visitor)
6701 redef class ATrueExpr
6702 private init empty_init
do end
6704 init init_atrueexpr
(
6705 n_kwtrue
: nullable TKwtrue
6709 _n_kwtrue
= n_kwtrue
.as(not null)
6710 n_kwtrue
.parent
= self
6713 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6715 if _n_kwtrue
== old_child
then
6716 if new_child
!= null then
6717 new_child
.parent
= self
6718 assert new_child
isa TKwtrue
6719 _n_kwtrue
= new_child
6727 redef fun visit_all
(v
: Visitor)
6729 v
.enter_visit
(_n_kwtrue
)
6732 redef class AFalseExpr
6733 private init empty_init
do end
6735 init init_afalseexpr
(
6736 n_kwfalse
: nullable TKwfalse
6740 _n_kwfalse
= n_kwfalse
.as(not null)
6741 n_kwfalse
.parent
= self
6744 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6746 if _n_kwfalse
== old_child
then
6747 if new_child
!= null then
6748 new_child
.parent
= self
6749 assert new_child
isa TKwfalse
6750 _n_kwfalse
= new_child
6758 redef fun visit_all
(v
: Visitor)
6760 v
.enter_visit
(_n_kwfalse
)
6763 redef class ANullExpr
6764 private init empty_init
do end
6766 init init_anullexpr
(
6767 n_kwnull
: nullable TKwnull
6771 _n_kwnull
= n_kwnull
.as(not null)
6772 n_kwnull
.parent
= self
6775 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6777 if _n_kwnull
== old_child
then
6778 if new_child
!= null then
6779 new_child
.parent
= self
6780 assert new_child
isa TKwnull
6781 _n_kwnull
= new_child
6789 redef fun visit_all
(v
: Visitor)
6791 v
.enter_visit
(_n_kwnull
)
6794 redef class AIntExpr
6795 private init empty_init
do end
6797 init init_aintexpr
(
6798 n_number
: nullable TNumber
6802 _n_number
= n_number
.as(not null)
6803 n_number
.parent
= self
6806 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6808 if _n_number
== old_child
then
6809 if new_child
!= null then
6810 new_child
.parent
= self
6811 assert new_child
isa TNumber
6812 _n_number
= new_child
6820 redef fun visit_all
(v
: Visitor)
6822 v
.enter_visit
(_n_number
)
6825 redef class AFloatExpr
6826 private init empty_init
do end
6828 init init_afloatexpr
(
6829 n_float
: nullable TFloat
6833 _n_float
= n_float
.as(not null)
6834 n_float
.parent
= self
6837 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6839 if _n_float
== old_child
then
6840 if new_child
!= null then
6841 new_child
.parent
= self
6842 assert new_child
isa TFloat
6843 _n_float
= new_child
6851 redef fun visit_all
(v
: Visitor)
6853 v
.enter_visit
(_n_float
)
6856 redef class ACharExpr
6857 private init empty_init
do end
6859 init init_acharexpr
(
6860 n_char
: nullable TChar
6864 _n_char
= n_char
.as(not null)
6865 n_char
.parent
= self
6868 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6870 if _n_char
== old_child
then
6871 if new_child
!= null then
6872 new_child
.parent
= self
6873 assert new_child
isa TChar
6882 redef fun visit_all
(v
: Visitor)
6884 v
.enter_visit
(_n_char
)
6887 redef class AStringExpr
6888 private init empty_init
do end
6890 init init_astringexpr
(
6891 n_string
: nullable TString
6895 _n_string
= n_string
.as(not null)
6896 n_string
.parent
= self
6899 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6901 if _n_string
== old_child
then
6902 if new_child
!= null then
6903 new_child
.parent
= self
6904 assert new_child
isa TString
6905 _n_string
= new_child
6913 redef fun visit_all
(v
: Visitor)
6915 v
.enter_visit
(_n_string
)
6918 redef class AStartStringExpr
6919 private init empty_init
do end
6921 init init_astartstringexpr
(
6922 n_string
: nullable TStartString
6926 _n_string
= n_string
.as(not null)
6927 n_string
.parent
= self
6930 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6932 if _n_string
== old_child
then
6933 if new_child
!= null then
6934 new_child
.parent
= self
6935 assert new_child
isa TStartString
6936 _n_string
= new_child
6944 redef fun visit_all
(v
: Visitor)
6946 v
.enter_visit
(_n_string
)
6949 redef class AMidStringExpr
6950 private init empty_init
do end
6952 init init_amidstringexpr
(
6953 n_string
: nullable TMidString
6957 _n_string
= n_string
.as(not null)
6958 n_string
.parent
= self
6961 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6963 if _n_string
== old_child
then
6964 if new_child
!= null then
6965 new_child
.parent
= self
6966 assert new_child
isa TMidString
6967 _n_string
= new_child
6975 redef fun visit_all
(v
: Visitor)
6977 v
.enter_visit
(_n_string
)
6980 redef class AEndStringExpr
6981 private init empty_init
do end
6983 init init_aendstringexpr
(
6984 n_string
: nullable TEndString
6988 _n_string
= n_string
.as(not null)
6989 n_string
.parent
= self
6992 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6994 if _n_string
== old_child
then
6995 if new_child
!= null then
6996 new_child
.parent
= self
6997 assert new_child
isa TEndString
6998 _n_string
= new_child
7006 redef fun visit_all
(v
: Visitor)
7008 v
.enter_visit
(_n_string
)
7011 redef class ASuperstringExpr
7012 private init empty_init
do end
7014 init init_asuperstringexpr
(
7015 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7026 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7028 for i
in [0.._n_exprs
.length
[ do
7029 if _n_exprs
[i
] == old_child
then
7030 if new_child
!= null then
7031 assert new_child
isa AExpr
7032 _n_exprs
[i
] = new_child
7033 new_child
.parent
= self
7035 _n_exprs
.remove_at
(i
)
7042 redef fun visit_all
(v
: Visitor)
7044 for n
in _n_exprs
do
7049 redef class AParExpr
7050 private init empty_init
do end
7052 init init_aparexpr
(
7053 n_opar
: nullable TOpar,
7054 n_expr
: nullable AExpr,
7055 n_cpar
: nullable TCpar
7059 _n_opar
= n_opar
.as(not null)
7060 n_opar
.parent
= self
7061 _n_expr
= n_expr
.as(not null)
7062 n_expr
.parent
= self
7063 _n_cpar
= n_cpar
.as(not null)
7064 n_cpar
.parent
= self
7067 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7069 if _n_opar
== old_child
then
7070 if new_child
!= null then
7071 new_child
.parent
= self
7072 assert new_child
isa TOpar
7079 if _n_expr
== old_child
then
7080 if new_child
!= null then
7081 new_child
.parent
= self
7082 assert new_child
isa AExpr
7089 if _n_cpar
== old_child
then
7090 if new_child
!= null then
7091 new_child
.parent
= self
7092 assert new_child
isa TCpar
7101 redef fun visit_all
(v
: Visitor)
7103 v
.enter_visit
(_n_opar
)
7104 v
.enter_visit
(_n_expr
)
7105 v
.enter_visit
(_n_cpar
)
7108 redef class AAsCastExpr
7109 private init empty_init
do end
7111 init init_aascastexpr
(
7112 n_expr
: nullable AExpr,
7113 n_kwas
: nullable TKwas,
7114 n_opar
: nullable TOpar,
7115 n_type
: nullable AType,
7116 n_cpar
: nullable TCpar
7120 _n_expr
= n_expr
.as(not null)
7121 n_expr
.parent
= self
7122 _n_kwas
= n_kwas
.as(not null)
7123 n_kwas
.parent
= self
7124 _n_opar
= n_opar
.as(not null)
7125 n_opar
.parent
= self
7126 _n_type
= n_type
.as(not null)
7127 n_type
.parent
= self
7128 _n_cpar
= n_cpar
.as(not null)
7129 n_cpar
.parent
= self
7132 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7134 if _n_expr
== old_child
then
7135 if new_child
!= null then
7136 new_child
.parent
= self
7137 assert new_child
isa AExpr
7144 if _n_kwas
== old_child
then
7145 if new_child
!= null then
7146 new_child
.parent
= self
7147 assert new_child
isa TKwas
7154 if _n_opar
== old_child
then
7155 if new_child
!= null then
7156 new_child
.parent
= self
7157 assert new_child
isa TOpar
7164 if _n_type
== old_child
then
7165 if new_child
!= null then
7166 new_child
.parent
= self
7167 assert new_child
isa AType
7174 if _n_cpar
== old_child
then
7175 if new_child
!= null then
7176 new_child
.parent
= self
7177 assert new_child
isa TCpar
7186 redef fun visit_all
(v
: Visitor)
7188 v
.enter_visit
(_n_expr
)
7189 v
.enter_visit
(_n_kwas
)
7190 v
.enter_visit
(_n_opar
)
7191 v
.enter_visit
(_n_type
)
7192 v
.enter_visit
(_n_cpar
)
7195 redef class AAsNotnullExpr
7196 private init empty_init
do end
7198 init init_aasnotnullexpr
(
7199 n_expr
: nullable AExpr,
7200 n_kwas
: nullable TKwas,
7201 n_opar
: nullable TOpar,
7202 n_kwnot
: nullable TKwnot,
7203 n_kwnull
: nullable TKwnull,
7204 n_cpar
: nullable TCpar
7208 _n_expr
= n_expr
.as(not null)
7209 n_expr
.parent
= self
7210 _n_kwas
= n_kwas
.as(not null)
7211 n_kwas
.parent
= self
7212 _n_opar
= n_opar
.as(not null)
7213 n_opar
.parent
= self
7214 _n_kwnot
= n_kwnot
.as(not null)
7215 n_kwnot
.parent
= self
7216 _n_kwnull
= n_kwnull
.as(not null)
7217 n_kwnull
.parent
= self
7218 _n_cpar
= n_cpar
.as(not null)
7219 n_cpar
.parent
= self
7222 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7224 if _n_expr
== old_child
then
7225 if new_child
!= null then
7226 new_child
.parent
= self
7227 assert new_child
isa AExpr
7234 if _n_kwas
== old_child
then
7235 if new_child
!= null then
7236 new_child
.parent
= self
7237 assert new_child
isa TKwas
7244 if _n_opar
== old_child
then
7245 if new_child
!= null then
7246 new_child
.parent
= self
7247 assert new_child
isa TOpar
7254 if _n_kwnot
== old_child
then
7255 if new_child
!= null then
7256 new_child
.parent
= self
7257 assert new_child
isa TKwnot
7258 _n_kwnot
= new_child
7264 if _n_kwnull
== old_child
then
7265 if new_child
!= null then
7266 new_child
.parent
= self
7267 assert new_child
isa TKwnull
7268 _n_kwnull
= new_child
7274 if _n_cpar
== old_child
then
7275 if new_child
!= null then
7276 new_child
.parent
= self
7277 assert new_child
isa TCpar
7286 redef fun visit_all
(v
: Visitor)
7288 v
.enter_visit
(_n_expr
)
7289 v
.enter_visit
(_n_kwas
)
7290 v
.enter_visit
(_n_opar
)
7291 v
.enter_visit
(_n_kwnot
)
7292 v
.enter_visit
(_n_kwnull
)
7293 v
.enter_visit
(_n_cpar
)
7296 redef class AIssetAttrExpr
7297 private init empty_init
do end
7299 init init_aissetattrexpr
(
7300 n_kwisset
: nullable TKwisset,
7301 n_expr
: nullable AExpr,
7302 n_id
: nullable TAttrid
7306 _n_kwisset
= n_kwisset
.as(not null)
7307 n_kwisset
.parent
= self
7308 _n_expr
= n_expr
.as(not null)
7309 n_expr
.parent
= self
7310 _n_id
= n_id
.as(not null)
7314 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7316 if _n_kwisset
== old_child
then
7317 if new_child
!= null then
7318 new_child
.parent
= self
7319 assert new_child
isa TKwisset
7320 _n_kwisset
= new_child
7326 if _n_expr
== old_child
then
7327 if new_child
!= null then
7328 new_child
.parent
= self
7329 assert new_child
isa AExpr
7336 if _n_id
== old_child
then
7337 if new_child
!= null then
7338 new_child
.parent
= self
7339 assert new_child
isa TAttrid
7348 redef fun visit_all
(v
: Visitor)
7350 v
.enter_visit
(_n_kwisset
)
7351 v
.enter_visit
(_n_expr
)
7352 v
.enter_visit
(_n_id
)
7355 redef class AListExprs
7356 private init empty_init
do end
7358 init init_alistexprs
(
7359 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7370 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7372 for i
in [0.._n_exprs
.length
[ do
7373 if _n_exprs
[i
] == old_child
then
7374 if new_child
!= null then
7375 assert new_child
isa AExpr
7376 _n_exprs
[i
] = new_child
7377 new_child
.parent
= self
7379 _n_exprs
.remove_at
(i
)
7386 redef fun visit_all
(v
: Visitor)
7388 for n
in _n_exprs
do
7393 redef class AParExprs
7394 private init empty_init
do end
7396 init init_aparexprs
(
7397 n_opar
: nullable TOpar,
7398 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7399 n_cpar
: nullable TCpar
7403 _n_opar
= n_opar
.as(not null)
7404 n_opar
.parent
= self
7410 _n_cpar
= n_cpar
.as(not null)
7411 n_cpar
.parent
= self
7414 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7416 if _n_opar
== old_child
then
7417 if new_child
!= null then
7418 new_child
.parent
= self
7419 assert new_child
isa TOpar
7426 for i
in [0.._n_exprs
.length
[ do
7427 if _n_exprs
[i
] == old_child
then
7428 if new_child
!= null then
7429 assert new_child
isa AExpr
7430 _n_exprs
[i
] = new_child
7431 new_child
.parent
= self
7433 _n_exprs
.remove_at
(i
)
7438 if _n_cpar
== old_child
then
7439 if new_child
!= null then
7440 new_child
.parent
= self
7441 assert new_child
isa TCpar
7450 redef fun visit_all
(v
: Visitor)
7452 v
.enter_visit
(_n_opar
)
7453 for n
in _n_exprs
do
7456 v
.enter_visit
(_n_cpar
)
7459 redef class ABraExprs
7460 private init empty_init
do end
7462 init init_abraexprs
(
7463 n_obra
: nullable TObra,
7464 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7465 n_cbra
: nullable TCbra
7469 _n_obra
= n_obra
.as(not null)
7470 n_obra
.parent
= self
7476 _n_cbra
= n_cbra
.as(not null)
7477 n_cbra
.parent
= self
7480 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7482 if _n_obra
== old_child
then
7483 if new_child
!= null then
7484 new_child
.parent
= self
7485 assert new_child
isa TObra
7492 for i
in [0.._n_exprs
.length
[ do
7493 if _n_exprs
[i
] == old_child
then
7494 if new_child
!= null then
7495 assert new_child
isa AExpr
7496 _n_exprs
[i
] = new_child
7497 new_child
.parent
= self
7499 _n_exprs
.remove_at
(i
)
7504 if _n_cbra
== old_child
then
7505 if new_child
!= null then
7506 new_child
.parent
= self
7507 assert new_child
isa TCbra
7516 redef fun visit_all
(v
: Visitor)
7518 v
.enter_visit
(_n_obra
)
7519 for n
in _n_exprs
do
7522 v
.enter_visit
(_n_cbra
)
7525 redef class APlusAssignOp
7526 private init empty_init
do end
7528 init init_aplusassignop
(
7529 n_pluseq
: nullable TPluseq
7533 _n_pluseq
= n_pluseq
.as(not null)
7534 n_pluseq
.parent
= self
7537 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7539 if _n_pluseq
== old_child
then
7540 if new_child
!= null then
7541 new_child
.parent
= self
7542 assert new_child
isa TPluseq
7543 _n_pluseq
= new_child
7551 redef fun visit_all
(v
: Visitor)
7553 v
.enter_visit
(_n_pluseq
)
7556 redef class AMinusAssignOp
7557 private init empty_init
do end
7559 init init_aminusassignop
(
7560 n_minuseq
: nullable TMinuseq
7564 _n_minuseq
= n_minuseq
.as(not null)
7565 n_minuseq
.parent
= self
7568 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7570 if _n_minuseq
== old_child
then
7571 if new_child
!= null then
7572 new_child
.parent
= self
7573 assert new_child
isa TMinuseq
7574 _n_minuseq
= new_child
7582 redef fun visit_all
(v
: Visitor)
7584 v
.enter_visit
(_n_minuseq
)
7587 redef class AClosureDef
7588 private init empty_init
do end
7590 init init_aclosuredef
(
7591 n_bang
: nullable TBang,
7592 n_id
: nullable AClosureId,
7593 n_ids
: Collection[Object], # Should be Collection[TId]
7594 n_kwdo
: nullable TKwdo,
7595 n_expr
: nullable AExpr,
7596 n_label
: nullable ALabel
7600 _n_bang
= n_bang
.as(not null)
7601 n_bang
.parent
= self
7602 _n_id
= n_id
.as(not null)
7610 if n_kwdo
!= null then
7611 n_kwdo
.parent
= self
7614 if n_expr
!= null then
7615 n_expr
.parent
= self
7618 if n_label
!= null then
7619 n_label
.parent
= self
7623 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7625 if _n_bang
== old_child
then
7626 if new_child
!= null then
7627 new_child
.parent
= self
7628 assert new_child
isa TBang
7635 if _n_id
== old_child
then
7636 if new_child
!= null then
7637 new_child
.parent
= self
7638 assert new_child
isa AClosureId
7645 for i
in [0.._n_ids
.length
[ do
7646 if _n_ids
[i
] == old_child
then
7647 if new_child
!= null then
7648 assert new_child
isa TId
7649 _n_ids
[i
] = new_child
7650 new_child
.parent
= self
7657 if _n_kwdo
== old_child
then
7658 if new_child
!= null then
7659 new_child
.parent
= self
7660 assert new_child
isa TKwdo
7667 if _n_expr
== old_child
then
7668 if new_child
!= null then
7669 new_child
.parent
= self
7670 assert new_child
isa AExpr
7677 if _n_label
== old_child
then
7678 if new_child
!= null then
7679 new_child
.parent
= self
7680 assert new_child
isa ALabel
7681 _n_label
= new_child
7689 redef fun visit_all
(v
: Visitor)
7691 v
.enter_visit
(_n_bang
)
7692 v
.enter_visit
(_n_id
)
7696 if _n_kwdo
!= null then
7697 v
.enter_visit
(_n_kwdo
.as(not null))
7699 if _n_expr
!= null then
7700 v
.enter_visit
(_n_expr
.as(not null))
7702 if _n_label
!= null then
7703 v
.enter_visit
(_n_label
.as(not null))
7707 redef class ASimpleClosureId
7708 private init empty_init
do end
7710 init init_asimpleclosureid
(
7715 _n_id
= n_id
.as(not null)
7719 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7721 if _n_id
== old_child
then
7722 if new_child
!= null then
7723 new_child
.parent
= self
7724 assert new_child
isa TId
7733 redef fun visit_all
(v
: Visitor)
7735 v
.enter_visit
(_n_id
)
7738 redef class ABreakClosureId
7739 private init empty_init
do end
7741 init init_abreakclosureid
(
7742 n_kwbreak
: nullable TKwbreak
7746 _n_kwbreak
= n_kwbreak
.as(not null)
7747 n_kwbreak
.parent
= self
7750 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7752 if _n_kwbreak
== old_child
then
7753 if new_child
!= null then
7754 new_child
.parent
= self
7755 assert new_child
isa TKwbreak
7756 _n_kwbreak
= new_child
7764 redef fun visit_all
(v
: Visitor)
7766 v
.enter_visit
(_n_kwbreak
)
7769 redef class AModuleName
7770 private init empty_init
do end
7772 init init_amodulename
(
7773 n_quad
: nullable TQuad,
7774 n_path
: Collection[Object], # Should be Collection[TId]
7780 if n_quad
!= null then
7781 n_quad
.parent
= self
7788 _n_id
= n_id
.as(not null)
7792 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7794 if _n_quad
== old_child
then
7795 if new_child
!= null then
7796 new_child
.parent
= self
7797 assert new_child
isa TQuad
7804 for i
in [0.._n_path
.length
[ do
7805 if _n_path
[i
] == old_child
then
7806 if new_child
!= null then
7807 assert new_child
isa TId
7808 _n_path
[i
] = new_child
7809 new_child
.parent
= self
7811 _n_path
.remove_at
(i
)
7816 if _n_id
== old_child
then
7817 if new_child
!= null then
7818 new_child
.parent
= self
7819 assert new_child
isa TId
7828 redef fun visit_all
(v
: Visitor)
7830 if _n_quad
!= null then
7831 v
.enter_visit
(_n_quad
.as(not null))
7836 v
.enter_visit
(_n_id
)
7839 redef class AExternCalls
7840 private init empty_init
do end
7842 init init_aexterncalls
(
7843 n_kwimport
: nullable TKwimport,
7844 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7848 _n_kwimport
= n_kwimport
.as(not null)
7849 n_kwimport
.parent
= self
7850 for n
in n_extern_calls
do
7851 assert n
isa AExternCall
7852 _n_extern_calls
.add
(n
)
7857 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7859 if _n_kwimport
== old_child
then
7860 if new_child
!= null then
7861 new_child
.parent
= self
7862 assert new_child
isa TKwimport
7863 _n_kwimport
= new_child
7869 for i
in [0.._n_extern_calls
.length
[ do
7870 if _n_extern_calls
[i
] == old_child
then
7871 if new_child
!= null then
7872 assert new_child
isa AExternCall
7873 _n_extern_calls
[i
] = new_child
7874 new_child
.parent
= self
7876 _n_extern_calls
.remove_at
(i
)
7883 redef fun visit_all
(v
: Visitor)
7885 v
.enter_visit
(_n_kwimport
)
7886 for n
in _n_extern_calls
do
7891 redef class AExternCall
7892 private init empty_init
do end
7894 init init_aexterncall
7899 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7903 redef fun visit_all
(v
: Visitor)
7907 redef class ASuperExternCall
7908 private init empty_init
do end
7910 init init_asuperexterncall
(
7911 n_kwsuper
: nullable TKwsuper
7915 _n_kwsuper
= n_kwsuper
.as(not null)
7916 n_kwsuper
.parent
= self
7919 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7921 if _n_kwsuper
== old_child
then
7922 if new_child
!= null then
7923 new_child
.parent
= self
7924 assert new_child
isa TKwsuper
7925 _n_kwsuper
= new_child
7933 redef fun visit_all
(v
: Visitor)
7935 v
.enter_visit
(_n_kwsuper
)
7938 redef class ALocalPropExternCall
7939 private init empty_init
do end
7941 init init_alocalpropexterncall
(
7942 n_methid
: nullable AMethid
7946 _n_methid
= n_methid
.as(not null)
7947 n_methid
.parent
= self
7950 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7952 if _n_methid
== old_child
then
7953 if new_child
!= null then
7954 new_child
.parent
= self
7955 assert new_child
isa AMethid
7956 _n_methid
= new_child
7964 redef fun visit_all
(v
: Visitor)
7966 v
.enter_visit
(_n_methid
)
7969 redef class AFullPropExternCall
7970 private init empty_init
do end
7972 init init_afullpropexterncall
(
7973 n_classid
: nullable TClassid,
7974 n_quad
: nullable TQuad,
7975 n_methid
: nullable AMethid
7979 _n_classid
= n_classid
.as(not null)
7980 n_classid
.parent
= self
7982 if n_quad
!= null then
7983 n_quad
.parent
= self
7985 _n_methid
= n_methid
.as(not null)
7986 n_methid
.parent
= self
7989 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7991 if _n_classid
== old_child
then
7992 if new_child
!= null then
7993 new_child
.parent
= self
7994 assert new_child
isa TClassid
7995 _n_classid
= new_child
8001 if _n_quad
== old_child
then
8002 if new_child
!= null then
8003 new_child
.parent
= self
8004 assert new_child
isa TQuad
8011 if _n_methid
== old_child
then
8012 if new_child
!= null then
8013 new_child
.parent
= self
8014 assert new_child
isa AMethid
8015 _n_methid
= new_child
8023 redef fun visit_all
(v
: Visitor)
8025 v
.enter_visit
(_n_classid
)
8026 if _n_quad
!= null then
8027 v
.enter_visit
(_n_quad
.as(not null))
8029 v
.enter_visit
(_n_methid
)
8032 redef class AInitPropExternCall
8033 private init empty_init
do end
8035 init init_ainitpropexterncall
(
8036 n_classid
: nullable TClassid
8040 _n_classid
= n_classid
.as(not null)
8041 n_classid
.parent
= self
8044 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8046 if _n_classid
== old_child
then
8047 if new_child
!= null then
8048 new_child
.parent
= self
8049 assert new_child
isa TClassid
8050 _n_classid
= new_child
8058 redef fun visit_all
(v
: Visitor)
8060 v
.enter_visit
(_n_classid
)
8063 redef class ACastAsExternCall
8064 private init empty_init
do end
8066 init init_acastasexterncall
(
8067 n_from_type
: nullable AType,
8068 n_kwas
: nullable TKwas,
8069 n_to_type
: nullable AType
8073 _n_from_type
= n_from_type
.as(not null)
8074 n_from_type
.parent
= self
8075 _n_kwas
= n_kwas
.as(not null)
8076 n_kwas
.parent
= self
8077 _n_to_type
= n_to_type
.as(not null)
8078 n_to_type
.parent
= self
8081 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8083 if _n_from_type
== old_child
then
8084 if new_child
!= null then
8085 new_child
.parent
= self
8086 assert new_child
isa AType
8087 _n_from_type
= new_child
8093 if _n_kwas
== old_child
then
8094 if new_child
!= null then
8095 new_child
.parent
= self
8096 assert new_child
isa TKwas
8103 if _n_to_type
== old_child
then
8104 if new_child
!= null then
8105 new_child
.parent
= self
8106 assert new_child
isa AType
8107 _n_to_type
= new_child
8115 redef fun visit_all
(v
: Visitor)
8117 v
.enter_visit
(_n_from_type
)
8118 v
.enter_visit
(_n_kwas
)
8119 v
.enter_visit
(_n_to_type
)
8122 redef class AAsNullableExternCall
8123 private init empty_init
do end
8125 init init_aasnullableexterncall
(
8126 n_type
: nullable AType,
8127 n_kwas
: nullable TKwas,
8128 n_kwnullable
: nullable TKwnullable
8132 _n_type
= n_type
.as(not null)
8133 n_type
.parent
= self
8134 _n_kwas
= n_kwas
.as(not null)
8135 n_kwas
.parent
= self
8136 _n_kwnullable
= n_kwnullable
.as(not null)
8137 n_kwnullable
.parent
= self
8140 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8142 if _n_type
== old_child
then
8143 if new_child
!= null then
8144 new_child
.parent
= self
8145 assert new_child
isa AType
8152 if _n_kwas
== old_child
then
8153 if new_child
!= null then
8154 new_child
.parent
= self
8155 assert new_child
isa TKwas
8162 if _n_kwnullable
== old_child
then
8163 if new_child
!= null then
8164 new_child
.parent
= self
8165 assert new_child
isa TKwnullable
8166 _n_kwnullable
= new_child
8174 redef fun visit_all
(v
: Visitor)
8176 v
.enter_visit
(_n_type
)
8177 v
.enter_visit
(_n_kwas
)
8178 v
.enter_visit
(_n_kwnullable
)
8181 redef class AAsNotNullableExternCall
8182 private init empty_init
do end
8184 init init_aasnotnullableexterncall
(
8185 n_type
: nullable AType,
8186 n_kwas
: nullable TKwas,
8187 n_kwnot
: nullable TKwnot,
8188 n_kwnullable
: nullable TKwnullable
8192 _n_type
= n_type
.as(not null)
8193 n_type
.parent
= self
8194 _n_kwas
= n_kwas
.as(not null)
8195 n_kwas
.parent
= self
8196 _n_kwnot
= n_kwnot
.as(not null)
8197 n_kwnot
.parent
= self
8198 _n_kwnullable
= n_kwnullable
.as(not null)
8199 n_kwnullable
.parent
= self
8202 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8204 if _n_type
== old_child
then
8205 if new_child
!= null then
8206 new_child
.parent
= self
8207 assert new_child
isa AType
8214 if _n_kwas
== old_child
then
8215 if new_child
!= null then
8216 new_child
.parent
= self
8217 assert new_child
isa TKwas
8224 if _n_kwnot
== old_child
then
8225 if new_child
!= null then
8226 new_child
.parent
= self
8227 assert new_child
isa TKwnot
8228 _n_kwnot
= new_child
8234 if _n_kwnullable
== old_child
then
8235 if new_child
!= null then
8236 new_child
.parent
= self
8237 assert new_child
isa TKwnullable
8238 _n_kwnullable
= new_child
8246 redef fun visit_all
(v
: Visitor)
8248 v
.enter_visit
(_n_type
)
8249 v
.enter_visit
(_n_kwas
)
8250 v
.enter_visit
(_n_kwnot
)
8251 v
.enter_visit
(_n_kwnullable
)
8254 redef class AQualified
8255 private init empty_init
do end
8257 init init_aqualified
(
8258 n_id
: Collection[Object], # Should be Collection[TId]
8259 n_classid
: nullable TClassid
8268 _n_classid
= n_classid
8269 if n_classid
!= null then
8270 n_classid
.parent
= self
8274 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8276 for i
in [0.._n_id
.length
[ do
8277 if _n_id
[i
] == old_child
then
8278 if new_child
!= null then
8279 assert new_child
isa TId
8280 _n_id
[i
] = new_child
8281 new_child
.parent
= self
8288 if _n_classid
== old_child
then
8289 if new_child
!= null then
8290 new_child
.parent
= self
8291 assert new_child
isa TClassid
8292 _n_classid
= new_child
8300 redef fun visit_all
(v
: Visitor)
8305 if _n_classid
!= null then
8306 v
.enter_visit
(_n_classid
.as(not null))
8311 private init empty_init
do end
8314 n_comment
: Collection[Object] # Should be Collection[TComment]
8318 for n
in n_comment
do
8319 assert n
isa TComment
8325 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8327 for i
in [0.._n_comment
.length
[ do
8328 if _n_comment
[i
] == old_child
then
8329 if new_child
!= null then
8330 assert new_child
isa TComment
8331 _n_comment
[i
] = new_child
8332 new_child
.parent
= self
8334 _n_comment
.remove_at
(i
)
8341 redef fun visit_all
(v
: Visitor)
8343 for n
in _n_comment
do
8351 n_base
: nullable AModule,
8358 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8360 if _n_base
== old_child
then
8361 if new_child
== null then
8363 new_child
.parent
= self
8364 assert new_child
isa AModule
8367 old_child
.parent
= null
8372 redef fun visit_all
(v
: Visitor)
8374 if _n_base
!= null then
8375 v
.enter_visit
(_n_base
.as(not null))
8377 v
.enter_visit
(_n_eof
)