1 # Production AST nodes full definition.
2 # This file was generated by SableCC (http://www.sablecc.org/).
6 intrude import parser_nodes
10 # Parent of the node in the AST
11 readable writable var _parent
: nullable ANode
13 # Remove a child from the AST
14 fun remove_child
(child
: ANode)
16 replace_child
(child
, null)
19 # Replace a child with an other node in the AST
20 fun replace_child
(old_child
: ANode, new_child
: nullable ANode) is abstract
22 # Replace itself with an other node in the AST
23 fun replace_with
(node
: ANode)
25 if _parent
!= null then
26 _parent
.replace_child
(self, node
)
30 # Visit all nodes in order.
31 # Thus, call "v.visit(e)" for each node e
32 fun visit_all
(v
: Visitor) is abstract
36 redef fun visit_all
(v
: Visitor) do end
37 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode) do end
41 redef fun replace_with
(n
: ANode)
49 # Abstract standard visitor
51 # What the visitor do when a node is visited
52 # Concrete visitors should redefine this method.
53 protected fun visit
(e
: nullable ANode) is abstract
55 # Ask the visitor to visit a given node.
56 # Usually automatically called by visit_all* methods.
57 # This methos should not be redefined
58 fun enter_visit
(e
: nullable ANode)
60 var old
= _current_node
66 # The current visited node
67 readable var _current_node
: nullable ANode = null
71 private init empty_init
do end
74 n_moduledecl
: nullable AModuledecl,
75 n_imports
: Collection[Object], # Should be Collection[AImport]
76 n_classdefs
: Collection[Object] # Should be Collection[AClassdef]
80 _n_moduledecl
= n_moduledecl
81 if n_moduledecl
!= null then
82 n_moduledecl
.parent
= self
89 for n
in n_classdefs
do
90 assert n
isa AClassdef
96 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
98 if _n_moduledecl
== old_child
then
99 if new_child
!= null then
100 new_child
.parent
= self
101 assert new_child
isa AModuledecl
102 _n_moduledecl
= new_child
108 for i
in [0.._n_imports
.length
[ do
109 if _n_imports
[i
] == old_child
then
110 if new_child
!= null then
111 assert new_child
isa AImport
112 _n_imports
[i
] = new_child
113 new_child
.parent
= self
115 _n_imports
.remove_at
(i
)
120 for i
in [0.._n_classdefs
.length
[ do
121 if _n_classdefs
[i
] == old_child
then
122 if new_child
!= null then
123 assert new_child
isa AClassdef
124 _n_classdefs
[i
] = new_child
125 new_child
.parent
= self
127 _n_classdefs
.remove_at
(i
)
134 redef fun visit_all
(v
: Visitor)
136 if _n_moduledecl
!= null then
137 v
.enter_visit
(_n_moduledecl
.as(not null))
139 for n
in _n_imports
do
142 for n
in _n_classdefs
do
147 redef class AModuledecl
148 private init empty_init
do end
150 init init_amoduledecl
(
151 n_doc
: nullable ADoc,
152 n_kwmodule
: nullable TKwmodule,
153 n_name
: nullable AModuleName
158 if n_doc
!= null then
161 _n_kwmodule
= n_kwmodule
.as(not null)
162 n_kwmodule
.parent
= self
163 _n_name
= n_name
.as(not null)
167 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
169 if _n_doc
== old_child
then
170 if new_child
!= null then
171 new_child
.parent
= self
172 assert new_child
isa ADoc
179 if _n_kwmodule
== old_child
then
180 if new_child
!= null then
181 new_child
.parent
= self
182 assert new_child
isa TKwmodule
183 _n_kwmodule
= new_child
189 if _n_name
== old_child
then
190 if new_child
!= null then
191 new_child
.parent
= self
192 assert new_child
isa AModuleName
201 redef fun visit_all
(v
: Visitor)
203 if _n_doc
!= null then
204 v
.enter_visit
(_n_doc
.as(not null))
206 v
.enter_visit
(_n_kwmodule
)
207 v
.enter_visit
(_n_name
)
210 redef class AStdImport
211 private init empty_init
do end
213 init init_astdimport
(
214 n_visibility
: nullable AVisibility,
215 n_kwimport
: nullable TKwimport,
216 n_name
: nullable AModuleName
220 _n_visibility
= n_visibility
.as(not null)
221 n_visibility
.parent
= self
222 _n_kwimport
= n_kwimport
.as(not null)
223 n_kwimport
.parent
= self
224 _n_name
= n_name
.as(not null)
228 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
230 if _n_visibility
== old_child
then
231 if new_child
!= null then
232 new_child
.parent
= self
233 assert new_child
isa AVisibility
234 _n_visibility
= new_child
240 if _n_kwimport
== old_child
then
241 if new_child
!= null then
242 new_child
.parent
= self
243 assert new_child
isa TKwimport
244 _n_kwimport
= new_child
250 if _n_name
== old_child
then
251 if new_child
!= null then
252 new_child
.parent
= self
253 assert new_child
isa AModuleName
262 redef fun visit_all
(v
: Visitor)
264 v
.enter_visit
(_n_visibility
)
265 v
.enter_visit
(_n_kwimport
)
266 v
.enter_visit
(_n_name
)
269 redef class ANoImport
270 private init empty_init
do end
272 init init_anoimport
(
273 n_visibility
: nullable AVisibility,
274 n_kwimport
: nullable TKwimport,
275 n_kwend
: nullable TKwend
279 _n_visibility
= n_visibility
.as(not null)
280 n_visibility
.parent
= self
281 _n_kwimport
= n_kwimport
.as(not null)
282 n_kwimport
.parent
= self
283 _n_kwend
= n_kwend
.as(not null)
284 n_kwend
.parent
= self
287 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
289 if _n_visibility
== old_child
then
290 if new_child
!= null then
291 new_child
.parent
= self
292 assert new_child
isa AVisibility
293 _n_visibility
= new_child
299 if _n_kwimport
== old_child
then
300 if new_child
!= null then
301 new_child
.parent
= self
302 assert new_child
isa TKwimport
303 _n_kwimport
= new_child
309 if _n_kwend
== old_child
then
310 if new_child
!= null then
311 new_child
.parent
= self
312 assert new_child
isa TKwend
321 redef fun visit_all
(v
: Visitor)
323 v
.enter_visit
(_n_visibility
)
324 v
.enter_visit
(_n_kwimport
)
325 v
.enter_visit
(_n_kwend
)
328 redef class APublicVisibility
329 private init empty_init
do end
331 init init_apublicvisibility
336 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
340 redef fun visit_all
(v
: Visitor)
344 redef class APrivateVisibility
345 private init empty_init
do end
347 init init_aprivatevisibility
(
348 n_kwprivate
: nullable TKwprivate
352 _n_kwprivate
= n_kwprivate
.as(not null)
353 n_kwprivate
.parent
= self
356 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
358 if _n_kwprivate
== old_child
then
359 if new_child
!= null then
360 new_child
.parent
= self
361 assert new_child
isa TKwprivate
362 _n_kwprivate
= new_child
370 redef fun visit_all
(v
: Visitor)
372 v
.enter_visit
(_n_kwprivate
)
375 redef class AProtectedVisibility
376 private init empty_init
do end
378 init init_aprotectedvisibility
(
379 n_kwprotected
: nullable TKwprotected
383 _n_kwprotected
= n_kwprotected
.as(not null)
384 n_kwprotected
.parent
= self
387 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
389 if _n_kwprotected
== old_child
then
390 if new_child
!= null then
391 new_child
.parent
= self
392 assert new_child
isa TKwprotected
393 _n_kwprotected
= new_child
401 redef fun visit_all
(v
: Visitor)
403 v
.enter_visit
(_n_kwprotected
)
406 redef class AIntrudeVisibility
407 private init empty_init
do end
409 init init_aintrudevisibility
(
410 n_kwintrude
: nullable TKwintrude
414 _n_kwintrude
= n_kwintrude
.as(not null)
415 n_kwintrude
.parent
= self
418 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
420 if _n_kwintrude
== old_child
then
421 if new_child
!= null then
422 new_child
.parent
= self
423 assert new_child
isa TKwintrude
424 _n_kwintrude
= new_child
432 redef fun visit_all
(v
: Visitor)
434 v
.enter_visit
(_n_kwintrude
)
437 redef class AStdClassdef
438 private init empty_init
do end
440 init init_astdclassdef
(
441 n_doc
: nullable ADoc,
442 n_kwredef
: nullable TKwredef,
443 n_visibility
: nullable AVisibility,
444 n_classkind
: nullable AClasskind,
445 n_id
: nullable TClassid,
446 n_formaldefs
: Collection[Object], # Should be Collection[AFormaldef]
447 n_superclasses
: Collection[Object], # Should be Collection[ASuperclass]
448 n_propdefs
: Collection[Object], # Should be Collection[APropdef]
449 n_kwend
: nullable TKwend
454 if n_doc
!= null then
457 _n_kwredef
= n_kwredef
458 if n_kwredef
!= null then
459 n_kwredef
.parent
= self
461 _n_visibility
= n_visibility
.as(not null)
462 n_visibility
.parent
= self
463 _n_classkind
= n_classkind
.as(not null)
464 n_classkind
.parent
= self
469 for n
in n_formaldefs
do
470 assert n
isa AFormaldef
474 for n
in n_superclasses
do
475 assert n
isa ASuperclass
476 _n_superclasses
.add
(n
)
479 for n
in n_propdefs
do
480 assert n
isa APropdef
484 _n_kwend
= n_kwend
.as(not null)
485 n_kwend
.parent
= self
488 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
490 if _n_doc
== old_child
then
491 if new_child
!= null then
492 new_child
.parent
= self
493 assert new_child
isa ADoc
500 if _n_kwredef
== old_child
then
501 if new_child
!= null then
502 new_child
.parent
= self
503 assert new_child
isa TKwredef
504 _n_kwredef
= new_child
510 if _n_visibility
== old_child
then
511 if new_child
!= null then
512 new_child
.parent
= self
513 assert new_child
isa AVisibility
514 _n_visibility
= new_child
520 if _n_classkind
== old_child
then
521 if new_child
!= null then
522 new_child
.parent
= self
523 assert new_child
isa AClasskind
524 _n_classkind
= new_child
530 if _n_id
== old_child
then
531 if new_child
!= null then
532 new_child
.parent
= self
533 assert new_child
isa TClassid
540 for i
in [0.._n_formaldefs
.length
[ do
541 if _n_formaldefs
[i
] == old_child
then
542 if new_child
!= null then
543 assert new_child
isa AFormaldef
544 _n_formaldefs
[i
] = new_child
545 new_child
.parent
= self
547 _n_formaldefs
.remove_at
(i
)
552 for i
in [0.._n_superclasses
.length
[ do
553 if _n_superclasses
[i
] == old_child
then
554 if new_child
!= null then
555 assert new_child
isa ASuperclass
556 _n_superclasses
[i
] = new_child
557 new_child
.parent
= self
559 _n_superclasses
.remove_at
(i
)
564 for i
in [0.._n_propdefs
.length
[ do
565 if _n_propdefs
[i
] == old_child
then
566 if new_child
!= null then
567 assert new_child
isa APropdef
568 _n_propdefs
[i
] = new_child
569 new_child
.parent
= self
571 _n_propdefs
.remove_at
(i
)
576 if _n_kwend
== old_child
then
577 if new_child
!= null then
578 new_child
.parent
= self
579 assert new_child
isa TKwend
588 redef fun visit_all
(v
: Visitor)
590 if _n_doc
!= null then
591 v
.enter_visit
(_n_doc
.as(not null))
593 if _n_kwredef
!= null then
594 v
.enter_visit
(_n_kwredef
.as(not null))
596 v
.enter_visit
(_n_visibility
)
597 v
.enter_visit
(_n_classkind
)
598 if _n_id
!= null then
599 v
.enter_visit
(_n_id
.as(not null))
601 for n
in _n_formaldefs
do
604 for n
in _n_superclasses
do
607 for n
in _n_propdefs
do
610 v
.enter_visit
(_n_kwend
)
613 redef class ATopClassdef
614 private init empty_init
do end
616 init init_atopclassdef
(
617 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
621 for n
in n_propdefs
do
622 assert n
isa APropdef
628 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
630 for i
in [0.._n_propdefs
.length
[ do
631 if _n_propdefs
[i
] == old_child
then
632 if new_child
!= null then
633 assert new_child
isa APropdef
634 _n_propdefs
[i
] = new_child
635 new_child
.parent
= self
637 _n_propdefs
.remove_at
(i
)
644 redef fun visit_all
(v
: Visitor)
646 for n
in _n_propdefs
do
651 redef class AMainClassdef
652 private init empty_init
do end
654 init init_amainclassdef
(
655 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
659 for n
in n_propdefs
do
660 assert n
isa APropdef
666 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
668 for i
in [0.._n_propdefs
.length
[ do
669 if _n_propdefs
[i
] == old_child
then
670 if new_child
!= null then
671 assert new_child
isa APropdef
672 _n_propdefs
[i
] = new_child
673 new_child
.parent
= self
675 _n_propdefs
.remove_at
(i
)
682 redef fun visit_all
(v
: Visitor)
684 for n
in _n_propdefs
do
689 redef class AConcreteClasskind
690 private init empty_init
do end
692 init init_aconcreteclasskind
(
693 n_kwclass
: nullable TKwclass
697 _n_kwclass
= n_kwclass
.as(not null)
698 n_kwclass
.parent
= self
701 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
703 if _n_kwclass
== old_child
then
704 if new_child
!= null then
705 new_child
.parent
= self
706 assert new_child
isa TKwclass
707 _n_kwclass
= new_child
715 redef fun visit_all
(v
: Visitor)
717 v
.enter_visit
(_n_kwclass
)
720 redef class AAbstractClasskind
721 private init empty_init
do end
723 init init_aabstractclasskind
(
724 n_kwabstract
: nullable TKwabstract,
725 n_kwclass
: nullable TKwclass
729 _n_kwabstract
= n_kwabstract
.as(not null)
730 n_kwabstract
.parent
= self
731 _n_kwclass
= n_kwclass
.as(not null)
732 n_kwclass
.parent
= self
735 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
737 if _n_kwabstract
== old_child
then
738 if new_child
!= null then
739 new_child
.parent
= self
740 assert new_child
isa TKwabstract
741 _n_kwabstract
= new_child
747 if _n_kwclass
== old_child
then
748 if new_child
!= null then
749 new_child
.parent
= self
750 assert new_child
isa TKwclass
751 _n_kwclass
= new_child
759 redef fun visit_all
(v
: Visitor)
761 v
.enter_visit
(_n_kwabstract
)
762 v
.enter_visit
(_n_kwclass
)
765 redef class AInterfaceClasskind
766 private init empty_init
do end
768 init init_ainterfaceclasskind
(
769 n_kwinterface
: nullable TKwinterface
773 _n_kwinterface
= n_kwinterface
.as(not null)
774 n_kwinterface
.parent
= self
777 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
779 if _n_kwinterface
== old_child
then
780 if new_child
!= null then
781 new_child
.parent
= self
782 assert new_child
isa TKwinterface
783 _n_kwinterface
= new_child
791 redef fun visit_all
(v
: Visitor)
793 v
.enter_visit
(_n_kwinterface
)
796 redef class AEnumClasskind
797 private init empty_init
do end
799 init init_aenumclasskind
(
800 n_kwenum
: nullable TKwenum
804 _n_kwenum
= n_kwenum
.as(not null)
805 n_kwenum
.parent
= self
808 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
810 if _n_kwenum
== old_child
then
811 if new_child
!= null then
812 new_child
.parent
= self
813 assert new_child
isa TKwenum
814 _n_kwenum
= new_child
822 redef fun visit_all
(v
: Visitor)
824 v
.enter_visit
(_n_kwenum
)
827 redef class AExternClasskind
828 private init empty_init
do end
830 init init_aexternclasskind
(
831 n_kwextern
: nullable TKwextern
835 _n_kwextern
= n_kwextern
.as(not null)
836 n_kwextern
.parent
= self
839 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
841 if _n_kwextern
== old_child
then
842 if new_child
!= null then
843 new_child
.parent
= self
844 assert new_child
isa TKwextern
845 _n_kwextern
= new_child
853 redef fun visit_all
(v
: Visitor)
855 v
.enter_visit
(_n_kwextern
)
858 redef class AFormaldef
859 private init empty_init
do end
861 init init_aformaldef
(
862 n_id
: nullable TClassid,
863 n_type
: nullable AType
867 _n_id
= n_id
.as(not null)
870 if n_type
!= null then
875 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
877 if _n_id
== old_child
then
878 if new_child
!= null then
879 new_child
.parent
= self
880 assert new_child
isa TClassid
887 if _n_type
== old_child
then
888 if new_child
!= null then
889 new_child
.parent
= self
890 assert new_child
isa AType
899 redef fun visit_all
(v
: Visitor)
902 if _n_type
!= null then
903 v
.enter_visit
(_n_type
.as(not null))
907 redef class ASuperclass
908 private init empty_init
do end
910 init init_asuperclass
(
911 n_kwspecial
: nullable TKwspecial,
912 n_kwsuper
: nullable TKwsuper,
913 n_type
: nullable AType
917 _n_kwspecial
= n_kwspecial
918 if n_kwspecial
!= null then
919 n_kwspecial
.parent
= self
921 _n_kwsuper
= n_kwsuper
922 if n_kwsuper
!= null then
923 n_kwsuper
.parent
= self
925 _n_type
= n_type
.as(not null)
929 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
931 if _n_kwspecial
== old_child
then
932 if new_child
!= null then
933 new_child
.parent
= self
934 assert new_child
isa TKwspecial
935 _n_kwspecial
= new_child
941 if _n_kwsuper
== old_child
then
942 if new_child
!= null then
943 new_child
.parent
= self
944 assert new_child
isa TKwsuper
945 _n_kwsuper
= new_child
951 if _n_type
== old_child
then
952 if new_child
!= null then
953 new_child
.parent
= self
954 assert new_child
isa AType
963 redef fun visit_all
(v
: Visitor)
965 if _n_kwspecial
!= null then
966 v
.enter_visit
(_n_kwspecial
.as(not null))
968 if _n_kwsuper
!= null then
969 v
.enter_visit
(_n_kwsuper
.as(not null))
971 v
.enter_visit
(_n_type
)
974 redef class AAttrPropdef
975 private init empty_init
do end
977 init init_aattrpropdef
(
978 n_doc
: nullable ADoc,
979 n_readable
: nullable AAble,
980 n_writable
: nullable AAble,
981 n_kwredef
: nullable TKwredef,
982 n_visibility
: nullable AVisibility,
983 n_kwvar
: nullable TKwvar,
984 n_id
: nullable TAttrid,
986 n_type
: nullable AType,
987 n_expr
: nullable AExpr
992 if n_doc
!= null then
995 _n_readable
= n_readable
996 if n_readable
!= null then
997 n_readable
.parent
= self
999 _n_writable
= n_writable
1000 if n_writable
!= null then
1001 n_writable
.parent
= self
1003 _n_kwredef
= n_kwredef
1004 if n_kwredef
!= null then
1005 n_kwredef
.parent
= self
1007 _n_visibility
= n_visibility
.as(not null)
1008 n_visibility
.parent
= self
1009 _n_kwvar
= n_kwvar
.as(not null)
1010 n_kwvar
.parent
= self
1012 if n_id
!= null then
1016 if n_id2
!= null then
1020 if n_type
!= null then
1021 n_type
.parent
= self
1024 if n_expr
!= null then
1025 n_expr
.parent
= self
1029 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1031 if _n_doc
== old_child
then
1032 if new_child
!= null then
1033 new_child
.parent
= self
1034 assert new_child
isa ADoc
1041 if _n_readable
== old_child
then
1042 if new_child
!= null then
1043 new_child
.parent
= self
1044 assert new_child
isa AAble
1045 _n_readable
= new_child
1051 if _n_writable
== old_child
then
1052 if new_child
!= null then
1053 new_child
.parent
= self
1054 assert new_child
isa AAble
1055 _n_writable
= new_child
1061 if _n_kwredef
== old_child
then
1062 if new_child
!= null then
1063 new_child
.parent
= self
1064 assert new_child
isa TKwredef
1065 _n_kwredef
= new_child
1071 if _n_visibility
== old_child
then
1072 if new_child
!= null then
1073 new_child
.parent
= self
1074 assert new_child
isa AVisibility
1075 _n_visibility
= new_child
1081 if _n_kwvar
== old_child
then
1082 if new_child
!= null then
1083 new_child
.parent
= self
1084 assert new_child
isa TKwvar
1085 _n_kwvar
= new_child
1091 if _n_id
== old_child
then
1092 if new_child
!= null then
1093 new_child
.parent
= self
1094 assert new_child
isa TAttrid
1101 if _n_id2
== old_child
then
1102 if new_child
!= null then
1103 new_child
.parent
= self
1104 assert new_child
isa TId
1111 if _n_type
== old_child
then
1112 if new_child
!= null then
1113 new_child
.parent
= self
1114 assert new_child
isa AType
1121 if _n_expr
== old_child
then
1122 if new_child
!= null then
1123 new_child
.parent
= self
1124 assert new_child
isa AExpr
1133 redef fun visit_all
(v
: Visitor)
1135 if _n_doc
!= null then
1136 v
.enter_visit
(_n_doc
.as(not null))
1138 if _n_readable
!= null then
1139 v
.enter_visit
(_n_readable
.as(not null))
1141 if _n_writable
!= null then
1142 v
.enter_visit
(_n_writable
.as(not null))
1144 if _n_kwredef
!= null then
1145 v
.enter_visit
(_n_kwredef
.as(not null))
1147 v
.enter_visit
(_n_visibility
)
1148 v
.enter_visit
(_n_kwvar
)
1149 if _n_id
!= null then
1150 v
.enter_visit
(_n_id
.as(not null))
1152 if _n_id2
!= null then
1153 v
.enter_visit
(_n_id2
.as(not null))
1155 if _n_type
!= null then
1156 v
.enter_visit
(_n_type
.as(not null))
1158 if _n_expr
!= null then
1159 v
.enter_visit
(_n_expr
.as(not null))
1163 redef class AMethPropdef
1164 private init empty_init
do end
1166 init init_amethpropdef
(
1167 n_doc
: nullable ADoc,
1168 n_kwredef
: nullable TKwredef,
1169 n_visibility
: nullable AVisibility,
1170 n_methid
: nullable AMethid,
1171 n_signature
: nullable ASignature
1176 if n_doc
!= null then
1179 _n_kwredef
= n_kwredef
1180 if n_kwredef
!= null then
1181 n_kwredef
.parent
= self
1183 _n_visibility
= n_visibility
.as(not null)
1184 n_visibility
.parent
= self
1185 _n_methid
= n_methid
.as(not null)
1186 n_methid
.parent
= self
1187 _n_signature
= n_signature
.as(not null)
1188 n_signature
.parent
= self
1191 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1193 if _n_doc
== old_child
then
1194 if new_child
!= null then
1195 new_child
.parent
= self
1196 assert new_child
isa ADoc
1203 if _n_kwredef
== old_child
then
1204 if new_child
!= null then
1205 new_child
.parent
= self
1206 assert new_child
isa TKwredef
1207 _n_kwredef
= new_child
1213 if _n_visibility
== old_child
then
1214 if new_child
!= null then
1215 new_child
.parent
= self
1216 assert new_child
isa AVisibility
1217 _n_visibility
= new_child
1223 if _n_methid
== old_child
then
1224 if new_child
!= null then
1225 new_child
.parent
= self
1226 assert new_child
isa AMethid
1227 _n_methid
= new_child
1233 if _n_signature
== old_child
then
1234 if new_child
!= null then
1235 new_child
.parent
= self
1236 assert new_child
isa ASignature
1237 _n_signature
= new_child
1245 redef fun visit_all
(v
: Visitor)
1247 if _n_doc
!= null then
1248 v
.enter_visit
(_n_doc
.as(not null))
1250 if _n_kwredef
!= null then
1251 v
.enter_visit
(_n_kwredef
.as(not null))
1253 v
.enter_visit
(_n_visibility
)
1254 v
.enter_visit
(_n_methid
)
1255 v
.enter_visit
(_n_signature
)
1258 redef class ADeferredMethPropdef
1259 private init empty_init
do end
1261 init init_adeferredmethpropdef
(
1262 n_doc
: nullable ADoc,
1263 n_kwredef
: nullable TKwredef,
1264 n_visibility
: nullable AVisibility,
1265 n_kwmeth
: nullable TKwmeth,
1266 n_methid
: nullable AMethid,
1267 n_signature
: nullable ASignature
1272 if n_doc
!= null then
1275 _n_kwredef
= n_kwredef
1276 if n_kwredef
!= null then
1277 n_kwredef
.parent
= self
1279 _n_visibility
= n_visibility
.as(not null)
1280 n_visibility
.parent
= self
1281 _n_kwmeth
= n_kwmeth
.as(not null)
1282 n_kwmeth
.parent
= self
1283 _n_methid
= n_methid
.as(not null)
1284 n_methid
.parent
= self
1285 _n_signature
= n_signature
.as(not null)
1286 n_signature
.parent
= self
1289 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1291 if _n_doc
== old_child
then
1292 if new_child
!= null then
1293 new_child
.parent
= self
1294 assert new_child
isa ADoc
1301 if _n_kwredef
== old_child
then
1302 if new_child
!= null then
1303 new_child
.parent
= self
1304 assert new_child
isa TKwredef
1305 _n_kwredef
= new_child
1311 if _n_visibility
== old_child
then
1312 if new_child
!= null then
1313 new_child
.parent
= self
1314 assert new_child
isa AVisibility
1315 _n_visibility
= new_child
1321 if _n_kwmeth
== old_child
then
1322 if new_child
!= null then
1323 new_child
.parent
= self
1324 assert new_child
isa TKwmeth
1325 _n_kwmeth
= new_child
1331 if _n_methid
== old_child
then
1332 if new_child
!= null then
1333 new_child
.parent
= self
1334 assert new_child
isa AMethid
1335 _n_methid
= new_child
1341 if _n_signature
== old_child
then
1342 if new_child
!= null then
1343 new_child
.parent
= self
1344 assert new_child
isa ASignature
1345 _n_signature
= new_child
1353 redef fun visit_all
(v
: Visitor)
1355 if _n_doc
!= null then
1356 v
.enter_visit
(_n_doc
.as(not null))
1358 if _n_kwredef
!= null then
1359 v
.enter_visit
(_n_kwredef
.as(not null))
1361 v
.enter_visit
(_n_visibility
)
1362 v
.enter_visit
(_n_kwmeth
)
1363 v
.enter_visit
(_n_methid
)
1364 v
.enter_visit
(_n_signature
)
1367 redef class AInternMethPropdef
1368 private init empty_init
do end
1370 init init_ainternmethpropdef
(
1371 n_doc
: nullable ADoc,
1372 n_kwredef
: nullable TKwredef,
1373 n_visibility
: nullable AVisibility,
1374 n_kwmeth
: nullable TKwmeth,
1375 n_methid
: nullable AMethid,
1376 n_signature
: nullable ASignature
1381 if n_doc
!= null then
1384 _n_kwredef
= n_kwredef
1385 if n_kwredef
!= null then
1386 n_kwredef
.parent
= self
1388 _n_visibility
= n_visibility
.as(not null)
1389 n_visibility
.parent
= self
1390 _n_kwmeth
= n_kwmeth
.as(not null)
1391 n_kwmeth
.parent
= self
1392 _n_methid
= n_methid
.as(not null)
1393 n_methid
.parent
= self
1394 _n_signature
= n_signature
.as(not null)
1395 n_signature
.parent
= self
1398 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1400 if _n_doc
== old_child
then
1401 if new_child
!= null then
1402 new_child
.parent
= self
1403 assert new_child
isa ADoc
1410 if _n_kwredef
== old_child
then
1411 if new_child
!= null then
1412 new_child
.parent
= self
1413 assert new_child
isa TKwredef
1414 _n_kwredef
= new_child
1420 if _n_visibility
== old_child
then
1421 if new_child
!= null then
1422 new_child
.parent
= self
1423 assert new_child
isa AVisibility
1424 _n_visibility
= new_child
1430 if _n_kwmeth
== old_child
then
1431 if new_child
!= null then
1432 new_child
.parent
= self
1433 assert new_child
isa TKwmeth
1434 _n_kwmeth
= new_child
1440 if _n_methid
== old_child
then
1441 if new_child
!= null then
1442 new_child
.parent
= self
1443 assert new_child
isa AMethid
1444 _n_methid
= new_child
1450 if _n_signature
== old_child
then
1451 if new_child
!= null then
1452 new_child
.parent
= self
1453 assert new_child
isa ASignature
1454 _n_signature
= new_child
1462 redef fun visit_all
(v
: Visitor)
1464 if _n_doc
!= null then
1465 v
.enter_visit
(_n_doc
.as(not null))
1467 if _n_kwredef
!= null then
1468 v
.enter_visit
(_n_kwredef
.as(not null))
1470 v
.enter_visit
(_n_visibility
)
1471 v
.enter_visit
(_n_kwmeth
)
1472 v
.enter_visit
(_n_methid
)
1473 v
.enter_visit
(_n_signature
)
1476 redef class AExternMethPropdef
1477 private init empty_init
do end
1479 init init_aexternmethpropdef
(
1480 n_doc
: nullable ADoc,
1481 n_kwredef
: nullable TKwredef,
1482 n_visibility
: nullable AVisibility,
1483 n_kwmeth
: nullable TKwmeth,
1484 n_methid
: nullable AMethid,
1485 n_signature
: nullable ASignature,
1486 n_extern
: nullable TString,
1487 n_extern_calls
: nullable AExternCalls
1492 if n_doc
!= null then
1495 _n_kwredef
= n_kwredef
1496 if n_kwredef
!= null then
1497 n_kwredef
.parent
= self
1499 _n_visibility
= n_visibility
.as(not null)
1500 n_visibility
.parent
= self
1501 _n_kwmeth
= n_kwmeth
.as(not null)
1502 n_kwmeth
.parent
= self
1503 _n_methid
= n_methid
.as(not null)
1504 n_methid
.parent
= self
1505 _n_signature
= n_signature
.as(not null)
1506 n_signature
.parent
= self
1507 _n_extern
= n_extern
1508 if n_extern
!= null then
1509 n_extern
.parent
= self
1511 _n_extern_calls
= n_extern_calls
1512 if n_extern_calls
!= null then
1513 n_extern_calls
.parent
= self
1517 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1519 if _n_doc
== old_child
then
1520 if new_child
!= null then
1521 new_child
.parent
= self
1522 assert new_child
isa ADoc
1529 if _n_kwredef
== old_child
then
1530 if new_child
!= null then
1531 new_child
.parent
= self
1532 assert new_child
isa TKwredef
1533 _n_kwredef
= new_child
1539 if _n_visibility
== old_child
then
1540 if new_child
!= null then
1541 new_child
.parent
= self
1542 assert new_child
isa AVisibility
1543 _n_visibility
= new_child
1549 if _n_kwmeth
== old_child
then
1550 if new_child
!= null then
1551 new_child
.parent
= self
1552 assert new_child
isa TKwmeth
1553 _n_kwmeth
= new_child
1559 if _n_methid
== old_child
then
1560 if new_child
!= null then
1561 new_child
.parent
= self
1562 assert new_child
isa AMethid
1563 _n_methid
= new_child
1569 if _n_signature
== old_child
then
1570 if new_child
!= null then
1571 new_child
.parent
= self
1572 assert new_child
isa ASignature
1573 _n_signature
= new_child
1579 if _n_extern
== old_child
then
1580 if new_child
!= null then
1581 new_child
.parent
= self
1582 assert new_child
isa TString
1583 _n_extern
= new_child
1589 if _n_extern_calls
== old_child
then
1590 if new_child
!= null then
1591 new_child
.parent
= self
1592 assert new_child
isa AExternCalls
1593 _n_extern_calls
= new_child
1595 _n_extern_calls
= null
1601 redef fun visit_all
(v
: Visitor)
1603 if _n_doc
!= null then
1604 v
.enter_visit
(_n_doc
.as(not null))
1606 if _n_kwredef
!= null then
1607 v
.enter_visit
(_n_kwredef
.as(not null))
1609 v
.enter_visit
(_n_visibility
)
1610 v
.enter_visit
(_n_kwmeth
)
1611 v
.enter_visit
(_n_methid
)
1612 v
.enter_visit
(_n_signature
)
1613 if _n_extern
!= null then
1614 v
.enter_visit
(_n_extern
.as(not null))
1616 if _n_extern_calls
!= null then
1617 v
.enter_visit
(_n_extern_calls
.as(not null))
1621 redef class AConcreteMethPropdef
1622 private init empty_init
do end
1624 init init_aconcretemethpropdef
(
1625 n_doc
: nullable ADoc,
1626 n_kwredef
: nullable TKwredef,
1627 n_visibility
: nullable AVisibility,
1628 n_kwmeth
: nullable TKwmeth,
1629 n_methid
: nullable AMethid,
1630 n_signature
: nullable ASignature,
1631 n_block
: nullable AExpr
1636 if n_doc
!= null then
1639 _n_kwredef
= n_kwredef
1640 if n_kwredef
!= null then
1641 n_kwredef
.parent
= self
1643 _n_visibility
= n_visibility
.as(not null)
1644 n_visibility
.parent
= self
1645 _n_kwmeth
= n_kwmeth
.as(not null)
1646 n_kwmeth
.parent
= self
1647 _n_methid
= n_methid
.as(not null)
1648 n_methid
.parent
= self
1649 _n_signature
= n_signature
.as(not null)
1650 n_signature
.parent
= self
1652 if n_block
!= null then
1653 n_block
.parent
= self
1657 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1659 if _n_doc
== old_child
then
1660 if new_child
!= null then
1661 new_child
.parent
= self
1662 assert new_child
isa ADoc
1669 if _n_kwredef
== old_child
then
1670 if new_child
!= null then
1671 new_child
.parent
= self
1672 assert new_child
isa TKwredef
1673 _n_kwredef
= new_child
1679 if _n_visibility
== old_child
then
1680 if new_child
!= null then
1681 new_child
.parent
= self
1682 assert new_child
isa AVisibility
1683 _n_visibility
= new_child
1689 if _n_kwmeth
== old_child
then
1690 if new_child
!= null then
1691 new_child
.parent
= self
1692 assert new_child
isa TKwmeth
1693 _n_kwmeth
= new_child
1699 if _n_methid
== old_child
then
1700 if new_child
!= null then
1701 new_child
.parent
= self
1702 assert new_child
isa AMethid
1703 _n_methid
= new_child
1709 if _n_signature
== old_child
then
1710 if new_child
!= null then
1711 new_child
.parent
= self
1712 assert new_child
isa ASignature
1713 _n_signature
= new_child
1719 if _n_block
== old_child
then
1720 if new_child
!= null then
1721 new_child
.parent
= self
1722 assert new_child
isa AExpr
1723 _n_block
= new_child
1731 redef fun visit_all
(v
: Visitor)
1733 if _n_doc
!= null then
1734 v
.enter_visit
(_n_doc
.as(not null))
1736 if _n_kwredef
!= null then
1737 v
.enter_visit
(_n_kwredef
.as(not null))
1739 v
.enter_visit
(_n_visibility
)
1740 v
.enter_visit
(_n_kwmeth
)
1741 v
.enter_visit
(_n_methid
)
1742 v
.enter_visit
(_n_signature
)
1743 if _n_block
!= null then
1744 v
.enter_visit
(_n_block
.as(not null))
1748 redef class AConcreteInitPropdef
1749 private init empty_init
do end
1751 init init_aconcreteinitpropdef
(
1752 n_doc
: nullable ADoc,
1753 n_kwredef
: nullable TKwredef,
1754 n_visibility
: nullable AVisibility,
1755 n_kwinit
: nullable TKwinit,
1756 n_methid
: nullable AMethid,
1757 n_signature
: nullable ASignature,
1758 n_block
: nullable AExpr
1763 if n_doc
!= null then
1766 _n_kwredef
= n_kwredef
1767 if n_kwredef
!= null then
1768 n_kwredef
.parent
= self
1770 _n_visibility
= n_visibility
.as(not null)
1771 n_visibility
.parent
= self
1772 _n_kwinit
= n_kwinit
.as(not null)
1773 n_kwinit
.parent
= self
1774 _n_methid
= n_methid
1775 if n_methid
!= null then
1776 n_methid
.parent
= self
1778 _n_signature
= n_signature
.as(not null)
1779 n_signature
.parent
= self
1781 if n_block
!= null then
1782 n_block
.parent
= self
1786 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1788 if _n_doc
== old_child
then
1789 if new_child
!= null then
1790 new_child
.parent
= self
1791 assert new_child
isa ADoc
1798 if _n_kwredef
== old_child
then
1799 if new_child
!= null then
1800 new_child
.parent
= self
1801 assert new_child
isa TKwredef
1802 _n_kwredef
= new_child
1808 if _n_visibility
== old_child
then
1809 if new_child
!= null then
1810 new_child
.parent
= self
1811 assert new_child
isa AVisibility
1812 _n_visibility
= new_child
1818 if _n_kwinit
== old_child
then
1819 if new_child
!= null then
1820 new_child
.parent
= self
1821 assert new_child
isa TKwinit
1822 _n_kwinit
= new_child
1828 if _n_methid
== old_child
then
1829 if new_child
!= null then
1830 new_child
.parent
= self
1831 assert new_child
isa AMethid
1832 _n_methid
= new_child
1838 if _n_signature
== old_child
then
1839 if new_child
!= null then
1840 new_child
.parent
= self
1841 assert new_child
isa ASignature
1842 _n_signature
= new_child
1848 if _n_block
== old_child
then
1849 if new_child
!= null then
1850 new_child
.parent
= self
1851 assert new_child
isa AExpr
1852 _n_block
= new_child
1860 redef fun visit_all
(v
: Visitor)
1862 if _n_doc
!= null then
1863 v
.enter_visit
(_n_doc
.as(not null))
1865 if _n_kwredef
!= null then
1866 v
.enter_visit
(_n_kwredef
.as(not null))
1868 v
.enter_visit
(_n_visibility
)
1869 v
.enter_visit
(_n_kwinit
)
1870 if _n_methid
!= null then
1871 v
.enter_visit
(_n_methid
.as(not null))
1873 v
.enter_visit
(_n_signature
)
1874 if _n_block
!= null then
1875 v
.enter_visit
(_n_block
.as(not null))
1879 redef class AExternInitPropdef
1880 private init empty_init
do end
1882 init init_aexterninitpropdef
(
1883 n_doc
: nullable ADoc,
1884 n_kwredef
: nullable TKwredef,
1885 n_visibility
: nullable AVisibility,
1886 n_kwnew
: nullable TKwnew,
1887 n_methid
: nullable AMethid,
1888 n_signature
: nullable ASignature,
1889 n_extern
: nullable TString,
1890 n_extern_calls
: nullable AExternCalls
1895 if n_doc
!= null then
1898 _n_kwredef
= n_kwredef
1899 if n_kwredef
!= null then
1900 n_kwredef
.parent
= self
1902 _n_visibility
= n_visibility
.as(not null)
1903 n_visibility
.parent
= self
1904 _n_kwnew
= n_kwnew
.as(not null)
1905 n_kwnew
.parent
= self
1906 _n_methid
= n_methid
1907 if n_methid
!= null then
1908 n_methid
.parent
= self
1910 _n_signature
= n_signature
.as(not null)
1911 n_signature
.parent
= self
1912 _n_extern
= n_extern
1913 if n_extern
!= null then
1914 n_extern
.parent
= self
1916 _n_extern_calls
= n_extern_calls
1917 if n_extern_calls
!= null then
1918 n_extern_calls
.parent
= self
1922 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1924 if _n_doc
== old_child
then
1925 if new_child
!= null then
1926 new_child
.parent
= self
1927 assert new_child
isa ADoc
1934 if _n_kwredef
== old_child
then
1935 if new_child
!= null then
1936 new_child
.parent
= self
1937 assert new_child
isa TKwredef
1938 _n_kwredef
= new_child
1944 if _n_visibility
== old_child
then
1945 if new_child
!= null then
1946 new_child
.parent
= self
1947 assert new_child
isa AVisibility
1948 _n_visibility
= new_child
1954 if _n_kwnew
== old_child
then
1955 if new_child
!= null then
1956 new_child
.parent
= self
1957 assert new_child
isa TKwnew
1958 _n_kwnew
= new_child
1964 if _n_methid
== old_child
then
1965 if new_child
!= null then
1966 new_child
.parent
= self
1967 assert new_child
isa AMethid
1968 _n_methid
= new_child
1974 if _n_signature
== old_child
then
1975 if new_child
!= null then
1976 new_child
.parent
= self
1977 assert new_child
isa ASignature
1978 _n_signature
= new_child
1984 if _n_extern
== old_child
then
1985 if new_child
!= null then
1986 new_child
.parent
= self
1987 assert new_child
isa TString
1988 _n_extern
= new_child
1994 if _n_extern_calls
== old_child
then
1995 if new_child
!= null then
1996 new_child
.parent
= self
1997 assert new_child
isa AExternCalls
1998 _n_extern_calls
= new_child
2000 _n_extern_calls
= null
2006 redef fun visit_all
(v
: Visitor)
2008 if _n_doc
!= null then
2009 v
.enter_visit
(_n_doc
.as(not null))
2011 if _n_kwredef
!= null then
2012 v
.enter_visit
(_n_kwredef
.as(not null))
2014 v
.enter_visit
(_n_visibility
)
2015 v
.enter_visit
(_n_kwnew
)
2016 if _n_methid
!= null then
2017 v
.enter_visit
(_n_methid
.as(not null))
2019 v
.enter_visit
(_n_signature
)
2020 if _n_extern
!= null then
2021 v
.enter_visit
(_n_extern
.as(not null))
2023 if _n_extern_calls
!= null then
2024 v
.enter_visit
(_n_extern_calls
.as(not null))
2028 redef class AMainMethPropdef
2029 private init empty_init
do end
2031 init init_amainmethpropdef
(
2032 n_kwredef
: nullable TKwredef,
2033 n_block
: nullable AExpr
2037 _n_kwredef
= n_kwredef
2038 if n_kwredef
!= null then
2039 n_kwredef
.parent
= self
2042 if n_block
!= null then
2043 n_block
.parent
= self
2047 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2049 if _n_kwredef
== old_child
then
2050 if new_child
!= null then
2051 new_child
.parent
= self
2052 assert new_child
isa TKwredef
2053 _n_kwredef
= new_child
2059 if _n_block
== old_child
then
2060 if new_child
!= null then
2061 new_child
.parent
= self
2062 assert new_child
isa AExpr
2063 _n_block
= new_child
2071 redef fun visit_all
(v
: Visitor)
2073 if _n_kwredef
!= null then
2074 v
.enter_visit
(_n_kwredef
.as(not null))
2076 if _n_block
!= null then
2077 v
.enter_visit
(_n_block
.as(not null))
2081 redef class ATypePropdef
2082 private init empty_init
do end
2084 init init_atypepropdef
(
2085 n_doc
: nullable ADoc,
2086 n_kwredef
: nullable TKwredef,
2087 n_visibility
: nullable AVisibility,
2088 n_kwtype
: nullable TKwtype,
2089 n_id
: nullable TClassid,
2090 n_type
: nullable AType
2095 if n_doc
!= null then
2098 _n_kwredef
= n_kwredef
2099 if n_kwredef
!= null then
2100 n_kwredef
.parent
= self
2102 _n_visibility
= n_visibility
.as(not null)
2103 n_visibility
.parent
= self
2104 _n_kwtype
= n_kwtype
.as(not null)
2105 n_kwtype
.parent
= self
2106 _n_id
= n_id
.as(not null)
2108 _n_type
= n_type
.as(not null)
2109 n_type
.parent
= self
2112 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2114 if _n_doc
== old_child
then
2115 if new_child
!= null then
2116 new_child
.parent
= self
2117 assert new_child
isa ADoc
2124 if _n_kwredef
== old_child
then
2125 if new_child
!= null then
2126 new_child
.parent
= self
2127 assert new_child
isa TKwredef
2128 _n_kwredef
= new_child
2134 if _n_visibility
== old_child
then
2135 if new_child
!= null then
2136 new_child
.parent
= self
2137 assert new_child
isa AVisibility
2138 _n_visibility
= new_child
2144 if _n_kwtype
== old_child
then
2145 if new_child
!= null then
2146 new_child
.parent
= self
2147 assert new_child
isa TKwtype
2148 _n_kwtype
= new_child
2154 if _n_id
== old_child
then
2155 if new_child
!= null then
2156 new_child
.parent
= self
2157 assert new_child
isa TClassid
2164 if _n_type
== old_child
then
2165 if new_child
!= null then
2166 new_child
.parent
= self
2167 assert new_child
isa AType
2176 redef fun visit_all
(v
: Visitor)
2178 if _n_doc
!= null then
2179 v
.enter_visit
(_n_doc
.as(not null))
2181 if _n_kwredef
!= null then
2182 v
.enter_visit
(_n_kwredef
.as(not null))
2184 v
.enter_visit
(_n_visibility
)
2185 v
.enter_visit
(_n_kwtype
)
2186 v
.enter_visit
(_n_id
)
2187 v
.enter_visit
(_n_type
)
2190 redef class AReadAble
2191 private init empty_init
do end
2193 init init_areadable
(
2194 n_kwredef
: nullable TKwredef,
2195 n_kwreadable
: nullable TKwreadable
2199 _n_kwredef
= n_kwredef
2200 if n_kwredef
!= null then
2201 n_kwredef
.parent
= self
2203 _n_kwreadable
= n_kwreadable
.as(not null)
2204 n_kwreadable
.parent
= self
2207 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2209 if _n_kwredef
== old_child
then
2210 if new_child
!= null then
2211 new_child
.parent
= self
2212 assert new_child
isa TKwredef
2213 _n_kwredef
= new_child
2219 if _n_kwreadable
== old_child
then
2220 if new_child
!= null then
2221 new_child
.parent
= self
2222 assert new_child
isa TKwreadable
2223 _n_kwreadable
= new_child
2231 redef fun visit_all
(v
: Visitor)
2233 if _n_kwredef
!= null then
2234 v
.enter_visit
(_n_kwredef
.as(not null))
2236 v
.enter_visit
(_n_kwreadable
)
2239 redef class AWriteAble
2240 private init empty_init
do end
2242 init init_awriteable
(
2243 n_kwredef
: nullable TKwredef,
2244 n_visibility
: nullable AVisibility,
2245 n_kwwritable
: nullable TKwwritable
2249 _n_kwredef
= n_kwredef
2250 if n_kwredef
!= null then
2251 n_kwredef
.parent
= self
2253 _n_visibility
= n_visibility
2254 if n_visibility
!= null then
2255 n_visibility
.parent
= self
2257 _n_kwwritable
= n_kwwritable
.as(not null)
2258 n_kwwritable
.parent
= self
2261 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2263 if _n_kwredef
== old_child
then
2264 if new_child
!= null then
2265 new_child
.parent
= self
2266 assert new_child
isa TKwredef
2267 _n_kwredef
= new_child
2273 if _n_visibility
== old_child
then
2274 if new_child
!= null then
2275 new_child
.parent
= self
2276 assert new_child
isa AVisibility
2277 _n_visibility
= new_child
2279 _n_visibility
= null
2283 if _n_kwwritable
== old_child
then
2284 if new_child
!= null then
2285 new_child
.parent
= self
2286 assert new_child
isa TKwwritable
2287 _n_kwwritable
= new_child
2295 redef fun visit_all
(v
: Visitor)
2297 if _n_kwredef
!= null then
2298 v
.enter_visit
(_n_kwredef
.as(not null))
2300 if _n_visibility
!= null then
2301 v
.enter_visit
(_n_visibility
.as(not null))
2303 v
.enter_visit
(_n_kwwritable
)
2306 redef class AIdMethid
2307 private init empty_init
do end
2309 init init_aidmethid
(
2314 _n_id
= n_id
.as(not null)
2318 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2320 if _n_id
== old_child
then
2321 if new_child
!= null then
2322 new_child
.parent
= self
2323 assert new_child
isa TId
2332 redef fun visit_all
(v
: Visitor)
2334 v
.enter_visit
(_n_id
)
2337 redef class APlusMethid
2338 private init empty_init
do end
2340 init init_aplusmethid
(
2341 n_plus
: nullable TPlus
2345 _n_plus
= n_plus
.as(not null)
2346 n_plus
.parent
= self
2349 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2351 if _n_plus
== old_child
then
2352 if new_child
!= null then
2353 new_child
.parent
= self
2354 assert new_child
isa TPlus
2363 redef fun visit_all
(v
: Visitor)
2365 v
.enter_visit
(_n_plus
)
2368 redef class AMinusMethid
2369 private init empty_init
do end
2371 init init_aminusmethid
(
2372 n_minus
: nullable TMinus
2376 _n_minus
= n_minus
.as(not null)
2377 n_minus
.parent
= self
2380 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2382 if _n_minus
== old_child
then
2383 if new_child
!= null then
2384 new_child
.parent
= self
2385 assert new_child
isa TMinus
2386 _n_minus
= new_child
2394 redef fun visit_all
(v
: Visitor)
2396 v
.enter_visit
(_n_minus
)
2399 redef class AStarMethid
2400 private init empty_init
do end
2402 init init_astarmethid
(
2403 n_star
: nullable TStar
2407 _n_star
= n_star
.as(not null)
2408 n_star
.parent
= self
2411 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2413 if _n_star
== old_child
then
2414 if new_child
!= null then
2415 new_child
.parent
= self
2416 assert new_child
isa TStar
2425 redef fun visit_all
(v
: Visitor)
2427 v
.enter_visit
(_n_star
)
2430 redef class ASlashMethid
2431 private init empty_init
do end
2433 init init_aslashmethid
(
2434 n_slash
: nullable TSlash
2438 _n_slash
= n_slash
.as(not null)
2439 n_slash
.parent
= self
2442 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2444 if _n_slash
== old_child
then
2445 if new_child
!= null then
2446 new_child
.parent
= self
2447 assert new_child
isa TSlash
2448 _n_slash
= new_child
2456 redef fun visit_all
(v
: Visitor)
2458 v
.enter_visit
(_n_slash
)
2461 redef class APercentMethid
2462 private init empty_init
do end
2464 init init_apercentmethid
(
2465 n_percent
: nullable TPercent
2469 _n_percent
= n_percent
.as(not null)
2470 n_percent
.parent
= self
2473 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2475 if _n_percent
== old_child
then
2476 if new_child
!= null then
2477 new_child
.parent
= self
2478 assert new_child
isa TPercent
2479 _n_percent
= new_child
2487 redef fun visit_all
(v
: Visitor)
2489 v
.enter_visit
(_n_percent
)
2492 redef class AEqMethid
2493 private init empty_init
do end
2495 init init_aeqmethid
(
2500 _n_eq
= n_eq
.as(not null)
2504 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2506 if _n_eq
== old_child
then
2507 if new_child
!= null then
2508 new_child
.parent
= self
2509 assert new_child
isa TEq
2518 redef fun visit_all
(v
: Visitor)
2520 v
.enter_visit
(_n_eq
)
2523 redef class ANeMethid
2524 private init empty_init
do end
2526 init init_anemethid
(
2531 _n_ne
= n_ne
.as(not null)
2535 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2537 if _n_ne
== old_child
then
2538 if new_child
!= null then
2539 new_child
.parent
= self
2540 assert new_child
isa TNe
2549 redef fun visit_all
(v
: Visitor)
2551 v
.enter_visit
(_n_ne
)
2554 redef class ALeMethid
2555 private init empty_init
do end
2557 init init_alemethid
(
2562 _n_le
= n_le
.as(not null)
2566 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2568 if _n_le
== old_child
then
2569 if new_child
!= null then
2570 new_child
.parent
= self
2571 assert new_child
isa TLe
2580 redef fun visit_all
(v
: Visitor)
2582 v
.enter_visit
(_n_le
)
2585 redef class AGeMethid
2586 private init empty_init
do end
2588 init init_agemethid
(
2593 _n_ge
= n_ge
.as(not null)
2597 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2599 if _n_ge
== old_child
then
2600 if new_child
!= null then
2601 new_child
.parent
= self
2602 assert new_child
isa TGe
2611 redef fun visit_all
(v
: Visitor)
2613 v
.enter_visit
(_n_ge
)
2616 redef class ALtMethid
2617 private init empty_init
do end
2619 init init_altmethid
(
2624 _n_lt
= n_lt
.as(not null)
2628 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2630 if _n_lt
== old_child
then
2631 if new_child
!= null then
2632 new_child
.parent
= self
2633 assert new_child
isa TLt
2642 redef fun visit_all
(v
: Visitor)
2644 v
.enter_visit
(_n_lt
)
2647 redef class AGtMethid
2648 private init empty_init
do end
2650 init init_agtmethid
(
2655 _n_gt
= n_gt
.as(not null)
2659 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2661 if _n_gt
== old_child
then
2662 if new_child
!= null then
2663 new_child
.parent
= self
2664 assert new_child
isa TGt
2673 redef fun visit_all
(v
: Visitor)
2675 v
.enter_visit
(_n_gt
)
2678 redef class ALlMethid
2679 private init empty_init
do end
2681 init init_allmethid
(
2686 _n_ll
= n_ll
.as(not null)
2690 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2692 if _n_ll
== old_child
then
2693 if new_child
!= null then
2694 new_child
.parent
= self
2695 assert new_child
isa TLl
2704 redef fun visit_all
(v
: Visitor)
2706 v
.enter_visit
(_n_ll
)
2709 redef class AGgMethid
2710 private init empty_init
do end
2712 init init_aggmethid
(
2717 _n_gg
= n_gg
.as(not null)
2721 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2723 if _n_gg
== old_child
then
2724 if new_child
!= null then
2725 new_child
.parent
= self
2726 assert new_child
isa TGg
2735 redef fun visit_all
(v
: Visitor)
2737 v
.enter_visit
(_n_gg
)
2740 redef class ABraMethid
2741 private init empty_init
do end
2743 init init_abramethid
(
2744 n_obra
: nullable TObra,
2745 n_cbra
: nullable TCbra
2749 _n_obra
= n_obra
.as(not null)
2750 n_obra
.parent
= self
2751 _n_cbra
= n_cbra
.as(not null)
2752 n_cbra
.parent
= self
2755 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2757 if _n_obra
== old_child
then
2758 if new_child
!= null then
2759 new_child
.parent
= self
2760 assert new_child
isa TObra
2767 if _n_cbra
== old_child
then
2768 if new_child
!= null then
2769 new_child
.parent
= self
2770 assert new_child
isa TCbra
2779 redef fun visit_all
(v
: Visitor)
2781 v
.enter_visit
(_n_obra
)
2782 v
.enter_visit
(_n_cbra
)
2785 redef class AStarshipMethid
2786 private init empty_init
do end
2788 init init_astarshipmethid
(
2789 n_starship
: nullable TStarship
2793 _n_starship
= n_starship
.as(not null)
2794 n_starship
.parent
= self
2797 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2799 if _n_starship
== old_child
then
2800 if new_child
!= null then
2801 new_child
.parent
= self
2802 assert new_child
isa TStarship
2803 _n_starship
= new_child
2811 redef fun visit_all
(v
: Visitor)
2813 v
.enter_visit
(_n_starship
)
2816 redef class AAssignMethid
2817 private init empty_init
do end
2819 init init_aassignmethid
(
2821 n_assign
: nullable TAssign
2825 _n_id
= n_id
.as(not null)
2827 _n_assign
= n_assign
.as(not null)
2828 n_assign
.parent
= self
2831 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2833 if _n_id
== old_child
then
2834 if new_child
!= null then
2835 new_child
.parent
= self
2836 assert new_child
isa TId
2843 if _n_assign
== old_child
then
2844 if new_child
!= null then
2845 new_child
.parent
= self
2846 assert new_child
isa TAssign
2847 _n_assign
= new_child
2855 redef fun visit_all
(v
: Visitor)
2857 v
.enter_visit
(_n_id
)
2858 v
.enter_visit
(_n_assign
)
2861 redef class ABraassignMethid
2862 private init empty_init
do end
2864 init init_abraassignmethid
(
2865 n_obra
: nullable TObra,
2866 n_cbra
: nullable TCbra,
2867 n_assign
: nullable TAssign
2871 _n_obra
= n_obra
.as(not null)
2872 n_obra
.parent
= self
2873 _n_cbra
= n_cbra
.as(not null)
2874 n_cbra
.parent
= self
2875 _n_assign
= n_assign
.as(not null)
2876 n_assign
.parent
= self
2879 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2881 if _n_obra
== old_child
then
2882 if new_child
!= null then
2883 new_child
.parent
= self
2884 assert new_child
isa TObra
2891 if _n_cbra
== old_child
then
2892 if new_child
!= null then
2893 new_child
.parent
= self
2894 assert new_child
isa TCbra
2901 if _n_assign
== old_child
then
2902 if new_child
!= null then
2903 new_child
.parent
= self
2904 assert new_child
isa TAssign
2905 _n_assign
= new_child
2913 redef fun visit_all
(v
: Visitor)
2915 v
.enter_visit
(_n_obra
)
2916 v
.enter_visit
(_n_cbra
)
2917 v
.enter_visit
(_n_assign
)
2920 redef class ASignature
2921 private init empty_init
do end
2923 init init_asignature
(
2924 n_params
: Collection[Object], # Should be Collection[AParam]
2925 n_type
: nullable AType,
2926 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2930 for n
in n_params
do
2936 if n_type
!= null then
2937 n_type
.parent
= self
2939 for n
in n_closure_decls
do
2940 assert n
isa AClosureDecl
2941 _n_closure_decls
.add
(n
)
2946 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2948 for i
in [0.._n_params
.length
[ do
2949 if _n_params
[i
] == old_child
then
2950 if new_child
!= null then
2951 assert new_child
isa AParam
2952 _n_params
[i
] = new_child
2953 new_child
.parent
= self
2955 _n_params
.remove_at
(i
)
2960 if _n_type
== old_child
then
2961 if new_child
!= null then
2962 new_child
.parent
= self
2963 assert new_child
isa AType
2970 for i
in [0.._n_closure_decls
.length
[ do
2971 if _n_closure_decls
[i
] == old_child
then
2972 if new_child
!= null then
2973 assert new_child
isa AClosureDecl
2974 _n_closure_decls
[i
] = new_child
2975 new_child
.parent
= self
2977 _n_closure_decls
.remove_at
(i
)
2984 redef fun visit_all
(v
: Visitor)
2986 for n
in _n_params
do
2989 if _n_type
!= null then
2990 v
.enter_visit
(_n_type
.as(not null))
2992 for n
in _n_closure_decls
do
2998 private init empty_init
do end
3002 n_type
: nullable AType,
3003 n_dotdotdot
: nullable TDotdotdot
3007 _n_id
= n_id
.as(not null)
3010 if n_type
!= null then
3011 n_type
.parent
= self
3013 _n_dotdotdot
= n_dotdotdot
3014 if n_dotdotdot
!= null then
3015 n_dotdotdot
.parent
= self
3019 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3021 if _n_id
== old_child
then
3022 if new_child
!= null then
3023 new_child
.parent
= self
3024 assert new_child
isa TId
3031 if _n_type
== old_child
then
3032 if new_child
!= null then
3033 new_child
.parent
= self
3034 assert new_child
isa AType
3041 if _n_dotdotdot
== old_child
then
3042 if new_child
!= null then
3043 new_child
.parent
= self
3044 assert new_child
isa TDotdotdot
3045 _n_dotdotdot
= new_child
3053 redef fun visit_all
(v
: Visitor)
3055 v
.enter_visit
(_n_id
)
3056 if _n_type
!= null then
3057 v
.enter_visit
(_n_type
.as(not null))
3059 if _n_dotdotdot
!= null then
3060 v
.enter_visit
(_n_dotdotdot
.as(not null))
3064 redef class AClosureDecl
3065 private init empty_init
do end
3067 init init_aclosuredecl
(
3068 n_kwbreak
: nullable TKwbreak,
3069 n_bang
: nullable TBang,
3071 n_signature
: nullable ASignature,
3072 n_expr
: nullable AExpr
3076 _n_kwbreak
= n_kwbreak
3077 if n_kwbreak
!= null then
3078 n_kwbreak
.parent
= self
3080 _n_bang
= n_bang
.as(not null)
3081 n_bang
.parent
= self
3082 _n_id
= n_id
.as(not null)
3084 _n_signature
= n_signature
.as(not null)
3085 n_signature
.parent
= self
3087 if n_expr
!= null then
3088 n_expr
.parent
= self
3092 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3094 if _n_kwbreak
== old_child
then
3095 if new_child
!= null then
3096 new_child
.parent
= self
3097 assert new_child
isa TKwbreak
3098 _n_kwbreak
= new_child
3104 if _n_bang
== old_child
then
3105 if new_child
!= null then
3106 new_child
.parent
= self
3107 assert new_child
isa TBang
3114 if _n_id
== old_child
then
3115 if new_child
!= null then
3116 new_child
.parent
= self
3117 assert new_child
isa TId
3124 if _n_signature
== old_child
then
3125 if new_child
!= null then
3126 new_child
.parent
= self
3127 assert new_child
isa ASignature
3128 _n_signature
= new_child
3134 if _n_expr
== old_child
then
3135 if new_child
!= null then
3136 new_child
.parent
= self
3137 assert new_child
isa AExpr
3146 redef fun visit_all
(v
: Visitor)
3148 if _n_kwbreak
!= null then
3149 v
.enter_visit
(_n_kwbreak
.as(not null))
3151 v
.enter_visit
(_n_bang
)
3152 v
.enter_visit
(_n_id
)
3153 v
.enter_visit
(_n_signature
)
3154 if _n_expr
!= null then
3155 v
.enter_visit
(_n_expr
.as(not null))
3160 private init empty_init
do end
3163 n_kwnullable
: nullable TKwnullable,
3164 n_id
: nullable TClassid,
3165 n_types
: Collection[Object] # Should be Collection[AType]
3169 _n_kwnullable
= n_kwnullable
3170 if n_kwnullable
!= null then
3171 n_kwnullable
.parent
= self
3173 _n_id
= n_id
.as(not null)
3182 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3184 if _n_kwnullable
== old_child
then
3185 if new_child
!= null then
3186 new_child
.parent
= self
3187 assert new_child
isa TKwnullable
3188 _n_kwnullable
= new_child
3190 _n_kwnullable
= null
3194 if _n_id
== old_child
then
3195 if new_child
!= null then
3196 new_child
.parent
= self
3197 assert new_child
isa TClassid
3204 for i
in [0.._n_types
.length
[ do
3205 if _n_types
[i
] == old_child
then
3206 if new_child
!= null then
3207 assert new_child
isa AType
3208 _n_types
[i
] = new_child
3209 new_child
.parent
= self
3211 _n_types
.remove_at
(i
)
3218 redef fun visit_all
(v
: Visitor)
3220 if _n_kwnullable
!= null then
3221 v
.enter_visit
(_n_kwnullable
.as(not null))
3223 v
.enter_visit
(_n_id
)
3224 for n
in _n_types
do
3230 private init empty_init
do end
3233 n_kwlabel
: nullable TKwlabel,
3238 _n_kwlabel
= n_kwlabel
.as(not null)
3239 n_kwlabel
.parent
= self
3240 _n_id
= n_id
.as(not null)
3244 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3246 if _n_kwlabel
== old_child
then
3247 if new_child
!= null then
3248 new_child
.parent
= self
3249 assert new_child
isa TKwlabel
3250 _n_kwlabel
= new_child
3256 if _n_id
== old_child
then
3257 if new_child
!= null then
3258 new_child
.parent
= self
3259 assert new_child
isa TId
3268 redef fun visit_all
(v
: Visitor)
3270 v
.enter_visit
(_n_kwlabel
)
3271 v
.enter_visit
(_n_id
)
3274 redef class ABlockExpr
3275 private init empty_init
do end
3277 init init_ablockexpr
(
3278 n_expr
: Collection[Object], # Should be Collection[AExpr]
3279 n_kwend
: nullable TKwend
3289 if n_kwend
!= null then
3290 n_kwend
.parent
= self
3294 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3296 for i
in [0.._n_expr
.length
[ do
3297 if _n_expr
[i
] == old_child
then
3298 if new_child
!= null then
3299 assert new_child
isa AExpr
3300 _n_expr
[i
] = new_child
3301 new_child
.parent
= self
3303 _n_expr
.remove_at
(i
)
3308 if _n_kwend
== old_child
then
3309 if new_child
!= null then
3310 new_child
.parent
= self
3311 assert new_child
isa TKwend
3312 _n_kwend
= new_child
3320 redef fun visit_all
(v
: Visitor)
3325 if _n_kwend
!= null then
3326 v
.enter_visit
(_n_kwend
.as(not null))
3330 redef class AVardeclExpr
3331 private init empty_init
do end
3333 init init_avardeclexpr
(
3334 n_kwvar
: nullable TKwvar,
3336 n_type
: nullable AType,
3337 n_assign
: nullable TAssign,
3338 n_expr
: nullable AExpr
3342 _n_kwvar
= n_kwvar
.as(not null)
3343 n_kwvar
.parent
= self
3344 _n_id
= n_id
.as(not null)
3347 if n_type
!= null then
3348 n_type
.parent
= self
3350 _n_assign
= n_assign
3351 if n_assign
!= null then
3352 n_assign
.parent
= self
3355 if n_expr
!= null then
3356 n_expr
.parent
= self
3360 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3362 if _n_kwvar
== old_child
then
3363 if new_child
!= null then
3364 new_child
.parent
= self
3365 assert new_child
isa TKwvar
3366 _n_kwvar
= new_child
3372 if _n_id
== old_child
then
3373 if new_child
!= null then
3374 new_child
.parent
= self
3375 assert new_child
isa TId
3382 if _n_type
== old_child
then
3383 if new_child
!= null then
3384 new_child
.parent
= self
3385 assert new_child
isa AType
3392 if _n_assign
== old_child
then
3393 if new_child
!= null then
3394 new_child
.parent
= self
3395 assert new_child
isa TAssign
3396 _n_assign
= new_child
3402 if _n_expr
== old_child
then
3403 if new_child
!= null then
3404 new_child
.parent
= self
3405 assert new_child
isa AExpr
3414 redef fun visit_all
(v
: Visitor)
3416 v
.enter_visit
(_n_kwvar
)
3417 v
.enter_visit
(_n_id
)
3418 if _n_type
!= null then
3419 v
.enter_visit
(_n_type
.as(not null))
3421 if _n_assign
!= null then
3422 v
.enter_visit
(_n_assign
.as(not null))
3424 if _n_expr
!= null then
3425 v
.enter_visit
(_n_expr
.as(not null))
3429 redef class AReturnExpr
3430 private init empty_init
do end
3432 init init_areturnexpr
(
3433 n_kwreturn
: nullable TKwreturn,
3434 n_expr
: nullable AExpr
3438 _n_kwreturn
= n_kwreturn
3439 if n_kwreturn
!= null then
3440 n_kwreturn
.parent
= self
3443 if n_expr
!= null then
3444 n_expr
.parent
= self
3448 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3450 if _n_kwreturn
== old_child
then
3451 if new_child
!= null then
3452 new_child
.parent
= self
3453 assert new_child
isa TKwreturn
3454 _n_kwreturn
= new_child
3460 if _n_expr
== old_child
then
3461 if new_child
!= null then
3462 new_child
.parent
= self
3463 assert new_child
isa AExpr
3472 redef fun visit_all
(v
: Visitor)
3474 if _n_kwreturn
!= null then
3475 v
.enter_visit
(_n_kwreturn
.as(not null))
3477 if _n_expr
!= null then
3478 v
.enter_visit
(_n_expr
.as(not null))
3482 redef class ABreakExpr
3483 private init empty_init
do end
3485 init init_abreakexpr
(
3486 n_kwbreak
: nullable TKwbreak,
3487 n_label
: nullable ALabel,
3488 n_expr
: nullable AExpr
3492 _n_kwbreak
= n_kwbreak
.as(not null)
3493 n_kwbreak
.parent
= self
3495 if n_label
!= null then
3496 n_label
.parent
= self
3499 if n_expr
!= null then
3500 n_expr
.parent
= self
3504 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3506 if _n_kwbreak
== old_child
then
3507 if new_child
!= null then
3508 new_child
.parent
= self
3509 assert new_child
isa TKwbreak
3510 _n_kwbreak
= new_child
3516 if _n_label
== old_child
then
3517 if new_child
!= null then
3518 new_child
.parent
= self
3519 assert new_child
isa ALabel
3520 _n_label
= new_child
3526 if _n_expr
== old_child
then
3527 if new_child
!= null then
3528 new_child
.parent
= self
3529 assert new_child
isa AExpr
3538 redef fun visit_all
(v
: Visitor)
3540 v
.enter_visit
(_n_kwbreak
)
3541 if _n_label
!= null then
3542 v
.enter_visit
(_n_label
.as(not null))
3544 if _n_expr
!= null then
3545 v
.enter_visit
(_n_expr
.as(not null))
3549 redef class AAbortExpr
3550 private init empty_init
do end
3552 init init_aabortexpr
(
3553 n_kwabort
: nullable TKwabort
3557 _n_kwabort
= n_kwabort
.as(not null)
3558 n_kwabort
.parent
= self
3561 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3563 if _n_kwabort
== old_child
then
3564 if new_child
!= null then
3565 new_child
.parent
= self
3566 assert new_child
isa TKwabort
3567 _n_kwabort
= new_child
3575 redef fun visit_all
(v
: Visitor)
3577 v
.enter_visit
(_n_kwabort
)
3580 redef class AContinueExpr
3581 private init empty_init
do end
3583 init init_acontinueexpr
(
3584 n_kwcontinue
: nullable TKwcontinue,
3585 n_label
: nullable ALabel,
3586 n_expr
: nullable AExpr
3590 _n_kwcontinue
= n_kwcontinue
3591 if n_kwcontinue
!= null then
3592 n_kwcontinue
.parent
= self
3595 if n_label
!= null then
3596 n_label
.parent
= self
3599 if n_expr
!= null then
3600 n_expr
.parent
= self
3604 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3606 if _n_kwcontinue
== old_child
then
3607 if new_child
!= null then
3608 new_child
.parent
= self
3609 assert new_child
isa TKwcontinue
3610 _n_kwcontinue
= new_child
3612 _n_kwcontinue
= null
3616 if _n_label
== old_child
then
3617 if new_child
!= null then
3618 new_child
.parent
= self
3619 assert new_child
isa ALabel
3620 _n_label
= new_child
3626 if _n_expr
== old_child
then
3627 if new_child
!= null then
3628 new_child
.parent
= self
3629 assert new_child
isa AExpr
3638 redef fun visit_all
(v
: Visitor)
3640 if _n_kwcontinue
!= null then
3641 v
.enter_visit
(_n_kwcontinue
.as(not null))
3643 if _n_label
!= null then
3644 v
.enter_visit
(_n_label
.as(not null))
3646 if _n_expr
!= null then
3647 v
.enter_visit
(_n_expr
.as(not null))
3652 private init empty_init
do end
3655 n_kwdo
: nullable TKwdo,
3656 n_block
: nullable AExpr,
3657 n_label
: nullable ALabel
3661 _n_kwdo
= n_kwdo
.as(not null)
3662 n_kwdo
.parent
= self
3664 if n_block
!= null then
3665 n_block
.parent
= self
3668 if n_label
!= null then
3669 n_label
.parent
= self
3673 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3675 if _n_kwdo
== old_child
then
3676 if new_child
!= null then
3677 new_child
.parent
= self
3678 assert new_child
isa TKwdo
3685 if _n_block
== old_child
then
3686 if new_child
!= null then
3687 new_child
.parent
= self
3688 assert new_child
isa AExpr
3689 _n_block
= new_child
3695 if _n_label
== old_child
then
3696 if new_child
!= null then
3697 new_child
.parent
= self
3698 assert new_child
isa ALabel
3699 _n_label
= new_child
3707 redef fun visit_all
(v
: Visitor)
3709 v
.enter_visit
(_n_kwdo
)
3710 if _n_block
!= null then
3711 v
.enter_visit
(_n_block
.as(not null))
3713 if _n_label
!= null then
3714 v
.enter_visit
(_n_label
.as(not null))
3719 private init empty_init
do end
3722 n_kwif
: nullable TKwif,
3723 n_expr
: nullable AExpr,
3724 n_then
: nullable AExpr,
3725 n_else
: nullable AExpr
3729 _n_kwif
= n_kwif
.as(not null)
3730 n_kwif
.parent
= self
3731 _n_expr
= n_expr
.as(not null)
3732 n_expr
.parent
= self
3734 if n_then
!= null then
3735 n_then
.parent
= self
3738 if n_else
!= null then
3739 n_else
.parent
= self
3743 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3745 if _n_kwif
== old_child
then
3746 if new_child
!= null then
3747 new_child
.parent
= self
3748 assert new_child
isa TKwif
3755 if _n_expr
== old_child
then
3756 if new_child
!= null then
3757 new_child
.parent
= self
3758 assert new_child
isa AExpr
3765 if _n_then
== old_child
then
3766 if new_child
!= null then
3767 new_child
.parent
= self
3768 assert new_child
isa AExpr
3775 if _n_else
== old_child
then
3776 if new_child
!= null then
3777 new_child
.parent
= self
3778 assert new_child
isa AExpr
3787 redef fun visit_all
(v
: Visitor)
3789 v
.enter_visit
(_n_kwif
)
3790 v
.enter_visit
(_n_expr
)
3791 if _n_then
!= null then
3792 v
.enter_visit
(_n_then
.as(not null))
3794 if _n_else
!= null then
3795 v
.enter_visit
(_n_else
.as(not null))
3799 redef class AIfexprExpr
3800 private init empty_init
do end
3802 init init_aifexprexpr
(
3803 n_kwif
: nullable TKwif,
3804 n_expr
: nullable AExpr,
3805 n_kwthen
: nullable TKwthen,
3806 n_then
: nullable AExpr,
3807 n_kwelse
: nullable TKwelse,
3808 n_else
: nullable AExpr
3812 _n_kwif
= n_kwif
.as(not null)
3813 n_kwif
.parent
= self
3814 _n_expr
= n_expr
.as(not null)
3815 n_expr
.parent
= self
3816 _n_kwthen
= n_kwthen
.as(not null)
3817 n_kwthen
.parent
= self
3818 _n_then
= n_then
.as(not null)
3819 n_then
.parent
= self
3820 _n_kwelse
= n_kwelse
.as(not null)
3821 n_kwelse
.parent
= self
3822 _n_else
= n_else
.as(not null)
3823 n_else
.parent
= self
3826 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3828 if _n_kwif
== old_child
then
3829 if new_child
!= null then
3830 new_child
.parent
= self
3831 assert new_child
isa TKwif
3838 if _n_expr
== old_child
then
3839 if new_child
!= null then
3840 new_child
.parent
= self
3841 assert new_child
isa AExpr
3848 if _n_kwthen
== old_child
then
3849 if new_child
!= null then
3850 new_child
.parent
= self
3851 assert new_child
isa TKwthen
3852 _n_kwthen
= new_child
3858 if _n_then
== old_child
then
3859 if new_child
!= null then
3860 new_child
.parent
= self
3861 assert new_child
isa AExpr
3868 if _n_kwelse
== old_child
then
3869 if new_child
!= null then
3870 new_child
.parent
= self
3871 assert new_child
isa TKwelse
3872 _n_kwelse
= new_child
3878 if _n_else
== old_child
then
3879 if new_child
!= null then
3880 new_child
.parent
= self
3881 assert new_child
isa AExpr
3890 redef fun visit_all
(v
: Visitor)
3892 v
.enter_visit
(_n_kwif
)
3893 v
.enter_visit
(_n_expr
)
3894 v
.enter_visit
(_n_kwthen
)
3895 v
.enter_visit
(_n_then
)
3896 v
.enter_visit
(_n_kwelse
)
3897 v
.enter_visit
(_n_else
)
3900 redef class AWhileExpr
3901 private init empty_init
do end
3903 init init_awhileexpr
(
3904 n_kwwhile
: nullable TKwwhile,
3905 n_expr
: nullable AExpr,
3906 n_kwdo
: nullable TKwdo,
3907 n_block
: nullable AExpr,
3908 n_label
: nullable ALabel
3912 _n_kwwhile
= n_kwwhile
.as(not null)
3913 n_kwwhile
.parent
= self
3914 _n_expr
= n_expr
.as(not null)
3915 n_expr
.parent
= self
3916 _n_kwdo
= n_kwdo
.as(not null)
3917 n_kwdo
.parent
= self
3919 if n_block
!= null then
3920 n_block
.parent
= self
3923 if n_label
!= null then
3924 n_label
.parent
= self
3928 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3930 if _n_kwwhile
== old_child
then
3931 if new_child
!= null then
3932 new_child
.parent
= self
3933 assert new_child
isa TKwwhile
3934 _n_kwwhile
= new_child
3940 if _n_expr
== old_child
then
3941 if new_child
!= null then
3942 new_child
.parent
= self
3943 assert new_child
isa AExpr
3950 if _n_kwdo
== old_child
then
3951 if new_child
!= null then
3952 new_child
.parent
= self
3953 assert new_child
isa TKwdo
3960 if _n_block
== old_child
then
3961 if new_child
!= null then
3962 new_child
.parent
= self
3963 assert new_child
isa AExpr
3964 _n_block
= new_child
3970 if _n_label
== old_child
then
3971 if new_child
!= null then
3972 new_child
.parent
= self
3973 assert new_child
isa ALabel
3974 _n_label
= new_child
3982 redef fun visit_all
(v
: Visitor)
3984 v
.enter_visit
(_n_kwwhile
)
3985 v
.enter_visit
(_n_expr
)
3986 v
.enter_visit
(_n_kwdo
)
3987 if _n_block
!= null then
3988 v
.enter_visit
(_n_block
.as(not null))
3990 if _n_label
!= null then
3991 v
.enter_visit
(_n_label
.as(not null))
3995 redef class ALoopExpr
3996 private init empty_init
do end
3998 init init_aloopexpr
(
3999 n_kwloop
: nullable TKwloop,
4000 n_block
: nullable AExpr,
4001 n_label
: nullable ALabel
4005 _n_kwloop
= n_kwloop
.as(not null)
4006 n_kwloop
.parent
= self
4008 if n_block
!= null then
4009 n_block
.parent
= self
4012 if n_label
!= null then
4013 n_label
.parent
= self
4017 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4019 if _n_kwloop
== old_child
then
4020 if new_child
!= null then
4021 new_child
.parent
= self
4022 assert new_child
isa TKwloop
4023 _n_kwloop
= new_child
4029 if _n_block
== old_child
then
4030 if new_child
!= null then
4031 new_child
.parent
= self
4032 assert new_child
isa AExpr
4033 _n_block
= new_child
4039 if _n_label
== old_child
then
4040 if new_child
!= null then
4041 new_child
.parent
= self
4042 assert new_child
isa ALabel
4043 _n_label
= new_child
4051 redef fun visit_all
(v
: Visitor)
4053 v
.enter_visit
(_n_kwloop
)
4054 if _n_block
!= null then
4055 v
.enter_visit
(_n_block
.as(not null))
4057 if _n_label
!= null then
4058 v
.enter_visit
(_n_label
.as(not null))
4062 redef class AForExpr
4063 private init empty_init
do end
4065 init init_aforexpr
(
4066 n_kwfor
: nullable TKwfor,
4067 n_ids
: Collection[Object], # Should be Collection[TId]
4068 n_expr
: nullable AExpr,
4069 n_kwdo
: nullable TKwdo,
4070 n_block
: nullable AExpr,
4071 n_label
: nullable ALabel
4075 _n_kwfor
= n_kwfor
.as(not null)
4076 n_kwfor
.parent
= self
4082 _n_expr
= n_expr
.as(not null)
4083 n_expr
.parent
= self
4084 _n_kwdo
= n_kwdo
.as(not null)
4085 n_kwdo
.parent
= self
4087 if n_block
!= null then
4088 n_block
.parent
= self
4091 if n_label
!= null then
4092 n_label
.parent
= self
4096 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4098 if _n_kwfor
== old_child
then
4099 if new_child
!= null then
4100 new_child
.parent
= self
4101 assert new_child
isa TKwfor
4102 _n_kwfor
= new_child
4108 for i
in [0.._n_ids
.length
[ do
4109 if _n_ids
[i
] == old_child
then
4110 if new_child
!= null then
4111 assert new_child
isa TId
4112 _n_ids
[i
] = new_child
4113 new_child
.parent
= self
4120 if _n_expr
== old_child
then
4121 if new_child
!= null then
4122 new_child
.parent
= self
4123 assert new_child
isa AExpr
4130 if _n_kwdo
== old_child
then
4131 if new_child
!= null then
4132 new_child
.parent
= self
4133 assert new_child
isa TKwdo
4140 if _n_block
== old_child
then
4141 if new_child
!= null then
4142 new_child
.parent
= self
4143 assert new_child
isa AExpr
4144 _n_block
= new_child
4150 if _n_label
== old_child
then
4151 if new_child
!= null then
4152 new_child
.parent
= self
4153 assert new_child
isa ALabel
4154 _n_label
= new_child
4162 redef fun visit_all
(v
: Visitor)
4164 v
.enter_visit
(_n_kwfor
)
4168 v
.enter_visit
(_n_expr
)
4169 v
.enter_visit
(_n_kwdo
)
4170 if _n_block
!= null then
4171 v
.enter_visit
(_n_block
.as(not null))
4173 if _n_label
!= null then
4174 v
.enter_visit
(_n_label
.as(not null))
4178 redef class AAssertExpr
4179 private init empty_init
do end
4181 init init_aassertexpr
(
4182 n_kwassert
: nullable TKwassert,
4184 n_expr
: nullable AExpr,
4185 n_else
: nullable AExpr
4189 _n_kwassert
= n_kwassert
.as(not null)
4190 n_kwassert
.parent
= self
4192 if n_id
!= null then
4195 _n_expr
= n_expr
.as(not null)
4196 n_expr
.parent
= self
4198 if n_else
!= null then
4199 n_else
.parent
= self
4203 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4205 if _n_kwassert
== old_child
then
4206 if new_child
!= null then
4207 new_child
.parent
= self
4208 assert new_child
isa TKwassert
4209 _n_kwassert
= new_child
4215 if _n_id
== old_child
then
4216 if new_child
!= null then
4217 new_child
.parent
= self
4218 assert new_child
isa TId
4225 if _n_expr
== old_child
then
4226 if new_child
!= null then
4227 new_child
.parent
= self
4228 assert new_child
isa AExpr
4235 if _n_else
== old_child
then
4236 if new_child
!= null then
4237 new_child
.parent
= self
4238 assert new_child
isa AExpr
4247 redef fun visit_all
(v
: Visitor)
4249 v
.enter_visit
(_n_kwassert
)
4250 if _n_id
!= null then
4251 v
.enter_visit
(_n_id
.as(not null))
4253 v
.enter_visit
(_n_expr
)
4254 if _n_else
!= null then
4255 v
.enter_visit
(_n_else
.as(not null))
4259 redef class AOnceExpr
4260 private init empty_init
do end
4262 init init_aonceexpr
(
4263 n_kwonce
: nullable TKwonce,
4264 n_expr
: nullable AExpr
4268 _n_kwonce
= n_kwonce
.as(not null)
4269 n_kwonce
.parent
= self
4270 _n_expr
= n_expr
.as(not null)
4271 n_expr
.parent
= self
4274 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4276 if _n_kwonce
== old_child
then
4277 if new_child
!= null then
4278 new_child
.parent
= self
4279 assert new_child
isa TKwonce
4280 _n_kwonce
= new_child
4286 if _n_expr
== old_child
then
4287 if new_child
!= null then
4288 new_child
.parent
= self
4289 assert new_child
isa AExpr
4298 redef fun visit_all
(v
: Visitor)
4300 v
.enter_visit
(_n_kwonce
)
4301 v
.enter_visit
(_n_expr
)
4304 redef class ASendExpr
4305 private init empty_init
do end
4307 init init_asendexpr
(
4308 n_expr
: nullable AExpr
4312 _n_expr
= n_expr
.as(not null)
4313 n_expr
.parent
= self
4316 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4318 if _n_expr
== old_child
then
4319 if new_child
!= null then
4320 new_child
.parent
= self
4321 assert new_child
isa AExpr
4330 redef fun visit_all
(v
: Visitor)
4332 v
.enter_visit
(_n_expr
)
4335 redef class ABinopExpr
4336 private init empty_init
do end
4338 init init_abinopexpr
(
4339 n_expr
: nullable AExpr,
4340 n_expr2
: nullable AExpr
4344 _n_expr
= n_expr
.as(not null)
4345 n_expr
.parent
= self
4346 _n_expr2
= n_expr2
.as(not null)
4347 n_expr2
.parent
= self
4350 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4352 if _n_expr
== old_child
then
4353 if new_child
!= null then
4354 new_child
.parent
= self
4355 assert new_child
isa AExpr
4362 if _n_expr2
== old_child
then
4363 if new_child
!= null then
4364 new_child
.parent
= self
4365 assert new_child
isa AExpr
4366 _n_expr2
= new_child
4374 redef fun visit_all
(v
: Visitor)
4376 v
.enter_visit
(_n_expr
)
4377 v
.enter_visit
(_n_expr2
)
4381 private init empty_init
do end
4384 n_expr
: nullable AExpr,
4385 n_expr2
: nullable AExpr
4389 _n_expr
= n_expr
.as(not null)
4390 n_expr
.parent
= self
4391 _n_expr2
= n_expr2
.as(not null)
4392 n_expr2
.parent
= self
4395 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4397 if _n_expr
== old_child
then
4398 if new_child
!= null then
4399 new_child
.parent
= self
4400 assert new_child
isa AExpr
4407 if _n_expr2
== old_child
then
4408 if new_child
!= null then
4409 new_child
.parent
= self
4410 assert new_child
isa AExpr
4411 _n_expr2
= new_child
4419 redef fun visit_all
(v
: Visitor)
4421 v
.enter_visit
(_n_expr
)
4422 v
.enter_visit
(_n_expr2
)
4425 redef class AAndExpr
4426 private init empty_init
do end
4428 init init_aandexpr
(
4429 n_expr
: nullable AExpr,
4430 n_expr2
: nullable AExpr
4434 _n_expr
= n_expr
.as(not null)
4435 n_expr
.parent
= self
4436 _n_expr2
= n_expr2
.as(not null)
4437 n_expr2
.parent
= self
4440 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4442 if _n_expr
== old_child
then
4443 if new_child
!= null then
4444 new_child
.parent
= self
4445 assert new_child
isa AExpr
4452 if _n_expr2
== old_child
then
4453 if new_child
!= null then
4454 new_child
.parent
= self
4455 assert new_child
isa AExpr
4456 _n_expr2
= new_child
4464 redef fun visit_all
(v
: Visitor)
4466 v
.enter_visit
(_n_expr
)
4467 v
.enter_visit
(_n_expr2
)
4470 redef class AOrElseExpr
4471 private init empty_init
do end
4473 init init_aorelseexpr
(
4474 n_expr
: nullable AExpr,
4475 n_expr2
: nullable AExpr
4479 _n_expr
= n_expr
.as(not null)
4480 n_expr
.parent
= self
4481 _n_expr2
= n_expr2
.as(not null)
4482 n_expr2
.parent
= self
4485 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4487 if _n_expr
== old_child
then
4488 if new_child
!= null then
4489 new_child
.parent
= self
4490 assert new_child
isa AExpr
4497 if _n_expr2
== old_child
then
4498 if new_child
!= null then
4499 new_child
.parent
= self
4500 assert new_child
isa AExpr
4501 _n_expr2
= new_child
4509 redef fun visit_all
(v
: Visitor)
4511 v
.enter_visit
(_n_expr
)
4512 v
.enter_visit
(_n_expr2
)
4515 redef class ANotExpr
4516 private init empty_init
do end
4518 init init_anotexpr
(
4519 n_kwnot
: nullable TKwnot,
4520 n_expr
: nullable AExpr
4524 _n_kwnot
= n_kwnot
.as(not null)
4525 n_kwnot
.parent
= self
4526 _n_expr
= n_expr
.as(not null)
4527 n_expr
.parent
= self
4530 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4532 if _n_kwnot
== old_child
then
4533 if new_child
!= null then
4534 new_child
.parent
= self
4535 assert new_child
isa TKwnot
4536 _n_kwnot
= new_child
4542 if _n_expr
== old_child
then
4543 if new_child
!= null then
4544 new_child
.parent
= self
4545 assert new_child
isa AExpr
4554 redef fun visit_all
(v
: Visitor)
4556 v
.enter_visit
(_n_kwnot
)
4557 v
.enter_visit
(_n_expr
)
4561 private init empty_init
do end
4564 n_expr
: nullable AExpr,
4565 n_expr2
: nullable AExpr
4569 _n_expr
= n_expr
.as(not null)
4570 n_expr
.parent
= self
4571 _n_expr2
= n_expr2
.as(not null)
4572 n_expr2
.parent
= self
4575 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4577 if _n_expr
== old_child
then
4578 if new_child
!= null then
4579 new_child
.parent
= self
4580 assert new_child
isa AExpr
4587 if _n_expr2
== old_child
then
4588 if new_child
!= null then
4589 new_child
.parent
= self
4590 assert new_child
isa AExpr
4591 _n_expr2
= new_child
4599 redef fun visit_all
(v
: Visitor)
4601 v
.enter_visit
(_n_expr
)
4602 v
.enter_visit
(_n_expr2
)
4606 private init empty_init
do end
4609 n_expr
: nullable AExpr,
4610 n_expr2
: nullable AExpr
4614 _n_expr
= n_expr
.as(not null)
4615 n_expr
.parent
= self
4616 _n_expr2
= n_expr2
.as(not null)
4617 n_expr2
.parent
= self
4620 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4622 if _n_expr
== old_child
then
4623 if new_child
!= null then
4624 new_child
.parent
= self
4625 assert new_child
isa AExpr
4632 if _n_expr2
== old_child
then
4633 if new_child
!= null then
4634 new_child
.parent
= self
4635 assert new_child
isa AExpr
4636 _n_expr2
= new_child
4644 redef fun visit_all
(v
: Visitor)
4646 v
.enter_visit
(_n_expr
)
4647 v
.enter_visit
(_n_expr2
)
4651 private init empty_init
do end
4654 n_expr
: nullable AExpr,
4655 n_expr2
: nullable AExpr
4659 _n_expr
= n_expr
.as(not null)
4660 n_expr
.parent
= self
4661 _n_expr2
= n_expr2
.as(not null)
4662 n_expr2
.parent
= self
4665 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4667 if _n_expr
== old_child
then
4668 if new_child
!= null then
4669 new_child
.parent
= self
4670 assert new_child
isa AExpr
4677 if _n_expr2
== old_child
then
4678 if new_child
!= null then
4679 new_child
.parent
= self
4680 assert new_child
isa AExpr
4681 _n_expr2
= new_child
4689 redef fun visit_all
(v
: Visitor)
4691 v
.enter_visit
(_n_expr
)
4692 v
.enter_visit
(_n_expr2
)
4696 private init empty_init
do end
4699 n_expr
: nullable AExpr,
4700 n_expr2
: nullable AExpr
4704 _n_expr
= n_expr
.as(not null)
4705 n_expr
.parent
= self
4706 _n_expr2
= n_expr2
.as(not null)
4707 n_expr2
.parent
= self
4710 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4712 if _n_expr
== old_child
then
4713 if new_child
!= null then
4714 new_child
.parent
= self
4715 assert new_child
isa AExpr
4722 if _n_expr2
== old_child
then
4723 if new_child
!= null then
4724 new_child
.parent
= self
4725 assert new_child
isa AExpr
4726 _n_expr2
= new_child
4734 redef fun visit_all
(v
: Visitor)
4736 v
.enter_visit
(_n_expr
)
4737 v
.enter_visit
(_n_expr2
)
4741 private init empty_init
do end
4744 n_expr
: nullable AExpr,
4745 n_expr2
: nullable AExpr
4749 _n_expr
= n_expr
.as(not null)
4750 n_expr
.parent
= self
4751 _n_expr2
= n_expr2
.as(not null)
4752 n_expr2
.parent
= self
4755 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4757 if _n_expr
== old_child
then
4758 if new_child
!= null then
4759 new_child
.parent
= self
4760 assert new_child
isa AExpr
4767 if _n_expr2
== old_child
then
4768 if new_child
!= null then
4769 new_child
.parent
= self
4770 assert new_child
isa AExpr
4771 _n_expr2
= new_child
4779 redef fun visit_all
(v
: Visitor)
4781 v
.enter_visit
(_n_expr
)
4782 v
.enter_visit
(_n_expr2
)
4786 private init empty_init
do end
4789 n_expr
: nullable AExpr,
4790 n_expr2
: nullable AExpr
4794 _n_expr
= n_expr
.as(not null)
4795 n_expr
.parent
= self
4796 _n_expr2
= n_expr2
.as(not null)
4797 n_expr2
.parent
= self
4800 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4802 if _n_expr
== old_child
then
4803 if new_child
!= null then
4804 new_child
.parent
= self
4805 assert new_child
isa AExpr
4812 if _n_expr2
== old_child
then
4813 if new_child
!= null then
4814 new_child
.parent
= self
4815 assert new_child
isa AExpr
4816 _n_expr2
= new_child
4824 redef fun visit_all
(v
: Visitor)
4826 v
.enter_visit
(_n_expr
)
4827 v
.enter_visit
(_n_expr2
)
4831 private init empty_init
do end
4834 n_expr
: nullable AExpr,
4835 n_expr2
: nullable AExpr
4839 _n_expr
= n_expr
.as(not null)
4840 n_expr
.parent
= self
4841 _n_expr2
= n_expr2
.as(not null)
4842 n_expr2
.parent
= self
4845 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4847 if _n_expr
== old_child
then
4848 if new_child
!= null then
4849 new_child
.parent
= self
4850 assert new_child
isa AExpr
4857 if _n_expr2
== old_child
then
4858 if new_child
!= null then
4859 new_child
.parent
= self
4860 assert new_child
isa AExpr
4861 _n_expr2
= new_child
4869 redef fun visit_all
(v
: Visitor)
4871 v
.enter_visit
(_n_expr
)
4872 v
.enter_visit
(_n_expr2
)
4876 private init empty_init
do end
4879 n_expr
: nullable AExpr,
4880 n_expr2
: nullable AExpr
4884 _n_expr
= n_expr
.as(not null)
4885 n_expr
.parent
= self
4886 _n_expr2
= n_expr2
.as(not null)
4887 n_expr2
.parent
= self
4890 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4892 if _n_expr
== old_child
then
4893 if new_child
!= null then
4894 new_child
.parent
= self
4895 assert new_child
isa AExpr
4902 if _n_expr2
== old_child
then
4903 if new_child
!= null then
4904 new_child
.parent
= self
4905 assert new_child
isa AExpr
4906 _n_expr2
= new_child
4914 redef fun visit_all
(v
: Visitor)
4916 v
.enter_visit
(_n_expr
)
4917 v
.enter_visit
(_n_expr2
)
4921 private init empty_init
do end
4924 n_expr
: nullable AExpr,
4925 n_expr2
: nullable AExpr
4929 _n_expr
= n_expr
.as(not null)
4930 n_expr
.parent
= self
4931 _n_expr2
= n_expr2
.as(not null)
4932 n_expr2
.parent
= self
4935 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4937 if _n_expr
== old_child
then
4938 if new_child
!= null then
4939 new_child
.parent
= self
4940 assert new_child
isa AExpr
4947 if _n_expr2
== old_child
then
4948 if new_child
!= null then
4949 new_child
.parent
= self
4950 assert new_child
isa AExpr
4951 _n_expr2
= new_child
4959 redef fun visit_all
(v
: Visitor)
4961 v
.enter_visit
(_n_expr
)
4962 v
.enter_visit
(_n_expr2
)
4965 redef class AIsaExpr
4966 private init empty_init
do end
4968 init init_aisaexpr
(
4969 n_expr
: nullable AExpr,
4970 n_type
: nullable AType
4974 _n_expr
= n_expr
.as(not null)
4975 n_expr
.parent
= self
4976 _n_type
= n_type
.as(not null)
4977 n_type
.parent
= self
4980 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4982 if _n_expr
== old_child
then
4983 if new_child
!= null then
4984 new_child
.parent
= self
4985 assert new_child
isa AExpr
4992 if _n_type
== old_child
then
4993 if new_child
!= null then
4994 new_child
.parent
= self
4995 assert new_child
isa AType
5004 redef fun visit_all
(v
: Visitor)
5006 v
.enter_visit
(_n_expr
)
5007 v
.enter_visit
(_n_type
)
5010 redef class APlusExpr
5011 private init empty_init
do end
5013 init init_aplusexpr
(
5014 n_expr
: nullable AExpr,
5015 n_expr2
: nullable AExpr
5019 _n_expr
= n_expr
.as(not null)
5020 n_expr
.parent
= self
5021 _n_expr2
= n_expr2
.as(not null)
5022 n_expr2
.parent
= self
5025 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5027 if _n_expr
== old_child
then
5028 if new_child
!= null then
5029 new_child
.parent
= self
5030 assert new_child
isa AExpr
5037 if _n_expr2
== old_child
then
5038 if new_child
!= null then
5039 new_child
.parent
= self
5040 assert new_child
isa AExpr
5041 _n_expr2
= new_child
5049 redef fun visit_all
(v
: Visitor)
5051 v
.enter_visit
(_n_expr
)
5052 v
.enter_visit
(_n_expr2
)
5055 redef class AMinusExpr
5056 private init empty_init
do end
5058 init init_aminusexpr
(
5059 n_expr
: nullable AExpr,
5060 n_expr2
: nullable AExpr
5064 _n_expr
= n_expr
.as(not null)
5065 n_expr
.parent
= self
5066 _n_expr2
= n_expr2
.as(not null)
5067 n_expr2
.parent
= self
5070 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5072 if _n_expr
== old_child
then
5073 if new_child
!= null then
5074 new_child
.parent
= self
5075 assert new_child
isa AExpr
5082 if _n_expr2
== old_child
then
5083 if new_child
!= null then
5084 new_child
.parent
= self
5085 assert new_child
isa AExpr
5086 _n_expr2
= new_child
5094 redef fun visit_all
(v
: Visitor)
5096 v
.enter_visit
(_n_expr
)
5097 v
.enter_visit
(_n_expr2
)
5100 redef class AStarshipExpr
5101 private init empty_init
do end
5103 init init_astarshipexpr
(
5104 n_expr
: nullable AExpr,
5105 n_expr2
: nullable AExpr
5109 _n_expr
= n_expr
.as(not null)
5110 n_expr
.parent
= self
5111 _n_expr2
= n_expr2
.as(not null)
5112 n_expr2
.parent
= self
5115 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5117 if _n_expr
== old_child
then
5118 if new_child
!= null then
5119 new_child
.parent
= self
5120 assert new_child
isa AExpr
5127 if _n_expr2
== old_child
then
5128 if new_child
!= null then
5129 new_child
.parent
= self
5130 assert new_child
isa AExpr
5131 _n_expr2
= new_child
5139 redef fun visit_all
(v
: Visitor)
5141 v
.enter_visit
(_n_expr
)
5142 v
.enter_visit
(_n_expr2
)
5145 redef class AStarExpr
5146 private init empty_init
do end
5148 init init_astarexpr
(
5149 n_expr
: nullable AExpr,
5150 n_expr2
: nullable AExpr
5154 _n_expr
= n_expr
.as(not null)
5155 n_expr
.parent
= self
5156 _n_expr2
= n_expr2
.as(not null)
5157 n_expr2
.parent
= self
5160 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5162 if _n_expr
== old_child
then
5163 if new_child
!= null then
5164 new_child
.parent
= self
5165 assert new_child
isa AExpr
5172 if _n_expr2
== old_child
then
5173 if new_child
!= null then
5174 new_child
.parent
= self
5175 assert new_child
isa AExpr
5176 _n_expr2
= new_child
5184 redef fun visit_all
(v
: Visitor)
5186 v
.enter_visit
(_n_expr
)
5187 v
.enter_visit
(_n_expr2
)
5190 redef class ASlashExpr
5191 private init empty_init
do end
5193 init init_aslashexpr
(
5194 n_expr
: nullable AExpr,
5195 n_expr2
: nullable AExpr
5199 _n_expr
= n_expr
.as(not null)
5200 n_expr
.parent
= self
5201 _n_expr2
= n_expr2
.as(not null)
5202 n_expr2
.parent
= self
5205 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5207 if _n_expr
== old_child
then
5208 if new_child
!= null then
5209 new_child
.parent
= self
5210 assert new_child
isa AExpr
5217 if _n_expr2
== old_child
then
5218 if new_child
!= null then
5219 new_child
.parent
= self
5220 assert new_child
isa AExpr
5221 _n_expr2
= new_child
5229 redef fun visit_all
(v
: Visitor)
5231 v
.enter_visit
(_n_expr
)
5232 v
.enter_visit
(_n_expr2
)
5235 redef class APercentExpr
5236 private init empty_init
do end
5238 init init_apercentexpr
(
5239 n_expr
: nullable AExpr,
5240 n_expr2
: nullable AExpr
5244 _n_expr
= n_expr
.as(not null)
5245 n_expr
.parent
= self
5246 _n_expr2
= n_expr2
.as(not null)
5247 n_expr2
.parent
= self
5250 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5252 if _n_expr
== old_child
then
5253 if new_child
!= null then
5254 new_child
.parent
= self
5255 assert new_child
isa AExpr
5262 if _n_expr2
== old_child
then
5263 if new_child
!= null then
5264 new_child
.parent
= self
5265 assert new_child
isa AExpr
5266 _n_expr2
= new_child
5274 redef fun visit_all
(v
: Visitor)
5276 v
.enter_visit
(_n_expr
)
5277 v
.enter_visit
(_n_expr2
)
5280 redef class AUminusExpr
5281 private init empty_init
do end
5283 init init_auminusexpr
(
5284 n_minus
: nullable TMinus,
5285 n_expr
: nullable AExpr
5289 _n_minus
= n_minus
.as(not null)
5290 n_minus
.parent
= self
5291 _n_expr
= n_expr
.as(not null)
5292 n_expr
.parent
= self
5295 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5297 if _n_minus
== old_child
then
5298 if new_child
!= null then
5299 new_child
.parent
= self
5300 assert new_child
isa TMinus
5301 _n_minus
= new_child
5307 if _n_expr
== old_child
then
5308 if new_child
!= null then
5309 new_child
.parent
= self
5310 assert new_child
isa AExpr
5319 redef fun visit_all
(v
: Visitor)
5321 v
.enter_visit
(_n_minus
)
5322 v
.enter_visit
(_n_expr
)
5325 redef class ANewExpr
5326 private init empty_init
do end
5328 init init_anewexpr
(
5329 n_kwnew
: nullable TKwnew,
5330 n_type
: nullable AType,
5332 n_args
: Collection[Object] # Should be Collection[AExpr]
5336 _n_kwnew
= n_kwnew
.as(not null)
5337 n_kwnew
.parent
= self
5338 _n_type
= n_type
.as(not null)
5339 n_type
.parent
= self
5341 if n_id
!= null then
5351 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5353 if _n_kwnew
== old_child
then
5354 if new_child
!= null then
5355 new_child
.parent
= self
5356 assert new_child
isa TKwnew
5357 _n_kwnew
= new_child
5363 if _n_type
== old_child
then
5364 if new_child
!= null then
5365 new_child
.parent
= self
5366 assert new_child
isa AType
5373 if _n_id
== old_child
then
5374 if new_child
!= null then
5375 new_child
.parent
= self
5376 assert new_child
isa TId
5383 for i
in [0.._n_args
.length
[ do
5384 if _n_args
[i
] == old_child
then
5385 if new_child
!= null then
5386 assert new_child
isa AExpr
5387 _n_args
[i
] = new_child
5388 new_child
.parent
= self
5390 _n_args
.remove_at
(i
)
5397 redef fun visit_all
(v
: Visitor)
5399 v
.enter_visit
(_n_kwnew
)
5400 v
.enter_visit
(_n_type
)
5401 if _n_id
!= null then
5402 v
.enter_visit
(_n_id
.as(not null))
5409 redef class AAttrExpr
5410 private init empty_init
do end
5412 init init_aattrexpr
(
5413 n_expr
: nullable AExpr,
5414 n_id
: nullable TAttrid
5418 _n_expr
= n_expr
.as(not null)
5419 n_expr
.parent
= self
5420 _n_id
= n_id
.as(not null)
5424 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5426 if _n_expr
== old_child
then
5427 if new_child
!= null then
5428 new_child
.parent
= self
5429 assert new_child
isa AExpr
5436 if _n_id
== old_child
then
5437 if new_child
!= null then
5438 new_child
.parent
= self
5439 assert new_child
isa TAttrid
5448 redef fun visit_all
(v
: Visitor)
5450 v
.enter_visit
(_n_expr
)
5451 v
.enter_visit
(_n_id
)
5454 redef class AAttrAssignExpr
5455 private init empty_init
do end
5457 init init_aattrassignexpr
(
5458 n_expr
: nullable AExpr,
5459 n_id
: nullable TAttrid,
5460 n_assign
: nullable TAssign,
5461 n_value
: nullable AExpr
5465 _n_expr
= n_expr
.as(not null)
5466 n_expr
.parent
= self
5467 _n_id
= n_id
.as(not null)
5469 _n_assign
= n_assign
.as(not null)
5470 n_assign
.parent
= self
5471 _n_value
= n_value
.as(not null)
5472 n_value
.parent
= self
5475 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5477 if _n_expr
== old_child
then
5478 if new_child
!= null then
5479 new_child
.parent
= self
5480 assert new_child
isa AExpr
5487 if _n_id
== old_child
then
5488 if new_child
!= null then
5489 new_child
.parent
= self
5490 assert new_child
isa TAttrid
5497 if _n_assign
== old_child
then
5498 if new_child
!= null then
5499 new_child
.parent
= self
5500 assert new_child
isa TAssign
5501 _n_assign
= new_child
5507 if _n_value
== old_child
then
5508 if new_child
!= null then
5509 new_child
.parent
= self
5510 assert new_child
isa AExpr
5511 _n_value
= new_child
5519 redef fun visit_all
(v
: Visitor)
5521 v
.enter_visit
(_n_expr
)
5522 v
.enter_visit
(_n_id
)
5523 v
.enter_visit
(_n_assign
)
5524 v
.enter_visit
(_n_value
)
5527 redef class AAttrReassignExpr
5528 private init empty_init
do end
5530 init init_aattrreassignexpr
(
5531 n_expr
: nullable AExpr,
5532 n_id
: nullable TAttrid,
5533 n_assign_op
: nullable AAssignOp,
5534 n_value
: nullable AExpr
5538 _n_expr
= n_expr
.as(not null)
5539 n_expr
.parent
= self
5540 _n_id
= n_id
.as(not null)
5542 _n_assign_op
= n_assign_op
.as(not null)
5543 n_assign_op
.parent
= self
5544 _n_value
= n_value
.as(not null)
5545 n_value
.parent
= self
5548 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5550 if _n_expr
== old_child
then
5551 if new_child
!= null then
5552 new_child
.parent
= self
5553 assert new_child
isa AExpr
5560 if _n_id
== old_child
then
5561 if new_child
!= null then
5562 new_child
.parent
= self
5563 assert new_child
isa TAttrid
5570 if _n_assign_op
== old_child
then
5571 if new_child
!= null then
5572 new_child
.parent
= self
5573 assert new_child
isa AAssignOp
5574 _n_assign_op
= new_child
5580 if _n_value
== old_child
then
5581 if new_child
!= null then
5582 new_child
.parent
= self
5583 assert new_child
isa AExpr
5584 _n_value
= new_child
5592 redef fun visit_all
(v
: Visitor)
5594 v
.enter_visit
(_n_expr
)
5595 v
.enter_visit
(_n_id
)
5596 v
.enter_visit
(_n_assign_op
)
5597 v
.enter_visit
(_n_value
)
5600 redef class ACallExpr
5601 private init empty_init
do end
5603 init init_acallexpr
(
5604 n_expr
: nullable AExpr,
5606 n_args
: Collection[Object], # Should be Collection[AExpr]
5607 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5611 _n_expr
= n_expr
.as(not null)
5612 n_expr
.parent
= self
5613 _n_id
= n_id
.as(not null)
5620 for n
in n_closure_defs
do
5621 assert n
isa AClosureDef
5622 _n_closure_defs
.add
(n
)
5627 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5629 if _n_expr
== old_child
then
5630 if new_child
!= null then
5631 new_child
.parent
= self
5632 assert new_child
isa AExpr
5639 if _n_id
== old_child
then
5640 if new_child
!= null then
5641 new_child
.parent
= self
5642 assert new_child
isa TId
5649 for i
in [0.._n_args
.length
[ do
5650 if _n_args
[i
] == old_child
then
5651 if new_child
!= null then
5652 assert new_child
isa AExpr
5653 _n_args
[i
] = new_child
5654 new_child
.parent
= self
5656 _n_args
.remove_at
(i
)
5661 for i
in [0.._n_closure_defs
.length
[ do
5662 if _n_closure_defs
[i
] == old_child
then
5663 if new_child
!= null then
5664 assert new_child
isa AClosureDef
5665 _n_closure_defs
[i
] = new_child
5666 new_child
.parent
= self
5668 _n_closure_defs
.remove_at
(i
)
5675 redef fun visit_all
(v
: Visitor)
5677 v
.enter_visit
(_n_expr
)
5678 v
.enter_visit
(_n_id
)
5682 for n
in _n_closure_defs
do
5687 redef class ACallAssignExpr
5688 private init empty_init
do end
5690 init init_acallassignexpr
(
5691 n_expr
: nullable AExpr,
5693 n_args
: Collection[Object], # Should be Collection[AExpr]
5694 n_assign
: nullable TAssign,
5695 n_value
: nullable AExpr
5699 _n_expr
= n_expr
.as(not null)
5700 n_expr
.parent
= self
5701 _n_id
= n_id
.as(not null)
5708 _n_assign
= n_assign
.as(not null)
5709 n_assign
.parent
= self
5710 _n_value
= n_value
.as(not null)
5711 n_value
.parent
= self
5714 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5716 if _n_expr
== old_child
then
5717 if new_child
!= null then
5718 new_child
.parent
= self
5719 assert new_child
isa AExpr
5726 if _n_id
== old_child
then
5727 if new_child
!= null then
5728 new_child
.parent
= self
5729 assert new_child
isa TId
5736 for i
in [0.._n_args
.length
[ do
5737 if _n_args
[i
] == old_child
then
5738 if new_child
!= null then
5739 assert new_child
isa AExpr
5740 _n_args
[i
] = new_child
5741 new_child
.parent
= self
5743 _n_args
.remove_at
(i
)
5748 if _n_assign
== old_child
then
5749 if new_child
!= null then
5750 new_child
.parent
= self
5751 assert new_child
isa TAssign
5752 _n_assign
= new_child
5758 if _n_value
== old_child
then
5759 if new_child
!= null then
5760 new_child
.parent
= self
5761 assert new_child
isa AExpr
5762 _n_value
= new_child
5770 redef fun visit_all
(v
: Visitor)
5772 v
.enter_visit
(_n_expr
)
5773 v
.enter_visit
(_n_id
)
5777 v
.enter_visit
(_n_assign
)
5778 v
.enter_visit
(_n_value
)
5781 redef class ACallReassignExpr
5782 private init empty_init
do end
5784 init init_acallreassignexpr
(
5785 n_expr
: nullable AExpr,
5787 n_args
: Collection[Object], # Should be Collection[AExpr]
5788 n_assign_op
: nullable AAssignOp,
5789 n_value
: nullable AExpr
5793 _n_expr
= n_expr
.as(not null)
5794 n_expr
.parent
= self
5795 _n_id
= n_id
.as(not null)
5802 _n_assign_op
= n_assign_op
.as(not null)
5803 n_assign_op
.parent
= self
5804 _n_value
= n_value
.as(not null)
5805 n_value
.parent
= self
5808 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5810 if _n_expr
== old_child
then
5811 if new_child
!= null then
5812 new_child
.parent
= self
5813 assert new_child
isa AExpr
5820 if _n_id
== old_child
then
5821 if new_child
!= null then
5822 new_child
.parent
= self
5823 assert new_child
isa TId
5830 for i
in [0.._n_args
.length
[ do
5831 if _n_args
[i
] == old_child
then
5832 if new_child
!= null then
5833 assert new_child
isa AExpr
5834 _n_args
[i
] = new_child
5835 new_child
.parent
= self
5837 _n_args
.remove_at
(i
)
5842 if _n_assign_op
== old_child
then
5843 if new_child
!= null then
5844 new_child
.parent
= self
5845 assert new_child
isa AAssignOp
5846 _n_assign_op
= new_child
5852 if _n_value
== old_child
then
5853 if new_child
!= null then
5854 new_child
.parent
= self
5855 assert new_child
isa AExpr
5856 _n_value
= new_child
5864 redef fun visit_all
(v
: Visitor)
5866 v
.enter_visit
(_n_expr
)
5867 v
.enter_visit
(_n_id
)
5871 v
.enter_visit
(_n_assign_op
)
5872 v
.enter_visit
(_n_value
)
5875 redef class ASuperExpr
5876 private init empty_init
do end
5878 init init_asuperexpr
(
5879 n_qualified
: nullable AQualified,
5880 n_kwsuper
: nullable TKwsuper,
5881 n_args
: Collection[Object] # Should be Collection[AExpr]
5885 _n_qualified
= n_qualified
5886 if n_qualified
!= null then
5887 n_qualified
.parent
= self
5889 _n_kwsuper
= n_kwsuper
.as(not null)
5890 n_kwsuper
.parent
= self
5898 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5900 if _n_qualified
== old_child
then
5901 if new_child
!= null then
5902 new_child
.parent
= self
5903 assert new_child
isa AQualified
5904 _n_qualified
= new_child
5910 if _n_kwsuper
== old_child
then
5911 if new_child
!= null then
5912 new_child
.parent
= self
5913 assert new_child
isa TKwsuper
5914 _n_kwsuper
= new_child
5920 for i
in [0.._n_args
.length
[ do
5921 if _n_args
[i
] == old_child
then
5922 if new_child
!= null then
5923 assert new_child
isa AExpr
5924 _n_args
[i
] = new_child
5925 new_child
.parent
= self
5927 _n_args
.remove_at
(i
)
5934 redef fun visit_all
(v
: Visitor)
5936 if _n_qualified
!= null then
5937 v
.enter_visit
(_n_qualified
.as(not null))
5939 v
.enter_visit
(_n_kwsuper
)
5945 redef class AInitExpr
5946 private init empty_init
do end
5948 init init_ainitexpr
(
5949 n_expr
: nullable AExpr,
5950 n_kwinit
: nullable TKwinit,
5951 n_args
: Collection[Object] # Should be Collection[AExpr]
5955 _n_expr
= n_expr
.as(not null)
5956 n_expr
.parent
= self
5957 _n_kwinit
= n_kwinit
.as(not null)
5958 n_kwinit
.parent
= self
5966 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5968 if _n_expr
== old_child
then
5969 if new_child
!= null then
5970 new_child
.parent
= self
5971 assert new_child
isa AExpr
5978 if _n_kwinit
== old_child
then
5979 if new_child
!= null then
5980 new_child
.parent
= self
5981 assert new_child
isa TKwinit
5982 _n_kwinit
= new_child
5988 for i
in [0.._n_args
.length
[ do
5989 if _n_args
[i
] == old_child
then
5990 if new_child
!= null then
5991 assert new_child
isa AExpr
5992 _n_args
[i
] = new_child
5993 new_child
.parent
= self
5995 _n_args
.remove_at
(i
)
6002 redef fun visit_all
(v
: Visitor)
6004 v
.enter_visit
(_n_expr
)
6005 v
.enter_visit
(_n_kwinit
)
6011 redef class ABraExpr
6012 private init empty_init
do end
6014 init init_abraexpr
(
6015 n_expr
: nullable AExpr,
6016 n_args
: Collection[Object], # Should be Collection[AExpr]
6017 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6021 _n_expr
= n_expr
.as(not null)
6022 n_expr
.parent
= self
6028 for n
in n_closure_defs
do
6029 assert n
isa AClosureDef
6030 _n_closure_defs
.add
(n
)
6035 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6037 if _n_expr
== old_child
then
6038 if new_child
!= null then
6039 new_child
.parent
= self
6040 assert new_child
isa AExpr
6047 for i
in [0.._n_args
.length
[ do
6048 if _n_args
[i
] == old_child
then
6049 if new_child
!= null then
6050 assert new_child
isa AExpr
6051 _n_args
[i
] = new_child
6052 new_child
.parent
= self
6054 _n_args
.remove_at
(i
)
6059 for i
in [0.._n_closure_defs
.length
[ do
6060 if _n_closure_defs
[i
] == old_child
then
6061 if new_child
!= null then
6062 assert new_child
isa AClosureDef
6063 _n_closure_defs
[i
] = new_child
6064 new_child
.parent
= self
6066 _n_closure_defs
.remove_at
(i
)
6073 redef fun visit_all
(v
: Visitor)
6075 v
.enter_visit
(_n_expr
)
6079 for n
in _n_closure_defs
do
6084 redef class ABraAssignExpr
6085 private init empty_init
do end
6087 init init_abraassignexpr
(
6088 n_expr
: nullable AExpr,
6089 n_args
: Collection[Object], # Should be Collection[AExpr]
6090 n_assign
: nullable TAssign,
6091 n_value
: nullable AExpr
6095 _n_expr
= n_expr
.as(not null)
6096 n_expr
.parent
= self
6102 _n_assign
= n_assign
.as(not null)
6103 n_assign
.parent
= self
6104 _n_value
= n_value
.as(not null)
6105 n_value
.parent
= self
6108 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6110 if _n_expr
== old_child
then
6111 if new_child
!= null then
6112 new_child
.parent
= self
6113 assert new_child
isa AExpr
6120 for i
in [0.._n_args
.length
[ do
6121 if _n_args
[i
] == old_child
then
6122 if new_child
!= null then
6123 assert new_child
isa AExpr
6124 _n_args
[i
] = new_child
6125 new_child
.parent
= self
6127 _n_args
.remove_at
(i
)
6132 if _n_assign
== old_child
then
6133 if new_child
!= null then
6134 new_child
.parent
= self
6135 assert new_child
isa TAssign
6136 _n_assign
= new_child
6142 if _n_value
== old_child
then
6143 if new_child
!= null then
6144 new_child
.parent
= self
6145 assert new_child
isa AExpr
6146 _n_value
= new_child
6154 redef fun visit_all
(v
: Visitor)
6156 v
.enter_visit
(_n_expr
)
6160 v
.enter_visit
(_n_assign
)
6161 v
.enter_visit
(_n_value
)
6164 redef class ABraReassignExpr
6165 private init empty_init
do end
6167 init init_abrareassignexpr
(
6168 n_expr
: nullable AExpr,
6169 n_args
: Collection[Object], # Should be Collection[AExpr]
6170 n_assign_op
: nullable AAssignOp,
6171 n_value
: nullable AExpr
6175 _n_expr
= n_expr
.as(not null)
6176 n_expr
.parent
= self
6182 _n_assign_op
= n_assign_op
.as(not null)
6183 n_assign_op
.parent
= self
6184 _n_value
= n_value
.as(not null)
6185 n_value
.parent
= self
6188 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6190 if _n_expr
== old_child
then
6191 if new_child
!= null then
6192 new_child
.parent
= self
6193 assert new_child
isa AExpr
6200 for i
in [0.._n_args
.length
[ do
6201 if _n_args
[i
] == old_child
then
6202 if new_child
!= null then
6203 assert new_child
isa AExpr
6204 _n_args
[i
] = new_child
6205 new_child
.parent
= self
6207 _n_args
.remove_at
(i
)
6212 if _n_assign_op
== old_child
then
6213 if new_child
!= null then
6214 new_child
.parent
= self
6215 assert new_child
isa AAssignOp
6216 _n_assign_op
= new_child
6222 if _n_value
== old_child
then
6223 if new_child
!= null then
6224 new_child
.parent
= self
6225 assert new_child
isa AExpr
6226 _n_value
= new_child
6234 redef fun visit_all
(v
: Visitor)
6236 v
.enter_visit
(_n_expr
)
6240 v
.enter_visit
(_n_assign_op
)
6241 v
.enter_visit
(_n_value
)
6244 redef class AClosureCallExpr
6245 private init empty_init
do end
6247 init init_aclosurecallexpr
(
6249 n_args
: Collection[Object], # Should be Collection[AExpr]
6250 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6254 _n_id
= n_id
.as(not null)
6261 for n
in n_closure_defs
do
6262 assert n
isa AClosureDef
6263 _n_closure_defs
.add
(n
)
6268 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6270 if _n_id
== old_child
then
6271 if new_child
!= null then
6272 new_child
.parent
= self
6273 assert new_child
isa TId
6280 for i
in [0.._n_args
.length
[ do
6281 if _n_args
[i
] == old_child
then
6282 if new_child
!= null then
6283 assert new_child
isa AExpr
6284 _n_args
[i
] = new_child
6285 new_child
.parent
= self
6287 _n_args
.remove_at
(i
)
6292 for i
in [0.._n_closure_defs
.length
[ do
6293 if _n_closure_defs
[i
] == old_child
then
6294 if new_child
!= null then
6295 assert new_child
isa AClosureDef
6296 _n_closure_defs
[i
] = new_child
6297 new_child
.parent
= self
6299 _n_closure_defs
.remove_at
(i
)
6306 redef fun visit_all
(v
: Visitor)
6308 v
.enter_visit
(_n_id
)
6312 for n
in _n_closure_defs
do
6317 redef class AVarExpr
6318 private init empty_init
do end
6320 init init_avarexpr
(
6325 _n_id
= n_id
.as(not null)
6329 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6331 if _n_id
== old_child
then
6332 if new_child
!= null then
6333 new_child
.parent
= self
6334 assert new_child
isa TId
6343 redef fun visit_all
(v
: Visitor)
6345 v
.enter_visit
(_n_id
)
6348 redef class AVarAssignExpr
6349 private init empty_init
do end
6351 init init_avarassignexpr
(
6353 n_assign
: nullable TAssign,
6354 n_value
: nullable AExpr
6358 _n_id
= n_id
.as(not null)
6360 _n_assign
= n_assign
.as(not null)
6361 n_assign
.parent
= self
6362 _n_value
= n_value
.as(not null)
6363 n_value
.parent
= self
6366 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6368 if _n_id
== old_child
then
6369 if new_child
!= null then
6370 new_child
.parent
= self
6371 assert new_child
isa TId
6378 if _n_assign
== old_child
then
6379 if new_child
!= null then
6380 new_child
.parent
= self
6381 assert new_child
isa TAssign
6382 _n_assign
= new_child
6388 if _n_value
== old_child
then
6389 if new_child
!= null then
6390 new_child
.parent
= self
6391 assert new_child
isa AExpr
6392 _n_value
= new_child
6400 redef fun visit_all
(v
: Visitor)
6402 v
.enter_visit
(_n_id
)
6403 v
.enter_visit
(_n_assign
)
6404 v
.enter_visit
(_n_value
)
6407 redef class AVarReassignExpr
6408 private init empty_init
do end
6410 init init_avarreassignexpr
(
6412 n_assign_op
: nullable AAssignOp,
6413 n_value
: nullable AExpr
6417 _n_id
= n_id
.as(not null)
6419 _n_assign_op
= n_assign_op
.as(not null)
6420 n_assign_op
.parent
= self
6421 _n_value
= n_value
.as(not null)
6422 n_value
.parent
= self
6425 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6427 if _n_id
== old_child
then
6428 if new_child
!= null then
6429 new_child
.parent
= self
6430 assert new_child
isa TId
6437 if _n_assign_op
== old_child
then
6438 if new_child
!= null then
6439 new_child
.parent
= self
6440 assert new_child
isa AAssignOp
6441 _n_assign_op
= new_child
6447 if _n_value
== old_child
then
6448 if new_child
!= null then
6449 new_child
.parent
= self
6450 assert new_child
isa AExpr
6451 _n_value
= new_child
6459 redef fun visit_all
(v
: Visitor)
6461 v
.enter_visit
(_n_id
)
6462 v
.enter_visit
(_n_assign_op
)
6463 v
.enter_visit
(_n_value
)
6466 redef class ARangeExpr
6467 private init empty_init
do end
6469 init init_arangeexpr
(
6470 n_expr
: nullable AExpr,
6471 n_expr2
: nullable AExpr
6475 _n_expr
= n_expr
.as(not null)
6476 n_expr
.parent
= self
6477 _n_expr2
= n_expr2
.as(not null)
6478 n_expr2
.parent
= self
6481 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6483 if _n_expr
== old_child
then
6484 if new_child
!= null then
6485 new_child
.parent
= self
6486 assert new_child
isa AExpr
6493 if _n_expr2
== old_child
then
6494 if new_child
!= null then
6495 new_child
.parent
= self
6496 assert new_child
isa AExpr
6497 _n_expr2
= new_child
6505 redef fun visit_all
(v
: Visitor)
6507 v
.enter_visit
(_n_expr
)
6508 v
.enter_visit
(_n_expr2
)
6511 redef class ACrangeExpr
6512 private init empty_init
do end
6514 init init_acrangeexpr
(
6515 n_obra
: nullable TObra,
6516 n_expr
: nullable AExpr,
6517 n_expr2
: nullable AExpr,
6518 n_cbra
: nullable TCbra
6522 _n_obra
= n_obra
.as(not null)
6523 n_obra
.parent
= self
6524 _n_expr
= n_expr
.as(not null)
6525 n_expr
.parent
= self
6526 _n_expr2
= n_expr2
.as(not null)
6527 n_expr2
.parent
= self
6528 _n_cbra
= n_cbra
.as(not null)
6529 n_cbra
.parent
= self
6532 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6534 if _n_obra
== old_child
then
6535 if new_child
!= null then
6536 new_child
.parent
= self
6537 assert new_child
isa TObra
6544 if _n_expr
== old_child
then
6545 if new_child
!= null then
6546 new_child
.parent
= self
6547 assert new_child
isa AExpr
6554 if _n_expr2
== old_child
then
6555 if new_child
!= null then
6556 new_child
.parent
= self
6557 assert new_child
isa AExpr
6558 _n_expr2
= new_child
6564 if _n_cbra
== old_child
then
6565 if new_child
!= null then
6566 new_child
.parent
= self
6567 assert new_child
isa TCbra
6576 redef fun visit_all
(v
: Visitor)
6578 v
.enter_visit
(_n_obra
)
6579 v
.enter_visit
(_n_expr
)
6580 v
.enter_visit
(_n_expr2
)
6581 v
.enter_visit
(_n_cbra
)
6584 redef class AOrangeExpr
6585 private init empty_init
do end
6587 init init_aorangeexpr
(
6588 n_obra
: nullable TObra,
6589 n_expr
: nullable AExpr,
6590 n_expr2
: nullable AExpr,
6591 n_cbra
: nullable TObra
6595 _n_obra
= n_obra
.as(not null)
6596 n_obra
.parent
= self
6597 _n_expr
= n_expr
.as(not null)
6598 n_expr
.parent
= self
6599 _n_expr2
= n_expr2
.as(not null)
6600 n_expr2
.parent
= self
6601 _n_cbra
= n_cbra
.as(not null)
6602 n_cbra
.parent
= self
6605 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6607 if _n_obra
== old_child
then
6608 if new_child
!= null then
6609 new_child
.parent
= self
6610 assert new_child
isa TObra
6617 if _n_expr
== old_child
then
6618 if new_child
!= null then
6619 new_child
.parent
= self
6620 assert new_child
isa AExpr
6627 if _n_expr2
== old_child
then
6628 if new_child
!= null then
6629 new_child
.parent
= self
6630 assert new_child
isa AExpr
6631 _n_expr2
= new_child
6637 if _n_cbra
== old_child
then
6638 if new_child
!= null then
6639 new_child
.parent
= self
6640 assert new_child
isa TObra
6649 redef fun visit_all
(v
: Visitor)
6651 v
.enter_visit
(_n_obra
)
6652 v
.enter_visit
(_n_expr
)
6653 v
.enter_visit
(_n_expr2
)
6654 v
.enter_visit
(_n_cbra
)
6657 redef class AArrayExpr
6658 private init empty_init
do end
6660 init init_aarrayexpr
(
6661 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6672 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6674 for i
in [0.._n_exprs
.length
[ do
6675 if _n_exprs
[i
] == old_child
then
6676 if new_child
!= null then
6677 assert new_child
isa AExpr
6678 _n_exprs
[i
] = new_child
6679 new_child
.parent
= self
6681 _n_exprs
.remove_at
(i
)
6688 redef fun visit_all
(v
: Visitor)
6690 for n
in _n_exprs
do
6695 redef class ASelfExpr
6696 private init empty_init
do end
6698 init init_aselfexpr
(
6699 n_kwself
: nullable TKwself
6703 _n_kwself
= n_kwself
.as(not null)
6704 n_kwself
.parent
= self
6707 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6709 if _n_kwself
== old_child
then
6710 if new_child
!= null then
6711 new_child
.parent
= self
6712 assert new_child
isa TKwself
6713 _n_kwself
= new_child
6721 redef fun visit_all
(v
: Visitor)
6723 v
.enter_visit
(_n_kwself
)
6726 redef class AImplicitSelfExpr
6727 private init empty_init
do end
6729 init init_aimplicitselfexpr
6734 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6738 redef fun visit_all
(v
: Visitor)
6742 redef class ATrueExpr
6743 private init empty_init
do end
6745 init init_atrueexpr
(
6746 n_kwtrue
: nullable TKwtrue
6750 _n_kwtrue
= n_kwtrue
.as(not null)
6751 n_kwtrue
.parent
= self
6754 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6756 if _n_kwtrue
== old_child
then
6757 if new_child
!= null then
6758 new_child
.parent
= self
6759 assert new_child
isa TKwtrue
6760 _n_kwtrue
= new_child
6768 redef fun visit_all
(v
: Visitor)
6770 v
.enter_visit
(_n_kwtrue
)
6773 redef class AFalseExpr
6774 private init empty_init
do end
6776 init init_afalseexpr
(
6777 n_kwfalse
: nullable TKwfalse
6781 _n_kwfalse
= n_kwfalse
.as(not null)
6782 n_kwfalse
.parent
= self
6785 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6787 if _n_kwfalse
== old_child
then
6788 if new_child
!= null then
6789 new_child
.parent
= self
6790 assert new_child
isa TKwfalse
6791 _n_kwfalse
= new_child
6799 redef fun visit_all
(v
: Visitor)
6801 v
.enter_visit
(_n_kwfalse
)
6804 redef class ANullExpr
6805 private init empty_init
do end
6807 init init_anullexpr
(
6808 n_kwnull
: nullable TKwnull
6812 _n_kwnull
= n_kwnull
.as(not null)
6813 n_kwnull
.parent
= self
6816 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6818 if _n_kwnull
== old_child
then
6819 if new_child
!= null then
6820 new_child
.parent
= self
6821 assert new_child
isa TKwnull
6822 _n_kwnull
= new_child
6830 redef fun visit_all
(v
: Visitor)
6832 v
.enter_visit
(_n_kwnull
)
6835 redef class AIntExpr
6836 private init empty_init
do end
6838 init init_aintexpr
(
6839 n_number
: nullable TNumber
6843 _n_number
= n_number
.as(not null)
6844 n_number
.parent
= self
6847 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6849 if _n_number
== old_child
then
6850 if new_child
!= null then
6851 new_child
.parent
= self
6852 assert new_child
isa TNumber
6853 _n_number
= new_child
6861 redef fun visit_all
(v
: Visitor)
6863 v
.enter_visit
(_n_number
)
6866 redef class AFloatExpr
6867 private init empty_init
do end
6869 init init_afloatexpr
(
6870 n_float
: nullable TFloat
6874 _n_float
= n_float
.as(not null)
6875 n_float
.parent
= self
6878 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6880 if _n_float
== old_child
then
6881 if new_child
!= null then
6882 new_child
.parent
= self
6883 assert new_child
isa TFloat
6884 _n_float
= new_child
6892 redef fun visit_all
(v
: Visitor)
6894 v
.enter_visit
(_n_float
)
6897 redef class ACharExpr
6898 private init empty_init
do end
6900 init init_acharexpr
(
6901 n_char
: nullable TChar
6905 _n_char
= n_char
.as(not null)
6906 n_char
.parent
= self
6909 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6911 if _n_char
== old_child
then
6912 if new_child
!= null then
6913 new_child
.parent
= self
6914 assert new_child
isa TChar
6923 redef fun visit_all
(v
: Visitor)
6925 v
.enter_visit
(_n_char
)
6928 redef class AStringExpr
6929 private init empty_init
do end
6931 init init_astringexpr
(
6932 n_string
: nullable TString
6936 _n_string
= n_string
.as(not null)
6937 n_string
.parent
= self
6940 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6942 if _n_string
== old_child
then
6943 if new_child
!= null then
6944 new_child
.parent
= self
6945 assert new_child
isa TString
6946 _n_string
= new_child
6954 redef fun visit_all
(v
: Visitor)
6956 v
.enter_visit
(_n_string
)
6959 redef class AStartStringExpr
6960 private init empty_init
do end
6962 init init_astartstringexpr
(
6963 n_string
: nullable TStartString
6967 _n_string
= n_string
.as(not null)
6968 n_string
.parent
= self
6971 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6973 if _n_string
== old_child
then
6974 if new_child
!= null then
6975 new_child
.parent
= self
6976 assert new_child
isa TStartString
6977 _n_string
= new_child
6985 redef fun visit_all
(v
: Visitor)
6987 v
.enter_visit
(_n_string
)
6990 redef class AMidStringExpr
6991 private init empty_init
do end
6993 init init_amidstringexpr
(
6994 n_string
: nullable TMidString
6998 _n_string
= n_string
.as(not null)
6999 n_string
.parent
= self
7002 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7004 if _n_string
== old_child
then
7005 if new_child
!= null then
7006 new_child
.parent
= self
7007 assert new_child
isa TMidString
7008 _n_string
= new_child
7016 redef fun visit_all
(v
: Visitor)
7018 v
.enter_visit
(_n_string
)
7021 redef class AEndStringExpr
7022 private init empty_init
do end
7024 init init_aendstringexpr
(
7025 n_string
: nullable TEndString
7029 _n_string
= n_string
.as(not null)
7030 n_string
.parent
= self
7033 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7035 if _n_string
== old_child
then
7036 if new_child
!= null then
7037 new_child
.parent
= self
7038 assert new_child
isa TEndString
7039 _n_string
= new_child
7047 redef fun visit_all
(v
: Visitor)
7049 v
.enter_visit
(_n_string
)
7052 redef class ASuperstringExpr
7053 private init empty_init
do end
7055 init init_asuperstringexpr
(
7056 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7067 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7069 for i
in [0.._n_exprs
.length
[ do
7070 if _n_exprs
[i
] == old_child
then
7071 if new_child
!= null then
7072 assert new_child
isa AExpr
7073 _n_exprs
[i
] = new_child
7074 new_child
.parent
= self
7076 _n_exprs
.remove_at
(i
)
7083 redef fun visit_all
(v
: Visitor)
7085 for n
in _n_exprs
do
7090 redef class AParExpr
7091 private init empty_init
do end
7093 init init_aparexpr
(
7094 n_opar
: nullable TOpar,
7095 n_expr
: nullable AExpr,
7096 n_cpar
: nullable TCpar
7100 _n_opar
= n_opar
.as(not null)
7101 n_opar
.parent
= self
7102 _n_expr
= n_expr
.as(not null)
7103 n_expr
.parent
= self
7104 _n_cpar
= n_cpar
.as(not null)
7105 n_cpar
.parent
= self
7108 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7110 if _n_opar
== old_child
then
7111 if new_child
!= null then
7112 new_child
.parent
= self
7113 assert new_child
isa TOpar
7120 if _n_expr
== old_child
then
7121 if new_child
!= null then
7122 new_child
.parent
= self
7123 assert new_child
isa AExpr
7130 if _n_cpar
== old_child
then
7131 if new_child
!= null then
7132 new_child
.parent
= self
7133 assert new_child
isa TCpar
7142 redef fun visit_all
(v
: Visitor)
7144 v
.enter_visit
(_n_opar
)
7145 v
.enter_visit
(_n_expr
)
7146 v
.enter_visit
(_n_cpar
)
7149 redef class AAsCastExpr
7150 private init empty_init
do end
7152 init init_aascastexpr
(
7153 n_expr
: nullable AExpr,
7154 n_kwas
: nullable TKwas,
7155 n_opar
: nullable TOpar,
7156 n_type
: nullable AType,
7157 n_cpar
: nullable TCpar
7161 _n_expr
= n_expr
.as(not null)
7162 n_expr
.parent
= self
7163 _n_kwas
= n_kwas
.as(not null)
7164 n_kwas
.parent
= self
7165 _n_opar
= n_opar
.as(not null)
7166 n_opar
.parent
= self
7167 _n_type
= n_type
.as(not null)
7168 n_type
.parent
= self
7169 _n_cpar
= n_cpar
.as(not null)
7170 n_cpar
.parent
= self
7173 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7175 if _n_expr
== old_child
then
7176 if new_child
!= null then
7177 new_child
.parent
= self
7178 assert new_child
isa AExpr
7185 if _n_kwas
== old_child
then
7186 if new_child
!= null then
7187 new_child
.parent
= self
7188 assert new_child
isa TKwas
7195 if _n_opar
== old_child
then
7196 if new_child
!= null then
7197 new_child
.parent
= self
7198 assert new_child
isa TOpar
7205 if _n_type
== old_child
then
7206 if new_child
!= null then
7207 new_child
.parent
= self
7208 assert new_child
isa AType
7215 if _n_cpar
== old_child
then
7216 if new_child
!= null then
7217 new_child
.parent
= self
7218 assert new_child
isa TCpar
7227 redef fun visit_all
(v
: Visitor)
7229 v
.enter_visit
(_n_expr
)
7230 v
.enter_visit
(_n_kwas
)
7231 v
.enter_visit
(_n_opar
)
7232 v
.enter_visit
(_n_type
)
7233 v
.enter_visit
(_n_cpar
)
7236 redef class AAsNotnullExpr
7237 private init empty_init
do end
7239 init init_aasnotnullexpr
(
7240 n_expr
: nullable AExpr,
7241 n_kwas
: nullable TKwas,
7242 n_opar
: nullable TOpar,
7243 n_kwnot
: nullable TKwnot,
7244 n_kwnull
: nullable TKwnull,
7245 n_cpar
: nullable TCpar
7249 _n_expr
= n_expr
.as(not null)
7250 n_expr
.parent
= self
7251 _n_kwas
= n_kwas
.as(not null)
7252 n_kwas
.parent
= self
7253 _n_opar
= n_opar
.as(not null)
7254 n_opar
.parent
= self
7255 _n_kwnot
= n_kwnot
.as(not null)
7256 n_kwnot
.parent
= self
7257 _n_kwnull
= n_kwnull
.as(not null)
7258 n_kwnull
.parent
= self
7259 _n_cpar
= n_cpar
.as(not null)
7260 n_cpar
.parent
= self
7263 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7265 if _n_expr
== old_child
then
7266 if new_child
!= null then
7267 new_child
.parent
= self
7268 assert new_child
isa AExpr
7275 if _n_kwas
== old_child
then
7276 if new_child
!= null then
7277 new_child
.parent
= self
7278 assert new_child
isa TKwas
7285 if _n_opar
== old_child
then
7286 if new_child
!= null then
7287 new_child
.parent
= self
7288 assert new_child
isa TOpar
7295 if _n_kwnot
== old_child
then
7296 if new_child
!= null then
7297 new_child
.parent
= self
7298 assert new_child
isa TKwnot
7299 _n_kwnot
= new_child
7305 if _n_kwnull
== old_child
then
7306 if new_child
!= null then
7307 new_child
.parent
= self
7308 assert new_child
isa TKwnull
7309 _n_kwnull
= new_child
7315 if _n_cpar
== old_child
then
7316 if new_child
!= null then
7317 new_child
.parent
= self
7318 assert new_child
isa TCpar
7327 redef fun visit_all
(v
: Visitor)
7329 v
.enter_visit
(_n_expr
)
7330 v
.enter_visit
(_n_kwas
)
7331 v
.enter_visit
(_n_opar
)
7332 v
.enter_visit
(_n_kwnot
)
7333 v
.enter_visit
(_n_kwnull
)
7334 v
.enter_visit
(_n_cpar
)
7337 redef class AIssetAttrExpr
7338 private init empty_init
do end
7340 init init_aissetattrexpr
(
7341 n_kwisset
: nullable TKwisset,
7342 n_expr
: nullable AExpr,
7343 n_id
: nullable TAttrid
7347 _n_kwisset
= n_kwisset
.as(not null)
7348 n_kwisset
.parent
= self
7349 _n_expr
= n_expr
.as(not null)
7350 n_expr
.parent
= self
7351 _n_id
= n_id
.as(not null)
7355 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7357 if _n_kwisset
== old_child
then
7358 if new_child
!= null then
7359 new_child
.parent
= self
7360 assert new_child
isa TKwisset
7361 _n_kwisset
= new_child
7367 if _n_expr
== old_child
then
7368 if new_child
!= null then
7369 new_child
.parent
= self
7370 assert new_child
isa AExpr
7377 if _n_id
== old_child
then
7378 if new_child
!= null then
7379 new_child
.parent
= self
7380 assert new_child
isa TAttrid
7389 redef fun visit_all
(v
: Visitor)
7391 v
.enter_visit
(_n_kwisset
)
7392 v
.enter_visit
(_n_expr
)
7393 v
.enter_visit
(_n_id
)
7396 redef class APlusAssignOp
7397 private init empty_init
do end
7399 init init_aplusassignop
(
7400 n_pluseq
: nullable TPluseq
7404 _n_pluseq
= n_pluseq
.as(not null)
7405 n_pluseq
.parent
= self
7408 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7410 if _n_pluseq
== old_child
then
7411 if new_child
!= null then
7412 new_child
.parent
= self
7413 assert new_child
isa TPluseq
7414 _n_pluseq
= new_child
7422 redef fun visit_all
(v
: Visitor)
7424 v
.enter_visit
(_n_pluseq
)
7427 redef class AMinusAssignOp
7428 private init empty_init
do end
7430 init init_aminusassignop
(
7431 n_minuseq
: nullable TMinuseq
7435 _n_minuseq
= n_minuseq
.as(not null)
7436 n_minuseq
.parent
= self
7439 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7441 if _n_minuseq
== old_child
then
7442 if new_child
!= null then
7443 new_child
.parent
= self
7444 assert new_child
isa TMinuseq
7445 _n_minuseq
= new_child
7453 redef fun visit_all
(v
: Visitor)
7455 v
.enter_visit
(_n_minuseq
)
7458 redef class AClosureDef
7459 private init empty_init
do end
7461 init init_aclosuredef
(
7462 n_bang
: nullable TBang,
7463 n_id
: nullable AClosureId,
7464 n_ids
: Collection[Object], # Should be Collection[TId]
7465 n_kwdo
: nullable TKwdo,
7466 n_expr
: nullable AExpr,
7467 n_label
: nullable ALabel
7471 _n_bang
= n_bang
.as(not null)
7472 n_bang
.parent
= self
7473 _n_id
= n_id
.as(not null)
7481 if n_kwdo
!= null then
7482 n_kwdo
.parent
= self
7485 if n_expr
!= null then
7486 n_expr
.parent
= self
7489 if n_label
!= null then
7490 n_label
.parent
= self
7494 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7496 if _n_bang
== old_child
then
7497 if new_child
!= null then
7498 new_child
.parent
= self
7499 assert new_child
isa TBang
7506 if _n_id
== old_child
then
7507 if new_child
!= null then
7508 new_child
.parent
= self
7509 assert new_child
isa AClosureId
7516 for i
in [0.._n_ids
.length
[ do
7517 if _n_ids
[i
] == old_child
then
7518 if new_child
!= null then
7519 assert new_child
isa TId
7520 _n_ids
[i
] = new_child
7521 new_child
.parent
= self
7528 if _n_kwdo
== old_child
then
7529 if new_child
!= null then
7530 new_child
.parent
= self
7531 assert new_child
isa TKwdo
7538 if _n_expr
== old_child
then
7539 if new_child
!= null then
7540 new_child
.parent
= self
7541 assert new_child
isa AExpr
7548 if _n_label
== old_child
then
7549 if new_child
!= null then
7550 new_child
.parent
= self
7551 assert new_child
isa ALabel
7552 _n_label
= new_child
7560 redef fun visit_all
(v
: Visitor)
7562 v
.enter_visit
(_n_bang
)
7563 v
.enter_visit
(_n_id
)
7567 if _n_kwdo
!= null then
7568 v
.enter_visit
(_n_kwdo
.as(not null))
7570 if _n_expr
!= null then
7571 v
.enter_visit
(_n_expr
.as(not null))
7573 if _n_label
!= null then
7574 v
.enter_visit
(_n_label
.as(not null))
7578 redef class ASimpleClosureId
7579 private init empty_init
do end
7581 init init_asimpleclosureid
(
7586 _n_id
= n_id
.as(not null)
7590 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7592 if _n_id
== old_child
then
7593 if new_child
!= null then
7594 new_child
.parent
= self
7595 assert new_child
isa TId
7604 redef fun visit_all
(v
: Visitor)
7606 v
.enter_visit
(_n_id
)
7609 redef class ABreakClosureId
7610 private init empty_init
do end
7612 init init_abreakclosureid
(
7613 n_kwbreak
: nullable TKwbreak
7617 _n_kwbreak
= n_kwbreak
.as(not null)
7618 n_kwbreak
.parent
= self
7621 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7623 if _n_kwbreak
== old_child
then
7624 if new_child
!= null then
7625 new_child
.parent
= self
7626 assert new_child
isa TKwbreak
7627 _n_kwbreak
= new_child
7635 redef fun visit_all
(v
: Visitor)
7637 v
.enter_visit
(_n_kwbreak
)
7640 redef class AModuleName
7641 private init empty_init
do end
7643 init init_amodulename
(
7644 n_quad
: nullable TQuad,
7645 n_path
: Collection[Object], # Should be Collection[TId]
7651 if n_quad
!= null then
7652 n_quad
.parent
= self
7659 _n_id
= n_id
.as(not null)
7663 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7665 if _n_quad
== old_child
then
7666 if new_child
!= null then
7667 new_child
.parent
= self
7668 assert new_child
isa TQuad
7675 for i
in [0.._n_path
.length
[ do
7676 if _n_path
[i
] == old_child
then
7677 if new_child
!= null then
7678 assert new_child
isa TId
7679 _n_path
[i
] = new_child
7680 new_child
.parent
= self
7682 _n_path
.remove_at
(i
)
7687 if _n_id
== old_child
then
7688 if new_child
!= null then
7689 new_child
.parent
= self
7690 assert new_child
isa TId
7699 redef fun visit_all
(v
: Visitor)
7701 if _n_quad
!= null then
7702 v
.enter_visit
(_n_quad
.as(not null))
7707 v
.enter_visit
(_n_id
)
7710 redef class AExternCalls
7711 private init empty_init
do end
7713 init init_aexterncalls
(
7714 n_kwimport
: nullable TKwimport,
7715 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7719 _n_kwimport
= n_kwimport
.as(not null)
7720 n_kwimport
.parent
= self
7721 for n
in n_extern_calls
do
7722 assert n
isa AExternCall
7723 _n_extern_calls
.add
(n
)
7728 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7730 if _n_kwimport
== old_child
then
7731 if new_child
!= null then
7732 new_child
.parent
= self
7733 assert new_child
isa TKwimport
7734 _n_kwimport
= new_child
7740 for i
in [0.._n_extern_calls
.length
[ do
7741 if _n_extern_calls
[i
] == old_child
then
7742 if new_child
!= null then
7743 assert new_child
isa AExternCall
7744 _n_extern_calls
[i
] = new_child
7745 new_child
.parent
= self
7747 _n_extern_calls
.remove_at
(i
)
7754 redef fun visit_all
(v
: Visitor)
7756 v
.enter_visit
(_n_kwimport
)
7757 for n
in _n_extern_calls
do
7762 redef class AExternCall
7763 private init empty_init
do end
7765 init init_aexterncall
7770 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7774 redef fun visit_all
(v
: Visitor)
7778 redef class ASuperExternCall
7779 private init empty_init
do end
7781 init init_asuperexterncall
(
7782 n_kwsuper
: nullable TKwsuper
7786 _n_kwsuper
= n_kwsuper
.as(not null)
7787 n_kwsuper
.parent
= self
7790 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7792 if _n_kwsuper
== old_child
then
7793 if new_child
!= null then
7794 new_child
.parent
= self
7795 assert new_child
isa TKwsuper
7796 _n_kwsuper
= new_child
7804 redef fun visit_all
(v
: Visitor)
7806 v
.enter_visit
(_n_kwsuper
)
7809 redef class ALocalPropExternCall
7810 private init empty_init
do end
7812 init init_alocalpropexterncall
(
7813 n_methid
: nullable AMethid
7817 _n_methid
= n_methid
.as(not null)
7818 n_methid
.parent
= self
7821 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7823 if _n_methid
== old_child
then
7824 if new_child
!= null then
7825 new_child
.parent
= self
7826 assert new_child
isa AMethid
7827 _n_methid
= new_child
7835 redef fun visit_all
(v
: Visitor)
7837 v
.enter_visit
(_n_methid
)
7840 redef class AFullPropExternCall
7841 private init empty_init
do end
7843 init init_afullpropexterncall
(
7844 n_classid
: nullable TClassid,
7845 n_quad
: nullable TQuad,
7846 n_methid
: nullable AMethid
7850 _n_classid
= n_classid
.as(not null)
7851 n_classid
.parent
= self
7853 if n_quad
!= null then
7854 n_quad
.parent
= self
7856 _n_methid
= n_methid
.as(not null)
7857 n_methid
.parent
= self
7860 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7862 if _n_classid
== old_child
then
7863 if new_child
!= null then
7864 new_child
.parent
= self
7865 assert new_child
isa TClassid
7866 _n_classid
= new_child
7872 if _n_quad
== old_child
then
7873 if new_child
!= null then
7874 new_child
.parent
= self
7875 assert new_child
isa TQuad
7882 if _n_methid
== old_child
then
7883 if new_child
!= null then
7884 new_child
.parent
= self
7885 assert new_child
isa AMethid
7886 _n_methid
= new_child
7894 redef fun visit_all
(v
: Visitor)
7896 v
.enter_visit
(_n_classid
)
7897 if _n_quad
!= null then
7898 v
.enter_visit
(_n_quad
.as(not null))
7900 v
.enter_visit
(_n_methid
)
7903 redef class AInitPropExternCall
7904 private init empty_init
do end
7906 init init_ainitpropexterncall
(
7907 n_classid
: nullable TClassid
7911 _n_classid
= n_classid
.as(not null)
7912 n_classid
.parent
= self
7915 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7917 if _n_classid
== old_child
then
7918 if new_child
!= null then
7919 new_child
.parent
= self
7920 assert new_child
isa TClassid
7921 _n_classid
= new_child
7929 redef fun visit_all
(v
: Visitor)
7931 v
.enter_visit
(_n_classid
)
7934 redef class ACastAsExternCall
7935 private init empty_init
do end
7937 init init_acastasexterncall
(
7938 n_from_type
: nullable AType,
7939 n_kwas
: nullable TKwas,
7940 n_to_type
: nullable AType
7944 _n_from_type
= n_from_type
.as(not null)
7945 n_from_type
.parent
= self
7946 _n_kwas
= n_kwas
.as(not null)
7947 n_kwas
.parent
= self
7948 _n_to_type
= n_to_type
.as(not null)
7949 n_to_type
.parent
= self
7952 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7954 if _n_from_type
== old_child
then
7955 if new_child
!= null then
7956 new_child
.parent
= self
7957 assert new_child
isa AType
7958 _n_from_type
= new_child
7964 if _n_kwas
== old_child
then
7965 if new_child
!= null then
7966 new_child
.parent
= self
7967 assert new_child
isa TKwas
7974 if _n_to_type
== old_child
then
7975 if new_child
!= null then
7976 new_child
.parent
= self
7977 assert new_child
isa AType
7978 _n_to_type
= new_child
7986 redef fun visit_all
(v
: Visitor)
7988 v
.enter_visit
(_n_from_type
)
7989 v
.enter_visit
(_n_kwas
)
7990 v
.enter_visit
(_n_to_type
)
7993 redef class AAsNullableExternCall
7994 private init empty_init
do end
7996 init init_aasnullableexterncall
(
7997 n_type
: nullable AType,
7998 n_kwas
: nullable TKwas,
7999 n_kwnullable
: nullable TKwnullable
8003 _n_type
= n_type
.as(not null)
8004 n_type
.parent
= self
8005 _n_kwas
= n_kwas
.as(not null)
8006 n_kwas
.parent
= self
8007 _n_kwnullable
= n_kwnullable
.as(not null)
8008 n_kwnullable
.parent
= self
8011 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8013 if _n_type
== old_child
then
8014 if new_child
!= null then
8015 new_child
.parent
= self
8016 assert new_child
isa AType
8023 if _n_kwas
== old_child
then
8024 if new_child
!= null then
8025 new_child
.parent
= self
8026 assert new_child
isa TKwas
8033 if _n_kwnullable
== old_child
then
8034 if new_child
!= null then
8035 new_child
.parent
= self
8036 assert new_child
isa TKwnullable
8037 _n_kwnullable
= new_child
8045 redef fun visit_all
(v
: Visitor)
8047 v
.enter_visit
(_n_type
)
8048 v
.enter_visit
(_n_kwas
)
8049 v
.enter_visit
(_n_kwnullable
)
8052 redef class AAsNotNullableExternCall
8053 private init empty_init
do end
8055 init init_aasnotnullableexterncall
(
8056 n_type
: nullable AType,
8057 n_kwas
: nullable TKwas,
8058 n_kwnot
: nullable TKwnot,
8059 n_kwnullable
: nullable TKwnullable
8063 _n_type
= n_type
.as(not null)
8064 n_type
.parent
= self
8065 _n_kwas
= n_kwas
.as(not null)
8066 n_kwas
.parent
= self
8067 _n_kwnot
= n_kwnot
.as(not null)
8068 n_kwnot
.parent
= self
8069 _n_kwnullable
= n_kwnullable
.as(not null)
8070 n_kwnullable
.parent
= self
8073 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8075 if _n_type
== old_child
then
8076 if new_child
!= null then
8077 new_child
.parent
= self
8078 assert new_child
isa AType
8085 if _n_kwas
== old_child
then
8086 if new_child
!= null then
8087 new_child
.parent
= self
8088 assert new_child
isa TKwas
8095 if _n_kwnot
== old_child
then
8096 if new_child
!= null then
8097 new_child
.parent
= self
8098 assert new_child
isa TKwnot
8099 _n_kwnot
= new_child
8105 if _n_kwnullable
== old_child
then
8106 if new_child
!= null then
8107 new_child
.parent
= self
8108 assert new_child
isa TKwnullable
8109 _n_kwnullable
= new_child
8117 redef fun visit_all
(v
: Visitor)
8119 v
.enter_visit
(_n_type
)
8120 v
.enter_visit
(_n_kwas
)
8121 v
.enter_visit
(_n_kwnot
)
8122 v
.enter_visit
(_n_kwnullable
)
8125 redef class AQualified
8126 private init empty_init
do end
8128 init init_aqualified
(
8129 n_id
: Collection[Object], # Should be Collection[TId]
8130 n_classid
: nullable TClassid
8139 _n_classid
= n_classid
8140 if n_classid
!= null then
8141 n_classid
.parent
= self
8145 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8147 for i
in [0.._n_id
.length
[ do
8148 if _n_id
[i
] == old_child
then
8149 if new_child
!= null then
8150 assert new_child
isa TId
8151 _n_id
[i
] = new_child
8152 new_child
.parent
= self
8159 if _n_classid
== old_child
then
8160 if new_child
!= null then
8161 new_child
.parent
= self
8162 assert new_child
isa TClassid
8163 _n_classid
= new_child
8171 redef fun visit_all
(v
: Visitor)
8176 if _n_classid
!= null then
8177 v
.enter_visit
(_n_classid
.as(not null))
8182 private init empty_init
do end
8185 n_comment
: Collection[Object] # Should be Collection[TComment]
8189 for n
in n_comment
do
8190 assert n
isa TComment
8196 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8198 for i
in [0.._n_comment
.length
[ do
8199 if _n_comment
[i
] == old_child
then
8200 if new_child
!= null then
8201 assert new_child
isa TComment
8202 _n_comment
[i
] = new_child
8203 new_child
.parent
= self
8205 _n_comment
.remove_at
(i
)
8212 redef fun visit_all
(v
: Visitor)
8214 for n
in _n_comment
do
8222 n_base
: nullable AModule,
8229 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8231 if _n_base
== old_child
then
8232 if new_child
== null then
8234 new_child
.parent
= self
8235 assert new_child
isa AModule
8238 old_child
.parent
= null
8243 redef fun visit_all
(v
: Visitor)
8245 if _n_base
!= null then
8246 v
.enter_visit
(_n_base
.as(not null))
8248 v
.enter_visit
(_n_eof
)