1 # Production AST nodes full definition.
2 # This file was generated by SableCC (http://www.sablecc.org/).
6 intrude import parser_nodes
9 # Parent of the node in the AST
10 readable writable var _parent
: nullable PNode
12 # Remove a child from the AST
13 fun remove_child
(child
: PNode)
15 replace_child
(child
, null)
18 # Replace a child with an other node in the AST
19 fun replace_child
(old_child
: PNode, new_child
: nullable PNode) is abstract
21 # Replace itself with an other node in the AST
22 fun replace_with
(node
: PNode)
24 if (_parent
!= null) then
25 _parent
.replace_child
(self, node
)
29 # Visit all nodes in order.
30 # Thus, call "v.visit(e)" for each node e
31 fun visit_all
(v
: Visitor) is abstract
33 # Visit all nodes in reverse order.
34 # Thus, call "v.visit(e)" for each node e starting from the last child
35 fun visit_all_reverse
(v
: Visitor) is abstract
37 # Give a human readable location of the node.
40 if location
== null then
46 # Debug method: output a message prefixed with the location.
47 fun printl
(str
: String)
49 print
("{locate}: {str}\n")
54 redef fun visit_all
(v
: Visitor) do end
55 redef fun visit_all_reverse
(v
: Visitor) do end
56 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode) do end
60 # The first token of the production node
61 readable writable var _first_token
: nullable Token
63 # The last token of the production node
64 readable writable var _last_token
: nullable Token
66 redef fun replace_with
(n
: PNode)
70 n
.first_token
= first_token
71 n
.last_token
= last_token
76 # Abstract standard visitor
78 # Ask the visitor to visit a given node.
79 # Usually automatically called by visit_all* methods.
80 # Concrete visitors should redefine this method.
81 fun visit
(e
: nullable PNode) is abstract
85 redef fun n_packagedecl
=(n
)
93 private init empty_init
do end
96 n_packagedecl
: nullable PPackagedecl ,
97 n_imports
: Collection[Object] , # Should be Collection[PImport]
98 n_classdefs
: Collection[Object] # Should be Collection[PClassdef]
102 _n_packagedecl
= n_packagedecl
103 if n_packagedecl
!= null then
104 n_packagedecl
.parent
= self
106 for n
in n_imports
do
111 for n
in n_classdefs
do
112 assert n
isa PClassdef
118 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
120 if _n_packagedecl
== old_child
then
121 if new_child
!= null then
122 new_child
.parent
= self
123 assert new_child
isa PPackagedecl
124 _n_packagedecl
= new_child
126 _n_packagedecl
= null
130 for i
in [0.._n_imports
.length
[ do
131 if _n_imports
[i
] == old_child
then
132 if new_child
!= null then
133 assert new_child
isa PImport
134 _n_imports
[i
] = new_child
135 new_child
.parent
= self
137 _n_imports
.remove_at
(i
)
142 for i
in [0.._n_classdefs
.length
[ do
143 if _n_classdefs
[i
] == old_child
then
144 if new_child
!= null then
145 assert new_child
isa PClassdef
146 _n_classdefs
[i
] = new_child
147 new_child
.parent
= self
149 _n_classdefs
.remove_at
(i
)
156 redef fun visit_all
(v
: Visitor)
158 if _n_packagedecl
!= null then
159 v
.visit
(_n_packagedecl
.as(not null))
161 for n
in _n_imports
do
164 for n
in _n_classdefs
do
169 redef fun visit_all_reverse
(v
: Visitor)
171 if _n_packagedecl
!= null then
172 v
.visit
(_n_packagedecl
.as(not null))
175 var i
= _n_imports
.length
177 v
.visit
(_n_imports
[i
])
182 var i
= _n_classdefs
.length
184 v
.visit
(_n_classdefs
[i
])
190 redef class APackagedecl
198 redef fun n_kwpackage
=(n
)
209 private init empty_init
do end
211 init init_apackagedecl
(
212 n_doc
: nullable PDoc ,
213 n_kwpackage
: nullable TKwpackage ,
219 if n_doc
!= null then
222 _n_kwpackage
= n_kwpackage
.as(not null)
223 n_kwpackage
.parent
= self
224 _n_id
= n_id
.as(not null)
228 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
230 if _n_doc
== old_child
then
231 if new_child
!= null then
232 new_child
.parent
= self
233 assert new_child
isa PDoc
240 if _n_kwpackage
== old_child
then
241 if new_child
!= null then
242 new_child
.parent
= self
243 assert new_child
isa TKwpackage
244 _n_kwpackage
= new_child
250 if _n_id
== old_child
then
251 if new_child
!= null then
252 new_child
.parent
= self
253 assert new_child
isa TId
262 redef fun visit_all
(v
: Visitor)
264 if _n_doc
!= null then
265 v
.visit
(_n_doc
.as(not null))
267 v
.visit
(_n_kwpackage
)
271 redef fun visit_all_reverse
(v
: Visitor)
273 if _n_doc
!= null then
274 v
.visit
(_n_doc
.as(not null))
276 v
.visit
(_n_kwpackage
)
281 redef fun n_visibility
=(n
)
286 redef fun n_kwimport
=(n
)
297 private init empty_init
do end
300 n_visibility
: nullable PVisibility ,
301 n_kwimport
: nullable TKwimport ,
306 _n_visibility
= n_visibility
.as(not null)
307 n_visibility
.parent
= self
308 _n_kwimport
= n_kwimport
.as(not null)
309 n_kwimport
.parent
= self
310 _n_id
= n_id
.as(not null)
314 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
316 if _n_visibility
== old_child
then
317 if new_child
!= null then
318 new_child
.parent
= self
319 assert new_child
isa PVisibility
320 _n_visibility
= new_child
326 if _n_kwimport
== old_child
then
327 if new_child
!= null then
328 new_child
.parent
= self
329 assert new_child
isa TKwimport
330 _n_kwimport
= new_child
336 if _n_id
== old_child
then
337 if new_child
!= null then
338 new_child
.parent
= self
339 assert new_child
isa TId
348 redef fun visit_all
(v
: Visitor)
350 v
.visit
(_n_visibility
)
355 redef fun visit_all_reverse
(v
: Visitor)
357 v
.visit
(_n_visibility
)
362 redef class ANoImport
363 redef fun n_visibility
=(n
)
368 redef fun n_kwimport
=(n
)
373 redef fun n_kwend
=(n
)
379 private init empty_init
do end
381 init init_anoimport
(
382 n_visibility
: nullable PVisibility ,
383 n_kwimport
: nullable TKwimport ,
384 n_kwend
: nullable TKwend
388 _n_visibility
= n_visibility
.as(not null)
389 n_visibility
.parent
= self
390 _n_kwimport
= n_kwimport
.as(not null)
391 n_kwimport
.parent
= self
392 _n_kwend
= n_kwend
.as(not null)
393 n_kwend
.parent
= self
396 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
398 if _n_visibility
== old_child
then
399 if new_child
!= null then
400 new_child
.parent
= self
401 assert new_child
isa PVisibility
402 _n_visibility
= new_child
408 if _n_kwimport
== old_child
then
409 if new_child
!= null then
410 new_child
.parent
= self
411 assert new_child
isa TKwimport
412 _n_kwimport
= new_child
418 if _n_kwend
== old_child
then
419 if new_child
!= null then
420 new_child
.parent
= self
421 assert new_child
isa TKwend
430 redef fun visit_all
(v
: Visitor)
432 v
.visit
(_n_visibility
)
437 redef fun visit_all_reverse
(v
: Visitor)
439 v
.visit
(_n_visibility
)
444 redef class APublicVisibility
446 private init empty_init
do end
448 init init_apublicvisibility
453 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
457 redef fun visit_all
(v
: Visitor)
461 redef fun visit_all_reverse
(v
: Visitor)
465 redef class APrivateVisibility
466 redef fun n_kwprivate
=(n
)
472 private init empty_init
do end
474 init init_aprivatevisibility
(
475 n_kwprivate
: nullable TKwprivate
479 _n_kwprivate
= n_kwprivate
.as(not null)
480 n_kwprivate
.parent
= self
483 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
485 if _n_kwprivate
== old_child
then
486 if new_child
!= null then
487 new_child
.parent
= self
488 assert new_child
isa TKwprivate
489 _n_kwprivate
= new_child
497 redef fun visit_all
(v
: Visitor)
499 v
.visit
(_n_kwprivate
)
502 redef fun visit_all_reverse
(v
: Visitor)
504 v
.visit
(_n_kwprivate
)
507 redef class AProtectedVisibility
508 redef fun n_kwprotected
=(n
)
514 private init empty_init
do end
516 init init_aprotectedvisibility
(
517 n_kwprotected
: nullable TKwprotected
521 _n_kwprotected
= n_kwprotected
.as(not null)
522 n_kwprotected
.parent
= self
525 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
527 if _n_kwprotected
== old_child
then
528 if new_child
!= null then
529 new_child
.parent
= self
530 assert new_child
isa TKwprotected
531 _n_kwprotected
= new_child
539 redef fun visit_all
(v
: Visitor)
541 v
.visit
(_n_kwprotected
)
544 redef fun visit_all_reverse
(v
: Visitor)
546 v
.visit
(_n_kwprotected
)
549 redef class AIntrudeVisibility
550 redef fun n_kwintrude
=(n
)
556 private init empty_init
do end
558 init init_aintrudevisibility
(
559 n_kwintrude
: nullable TKwintrude
563 _n_kwintrude
= n_kwintrude
.as(not null)
564 n_kwintrude
.parent
= self
567 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
569 if _n_kwintrude
== old_child
then
570 if new_child
!= null then
571 new_child
.parent
= self
572 assert new_child
isa TKwintrude
573 _n_kwintrude
= new_child
581 redef fun visit_all
(v
: Visitor)
583 v
.visit
(_n_kwintrude
)
586 redef fun visit_all_reverse
(v
: Visitor)
588 v
.visit
(_n_kwintrude
)
591 redef class AClassdef
599 redef fun n_kwredef
=(n
)
606 redef fun n_visibility
=(n
)
611 redef fun n_classkind
=(n
)
624 private init empty_init
do end
626 init init_aclassdef
(
627 n_doc
: nullable PDoc ,
628 n_kwredef
: nullable TKwredef ,
629 n_visibility
: nullable PVisibility ,
630 n_classkind
: nullable PClasskind ,
631 n_id
: nullable TClassid ,
632 n_formaldefs
: Collection[Object] , # Should be Collection[PFormaldef]
633 n_superclasses
: Collection[Object] , # Should be Collection[PSuperclass]
634 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
639 if n_doc
!= null then
642 _n_kwredef
= n_kwredef
643 if n_kwredef
!= null then
644 n_kwredef
.parent
= self
646 _n_visibility
= n_visibility
.as(not null)
647 n_visibility
.parent
= self
648 _n_classkind
= n_classkind
.as(not null)
649 n_classkind
.parent
= self
654 for n
in n_formaldefs
do
655 assert n
isa PFormaldef
659 for n
in n_superclasses
do
660 assert n
isa PSuperclass
661 _n_superclasses
.add
(n
)
664 for n
in n_propdefs
do
665 assert n
isa PPropdef
671 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
673 if _n_doc
== old_child
then
674 if new_child
!= null then
675 new_child
.parent
= self
676 assert new_child
isa PDoc
683 if _n_kwredef
== old_child
then
684 if new_child
!= null then
685 new_child
.parent
= self
686 assert new_child
isa TKwredef
687 _n_kwredef
= new_child
693 if _n_visibility
== old_child
then
694 if new_child
!= null then
695 new_child
.parent
= self
696 assert new_child
isa PVisibility
697 _n_visibility
= new_child
703 if _n_classkind
== old_child
then
704 if new_child
!= null then
705 new_child
.parent
= self
706 assert new_child
isa PClasskind
707 _n_classkind
= new_child
713 if _n_id
== old_child
then
714 if new_child
!= null then
715 new_child
.parent
= self
716 assert new_child
isa TClassid
723 for i
in [0.._n_formaldefs
.length
[ do
724 if _n_formaldefs
[i
] == old_child
then
725 if new_child
!= null then
726 assert new_child
isa PFormaldef
727 _n_formaldefs
[i
] = new_child
728 new_child
.parent
= self
730 _n_formaldefs
.remove_at
(i
)
735 for i
in [0.._n_superclasses
.length
[ do
736 if _n_superclasses
[i
] == old_child
then
737 if new_child
!= null then
738 assert new_child
isa PSuperclass
739 _n_superclasses
[i
] = new_child
740 new_child
.parent
= self
742 _n_superclasses
.remove_at
(i
)
747 for i
in [0.._n_propdefs
.length
[ do
748 if _n_propdefs
[i
] == old_child
then
749 if new_child
!= null then
750 assert new_child
isa PPropdef
751 _n_propdefs
[i
] = new_child
752 new_child
.parent
= self
754 _n_propdefs
.remove_at
(i
)
761 redef fun visit_all
(v
: Visitor)
763 if _n_doc
!= null then
764 v
.visit
(_n_doc
.as(not null))
766 if _n_kwredef
!= null then
767 v
.visit
(_n_kwredef
.as(not null))
769 v
.visit
(_n_visibility
)
770 v
.visit
(_n_classkind
)
771 if _n_id
!= null then
772 v
.visit
(_n_id
.as(not null))
774 for n
in _n_formaldefs
do
777 for n
in _n_superclasses
do
780 for n
in _n_propdefs
do
785 redef fun visit_all_reverse
(v
: Visitor)
787 if _n_doc
!= null then
788 v
.visit
(_n_doc
.as(not null))
790 if _n_kwredef
!= null then
791 v
.visit
(_n_kwredef
.as(not null))
793 v
.visit
(_n_visibility
)
794 v
.visit
(_n_classkind
)
795 if _n_id
!= null then
796 v
.visit
(_n_id
.as(not null))
799 var i
= _n_formaldefs
.length
801 v
.visit
(_n_formaldefs
[i
])
806 var i
= _n_superclasses
.length
808 v
.visit
(_n_superclasses
[i
])
813 var i
= _n_propdefs
.length
815 v
.visit
(_n_propdefs
[i
])
821 redef class ATopClassdef
823 private init empty_init
do end
825 init init_atopclassdef
(
826 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
830 for n
in n_propdefs
do
831 assert n
isa PPropdef
837 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
839 for i
in [0.._n_propdefs
.length
[ do
840 if _n_propdefs
[i
] == old_child
then
841 if new_child
!= null then
842 assert new_child
isa PPropdef
843 _n_propdefs
[i
] = new_child
844 new_child
.parent
= self
846 _n_propdefs
.remove_at
(i
)
853 redef fun visit_all
(v
: Visitor)
855 for n
in _n_propdefs
do
860 redef fun visit_all_reverse
(v
: Visitor)
863 var i
= _n_propdefs
.length
865 v
.visit
(_n_propdefs
[i
])
871 redef class AMainClassdef
873 private init empty_init
do end
875 init init_amainclassdef
(
876 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
880 for n
in n_propdefs
do
881 assert n
isa PPropdef
887 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
889 for i
in [0.._n_propdefs
.length
[ do
890 if _n_propdefs
[i
] == old_child
then
891 if new_child
!= null then
892 assert new_child
isa PPropdef
893 _n_propdefs
[i
] = new_child
894 new_child
.parent
= self
896 _n_propdefs
.remove_at
(i
)
903 redef fun visit_all
(v
: Visitor)
905 for n
in _n_propdefs
do
910 redef fun visit_all_reverse
(v
: Visitor)
913 var i
= _n_propdefs
.length
915 v
.visit
(_n_propdefs
[i
])
921 redef class AConcreteClasskind
922 redef fun n_kwclass
=(n
)
928 private init empty_init
do end
930 init init_aconcreteclasskind
(
931 n_kwclass
: nullable TKwclass
935 _n_kwclass
= n_kwclass
.as(not null)
936 n_kwclass
.parent
= self
939 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
941 if _n_kwclass
== old_child
then
942 if new_child
!= null then
943 new_child
.parent
= self
944 assert new_child
isa TKwclass
945 _n_kwclass
= new_child
953 redef fun visit_all
(v
: Visitor)
958 redef fun visit_all_reverse
(v
: Visitor)
963 redef class AAbstractClasskind
964 redef fun n_kwabstract
=(n
)
969 redef fun n_kwclass
=(n
)
975 private init empty_init
do end
977 init init_aabstractclasskind
(
978 n_kwabstract
: nullable TKwabstract ,
979 n_kwclass
: nullable TKwclass
983 _n_kwabstract
= n_kwabstract
.as(not null)
984 n_kwabstract
.parent
= self
985 _n_kwclass
= n_kwclass
.as(not null)
986 n_kwclass
.parent
= self
989 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
991 if _n_kwabstract
== old_child
then
992 if new_child
!= null then
993 new_child
.parent
= self
994 assert new_child
isa TKwabstract
995 _n_kwabstract
= new_child
1001 if _n_kwclass
== old_child
then
1002 if new_child
!= null then
1003 new_child
.parent
= self
1004 assert new_child
isa TKwclass
1005 _n_kwclass
= new_child
1013 redef fun visit_all
(v
: Visitor)
1015 v
.visit
(_n_kwabstract
)
1019 redef fun visit_all_reverse
(v
: Visitor)
1021 v
.visit
(_n_kwabstract
)
1025 redef class AInterfaceClasskind
1026 redef fun n_kwinterface
=(n
)
1032 private init empty_init
do end
1034 init init_ainterfaceclasskind
(
1035 n_kwinterface
: nullable TKwinterface
1039 _n_kwinterface
= n_kwinterface
.as(not null)
1040 n_kwinterface
.parent
= self
1043 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1045 if _n_kwinterface
== old_child
then
1046 if new_child
!= null then
1047 new_child
.parent
= self
1048 assert new_child
isa TKwinterface
1049 _n_kwinterface
= new_child
1057 redef fun visit_all
(v
: Visitor)
1059 v
.visit
(_n_kwinterface
)
1062 redef fun visit_all_reverse
(v
: Visitor)
1064 v
.visit
(_n_kwinterface
)
1067 redef class AUniversalClasskind
1068 redef fun n_kwuniversal
=(n
)
1074 private init empty_init
do end
1076 init init_auniversalclasskind
(
1077 n_kwuniversal
: nullable TKwuniversal
1081 _n_kwuniversal
= n_kwuniversal
.as(not null)
1082 n_kwuniversal
.parent
= self
1085 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1087 if _n_kwuniversal
== old_child
then
1088 if new_child
!= null then
1089 new_child
.parent
= self
1090 assert new_child
isa TKwuniversal
1091 _n_kwuniversal
= new_child
1099 redef fun visit_all
(v
: Visitor)
1101 v
.visit
(_n_kwuniversal
)
1104 redef fun visit_all_reverse
(v
: Visitor)
1106 v
.visit
(_n_kwuniversal
)
1109 redef class AFormaldef
1115 redef fun n_type
=(n
)
1123 private init empty_init
do end
1125 init init_aformaldef
(
1126 n_id
: nullable TClassid ,
1127 n_type
: nullable PType
1131 _n_id
= n_id
.as(not null)
1134 if n_type
!= null then
1135 n_type
.parent
= self
1139 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1141 if _n_id
== old_child
then
1142 if new_child
!= null then
1143 new_child
.parent
= self
1144 assert new_child
isa TClassid
1151 if _n_type
== old_child
then
1152 if new_child
!= null then
1153 new_child
.parent
= self
1154 assert new_child
isa PType
1163 redef fun visit_all
(v
: Visitor)
1166 if _n_type
!= null then
1167 v
.visit
(_n_type
.as(not null))
1171 redef fun visit_all_reverse
(v
: Visitor)
1174 if _n_type
!= null then
1175 v
.visit
(_n_type
.as(not null))
1179 redef class ASuperclass
1180 redef fun n_kwspecial
=(n
)
1185 redef fun n_type
=(n
)
1191 private init empty_init
do end
1193 init init_asuperclass
(
1194 n_kwspecial
: nullable TKwspecial ,
1195 n_type
: nullable PType
1199 _n_kwspecial
= n_kwspecial
.as(not null)
1200 n_kwspecial
.parent
= self
1201 _n_type
= n_type
.as(not null)
1202 n_type
.parent
= self
1205 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1207 if _n_kwspecial
== old_child
then
1208 if new_child
!= null then
1209 new_child
.parent
= self
1210 assert new_child
isa TKwspecial
1211 _n_kwspecial
= new_child
1217 if _n_type
== old_child
then
1218 if new_child
!= null then
1219 new_child
.parent
= self
1220 assert new_child
isa PType
1229 redef fun visit_all
(v
: Visitor)
1231 v
.visit
(_n_kwspecial
)
1235 redef fun visit_all_reverse
(v
: Visitor)
1237 v
.visit
(_n_kwspecial
)
1241 redef class AAttrPropdef
1249 redef fun n_readable
=(n
)
1256 redef fun n_writable
=(n
)
1263 redef fun n_kwredef
=(n
)
1270 redef fun n_visibility
=(n
)
1275 redef fun n_kwattr
=(n
)
1282 redef fun n_kwvar
=(n
)
1294 redef fun n_type
=(n
)
1301 redef fun n_expr
=(n
)
1309 private init empty_init
do end
1311 init init_aattrpropdef
(
1312 n_doc
: nullable PDoc ,
1313 n_readable
: nullable PAble ,
1314 n_writable
: nullable PAble ,
1315 n_kwredef
: nullable TKwredef ,
1316 n_visibility
: nullable PVisibility ,
1317 n_kwattr
: nullable TKwattr ,
1318 n_kwvar
: nullable TKwvar ,
1319 n_id
: nullable TAttrid ,
1320 n_type
: nullable PType ,
1321 n_expr
: nullable PExpr
1326 if n_doc
!= null then
1329 _n_readable
= n_readable
1330 if n_readable
!= null then
1331 n_readable
.parent
= self
1333 _n_writable
= n_writable
1334 if n_writable
!= null then
1335 n_writable
.parent
= self
1337 _n_kwredef
= n_kwredef
1338 if n_kwredef
!= null then
1339 n_kwredef
.parent
= self
1341 _n_visibility
= n_visibility
.as(not null)
1342 n_visibility
.parent
= self
1343 _n_kwattr
= n_kwattr
1344 if n_kwattr
!= null then
1345 n_kwattr
.parent
= self
1348 if n_kwvar
!= null then
1349 n_kwvar
.parent
= self
1351 _n_id
= n_id
.as(not null)
1354 if n_type
!= null then
1355 n_type
.parent
= self
1358 if n_expr
!= null then
1359 n_expr
.parent
= self
1363 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1365 if _n_doc
== old_child
then
1366 if new_child
!= null then
1367 new_child
.parent
= self
1368 assert new_child
isa PDoc
1375 if _n_readable
== old_child
then
1376 if new_child
!= null then
1377 new_child
.parent
= self
1378 assert new_child
isa PAble
1379 _n_readable
= new_child
1385 if _n_writable
== old_child
then
1386 if new_child
!= null then
1387 new_child
.parent
= self
1388 assert new_child
isa PAble
1389 _n_writable
= new_child
1395 if _n_kwredef
== old_child
then
1396 if new_child
!= null then
1397 new_child
.parent
= self
1398 assert new_child
isa TKwredef
1399 _n_kwredef
= new_child
1405 if _n_visibility
== old_child
then
1406 if new_child
!= null then
1407 new_child
.parent
= self
1408 assert new_child
isa PVisibility
1409 _n_visibility
= new_child
1415 if _n_kwattr
== old_child
then
1416 if new_child
!= null then
1417 new_child
.parent
= self
1418 assert new_child
isa TKwattr
1419 _n_kwattr
= new_child
1425 if _n_kwvar
== old_child
then
1426 if new_child
!= null then
1427 new_child
.parent
= self
1428 assert new_child
isa TKwvar
1429 _n_kwvar
= new_child
1435 if _n_id
== old_child
then
1436 if new_child
!= null then
1437 new_child
.parent
= self
1438 assert new_child
isa TAttrid
1445 if _n_type
== old_child
then
1446 if new_child
!= null then
1447 new_child
.parent
= self
1448 assert new_child
isa PType
1455 if _n_expr
== old_child
then
1456 if new_child
!= null then
1457 new_child
.parent
= self
1458 assert new_child
isa PExpr
1467 redef fun visit_all
(v
: Visitor)
1469 if _n_doc
!= null then
1470 v
.visit
(_n_doc
.as(not null))
1472 if _n_readable
!= null then
1473 v
.visit
(_n_readable
.as(not null))
1475 if _n_writable
!= null then
1476 v
.visit
(_n_writable
.as(not null))
1478 if _n_kwredef
!= null then
1479 v
.visit
(_n_kwredef
.as(not null))
1481 v
.visit
(_n_visibility
)
1482 if _n_kwattr
!= null then
1483 v
.visit
(_n_kwattr
.as(not null))
1485 if _n_kwvar
!= null then
1486 v
.visit
(_n_kwvar
.as(not null))
1489 if _n_type
!= null then
1490 v
.visit
(_n_type
.as(not null))
1492 if _n_expr
!= null then
1493 v
.visit
(_n_expr
.as(not null))
1497 redef fun visit_all_reverse
(v
: Visitor)
1499 if _n_doc
!= null then
1500 v
.visit
(_n_doc
.as(not null))
1502 if _n_readable
!= null then
1503 v
.visit
(_n_readable
.as(not null))
1505 if _n_writable
!= null then
1506 v
.visit
(_n_writable
.as(not null))
1508 if _n_kwredef
!= null then
1509 v
.visit
(_n_kwredef
.as(not null))
1511 v
.visit
(_n_visibility
)
1512 if _n_kwattr
!= null then
1513 v
.visit
(_n_kwattr
.as(not null))
1515 if _n_kwvar
!= null then
1516 v
.visit
(_n_kwvar
.as(not null))
1519 if _n_type
!= null then
1520 v
.visit
(_n_type
.as(not null))
1522 if _n_expr
!= null then
1523 v
.visit
(_n_expr
.as(not null))
1527 redef class AMethPropdef
1535 redef fun n_kwredef
=(n
)
1542 redef fun n_visibility
=(n
)
1547 redef fun n_methid
=(n
)
1552 redef fun n_signature
=(n
)
1558 private init empty_init
do end
1560 init init_amethpropdef
(
1561 n_doc
: nullable PDoc ,
1562 n_kwredef
: nullable TKwredef ,
1563 n_visibility
: nullable PVisibility ,
1564 n_methid
: nullable PMethid ,
1565 n_signature
: nullable PSignature
1570 if n_doc
!= null then
1573 _n_kwredef
= n_kwredef
1574 if n_kwredef
!= null then
1575 n_kwredef
.parent
= self
1577 _n_visibility
= n_visibility
.as(not null)
1578 n_visibility
.parent
= self
1579 _n_methid
= n_methid
.as(not null)
1580 n_methid
.parent
= self
1581 _n_signature
= n_signature
.as(not null)
1582 n_signature
.parent
= self
1585 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1587 if _n_doc
== old_child
then
1588 if new_child
!= null then
1589 new_child
.parent
= self
1590 assert new_child
isa PDoc
1597 if _n_kwredef
== old_child
then
1598 if new_child
!= null then
1599 new_child
.parent
= self
1600 assert new_child
isa TKwredef
1601 _n_kwredef
= new_child
1607 if _n_visibility
== old_child
then
1608 if new_child
!= null then
1609 new_child
.parent
= self
1610 assert new_child
isa PVisibility
1611 _n_visibility
= new_child
1617 if _n_methid
== old_child
then
1618 if new_child
!= null then
1619 new_child
.parent
= self
1620 assert new_child
isa PMethid
1621 _n_methid
= new_child
1627 if _n_signature
== old_child
then
1628 if new_child
!= null then
1629 new_child
.parent
= self
1630 assert new_child
isa PSignature
1631 _n_signature
= new_child
1639 redef fun visit_all
(v
: Visitor)
1641 if _n_doc
!= null then
1642 v
.visit
(_n_doc
.as(not null))
1644 if _n_kwredef
!= null then
1645 v
.visit
(_n_kwredef
.as(not null))
1647 v
.visit
(_n_visibility
)
1649 v
.visit
(_n_signature
)
1652 redef fun visit_all_reverse
(v
: Visitor)
1654 if _n_doc
!= null then
1655 v
.visit
(_n_doc
.as(not null))
1657 if _n_kwredef
!= null then
1658 v
.visit
(_n_kwredef
.as(not null))
1660 v
.visit
(_n_visibility
)
1662 v
.visit
(_n_signature
)
1665 redef class ADeferredMethPropdef
1673 redef fun n_kwredef
=(n
)
1680 redef fun n_visibility
=(n
)
1685 redef fun n_kwmeth
=(n
)
1690 redef fun n_methid
=(n
)
1695 redef fun n_signature
=(n
)
1701 private init empty_init
do end
1703 init init_adeferredmethpropdef
(
1704 n_doc
: nullable PDoc ,
1705 n_kwredef
: nullable TKwredef ,
1706 n_visibility
: nullable PVisibility ,
1707 n_kwmeth
: nullable TKwmeth ,
1708 n_methid
: nullable PMethid ,
1709 n_signature
: nullable PSignature
1714 if n_doc
!= null then
1717 _n_kwredef
= n_kwredef
1718 if n_kwredef
!= null then
1719 n_kwredef
.parent
= self
1721 _n_visibility
= n_visibility
.as(not null)
1722 n_visibility
.parent
= self
1723 _n_kwmeth
= n_kwmeth
.as(not null)
1724 n_kwmeth
.parent
= self
1725 _n_methid
= n_methid
.as(not null)
1726 n_methid
.parent
= self
1727 _n_signature
= n_signature
.as(not null)
1728 n_signature
.parent
= self
1731 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1733 if _n_doc
== old_child
then
1734 if new_child
!= null then
1735 new_child
.parent
= self
1736 assert new_child
isa PDoc
1743 if _n_kwredef
== old_child
then
1744 if new_child
!= null then
1745 new_child
.parent
= self
1746 assert new_child
isa TKwredef
1747 _n_kwredef
= new_child
1753 if _n_visibility
== old_child
then
1754 if new_child
!= null then
1755 new_child
.parent
= self
1756 assert new_child
isa PVisibility
1757 _n_visibility
= new_child
1763 if _n_kwmeth
== old_child
then
1764 if new_child
!= null then
1765 new_child
.parent
= self
1766 assert new_child
isa TKwmeth
1767 _n_kwmeth
= new_child
1773 if _n_methid
== old_child
then
1774 if new_child
!= null then
1775 new_child
.parent
= self
1776 assert new_child
isa PMethid
1777 _n_methid
= new_child
1783 if _n_signature
== old_child
then
1784 if new_child
!= null then
1785 new_child
.parent
= self
1786 assert new_child
isa PSignature
1787 _n_signature
= new_child
1795 redef fun visit_all
(v
: Visitor)
1797 if _n_doc
!= null then
1798 v
.visit
(_n_doc
.as(not null))
1800 if _n_kwredef
!= null then
1801 v
.visit
(_n_kwredef
.as(not null))
1803 v
.visit
(_n_visibility
)
1806 v
.visit
(_n_signature
)
1809 redef fun visit_all_reverse
(v
: Visitor)
1811 if _n_doc
!= null then
1812 v
.visit
(_n_doc
.as(not null))
1814 if _n_kwredef
!= null then
1815 v
.visit
(_n_kwredef
.as(not null))
1817 v
.visit
(_n_visibility
)
1820 v
.visit
(_n_signature
)
1823 redef class AInternMethPropdef
1831 redef fun n_kwredef
=(n
)
1838 redef fun n_visibility
=(n
)
1843 redef fun n_kwmeth
=(n
)
1848 redef fun n_methid
=(n
)
1853 redef fun n_signature
=(n
)
1859 private init empty_init
do end
1861 init init_ainternmethpropdef
(
1862 n_doc
: nullable PDoc ,
1863 n_kwredef
: nullable TKwredef ,
1864 n_visibility
: nullable PVisibility ,
1865 n_kwmeth
: nullable TKwmeth ,
1866 n_methid
: nullable PMethid ,
1867 n_signature
: nullable PSignature
1872 if n_doc
!= null then
1875 _n_kwredef
= n_kwredef
1876 if n_kwredef
!= null then
1877 n_kwredef
.parent
= self
1879 _n_visibility
= n_visibility
.as(not null)
1880 n_visibility
.parent
= self
1881 _n_kwmeth
= n_kwmeth
.as(not null)
1882 n_kwmeth
.parent
= self
1883 _n_methid
= n_methid
.as(not null)
1884 n_methid
.parent
= self
1885 _n_signature
= n_signature
.as(not null)
1886 n_signature
.parent
= self
1889 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1891 if _n_doc
== old_child
then
1892 if new_child
!= null then
1893 new_child
.parent
= self
1894 assert new_child
isa PDoc
1901 if _n_kwredef
== old_child
then
1902 if new_child
!= null then
1903 new_child
.parent
= self
1904 assert new_child
isa TKwredef
1905 _n_kwredef
= new_child
1911 if _n_visibility
== old_child
then
1912 if new_child
!= null then
1913 new_child
.parent
= self
1914 assert new_child
isa PVisibility
1915 _n_visibility
= new_child
1921 if _n_kwmeth
== old_child
then
1922 if new_child
!= null then
1923 new_child
.parent
= self
1924 assert new_child
isa TKwmeth
1925 _n_kwmeth
= new_child
1931 if _n_methid
== old_child
then
1932 if new_child
!= null then
1933 new_child
.parent
= self
1934 assert new_child
isa PMethid
1935 _n_methid
= new_child
1941 if _n_signature
== old_child
then
1942 if new_child
!= null then
1943 new_child
.parent
= self
1944 assert new_child
isa PSignature
1945 _n_signature
= new_child
1953 redef fun visit_all
(v
: Visitor)
1955 if _n_doc
!= null then
1956 v
.visit
(_n_doc
.as(not null))
1958 if _n_kwredef
!= null then
1959 v
.visit
(_n_kwredef
.as(not null))
1961 v
.visit
(_n_visibility
)
1964 v
.visit
(_n_signature
)
1967 redef fun visit_all_reverse
(v
: Visitor)
1969 if _n_doc
!= null then
1970 v
.visit
(_n_doc
.as(not null))
1972 if _n_kwredef
!= null then
1973 v
.visit
(_n_kwredef
.as(not null))
1975 v
.visit
(_n_visibility
)
1978 v
.visit
(_n_signature
)
1981 redef class AExternMethPropdef
1989 redef fun n_kwredef
=(n
)
1996 redef fun n_visibility
=(n
)
2001 redef fun n_kwmeth
=(n
)
2006 redef fun n_methid
=(n
)
2011 redef fun n_signature
=(n
)
2016 redef fun n_extern
=(n
)
2024 private init empty_init
do end
2026 init init_aexternmethpropdef
(
2027 n_doc
: nullable PDoc ,
2028 n_kwredef
: nullable TKwredef ,
2029 n_visibility
: nullable PVisibility ,
2030 n_kwmeth
: nullable TKwmeth ,
2031 n_methid
: nullable PMethid ,
2032 n_signature
: nullable PSignature ,
2033 n_extern
: nullable TString
2038 if n_doc
!= null then
2041 _n_kwredef
= n_kwredef
2042 if n_kwredef
!= null then
2043 n_kwredef
.parent
= self
2045 _n_visibility
= n_visibility
.as(not null)
2046 n_visibility
.parent
= self
2047 _n_kwmeth
= n_kwmeth
.as(not null)
2048 n_kwmeth
.parent
= self
2049 _n_methid
= n_methid
.as(not null)
2050 n_methid
.parent
= self
2051 _n_signature
= n_signature
.as(not null)
2052 n_signature
.parent
= self
2053 _n_extern
= n_extern
2054 if n_extern
!= null then
2055 n_extern
.parent
= self
2059 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2061 if _n_doc
== old_child
then
2062 if new_child
!= null then
2063 new_child
.parent
= self
2064 assert new_child
isa PDoc
2071 if _n_kwredef
== old_child
then
2072 if new_child
!= null then
2073 new_child
.parent
= self
2074 assert new_child
isa TKwredef
2075 _n_kwredef
= new_child
2081 if _n_visibility
== old_child
then
2082 if new_child
!= null then
2083 new_child
.parent
= self
2084 assert new_child
isa PVisibility
2085 _n_visibility
= new_child
2091 if _n_kwmeth
== old_child
then
2092 if new_child
!= null then
2093 new_child
.parent
= self
2094 assert new_child
isa TKwmeth
2095 _n_kwmeth
= new_child
2101 if _n_methid
== old_child
then
2102 if new_child
!= null then
2103 new_child
.parent
= self
2104 assert new_child
isa PMethid
2105 _n_methid
= new_child
2111 if _n_signature
== old_child
then
2112 if new_child
!= null then
2113 new_child
.parent
= self
2114 assert new_child
isa PSignature
2115 _n_signature
= new_child
2121 if _n_extern
== old_child
then
2122 if new_child
!= null then
2123 new_child
.parent
= self
2124 assert new_child
isa TString
2125 _n_extern
= new_child
2133 redef fun visit_all
(v
: Visitor)
2135 if _n_doc
!= null then
2136 v
.visit
(_n_doc
.as(not null))
2138 if _n_kwredef
!= null then
2139 v
.visit
(_n_kwredef
.as(not null))
2141 v
.visit
(_n_visibility
)
2144 v
.visit
(_n_signature
)
2145 if _n_extern
!= null then
2146 v
.visit
(_n_extern
.as(not null))
2150 redef fun visit_all_reverse
(v
: Visitor)
2152 if _n_doc
!= null then
2153 v
.visit
(_n_doc
.as(not null))
2155 if _n_kwredef
!= null then
2156 v
.visit
(_n_kwredef
.as(not null))
2158 v
.visit
(_n_visibility
)
2161 v
.visit
(_n_signature
)
2162 if _n_extern
!= null then
2163 v
.visit
(_n_extern
.as(not null))
2167 redef class AConcreteMethPropdef
2175 redef fun n_kwredef
=(n
)
2182 redef fun n_visibility
=(n
)
2187 redef fun n_kwmeth
=(n
)
2192 redef fun n_methid
=(n
)
2197 redef fun n_signature
=(n
)
2202 redef fun n_block
=(n
)
2210 private init empty_init
do end
2212 init init_aconcretemethpropdef
(
2213 n_doc
: nullable PDoc ,
2214 n_kwredef
: nullable TKwredef ,
2215 n_visibility
: nullable PVisibility ,
2216 n_kwmeth
: nullable TKwmeth ,
2217 n_methid
: nullable PMethid ,
2218 n_signature
: nullable PSignature ,
2219 n_block
: nullable PExpr
2224 if n_doc
!= null then
2227 _n_kwredef
= n_kwredef
2228 if n_kwredef
!= null then
2229 n_kwredef
.parent
= self
2231 _n_visibility
= n_visibility
.as(not null)
2232 n_visibility
.parent
= self
2233 _n_kwmeth
= n_kwmeth
.as(not null)
2234 n_kwmeth
.parent
= self
2235 _n_methid
= n_methid
.as(not null)
2236 n_methid
.parent
= self
2237 _n_signature
= n_signature
.as(not null)
2238 n_signature
.parent
= self
2240 if n_block
!= null then
2241 n_block
.parent
= self
2245 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2247 if _n_doc
== old_child
then
2248 if new_child
!= null then
2249 new_child
.parent
= self
2250 assert new_child
isa PDoc
2257 if _n_kwredef
== old_child
then
2258 if new_child
!= null then
2259 new_child
.parent
= self
2260 assert new_child
isa TKwredef
2261 _n_kwredef
= new_child
2267 if _n_visibility
== old_child
then
2268 if new_child
!= null then
2269 new_child
.parent
= self
2270 assert new_child
isa PVisibility
2271 _n_visibility
= new_child
2277 if _n_kwmeth
== old_child
then
2278 if new_child
!= null then
2279 new_child
.parent
= self
2280 assert new_child
isa TKwmeth
2281 _n_kwmeth
= new_child
2287 if _n_methid
== old_child
then
2288 if new_child
!= null then
2289 new_child
.parent
= self
2290 assert new_child
isa PMethid
2291 _n_methid
= new_child
2297 if _n_signature
== old_child
then
2298 if new_child
!= null then
2299 new_child
.parent
= self
2300 assert new_child
isa PSignature
2301 _n_signature
= new_child
2307 if _n_block
== old_child
then
2308 if new_child
!= null then
2309 new_child
.parent
= self
2310 assert new_child
isa PExpr
2311 _n_block
= new_child
2319 redef fun visit_all
(v
: Visitor)
2321 if _n_doc
!= null then
2322 v
.visit
(_n_doc
.as(not null))
2324 if _n_kwredef
!= null then
2325 v
.visit
(_n_kwredef
.as(not null))
2327 v
.visit
(_n_visibility
)
2330 v
.visit
(_n_signature
)
2331 if _n_block
!= null then
2332 v
.visit
(_n_block
.as(not null))
2336 redef fun visit_all_reverse
(v
: Visitor)
2338 if _n_doc
!= null then
2339 v
.visit
(_n_doc
.as(not null))
2341 if _n_kwredef
!= null then
2342 v
.visit
(_n_kwredef
.as(not null))
2344 v
.visit
(_n_visibility
)
2347 v
.visit
(_n_signature
)
2348 if _n_block
!= null then
2349 v
.visit
(_n_block
.as(not null))
2353 redef class AConcreteInitPropdef
2361 redef fun n_kwredef
=(n
)
2368 redef fun n_visibility
=(n
)
2373 redef fun n_kwinit
=(n
)
2378 redef fun n_methid
=(n
)
2385 redef fun n_signature
=(n
)
2390 redef fun n_block
=(n
)
2398 private init empty_init
do end
2400 init init_aconcreteinitpropdef
(
2401 n_doc
: nullable PDoc ,
2402 n_kwredef
: nullable TKwredef ,
2403 n_visibility
: nullable PVisibility ,
2404 n_kwinit
: nullable TKwinit ,
2405 n_methid
: nullable PMethid ,
2406 n_signature
: nullable PSignature ,
2407 n_block
: nullable PExpr
2412 if n_doc
!= null then
2415 _n_kwredef
= n_kwredef
2416 if n_kwredef
!= null then
2417 n_kwredef
.parent
= self
2419 _n_visibility
= n_visibility
.as(not null)
2420 n_visibility
.parent
= self
2421 _n_kwinit
= n_kwinit
.as(not null)
2422 n_kwinit
.parent
= self
2423 _n_methid
= n_methid
2424 if n_methid
!= null then
2425 n_methid
.parent
= self
2427 _n_signature
= n_signature
.as(not null)
2428 n_signature
.parent
= self
2430 if n_block
!= null then
2431 n_block
.parent
= self
2435 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2437 if _n_doc
== old_child
then
2438 if new_child
!= null then
2439 new_child
.parent
= self
2440 assert new_child
isa PDoc
2447 if _n_kwredef
== old_child
then
2448 if new_child
!= null then
2449 new_child
.parent
= self
2450 assert new_child
isa TKwredef
2451 _n_kwredef
= new_child
2457 if _n_visibility
== old_child
then
2458 if new_child
!= null then
2459 new_child
.parent
= self
2460 assert new_child
isa PVisibility
2461 _n_visibility
= new_child
2467 if _n_kwinit
== old_child
then
2468 if new_child
!= null then
2469 new_child
.parent
= self
2470 assert new_child
isa TKwinit
2471 _n_kwinit
= new_child
2477 if _n_methid
== old_child
then
2478 if new_child
!= null then
2479 new_child
.parent
= self
2480 assert new_child
isa PMethid
2481 _n_methid
= new_child
2487 if _n_signature
== old_child
then
2488 if new_child
!= null then
2489 new_child
.parent
= self
2490 assert new_child
isa PSignature
2491 _n_signature
= new_child
2497 if _n_block
== old_child
then
2498 if new_child
!= null then
2499 new_child
.parent
= self
2500 assert new_child
isa PExpr
2501 _n_block
= new_child
2509 redef fun visit_all
(v
: Visitor)
2511 if _n_doc
!= null then
2512 v
.visit
(_n_doc
.as(not null))
2514 if _n_kwredef
!= null then
2515 v
.visit
(_n_kwredef
.as(not null))
2517 v
.visit
(_n_visibility
)
2519 if _n_methid
!= null then
2520 v
.visit
(_n_methid
.as(not null))
2522 v
.visit
(_n_signature
)
2523 if _n_block
!= null then
2524 v
.visit
(_n_block
.as(not null))
2528 redef fun visit_all_reverse
(v
: Visitor)
2530 if _n_doc
!= null then
2531 v
.visit
(_n_doc
.as(not null))
2533 if _n_kwredef
!= null then
2534 v
.visit
(_n_kwredef
.as(not null))
2536 v
.visit
(_n_visibility
)
2538 if _n_methid
!= null then
2539 v
.visit
(_n_methid
.as(not null))
2541 v
.visit
(_n_signature
)
2542 if _n_block
!= null then
2543 v
.visit
(_n_block
.as(not null))
2547 redef class AMainMethPropdef
2548 redef fun n_kwredef
=(n
)
2555 redef fun n_block
=(n
)
2563 private init empty_init
do end
2565 init init_amainmethpropdef
(
2566 n_kwredef
: nullable TKwredef ,
2567 n_block
: nullable PExpr
2571 _n_kwredef
= n_kwredef
2572 if n_kwredef
!= null then
2573 n_kwredef
.parent
= self
2576 if n_block
!= null then
2577 n_block
.parent
= self
2581 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2583 if _n_kwredef
== old_child
then
2584 if new_child
!= null then
2585 new_child
.parent
= self
2586 assert new_child
isa TKwredef
2587 _n_kwredef
= new_child
2593 if _n_block
== old_child
then
2594 if new_child
!= null then
2595 new_child
.parent
= self
2596 assert new_child
isa PExpr
2597 _n_block
= new_child
2605 redef fun visit_all
(v
: Visitor)
2607 if _n_kwredef
!= null then
2608 v
.visit
(_n_kwredef
.as(not null))
2610 if _n_block
!= null then
2611 v
.visit
(_n_block
.as(not null))
2615 redef fun visit_all_reverse
(v
: Visitor)
2617 if _n_kwredef
!= null then
2618 v
.visit
(_n_kwredef
.as(not null))
2620 if _n_block
!= null then
2621 v
.visit
(_n_block
.as(not null))
2625 redef class ATypePropdef
2633 redef fun n_kwredef
=(n
)
2640 redef fun n_visibility
=(n
)
2645 redef fun n_kwtype
=(n
)
2655 redef fun n_type
=(n
)
2661 private init empty_init
do end
2663 init init_atypepropdef
(
2664 n_doc
: nullable PDoc ,
2665 n_kwredef
: nullable TKwredef ,
2666 n_visibility
: nullable PVisibility ,
2667 n_kwtype
: nullable TKwtype ,
2668 n_id
: nullable TClassid ,
2669 n_type
: nullable PType
2674 if n_doc
!= null then
2677 _n_kwredef
= n_kwredef
2678 if n_kwredef
!= null then
2679 n_kwredef
.parent
= self
2681 _n_visibility
= n_visibility
.as(not null)
2682 n_visibility
.parent
= self
2683 _n_kwtype
= n_kwtype
.as(not null)
2684 n_kwtype
.parent
= self
2685 _n_id
= n_id
.as(not null)
2687 _n_type
= n_type
.as(not null)
2688 n_type
.parent
= self
2691 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2693 if _n_doc
== old_child
then
2694 if new_child
!= null then
2695 new_child
.parent
= self
2696 assert new_child
isa PDoc
2703 if _n_kwredef
== old_child
then
2704 if new_child
!= null then
2705 new_child
.parent
= self
2706 assert new_child
isa TKwredef
2707 _n_kwredef
= new_child
2713 if _n_visibility
== old_child
then
2714 if new_child
!= null then
2715 new_child
.parent
= self
2716 assert new_child
isa PVisibility
2717 _n_visibility
= new_child
2723 if _n_kwtype
== old_child
then
2724 if new_child
!= null then
2725 new_child
.parent
= self
2726 assert new_child
isa TKwtype
2727 _n_kwtype
= new_child
2733 if _n_id
== old_child
then
2734 if new_child
!= null then
2735 new_child
.parent
= self
2736 assert new_child
isa TClassid
2743 if _n_type
== old_child
then
2744 if new_child
!= null then
2745 new_child
.parent
= self
2746 assert new_child
isa PType
2755 redef fun visit_all
(v
: Visitor)
2757 if _n_doc
!= null then
2758 v
.visit
(_n_doc
.as(not null))
2760 if _n_kwredef
!= null then
2761 v
.visit
(_n_kwredef
.as(not null))
2763 v
.visit
(_n_visibility
)
2769 redef fun visit_all_reverse
(v
: Visitor)
2771 if _n_doc
!= null then
2772 v
.visit
(_n_doc
.as(not null))
2774 if _n_kwredef
!= null then
2775 v
.visit
(_n_kwredef
.as(not null))
2777 v
.visit
(_n_visibility
)
2783 redef class AReadAble
2784 redef fun n_kwredef
=(n
)
2791 redef fun n_kwreadable
=(n
)
2797 private init empty_init
do end
2799 init init_areadable
(
2800 n_kwredef
: nullable TKwredef ,
2801 n_kwreadable
: nullable TKwreadable
2805 _n_kwredef
= n_kwredef
2806 if n_kwredef
!= null then
2807 n_kwredef
.parent
= self
2809 _n_kwreadable
= n_kwreadable
.as(not null)
2810 n_kwreadable
.parent
= self
2813 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2815 if _n_kwredef
== old_child
then
2816 if new_child
!= null then
2817 new_child
.parent
= self
2818 assert new_child
isa TKwredef
2819 _n_kwredef
= new_child
2825 if _n_kwreadable
== old_child
then
2826 if new_child
!= null then
2827 new_child
.parent
= self
2828 assert new_child
isa TKwreadable
2829 _n_kwreadable
= new_child
2837 redef fun visit_all
(v
: Visitor)
2839 if _n_kwredef
!= null then
2840 v
.visit
(_n_kwredef
.as(not null))
2842 v
.visit
(_n_kwreadable
)
2845 redef fun visit_all_reverse
(v
: Visitor)
2847 if _n_kwredef
!= null then
2848 v
.visit
(_n_kwredef
.as(not null))
2850 v
.visit
(_n_kwreadable
)
2853 redef class AWriteAble
2854 redef fun n_kwredef
=(n
)
2861 redef fun n_kwwritable
=(n
)
2867 private init empty_init
do end
2869 init init_awriteable
(
2870 n_kwredef
: nullable TKwredef ,
2871 n_kwwritable
: nullable TKwwritable
2875 _n_kwredef
= n_kwredef
2876 if n_kwredef
!= null then
2877 n_kwredef
.parent
= self
2879 _n_kwwritable
= n_kwwritable
.as(not null)
2880 n_kwwritable
.parent
= self
2883 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2885 if _n_kwredef
== old_child
then
2886 if new_child
!= null then
2887 new_child
.parent
= self
2888 assert new_child
isa TKwredef
2889 _n_kwredef
= new_child
2895 if _n_kwwritable
== old_child
then
2896 if new_child
!= null then
2897 new_child
.parent
= self
2898 assert new_child
isa TKwwritable
2899 _n_kwwritable
= new_child
2907 redef fun visit_all
(v
: Visitor)
2909 if _n_kwredef
!= null then
2910 v
.visit
(_n_kwredef
.as(not null))
2912 v
.visit
(_n_kwwritable
)
2915 redef fun visit_all_reverse
(v
: Visitor)
2917 if _n_kwredef
!= null then
2918 v
.visit
(_n_kwredef
.as(not null))
2920 v
.visit
(_n_kwwritable
)
2923 redef class AIdMethid
2930 private init empty_init
do end
2932 init init_aidmethid
(
2937 _n_id
= n_id
.as(not null)
2941 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2943 if _n_id
== old_child
then
2944 if new_child
!= null then
2945 new_child
.parent
= self
2946 assert new_child
isa TId
2955 redef fun visit_all
(v
: Visitor)
2960 redef fun visit_all_reverse
(v
: Visitor)
2965 redef class APlusMethid
2966 redef fun n_plus
=(n
)
2972 private init empty_init
do end
2974 init init_aplusmethid
(
2975 n_plus
: nullable TPlus
2979 _n_plus
= n_plus
.as(not null)
2980 n_plus
.parent
= self
2983 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2985 if _n_plus
== old_child
then
2986 if new_child
!= null then
2987 new_child
.parent
= self
2988 assert new_child
isa TPlus
2997 redef fun visit_all
(v
: Visitor)
3002 redef fun visit_all_reverse
(v
: Visitor)
3007 redef class AMinusMethid
3008 redef fun n_minus
=(n
)
3014 private init empty_init
do end
3016 init init_aminusmethid
(
3017 n_minus
: nullable TMinus
3021 _n_minus
= n_minus
.as(not null)
3022 n_minus
.parent
= self
3025 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3027 if _n_minus
== old_child
then
3028 if new_child
!= null then
3029 new_child
.parent
= self
3030 assert new_child
isa TMinus
3031 _n_minus
= new_child
3039 redef fun visit_all
(v
: Visitor)
3044 redef fun visit_all_reverse
(v
: Visitor)
3049 redef class AStarMethid
3050 redef fun n_star
=(n
)
3056 private init empty_init
do end
3058 init init_astarmethid
(
3059 n_star
: nullable TStar
3063 _n_star
= n_star
.as(not null)
3064 n_star
.parent
= self
3067 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3069 if _n_star
== old_child
then
3070 if new_child
!= null then
3071 new_child
.parent
= self
3072 assert new_child
isa TStar
3081 redef fun visit_all
(v
: Visitor)
3086 redef fun visit_all_reverse
(v
: Visitor)
3091 redef class ASlashMethid
3092 redef fun n_slash
=(n
)
3098 private init empty_init
do end
3100 init init_aslashmethid
(
3101 n_slash
: nullable TSlash
3105 _n_slash
= n_slash
.as(not null)
3106 n_slash
.parent
= self
3109 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3111 if _n_slash
== old_child
then
3112 if new_child
!= null then
3113 new_child
.parent
= self
3114 assert new_child
isa TSlash
3115 _n_slash
= new_child
3123 redef fun visit_all
(v
: Visitor)
3128 redef fun visit_all_reverse
(v
: Visitor)
3133 redef class APercentMethid
3134 redef fun n_percent
=(n
)
3140 private init empty_init
do end
3142 init init_apercentmethid
(
3143 n_percent
: nullable TPercent
3147 _n_percent
= n_percent
.as(not null)
3148 n_percent
.parent
= self
3151 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3153 if _n_percent
== old_child
then
3154 if new_child
!= null then
3155 new_child
.parent
= self
3156 assert new_child
isa TPercent
3157 _n_percent
= new_child
3165 redef fun visit_all
(v
: Visitor)
3170 redef fun visit_all_reverse
(v
: Visitor)
3175 redef class AEqMethid
3182 private init empty_init
do end
3184 init init_aeqmethid
(
3189 _n_eq
= n_eq
.as(not null)
3193 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3195 if _n_eq
== old_child
then
3196 if new_child
!= null then
3197 new_child
.parent
= self
3198 assert new_child
isa TEq
3207 redef fun visit_all
(v
: Visitor)
3212 redef fun visit_all_reverse
(v
: Visitor)
3217 redef class ANeMethid
3224 private init empty_init
do end
3226 init init_anemethid
(
3231 _n_ne
= n_ne
.as(not null)
3235 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3237 if _n_ne
== old_child
then
3238 if new_child
!= null then
3239 new_child
.parent
= self
3240 assert new_child
isa TNe
3249 redef fun visit_all
(v
: Visitor)
3254 redef fun visit_all_reverse
(v
: Visitor)
3259 redef class ALeMethid
3266 private init empty_init
do end
3268 init init_alemethid
(
3273 _n_le
= n_le
.as(not null)
3277 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3279 if _n_le
== old_child
then
3280 if new_child
!= null then
3281 new_child
.parent
= self
3282 assert new_child
isa TLe
3291 redef fun visit_all
(v
: Visitor)
3296 redef fun visit_all_reverse
(v
: Visitor)
3301 redef class AGeMethid
3308 private init empty_init
do end
3310 init init_agemethid
(
3315 _n_ge
= n_ge
.as(not null)
3319 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3321 if _n_ge
== old_child
then
3322 if new_child
!= null then
3323 new_child
.parent
= self
3324 assert new_child
isa TGe
3333 redef fun visit_all
(v
: Visitor)
3338 redef fun visit_all_reverse
(v
: Visitor)
3343 redef class ALtMethid
3350 private init empty_init
do end
3352 init init_altmethid
(
3357 _n_lt
= n_lt
.as(not null)
3361 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3363 if _n_lt
== old_child
then
3364 if new_child
!= null then
3365 new_child
.parent
= self
3366 assert new_child
isa TLt
3375 redef fun visit_all
(v
: Visitor)
3380 redef fun visit_all_reverse
(v
: Visitor)
3385 redef class AGtMethid
3392 private init empty_init
do end
3394 init init_agtmethid
(
3399 _n_gt
= n_gt
.as(not null)
3403 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3405 if _n_gt
== old_child
then
3406 if new_child
!= null then
3407 new_child
.parent
= self
3408 assert new_child
isa TGt
3417 redef fun visit_all
(v
: Visitor)
3422 redef fun visit_all_reverse
(v
: Visitor)
3427 redef class ABraMethid
3428 redef fun n_obra
=(n
)
3433 redef fun n_cbra
=(n
)
3439 private init empty_init
do end
3441 init init_abramethid
(
3442 n_obra
: nullable TObra ,
3443 n_cbra
: nullable TCbra
3447 _n_obra
= n_obra
.as(not null)
3448 n_obra
.parent
= self
3449 _n_cbra
= n_cbra
.as(not null)
3450 n_cbra
.parent
= self
3453 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3455 if _n_obra
== old_child
then
3456 if new_child
!= null then
3457 new_child
.parent
= self
3458 assert new_child
isa TObra
3465 if _n_cbra
== old_child
then
3466 if new_child
!= null then
3467 new_child
.parent
= self
3468 assert new_child
isa TCbra
3477 redef fun visit_all
(v
: Visitor)
3483 redef fun visit_all_reverse
(v
: Visitor)
3489 redef class AStarshipMethid
3490 redef fun n_starship
=(n
)
3496 private init empty_init
do end
3498 init init_astarshipmethid
(
3499 n_starship
: nullable TStarship
3503 _n_starship
= n_starship
.as(not null)
3504 n_starship
.parent
= self
3507 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3509 if _n_starship
== old_child
then
3510 if new_child
!= null then
3511 new_child
.parent
= self
3512 assert new_child
isa TStarship
3513 _n_starship
= new_child
3521 redef fun visit_all
(v
: Visitor)
3523 v
.visit
(_n_starship
)
3526 redef fun visit_all_reverse
(v
: Visitor)
3528 v
.visit
(_n_starship
)
3531 redef class AAssignMethid
3537 redef fun n_assign
=(n
)
3543 private init empty_init
do end
3545 init init_aassignmethid
(
3546 n_id
: nullable TId ,
3547 n_assign
: nullable TAssign
3551 _n_id
= n_id
.as(not null)
3553 _n_assign
= n_assign
.as(not null)
3554 n_assign
.parent
= self
3557 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3559 if _n_id
== old_child
then
3560 if new_child
!= null then
3561 new_child
.parent
= self
3562 assert new_child
isa TId
3569 if _n_assign
== old_child
then
3570 if new_child
!= null then
3571 new_child
.parent
= self
3572 assert new_child
isa TAssign
3573 _n_assign
= new_child
3581 redef fun visit_all
(v
: Visitor)
3587 redef fun visit_all_reverse
(v
: Visitor)
3593 redef class ABraassignMethid
3594 redef fun n_obra
=(n
)
3599 redef fun n_cbra
=(n
)
3604 redef fun n_assign
=(n
)
3610 private init empty_init
do end
3612 init init_abraassignmethid
(
3613 n_obra
: nullable TObra ,
3614 n_cbra
: nullable TCbra ,
3615 n_assign
: nullable TAssign
3619 _n_obra
= n_obra
.as(not null)
3620 n_obra
.parent
= self
3621 _n_cbra
= n_cbra
.as(not null)
3622 n_cbra
.parent
= self
3623 _n_assign
= n_assign
.as(not null)
3624 n_assign
.parent
= self
3627 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3629 if _n_obra
== old_child
then
3630 if new_child
!= null then
3631 new_child
.parent
= self
3632 assert new_child
isa TObra
3639 if _n_cbra
== old_child
then
3640 if new_child
!= null then
3641 new_child
.parent
= self
3642 assert new_child
isa TCbra
3649 if _n_assign
== old_child
then
3650 if new_child
!= null then
3651 new_child
.parent
= self
3652 assert new_child
isa TAssign
3653 _n_assign
= new_child
3661 redef fun visit_all
(v
: Visitor)
3668 redef fun visit_all_reverse
(v
: Visitor)
3675 redef class ASignature
3676 redef fun n_type
=(n
)
3684 private init empty_init
do end
3686 init init_asignature
(
3687 n_params
: Collection[Object] , # Should be Collection[PParam]
3688 n_type
: nullable PType ,
3689 n_closure_decls
: Collection[Object] # Should be Collection[PClosureDecl]
3693 for n
in n_params
do
3699 if n_type
!= null then
3700 n_type
.parent
= self
3702 for n
in n_closure_decls
do
3703 assert n
isa PClosureDecl
3704 _n_closure_decls
.add
(n
)
3709 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3711 for i
in [0.._n_params
.length
[ do
3712 if _n_params
[i
] == old_child
then
3713 if new_child
!= null then
3714 assert new_child
isa PParam
3715 _n_params
[i
] = new_child
3716 new_child
.parent
= self
3718 _n_params
.remove_at
(i
)
3723 if _n_type
== old_child
then
3724 if new_child
!= null then
3725 new_child
.parent
= self
3726 assert new_child
isa PType
3733 for i
in [0.._n_closure_decls
.length
[ do
3734 if _n_closure_decls
[i
] == old_child
then
3735 if new_child
!= null then
3736 assert new_child
isa PClosureDecl
3737 _n_closure_decls
[i
] = new_child
3738 new_child
.parent
= self
3740 _n_closure_decls
.remove_at
(i
)
3747 redef fun visit_all
(v
: Visitor)
3749 for n
in _n_params
do
3752 if _n_type
!= null then
3753 v
.visit
(_n_type
.as(not null))
3755 for n
in _n_closure_decls
do
3760 redef fun visit_all_reverse
(v
: Visitor)
3763 var i
= _n_params
.length
3765 v
.visit
(_n_params
[i
])
3769 if _n_type
!= null then
3770 v
.visit
(_n_type
.as(not null))
3773 var i
= _n_closure_decls
.length
3775 v
.visit
(_n_closure_decls
[i
])
3787 redef fun n_type
=(n
)
3794 redef fun n_dotdotdot
=(n
)
3802 private init empty_init
do end
3805 n_id
: nullable TId ,
3806 n_type
: nullable PType ,
3807 n_dotdotdot
: nullable TDotdotdot
3811 _n_id
= n_id
.as(not null)
3814 if n_type
!= null then
3815 n_type
.parent
= self
3817 _n_dotdotdot
= n_dotdotdot
3818 if n_dotdotdot
!= null then
3819 n_dotdotdot
.parent
= self
3823 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3825 if _n_id
== old_child
then
3826 if new_child
!= null then
3827 new_child
.parent
= self
3828 assert new_child
isa TId
3835 if _n_type
== old_child
then
3836 if new_child
!= null then
3837 new_child
.parent
= self
3838 assert new_child
isa PType
3845 if _n_dotdotdot
== old_child
then
3846 if new_child
!= null then
3847 new_child
.parent
= self
3848 assert new_child
isa TDotdotdot
3849 _n_dotdotdot
= new_child
3857 redef fun visit_all
(v
: Visitor)
3860 if _n_type
!= null then
3861 v
.visit
(_n_type
.as(not null))
3863 if _n_dotdotdot
!= null then
3864 v
.visit
(_n_dotdotdot
.as(not null))
3868 redef fun visit_all_reverse
(v
: Visitor)
3871 if _n_type
!= null then
3872 v
.visit
(_n_type
.as(not null))
3874 if _n_dotdotdot
!= null then
3875 v
.visit
(_n_dotdotdot
.as(not null))
3879 redef class AClosureDecl
3880 redef fun n_kwwith
=(n
)
3885 redef fun n_kwbreak
=(n
)
3897 redef fun n_signature
=(n
)
3902 redef fun n_expr
=(n
)
3910 private init empty_init
do end
3912 init init_aclosuredecl
(
3913 n_kwwith
: nullable TKwwith ,
3914 n_kwbreak
: nullable TKwbreak ,
3915 n_id
: nullable TId ,
3916 n_signature
: nullable PSignature ,
3917 n_expr
: nullable PExpr
3921 _n_kwwith
= n_kwwith
.as(not null)
3922 n_kwwith
.parent
= self
3923 _n_kwbreak
= n_kwbreak
3924 if n_kwbreak
!= null then
3925 n_kwbreak
.parent
= self
3927 _n_id
= n_id
.as(not null)
3929 _n_signature
= n_signature
.as(not null)
3930 n_signature
.parent
= self
3932 if n_expr
!= null then
3933 n_expr
.parent
= self
3937 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3939 if _n_kwwith
== old_child
then
3940 if new_child
!= null then
3941 new_child
.parent
= self
3942 assert new_child
isa TKwwith
3943 _n_kwwith
= new_child
3949 if _n_kwbreak
== old_child
then
3950 if new_child
!= null then
3951 new_child
.parent
= self
3952 assert new_child
isa TKwbreak
3953 _n_kwbreak
= new_child
3959 if _n_id
== old_child
then
3960 if new_child
!= null then
3961 new_child
.parent
= self
3962 assert new_child
isa TId
3969 if _n_signature
== old_child
then
3970 if new_child
!= null then
3971 new_child
.parent
= self
3972 assert new_child
isa PSignature
3973 _n_signature
= new_child
3979 if _n_expr
== old_child
then
3980 if new_child
!= null then
3981 new_child
.parent
= self
3982 assert new_child
isa PExpr
3991 redef fun visit_all
(v
: Visitor)
3994 if _n_kwbreak
!= null then
3995 v
.visit
(_n_kwbreak
.as(not null))
3998 v
.visit
(_n_signature
)
3999 if _n_expr
!= null then
4000 v
.visit
(_n_expr
.as(not null))
4004 redef fun visit_all_reverse
(v
: Visitor)
4007 if _n_kwbreak
!= null then
4008 v
.visit
(_n_kwbreak
.as(not null))
4011 v
.visit
(_n_signature
)
4012 if _n_expr
!= null then
4013 v
.visit
(_n_expr
.as(not null))
4018 redef fun n_kwnullable
=(n
)
4031 private init empty_init
do end
4034 n_kwnullable
: nullable TKwnullable ,
4035 n_id
: nullable TClassid ,
4036 n_types
: Collection[Object] # Should be Collection[PType]
4040 _n_kwnullable
= n_kwnullable
4041 if n_kwnullable
!= null then
4042 n_kwnullable
.parent
= self
4044 _n_id
= n_id
.as(not null)
4053 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4055 if _n_kwnullable
== old_child
then
4056 if new_child
!= null then
4057 new_child
.parent
= self
4058 assert new_child
isa TKwnullable
4059 _n_kwnullable
= new_child
4061 _n_kwnullable
= null
4065 if _n_id
== old_child
then
4066 if new_child
!= null then
4067 new_child
.parent
= self
4068 assert new_child
isa TClassid
4075 for i
in [0.._n_types
.length
[ do
4076 if _n_types
[i
] == old_child
then
4077 if new_child
!= null then
4078 assert new_child
isa PType
4079 _n_types
[i
] = new_child
4080 new_child
.parent
= self
4082 _n_types
.remove_at
(i
)
4089 redef fun visit_all
(v
: Visitor)
4091 if _n_kwnullable
!= null then
4092 v
.visit
(_n_kwnullable
.as(not null))
4095 for n
in _n_types
do
4100 redef fun visit_all_reverse
(v
: Visitor)
4102 if _n_kwnullable
!= null then
4103 v
.visit
(_n_kwnullable
.as(not null))
4107 var i
= _n_types
.length
4109 v
.visit
(_n_types
[i
])
4115 redef class ABlockExpr
4117 private init empty_init
do end
4119 init init_ablockexpr
(
4120 n_expr
: Collection[Object] # Should be Collection[PExpr]
4131 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4133 for i
in [0.._n_expr
.length
[ do
4134 if _n_expr
[i
] == old_child
then
4135 if new_child
!= null then
4136 assert new_child
isa PExpr
4137 _n_expr
[i
] = new_child
4138 new_child
.parent
= self
4140 _n_expr
.remove_at
(i
)
4147 redef fun visit_all
(v
: Visitor)
4154 redef fun visit_all_reverse
(v
: Visitor)
4157 var i
= _n_expr
.length
4165 redef class AVardeclExpr
4166 redef fun n_kwvar
=(n
)
4176 redef fun n_type
=(n
)
4183 redef fun n_assign
=(n
)
4190 redef fun n_expr
=(n
)
4198 private init empty_init
do end
4200 init init_avardeclexpr
(
4201 n_kwvar
: nullable TKwvar ,
4202 n_id
: nullable TId ,
4203 n_type
: nullable PType ,
4204 n_assign
: nullable TAssign ,
4205 n_expr
: nullable PExpr
4209 _n_kwvar
= n_kwvar
.as(not null)
4210 n_kwvar
.parent
= self
4211 _n_id
= n_id
.as(not null)
4214 if n_type
!= null then
4215 n_type
.parent
= self
4217 _n_assign
= n_assign
4218 if n_assign
!= null then
4219 n_assign
.parent
= self
4222 if n_expr
!= null then
4223 n_expr
.parent
= self
4227 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4229 if _n_kwvar
== old_child
then
4230 if new_child
!= null then
4231 new_child
.parent
= self
4232 assert new_child
isa TKwvar
4233 _n_kwvar
= new_child
4239 if _n_id
== old_child
then
4240 if new_child
!= null then
4241 new_child
.parent
= self
4242 assert new_child
isa TId
4249 if _n_type
== old_child
then
4250 if new_child
!= null then
4251 new_child
.parent
= self
4252 assert new_child
isa PType
4259 if _n_assign
== old_child
then
4260 if new_child
!= null then
4261 new_child
.parent
= self
4262 assert new_child
isa TAssign
4263 _n_assign
= new_child
4269 if _n_expr
== old_child
then
4270 if new_child
!= null then
4271 new_child
.parent
= self
4272 assert new_child
isa PExpr
4281 redef fun visit_all
(v
: Visitor)
4285 if _n_type
!= null then
4286 v
.visit
(_n_type
.as(not null))
4288 if _n_assign
!= null then
4289 v
.visit
(_n_assign
.as(not null))
4291 if _n_expr
!= null then
4292 v
.visit
(_n_expr
.as(not null))
4296 redef fun visit_all_reverse
(v
: Visitor)
4300 if _n_type
!= null then
4301 v
.visit
(_n_type
.as(not null))
4303 if _n_assign
!= null then
4304 v
.visit
(_n_assign
.as(not null))
4306 if _n_expr
!= null then
4307 v
.visit
(_n_expr
.as(not null))
4311 redef class AReturnExpr
4312 redef fun n_kwreturn
=(n
)
4317 redef fun n_expr
=(n
)
4325 private init empty_init
do end
4327 init init_areturnexpr
(
4328 n_kwreturn
: nullable TKwreturn ,
4329 n_expr
: nullable PExpr
4333 _n_kwreturn
= n_kwreturn
.as(not null)
4334 n_kwreturn
.parent
= self
4336 if n_expr
!= null then
4337 n_expr
.parent
= self
4341 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4343 if _n_kwreturn
== old_child
then
4344 if new_child
!= null then
4345 new_child
.parent
= self
4346 assert new_child
isa TKwreturn
4347 _n_kwreturn
= new_child
4353 if _n_expr
== old_child
then
4354 if new_child
!= null then
4355 new_child
.parent
= self
4356 assert new_child
isa PExpr
4365 redef fun visit_all
(v
: Visitor)
4367 v
.visit
(_n_kwreturn
)
4368 if _n_expr
!= null then
4369 v
.visit
(_n_expr
.as(not null))
4373 redef fun visit_all_reverse
(v
: Visitor)
4375 v
.visit
(_n_kwreturn
)
4376 if _n_expr
!= null then
4377 v
.visit
(_n_expr
.as(not null))
4381 redef class ABreakExpr
4382 redef fun n_kwbreak
=(n
)
4387 redef fun n_expr
=(n
)
4395 private init empty_init
do end
4397 init init_abreakexpr
(
4398 n_kwbreak
: nullable TKwbreak ,
4399 n_expr
: nullable PExpr
4403 _n_kwbreak
= n_kwbreak
.as(not null)
4404 n_kwbreak
.parent
= self
4406 if n_expr
!= null then
4407 n_expr
.parent
= self
4411 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4413 if _n_kwbreak
== old_child
then
4414 if new_child
!= null then
4415 new_child
.parent
= self
4416 assert new_child
isa TKwbreak
4417 _n_kwbreak
= new_child
4423 if _n_expr
== old_child
then
4424 if new_child
!= null then
4425 new_child
.parent
= self
4426 assert new_child
isa PExpr
4435 redef fun visit_all
(v
: Visitor)
4438 if _n_expr
!= null then
4439 v
.visit
(_n_expr
.as(not null))
4443 redef fun visit_all_reverse
(v
: Visitor)
4446 if _n_expr
!= null then
4447 v
.visit
(_n_expr
.as(not null))
4451 redef class AAbortExpr
4452 redef fun n_kwabort
=(n
)
4458 private init empty_init
do end
4460 init init_aabortexpr
(
4461 n_kwabort
: nullable TKwabort
4465 _n_kwabort
= n_kwabort
.as(not null)
4466 n_kwabort
.parent
= self
4469 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4471 if _n_kwabort
== old_child
then
4472 if new_child
!= null then
4473 new_child
.parent
= self
4474 assert new_child
isa TKwabort
4475 _n_kwabort
= new_child
4483 redef fun visit_all
(v
: Visitor)
4488 redef fun visit_all_reverse
(v
: Visitor)
4493 redef class AContinueExpr
4494 redef fun n_kwcontinue
=(n
)
4499 redef fun n_expr
=(n
)
4507 private init empty_init
do end
4509 init init_acontinueexpr
(
4510 n_kwcontinue
: nullable TKwcontinue ,
4511 n_expr
: nullable PExpr
4515 _n_kwcontinue
= n_kwcontinue
.as(not null)
4516 n_kwcontinue
.parent
= self
4518 if n_expr
!= null then
4519 n_expr
.parent
= self
4523 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4525 if _n_kwcontinue
== old_child
then
4526 if new_child
!= null then
4527 new_child
.parent
= self
4528 assert new_child
isa TKwcontinue
4529 _n_kwcontinue
= new_child
4535 if _n_expr
== old_child
then
4536 if new_child
!= null then
4537 new_child
.parent
= self
4538 assert new_child
isa PExpr
4547 redef fun visit_all
(v
: Visitor)
4549 v
.visit
(_n_kwcontinue
)
4550 if _n_expr
!= null then
4551 v
.visit
(_n_expr
.as(not null))
4555 redef fun visit_all_reverse
(v
: Visitor)
4557 v
.visit
(_n_kwcontinue
)
4558 if _n_expr
!= null then
4559 v
.visit
(_n_expr
.as(not null))
4564 redef fun n_kwdo
=(n
)
4569 redef fun n_block
=(n
)
4577 private init empty_init
do end
4580 n_kwdo
: nullable TKwdo ,
4581 n_block
: nullable PExpr
4585 _n_kwdo
= n_kwdo
.as(not null)
4586 n_kwdo
.parent
= self
4588 if n_block
!= null then
4589 n_block
.parent
= self
4593 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4595 if _n_kwdo
== old_child
then
4596 if new_child
!= null then
4597 new_child
.parent
= self
4598 assert new_child
isa TKwdo
4605 if _n_block
== old_child
then
4606 if new_child
!= null then
4607 new_child
.parent
= self
4608 assert new_child
isa PExpr
4609 _n_block
= new_child
4617 redef fun visit_all
(v
: Visitor)
4620 if _n_block
!= null then
4621 v
.visit
(_n_block
.as(not null))
4625 redef fun visit_all_reverse
(v
: Visitor)
4628 if _n_block
!= null then
4629 v
.visit
(_n_block
.as(not null))
4634 redef fun n_kwif
=(n
)
4639 redef fun n_expr
=(n
)
4644 redef fun n_then
=(n
)
4651 redef fun n_else
=(n
)
4659 private init empty_init
do end
4662 n_kwif
: nullable TKwif ,
4663 n_expr
: nullable PExpr ,
4664 n_then
: nullable PExpr ,
4665 n_else
: nullable PExpr
4669 _n_kwif
= n_kwif
.as(not null)
4670 n_kwif
.parent
= self
4671 _n_expr
= n_expr
.as(not null)
4672 n_expr
.parent
= self
4674 if n_then
!= null then
4675 n_then
.parent
= self
4678 if n_else
!= null then
4679 n_else
.parent
= self
4683 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4685 if _n_kwif
== old_child
then
4686 if new_child
!= null then
4687 new_child
.parent
= self
4688 assert new_child
isa TKwif
4695 if _n_expr
== old_child
then
4696 if new_child
!= null then
4697 new_child
.parent
= self
4698 assert new_child
isa PExpr
4705 if _n_then
== old_child
then
4706 if new_child
!= null then
4707 new_child
.parent
= self
4708 assert new_child
isa PExpr
4715 if _n_else
== old_child
then
4716 if new_child
!= null then
4717 new_child
.parent
= self
4718 assert new_child
isa PExpr
4727 redef fun visit_all
(v
: Visitor)
4731 if _n_then
!= null then
4732 v
.visit
(_n_then
.as(not null))
4734 if _n_else
!= null then
4735 v
.visit
(_n_else
.as(not null))
4739 redef fun visit_all_reverse
(v
: Visitor)
4743 if _n_then
!= null then
4744 v
.visit
(_n_then
.as(not null))
4746 if _n_else
!= null then
4747 v
.visit
(_n_else
.as(not null))
4751 redef class AIfexprExpr
4752 redef fun n_kwif
=(n
)
4757 redef fun n_expr
=(n
)
4762 redef fun n_kwthen
=(n
)
4767 redef fun n_then
=(n
)
4772 redef fun n_kwelse
=(n
)
4777 redef fun n_else
=(n
)
4783 private init empty_init
do end
4785 init init_aifexprexpr
(
4786 n_kwif
: nullable TKwif ,
4787 n_expr
: nullable PExpr ,
4788 n_kwthen
: nullable TKwthen ,
4789 n_then
: nullable PExpr ,
4790 n_kwelse
: nullable TKwelse ,
4791 n_else
: nullable PExpr
4795 _n_kwif
= n_kwif
.as(not null)
4796 n_kwif
.parent
= self
4797 _n_expr
= n_expr
.as(not null)
4798 n_expr
.parent
= self
4799 _n_kwthen
= n_kwthen
.as(not null)
4800 n_kwthen
.parent
= self
4801 _n_then
= n_then
.as(not null)
4802 n_then
.parent
= self
4803 _n_kwelse
= n_kwelse
.as(not null)
4804 n_kwelse
.parent
= self
4805 _n_else
= n_else
.as(not null)
4806 n_else
.parent
= self
4809 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4811 if _n_kwif
== old_child
then
4812 if new_child
!= null then
4813 new_child
.parent
= self
4814 assert new_child
isa TKwif
4821 if _n_expr
== old_child
then
4822 if new_child
!= null then
4823 new_child
.parent
= self
4824 assert new_child
isa PExpr
4831 if _n_kwthen
== old_child
then
4832 if new_child
!= null then
4833 new_child
.parent
= self
4834 assert new_child
isa TKwthen
4835 _n_kwthen
= new_child
4841 if _n_then
== old_child
then
4842 if new_child
!= null then
4843 new_child
.parent
= self
4844 assert new_child
isa PExpr
4851 if _n_kwelse
== old_child
then
4852 if new_child
!= null then
4853 new_child
.parent
= self
4854 assert new_child
isa TKwelse
4855 _n_kwelse
= new_child
4861 if _n_else
== old_child
then
4862 if new_child
!= null then
4863 new_child
.parent
= self
4864 assert new_child
isa PExpr
4873 redef fun visit_all
(v
: Visitor)
4883 redef fun visit_all_reverse
(v
: Visitor)
4893 redef class AWhileExpr
4894 redef fun n_kwwhile
=(n
)
4899 redef fun n_expr
=(n
)
4904 redef fun n_kwdo
=(n
)
4909 redef fun n_block
=(n
)
4917 private init empty_init
do end
4919 init init_awhileexpr
(
4920 n_kwwhile
: nullable TKwwhile ,
4921 n_expr
: nullable PExpr ,
4922 n_kwdo
: nullable TKwdo ,
4923 n_block
: nullable PExpr
4927 _n_kwwhile
= n_kwwhile
.as(not null)
4928 n_kwwhile
.parent
= self
4929 _n_expr
= n_expr
.as(not null)
4930 n_expr
.parent
= self
4931 _n_kwdo
= n_kwdo
.as(not null)
4932 n_kwdo
.parent
= self
4934 if n_block
!= null then
4935 n_block
.parent
= self
4939 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4941 if _n_kwwhile
== old_child
then
4942 if new_child
!= null then
4943 new_child
.parent
= self
4944 assert new_child
isa TKwwhile
4945 _n_kwwhile
= new_child
4951 if _n_expr
== old_child
then
4952 if new_child
!= null then
4953 new_child
.parent
= self
4954 assert new_child
isa PExpr
4961 if _n_kwdo
== old_child
then
4962 if new_child
!= null then
4963 new_child
.parent
= self
4964 assert new_child
isa TKwdo
4971 if _n_block
== old_child
then
4972 if new_child
!= null then
4973 new_child
.parent
= self
4974 assert new_child
isa PExpr
4975 _n_block
= new_child
4983 redef fun visit_all
(v
: Visitor)
4988 if _n_block
!= null then
4989 v
.visit
(_n_block
.as(not null))
4993 redef fun visit_all_reverse
(v
: Visitor)
4998 if _n_block
!= null then
4999 v
.visit
(_n_block
.as(not null))
5003 redef class AForExpr
5004 redef fun n_kwfor
=(n
)
5014 redef fun n_expr
=(n
)
5019 redef fun n_kwdo
=(n
)
5024 redef fun n_block
=(n
)
5032 private init empty_init
do end
5034 init init_aforexpr
(
5035 n_kwfor
: nullable TKwfor ,
5036 n_id
: nullable TId ,
5037 n_expr
: nullable PExpr ,
5038 n_kwdo
: nullable TKwdo ,
5039 n_block
: nullable PExpr
5043 _n_kwfor
= n_kwfor
.as(not null)
5044 n_kwfor
.parent
= self
5045 _n_id
= n_id
.as(not null)
5047 _n_expr
= n_expr
.as(not null)
5048 n_expr
.parent
= self
5049 _n_kwdo
= n_kwdo
.as(not null)
5050 n_kwdo
.parent
= self
5052 if n_block
!= null then
5053 n_block
.parent
= self
5057 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5059 if _n_kwfor
== old_child
then
5060 if new_child
!= null then
5061 new_child
.parent
= self
5062 assert new_child
isa TKwfor
5063 _n_kwfor
= new_child
5069 if _n_id
== old_child
then
5070 if new_child
!= null then
5071 new_child
.parent
= self
5072 assert new_child
isa TId
5079 if _n_expr
== old_child
then
5080 if new_child
!= null then
5081 new_child
.parent
= self
5082 assert new_child
isa PExpr
5089 if _n_kwdo
== old_child
then
5090 if new_child
!= null then
5091 new_child
.parent
= self
5092 assert new_child
isa TKwdo
5099 if _n_block
== old_child
then
5100 if new_child
!= null then
5101 new_child
.parent
= self
5102 assert new_child
isa PExpr
5103 _n_block
= new_child
5111 redef fun visit_all
(v
: Visitor)
5117 if _n_block
!= null then
5118 v
.visit
(_n_block
.as(not null))
5122 redef fun visit_all_reverse
(v
: Visitor)
5128 if _n_block
!= null then
5129 v
.visit
(_n_block
.as(not null))
5133 redef class AAssertExpr
5134 redef fun n_kwassert
=(n
)
5146 redef fun n_expr
=(n
)
5152 private init empty_init
do end
5154 init init_aassertexpr
(
5155 n_kwassert
: nullable TKwassert ,
5156 n_id
: nullable TId ,
5157 n_expr
: nullable PExpr
5161 _n_kwassert
= n_kwassert
.as(not null)
5162 n_kwassert
.parent
= self
5164 if n_id
!= null then
5167 _n_expr
= n_expr
.as(not null)
5168 n_expr
.parent
= self
5171 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5173 if _n_kwassert
== old_child
then
5174 if new_child
!= null then
5175 new_child
.parent
= self
5176 assert new_child
isa TKwassert
5177 _n_kwassert
= new_child
5183 if _n_id
== old_child
then
5184 if new_child
!= null then
5185 new_child
.parent
= self
5186 assert new_child
isa TId
5193 if _n_expr
== old_child
then
5194 if new_child
!= null then
5195 new_child
.parent
= self
5196 assert new_child
isa PExpr
5205 redef fun visit_all
(v
: Visitor)
5207 v
.visit
(_n_kwassert
)
5208 if _n_id
!= null then
5209 v
.visit
(_n_id
.as(not null))
5214 redef fun visit_all_reverse
(v
: Visitor)
5216 v
.visit
(_n_kwassert
)
5217 if _n_id
!= null then
5218 v
.visit
(_n_id
.as(not null))
5223 redef class AOnceExpr
5224 redef fun n_kwonce
=(n
)
5229 redef fun n_expr
=(n
)
5235 private init empty_init
do end
5237 init init_aonceexpr
(
5238 n_kwonce
: nullable TKwonce ,
5239 n_expr
: nullable PExpr
5243 _n_kwonce
= n_kwonce
.as(not null)
5244 n_kwonce
.parent
= self
5245 _n_expr
= n_expr
.as(not null)
5246 n_expr
.parent
= self
5249 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5251 if _n_kwonce
== old_child
then
5252 if new_child
!= null then
5253 new_child
.parent
= self
5254 assert new_child
isa TKwonce
5255 _n_kwonce
= new_child
5261 if _n_expr
== old_child
then
5262 if new_child
!= null then
5263 new_child
.parent
= self
5264 assert new_child
isa PExpr
5273 redef fun visit_all
(v
: Visitor)
5279 redef fun visit_all_reverse
(v
: Visitor)
5285 redef class ASendExpr
5286 redef fun n_expr
=(n
)
5292 private init empty_init
do end
5294 init init_asendexpr
(
5295 n_expr
: nullable PExpr
5299 _n_expr
= n_expr
.as(not null)
5300 n_expr
.parent
= self
5303 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5305 if _n_expr
== old_child
then
5306 if new_child
!= null then
5307 new_child
.parent
= self
5308 assert new_child
isa PExpr
5317 redef fun visit_all
(v
: Visitor)
5322 redef fun visit_all_reverse
(v
: Visitor)
5327 redef class ABinopExpr
5328 redef fun n_expr
=(n
)
5333 redef fun n_expr2
=(n
)
5339 private init empty_init
do end
5341 init init_abinopexpr
(
5342 n_expr
: nullable PExpr ,
5343 n_expr2
: nullable PExpr
5347 _n_expr
= n_expr
.as(not null)
5348 n_expr
.parent
= self
5349 _n_expr2
= n_expr2
.as(not null)
5350 n_expr2
.parent
= self
5353 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5355 if _n_expr
== old_child
then
5356 if new_child
!= null then
5357 new_child
.parent
= self
5358 assert new_child
isa PExpr
5365 if _n_expr2
== old_child
then
5366 if new_child
!= null then
5367 new_child
.parent
= self
5368 assert new_child
isa PExpr
5369 _n_expr2
= new_child
5377 redef fun visit_all
(v
: Visitor)
5383 redef fun visit_all_reverse
(v
: Visitor)
5390 redef fun n_expr
=(n
)
5395 redef fun n_expr2
=(n
)
5401 private init empty_init
do end
5404 n_expr
: nullable PExpr ,
5405 n_expr2
: nullable PExpr
5409 _n_expr
= n_expr
.as(not null)
5410 n_expr
.parent
= self
5411 _n_expr2
= n_expr2
.as(not null)
5412 n_expr2
.parent
= self
5415 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5417 if _n_expr
== old_child
then
5418 if new_child
!= null then
5419 new_child
.parent
= self
5420 assert new_child
isa PExpr
5427 if _n_expr2
== old_child
then
5428 if new_child
!= null then
5429 new_child
.parent
= self
5430 assert new_child
isa PExpr
5431 _n_expr2
= new_child
5439 redef fun visit_all
(v
: Visitor)
5445 redef fun visit_all_reverse
(v
: Visitor)
5451 redef class AAndExpr
5452 redef fun n_expr
=(n
)
5457 redef fun n_expr2
=(n
)
5463 private init empty_init
do end
5465 init init_aandexpr
(
5466 n_expr
: nullable PExpr ,
5467 n_expr2
: nullable PExpr
5471 _n_expr
= n_expr
.as(not null)
5472 n_expr
.parent
= self
5473 _n_expr2
= n_expr2
.as(not null)
5474 n_expr2
.parent
= self
5477 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5479 if _n_expr
== old_child
then
5480 if new_child
!= null then
5481 new_child
.parent
= self
5482 assert new_child
isa PExpr
5489 if _n_expr2
== old_child
then
5490 if new_child
!= null then
5491 new_child
.parent
= self
5492 assert new_child
isa PExpr
5493 _n_expr2
= new_child
5501 redef fun visit_all
(v
: Visitor)
5507 redef fun visit_all_reverse
(v
: Visitor)
5513 redef class ANotExpr
5514 redef fun n_kwnot
=(n
)
5519 redef fun n_expr
=(n
)
5525 private init empty_init
do end
5527 init init_anotexpr
(
5528 n_kwnot
: nullable TKwnot ,
5529 n_expr
: nullable PExpr
5533 _n_kwnot
= n_kwnot
.as(not null)
5534 n_kwnot
.parent
= self
5535 _n_expr
= n_expr
.as(not null)
5536 n_expr
.parent
= self
5539 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5541 if _n_kwnot
== old_child
then
5542 if new_child
!= null then
5543 new_child
.parent
= self
5544 assert new_child
isa TKwnot
5545 _n_kwnot
= new_child
5551 if _n_expr
== old_child
then
5552 if new_child
!= null then
5553 new_child
.parent
= self
5554 assert new_child
isa PExpr
5563 redef fun visit_all
(v
: Visitor)
5569 redef fun visit_all_reverse
(v
: Visitor)
5576 redef fun n_expr
=(n
)
5581 redef fun n_expr2
=(n
)
5587 private init empty_init
do end
5590 n_expr
: nullable PExpr ,
5591 n_expr2
: nullable PExpr
5595 _n_expr
= n_expr
.as(not null)
5596 n_expr
.parent
= self
5597 _n_expr2
= n_expr2
.as(not null)
5598 n_expr2
.parent
= self
5601 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5603 if _n_expr
== old_child
then
5604 if new_child
!= null then
5605 new_child
.parent
= self
5606 assert new_child
isa PExpr
5613 if _n_expr2
== old_child
then
5614 if new_child
!= null then
5615 new_child
.parent
= self
5616 assert new_child
isa PExpr
5617 _n_expr2
= new_child
5625 redef fun visit_all
(v
: Visitor)
5631 redef fun visit_all_reverse
(v
: Visitor)
5638 redef fun n_expr
=(n
)
5643 redef fun n_expr2
=(n
)
5649 private init empty_init
do end
5652 n_expr
: nullable PExpr ,
5653 n_expr2
: nullable PExpr
5657 _n_expr
= n_expr
.as(not null)
5658 n_expr
.parent
= self
5659 _n_expr2
= n_expr2
.as(not null)
5660 n_expr2
.parent
= self
5663 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5665 if _n_expr
== old_child
then
5666 if new_child
!= null then
5667 new_child
.parent
= self
5668 assert new_child
isa PExpr
5675 if _n_expr2
== old_child
then
5676 if new_child
!= null then
5677 new_child
.parent
= self
5678 assert new_child
isa PExpr
5679 _n_expr2
= new_child
5687 redef fun visit_all
(v
: Visitor)
5693 redef fun visit_all_reverse
(v
: Visitor)
5700 redef fun n_expr
=(n
)
5705 redef fun n_expr2
=(n
)
5711 private init empty_init
do end
5714 n_expr
: nullable PExpr ,
5715 n_expr2
: nullable PExpr
5719 _n_expr
= n_expr
.as(not null)
5720 n_expr
.parent
= self
5721 _n_expr2
= n_expr2
.as(not null)
5722 n_expr2
.parent
= self
5725 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5727 if _n_expr
== old_child
then
5728 if new_child
!= null then
5729 new_child
.parent
= self
5730 assert new_child
isa PExpr
5737 if _n_expr2
== old_child
then
5738 if new_child
!= null then
5739 new_child
.parent
= self
5740 assert new_child
isa PExpr
5741 _n_expr2
= new_child
5749 redef fun visit_all
(v
: Visitor)
5755 redef fun visit_all_reverse
(v
: Visitor)
5762 redef fun n_expr
=(n
)
5767 redef fun n_expr2
=(n
)
5773 private init empty_init
do end
5776 n_expr
: nullable PExpr ,
5777 n_expr2
: nullable PExpr
5781 _n_expr
= n_expr
.as(not null)
5782 n_expr
.parent
= self
5783 _n_expr2
= n_expr2
.as(not null)
5784 n_expr2
.parent
= self
5787 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5789 if _n_expr
== old_child
then
5790 if new_child
!= null then
5791 new_child
.parent
= self
5792 assert new_child
isa PExpr
5799 if _n_expr2
== old_child
then
5800 if new_child
!= null then
5801 new_child
.parent
= self
5802 assert new_child
isa PExpr
5803 _n_expr2
= new_child
5811 redef fun visit_all
(v
: Visitor)
5817 redef fun visit_all_reverse
(v
: Visitor)
5824 redef fun n_expr
=(n
)
5829 redef fun n_expr2
=(n
)
5835 private init empty_init
do end
5838 n_expr
: nullable PExpr ,
5839 n_expr2
: nullable PExpr
5843 _n_expr
= n_expr
.as(not null)
5844 n_expr
.parent
= self
5845 _n_expr2
= n_expr2
.as(not null)
5846 n_expr2
.parent
= self
5849 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5851 if _n_expr
== old_child
then
5852 if new_child
!= null then
5853 new_child
.parent
= self
5854 assert new_child
isa PExpr
5861 if _n_expr2
== old_child
then
5862 if new_child
!= null then
5863 new_child
.parent
= self
5864 assert new_child
isa PExpr
5865 _n_expr2
= new_child
5873 redef fun visit_all
(v
: Visitor)
5879 redef fun visit_all_reverse
(v
: Visitor)
5886 redef fun n_expr
=(n
)
5891 redef fun n_expr2
=(n
)
5897 private init empty_init
do end
5900 n_expr
: nullable PExpr ,
5901 n_expr2
: nullable PExpr
5905 _n_expr
= n_expr
.as(not null)
5906 n_expr
.parent
= self
5907 _n_expr2
= n_expr2
.as(not null)
5908 n_expr2
.parent
= self
5911 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5913 if _n_expr
== old_child
then
5914 if new_child
!= null then
5915 new_child
.parent
= self
5916 assert new_child
isa PExpr
5923 if _n_expr2
== old_child
then
5924 if new_child
!= null then
5925 new_child
.parent
= self
5926 assert new_child
isa PExpr
5927 _n_expr2
= new_child
5935 redef fun visit_all
(v
: Visitor)
5941 redef fun visit_all_reverse
(v
: Visitor)
5948 redef fun n_expr
=(n
)
5953 redef fun n_expr2
=(n
)
5959 private init empty_init
do end
5962 n_expr
: nullable PExpr ,
5963 n_expr2
: nullable PExpr
5967 _n_expr
= n_expr
.as(not null)
5968 n_expr
.parent
= self
5969 _n_expr2
= n_expr2
.as(not null)
5970 n_expr2
.parent
= self
5973 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5975 if _n_expr
== old_child
then
5976 if new_child
!= null then
5977 new_child
.parent
= self
5978 assert new_child
isa PExpr
5985 if _n_expr2
== old_child
then
5986 if new_child
!= null then
5987 new_child
.parent
= self
5988 assert new_child
isa PExpr
5989 _n_expr2
= new_child
5997 redef fun visit_all
(v
: Visitor)
6003 redef fun visit_all_reverse
(v
: Visitor)
6009 redef class AIsaExpr
6010 redef fun n_expr
=(n
)
6015 redef fun n_type
=(n
)
6021 private init empty_init
do end
6023 init init_aisaexpr
(
6024 n_expr
: nullable PExpr ,
6025 n_type
: nullable PType
6029 _n_expr
= n_expr
.as(not null)
6030 n_expr
.parent
= self
6031 _n_type
= n_type
.as(not null)
6032 n_type
.parent
= self
6035 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6037 if _n_expr
== old_child
then
6038 if new_child
!= null then
6039 new_child
.parent
= self
6040 assert new_child
isa PExpr
6047 if _n_type
== old_child
then
6048 if new_child
!= null then
6049 new_child
.parent
= self
6050 assert new_child
isa PType
6059 redef fun visit_all
(v
: Visitor)
6065 redef fun visit_all_reverse
(v
: Visitor)
6071 redef class APlusExpr
6072 redef fun n_expr
=(n
)
6077 redef fun n_expr2
=(n
)
6083 private init empty_init
do end
6085 init init_aplusexpr
(
6086 n_expr
: nullable PExpr ,
6087 n_expr2
: nullable PExpr
6091 _n_expr
= n_expr
.as(not null)
6092 n_expr
.parent
= self
6093 _n_expr2
= n_expr2
.as(not null)
6094 n_expr2
.parent
= self
6097 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6099 if _n_expr
== old_child
then
6100 if new_child
!= null then
6101 new_child
.parent
= self
6102 assert new_child
isa PExpr
6109 if _n_expr2
== old_child
then
6110 if new_child
!= null then
6111 new_child
.parent
= self
6112 assert new_child
isa PExpr
6113 _n_expr2
= new_child
6121 redef fun visit_all
(v
: Visitor)
6127 redef fun visit_all_reverse
(v
: Visitor)
6133 redef class AMinusExpr
6134 redef fun n_expr
=(n
)
6139 redef fun n_expr2
=(n
)
6145 private init empty_init
do end
6147 init init_aminusexpr
(
6148 n_expr
: nullable PExpr ,
6149 n_expr2
: nullable PExpr
6153 _n_expr
= n_expr
.as(not null)
6154 n_expr
.parent
= self
6155 _n_expr2
= n_expr2
.as(not null)
6156 n_expr2
.parent
= self
6159 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6161 if _n_expr
== old_child
then
6162 if new_child
!= null then
6163 new_child
.parent
= self
6164 assert new_child
isa PExpr
6171 if _n_expr2
== old_child
then
6172 if new_child
!= null then
6173 new_child
.parent
= self
6174 assert new_child
isa PExpr
6175 _n_expr2
= new_child
6183 redef fun visit_all
(v
: Visitor)
6189 redef fun visit_all_reverse
(v
: Visitor)
6195 redef class AStarshipExpr
6196 redef fun n_expr
=(n
)
6201 redef fun n_expr2
=(n
)
6207 private init empty_init
do end
6209 init init_astarshipexpr
(
6210 n_expr
: nullable PExpr ,
6211 n_expr2
: nullable PExpr
6215 _n_expr
= n_expr
.as(not null)
6216 n_expr
.parent
= self
6217 _n_expr2
= n_expr2
.as(not null)
6218 n_expr2
.parent
= self
6221 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6223 if _n_expr
== old_child
then
6224 if new_child
!= null then
6225 new_child
.parent
= self
6226 assert new_child
isa PExpr
6233 if _n_expr2
== old_child
then
6234 if new_child
!= null then
6235 new_child
.parent
= self
6236 assert new_child
isa PExpr
6237 _n_expr2
= new_child
6245 redef fun visit_all
(v
: Visitor)
6251 redef fun visit_all_reverse
(v
: Visitor)
6257 redef class AStarExpr
6258 redef fun n_expr
=(n
)
6263 redef fun n_expr2
=(n
)
6269 private init empty_init
do end
6271 init init_astarexpr
(
6272 n_expr
: nullable PExpr ,
6273 n_expr2
: nullable PExpr
6277 _n_expr
= n_expr
.as(not null)
6278 n_expr
.parent
= self
6279 _n_expr2
= n_expr2
.as(not null)
6280 n_expr2
.parent
= self
6283 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6285 if _n_expr
== old_child
then
6286 if new_child
!= null then
6287 new_child
.parent
= self
6288 assert new_child
isa PExpr
6295 if _n_expr2
== old_child
then
6296 if new_child
!= null then
6297 new_child
.parent
= self
6298 assert new_child
isa PExpr
6299 _n_expr2
= new_child
6307 redef fun visit_all
(v
: Visitor)
6313 redef fun visit_all_reverse
(v
: Visitor)
6319 redef class ASlashExpr
6320 redef fun n_expr
=(n
)
6325 redef fun n_expr2
=(n
)
6331 private init empty_init
do end
6333 init init_aslashexpr
(
6334 n_expr
: nullable PExpr ,
6335 n_expr2
: nullable PExpr
6339 _n_expr
= n_expr
.as(not null)
6340 n_expr
.parent
= self
6341 _n_expr2
= n_expr2
.as(not null)
6342 n_expr2
.parent
= self
6345 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6347 if _n_expr
== old_child
then
6348 if new_child
!= null then
6349 new_child
.parent
= self
6350 assert new_child
isa PExpr
6357 if _n_expr2
== old_child
then
6358 if new_child
!= null then
6359 new_child
.parent
= self
6360 assert new_child
isa PExpr
6361 _n_expr2
= new_child
6369 redef fun visit_all
(v
: Visitor)
6375 redef fun visit_all_reverse
(v
: Visitor)
6381 redef class APercentExpr
6382 redef fun n_expr
=(n
)
6387 redef fun n_expr2
=(n
)
6393 private init empty_init
do end
6395 init init_apercentexpr
(
6396 n_expr
: nullable PExpr ,
6397 n_expr2
: nullable PExpr
6401 _n_expr
= n_expr
.as(not null)
6402 n_expr
.parent
= self
6403 _n_expr2
= n_expr2
.as(not null)
6404 n_expr2
.parent
= self
6407 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6409 if _n_expr
== old_child
then
6410 if new_child
!= null then
6411 new_child
.parent
= self
6412 assert new_child
isa PExpr
6419 if _n_expr2
== old_child
then
6420 if new_child
!= null then
6421 new_child
.parent
= self
6422 assert new_child
isa PExpr
6423 _n_expr2
= new_child
6431 redef fun visit_all
(v
: Visitor)
6437 redef fun visit_all_reverse
(v
: Visitor)
6443 redef class AUminusExpr
6444 redef fun n_minus
=(n
)
6449 redef fun n_expr
=(n
)
6455 private init empty_init
do end
6457 init init_auminusexpr
(
6458 n_minus
: nullable TMinus ,
6459 n_expr
: nullable PExpr
6463 _n_minus
= n_minus
.as(not null)
6464 n_minus
.parent
= self
6465 _n_expr
= n_expr
.as(not null)
6466 n_expr
.parent
= self
6469 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6471 if _n_minus
== old_child
then
6472 if new_child
!= null then
6473 new_child
.parent
= self
6474 assert new_child
isa TMinus
6475 _n_minus
= new_child
6481 if _n_expr
== old_child
then
6482 if new_child
!= null then
6483 new_child
.parent
= self
6484 assert new_child
isa PExpr
6493 redef fun visit_all
(v
: Visitor)
6499 redef fun visit_all_reverse
(v
: Visitor)
6505 redef class ANewExpr
6506 redef fun n_kwnew
=(n
)
6511 redef fun n_type
=(n
)
6524 private init empty_init
do end
6526 init init_anewexpr
(
6527 n_kwnew
: nullable TKwnew ,
6528 n_type
: nullable PType ,
6529 n_id
: nullable TId ,
6530 n_args
: Collection[Object] # Should be Collection[PExpr]
6534 _n_kwnew
= n_kwnew
.as(not null)
6535 n_kwnew
.parent
= self
6536 _n_type
= n_type
.as(not null)
6537 n_type
.parent
= self
6539 if n_id
!= null then
6549 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6551 if _n_kwnew
== old_child
then
6552 if new_child
!= null then
6553 new_child
.parent
= self
6554 assert new_child
isa TKwnew
6555 _n_kwnew
= new_child
6561 if _n_type
== old_child
then
6562 if new_child
!= null then
6563 new_child
.parent
= self
6564 assert new_child
isa PType
6571 if _n_id
== old_child
then
6572 if new_child
!= null then
6573 new_child
.parent
= self
6574 assert new_child
isa TId
6581 for i
in [0.._n_args
.length
[ do
6582 if _n_args
[i
] == old_child
then
6583 if new_child
!= null then
6584 assert new_child
isa PExpr
6585 _n_args
[i
] = new_child
6586 new_child
.parent
= self
6588 _n_args
.remove_at
(i
)
6595 redef fun visit_all
(v
: Visitor)
6599 if _n_id
!= null then
6600 v
.visit
(_n_id
.as(not null))
6607 redef fun visit_all_reverse
(v
: Visitor)
6611 if _n_id
!= null then
6612 v
.visit
(_n_id
.as(not null))
6615 var i
= _n_args
.length
6623 redef class AAttrExpr
6624 redef fun n_expr
=(n
)
6635 private init empty_init
do end
6637 init init_aattrexpr
(
6638 n_expr
: nullable PExpr ,
6639 n_id
: nullable TAttrid
6643 _n_expr
= n_expr
.as(not null)
6644 n_expr
.parent
= self
6645 _n_id
= n_id
.as(not null)
6649 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6651 if _n_expr
== old_child
then
6652 if new_child
!= null then
6653 new_child
.parent
= self
6654 assert new_child
isa PExpr
6661 if _n_id
== old_child
then
6662 if new_child
!= null then
6663 new_child
.parent
= self
6664 assert new_child
isa TAttrid
6673 redef fun visit_all
(v
: Visitor)
6679 redef fun visit_all_reverse
(v
: Visitor)
6685 redef class AAttrAssignExpr
6686 redef fun n_expr
=(n
)
6696 redef fun n_assign
=(n
)
6701 redef fun n_value
=(n
)
6707 private init empty_init
do end
6709 init init_aattrassignexpr
(
6710 n_expr
: nullable PExpr ,
6711 n_id
: nullable TAttrid ,
6712 n_assign
: nullable TAssign ,
6713 n_value
: nullable PExpr
6717 _n_expr
= n_expr
.as(not null)
6718 n_expr
.parent
= self
6719 _n_id
= n_id
.as(not null)
6721 _n_assign
= n_assign
.as(not null)
6722 n_assign
.parent
= self
6723 _n_value
= n_value
.as(not null)
6724 n_value
.parent
= self
6727 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6729 if _n_expr
== old_child
then
6730 if new_child
!= null then
6731 new_child
.parent
= self
6732 assert new_child
isa PExpr
6739 if _n_id
== old_child
then
6740 if new_child
!= null then
6741 new_child
.parent
= self
6742 assert new_child
isa TAttrid
6749 if _n_assign
== old_child
then
6750 if new_child
!= null then
6751 new_child
.parent
= self
6752 assert new_child
isa TAssign
6753 _n_assign
= new_child
6759 if _n_value
== old_child
then
6760 if new_child
!= null then
6761 new_child
.parent
= self
6762 assert new_child
isa PExpr
6763 _n_value
= new_child
6771 redef fun visit_all
(v
: Visitor)
6779 redef fun visit_all_reverse
(v
: Visitor)
6787 redef class AAttrReassignExpr
6788 redef fun n_expr
=(n
)
6798 redef fun n_assign_op
=(n
)
6803 redef fun n_value
=(n
)
6809 private init empty_init
do end
6811 init init_aattrreassignexpr
(
6812 n_expr
: nullable PExpr ,
6813 n_id
: nullable TAttrid ,
6814 n_assign_op
: nullable PAssignOp ,
6815 n_value
: nullable PExpr
6819 _n_expr
= n_expr
.as(not null)
6820 n_expr
.parent
= self
6821 _n_id
= n_id
.as(not null)
6823 _n_assign_op
= n_assign_op
.as(not null)
6824 n_assign_op
.parent
= self
6825 _n_value
= n_value
.as(not null)
6826 n_value
.parent
= self
6829 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6831 if _n_expr
== old_child
then
6832 if new_child
!= null then
6833 new_child
.parent
= self
6834 assert new_child
isa PExpr
6841 if _n_id
== old_child
then
6842 if new_child
!= null then
6843 new_child
.parent
= self
6844 assert new_child
isa TAttrid
6851 if _n_assign_op
== old_child
then
6852 if new_child
!= null then
6853 new_child
.parent
= self
6854 assert new_child
isa PAssignOp
6855 _n_assign_op
= new_child
6861 if _n_value
== old_child
then
6862 if new_child
!= null then
6863 new_child
.parent
= self
6864 assert new_child
isa PExpr
6865 _n_value
= new_child
6873 redef fun visit_all
(v
: Visitor)
6877 v
.visit
(_n_assign_op
)
6881 redef fun visit_all_reverse
(v
: Visitor)
6885 v
.visit
(_n_assign_op
)
6889 redef class ACallExpr
6890 redef fun n_expr
=(n
)
6901 private init empty_init
do end
6903 init init_acallexpr
(
6904 n_expr
: nullable PExpr ,
6905 n_id
: nullable TId ,
6906 n_args
: Collection[Object] , # Should be Collection[PExpr]
6907 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
6911 _n_expr
= n_expr
.as(not null)
6912 n_expr
.parent
= self
6913 _n_id
= n_id
.as(not null)
6920 for n
in n_closure_defs
do
6921 assert n
isa PClosureDef
6922 _n_closure_defs
.add
(n
)
6927 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6929 if _n_expr
== old_child
then
6930 if new_child
!= null then
6931 new_child
.parent
= self
6932 assert new_child
isa PExpr
6939 if _n_id
== old_child
then
6940 if new_child
!= null then
6941 new_child
.parent
= self
6942 assert new_child
isa TId
6949 for i
in [0.._n_args
.length
[ do
6950 if _n_args
[i
] == old_child
then
6951 if new_child
!= null then
6952 assert new_child
isa PExpr
6953 _n_args
[i
] = new_child
6954 new_child
.parent
= self
6956 _n_args
.remove_at
(i
)
6961 for i
in [0.._n_closure_defs
.length
[ do
6962 if _n_closure_defs
[i
] == old_child
then
6963 if new_child
!= null then
6964 assert new_child
isa PClosureDef
6965 _n_closure_defs
[i
] = new_child
6966 new_child
.parent
= self
6968 _n_closure_defs
.remove_at
(i
)
6975 redef fun visit_all
(v
: Visitor)
6982 for n
in _n_closure_defs
do
6987 redef fun visit_all_reverse
(v
: Visitor)
6992 var i
= _n_args
.length
6999 var i
= _n_closure_defs
.length
7001 v
.visit
(_n_closure_defs
[i
])
7007 redef class ACallAssignExpr
7008 redef fun n_expr
=(n
)
7018 redef fun n_assign
=(n
)
7023 redef fun n_value
=(n
)
7029 private init empty_init
do end
7031 init init_acallassignexpr
(
7032 n_expr
: nullable PExpr ,
7033 n_id
: nullable TId ,
7034 n_args
: Collection[Object] , # Should be Collection[PExpr]
7035 n_assign
: nullable TAssign ,
7036 n_value
: nullable PExpr
7040 _n_expr
= n_expr
.as(not null)
7041 n_expr
.parent
= self
7042 _n_id
= n_id
.as(not null)
7049 _n_assign
= n_assign
.as(not null)
7050 n_assign
.parent
= self
7051 _n_value
= n_value
.as(not null)
7052 n_value
.parent
= self
7055 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7057 if _n_expr
== old_child
then
7058 if new_child
!= null then
7059 new_child
.parent
= self
7060 assert new_child
isa PExpr
7067 if _n_id
== old_child
then
7068 if new_child
!= null then
7069 new_child
.parent
= self
7070 assert new_child
isa TId
7077 for i
in [0.._n_args
.length
[ do
7078 if _n_args
[i
] == old_child
then
7079 if new_child
!= null then
7080 assert new_child
isa PExpr
7081 _n_args
[i
] = new_child
7082 new_child
.parent
= self
7084 _n_args
.remove_at
(i
)
7089 if _n_assign
== old_child
then
7090 if new_child
!= null then
7091 new_child
.parent
= self
7092 assert new_child
isa TAssign
7093 _n_assign
= new_child
7099 if _n_value
== old_child
then
7100 if new_child
!= null then
7101 new_child
.parent
= self
7102 assert new_child
isa PExpr
7103 _n_value
= new_child
7111 redef fun visit_all
(v
: Visitor)
7122 redef fun visit_all_reverse
(v
: Visitor)
7127 var i
= _n_args
.length
7137 redef class ACallReassignExpr
7138 redef fun n_expr
=(n
)
7148 redef fun n_assign_op
=(n
)
7153 redef fun n_value
=(n
)
7159 private init empty_init
do end
7161 init init_acallreassignexpr
(
7162 n_expr
: nullable PExpr ,
7163 n_id
: nullable TId ,
7164 n_args
: Collection[Object] , # Should be Collection[PExpr]
7165 n_assign_op
: nullable PAssignOp ,
7166 n_value
: nullable PExpr
7170 _n_expr
= n_expr
.as(not null)
7171 n_expr
.parent
= self
7172 _n_id
= n_id
.as(not null)
7179 _n_assign_op
= n_assign_op
.as(not null)
7180 n_assign_op
.parent
= self
7181 _n_value
= n_value
.as(not null)
7182 n_value
.parent
= self
7185 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7187 if _n_expr
== old_child
then
7188 if new_child
!= null then
7189 new_child
.parent
= self
7190 assert new_child
isa PExpr
7197 if _n_id
== old_child
then
7198 if new_child
!= null then
7199 new_child
.parent
= self
7200 assert new_child
isa TId
7207 for i
in [0.._n_args
.length
[ do
7208 if _n_args
[i
] == old_child
then
7209 if new_child
!= null then
7210 assert new_child
isa PExpr
7211 _n_args
[i
] = new_child
7212 new_child
.parent
= self
7214 _n_args
.remove_at
(i
)
7219 if _n_assign_op
== old_child
then
7220 if new_child
!= null then
7221 new_child
.parent
= self
7222 assert new_child
isa PAssignOp
7223 _n_assign_op
= new_child
7229 if _n_value
== old_child
then
7230 if new_child
!= null then
7231 new_child
.parent
= self
7232 assert new_child
isa PExpr
7233 _n_value
= new_child
7241 redef fun visit_all
(v
: Visitor)
7248 v
.visit
(_n_assign_op
)
7252 redef fun visit_all_reverse
(v
: Visitor)
7257 var i
= _n_args
.length
7263 v
.visit
(_n_assign_op
)
7267 redef class ASuperExpr
7268 redef fun n_qualified
=(n
)
7275 redef fun n_kwsuper
=(n
)
7281 private init empty_init
do end
7283 init init_asuperexpr
(
7284 n_qualified
: nullable PQualified ,
7285 n_kwsuper
: nullable TKwsuper ,
7286 n_args
: Collection[Object] # Should be Collection[PExpr]
7290 _n_qualified
= n_qualified
7291 if n_qualified
!= null then
7292 n_qualified
.parent
= self
7294 _n_kwsuper
= n_kwsuper
.as(not null)
7295 n_kwsuper
.parent
= self
7303 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7305 if _n_qualified
== old_child
then
7306 if new_child
!= null then
7307 new_child
.parent
= self
7308 assert new_child
isa PQualified
7309 _n_qualified
= new_child
7315 if _n_kwsuper
== old_child
then
7316 if new_child
!= null then
7317 new_child
.parent
= self
7318 assert new_child
isa TKwsuper
7319 _n_kwsuper
= new_child
7325 for i
in [0.._n_args
.length
[ do
7326 if _n_args
[i
] == old_child
then
7327 if new_child
!= null then
7328 assert new_child
isa PExpr
7329 _n_args
[i
] = new_child
7330 new_child
.parent
= self
7332 _n_args
.remove_at
(i
)
7339 redef fun visit_all
(v
: Visitor)
7341 if _n_qualified
!= null then
7342 v
.visit
(_n_qualified
.as(not null))
7350 redef fun visit_all_reverse
(v
: Visitor)
7352 if _n_qualified
!= null then
7353 v
.visit
(_n_qualified
.as(not null))
7357 var i
= _n_args
.length
7365 redef class AInitExpr
7366 redef fun n_expr
=(n
)
7371 redef fun n_kwinit
=(n
)
7377 private init empty_init
do end
7379 init init_ainitexpr
(
7380 n_expr
: nullable PExpr ,
7381 n_kwinit
: nullable TKwinit ,
7382 n_args
: Collection[Object] # Should be Collection[PExpr]
7386 _n_expr
= n_expr
.as(not null)
7387 n_expr
.parent
= self
7388 _n_kwinit
= n_kwinit
.as(not null)
7389 n_kwinit
.parent
= self
7397 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7399 if _n_expr
== old_child
then
7400 if new_child
!= null then
7401 new_child
.parent
= self
7402 assert new_child
isa PExpr
7409 if _n_kwinit
== old_child
then
7410 if new_child
!= null then
7411 new_child
.parent
= self
7412 assert new_child
isa TKwinit
7413 _n_kwinit
= new_child
7419 for i
in [0.._n_args
.length
[ do
7420 if _n_args
[i
] == old_child
then
7421 if new_child
!= null then
7422 assert new_child
isa PExpr
7423 _n_args
[i
] = new_child
7424 new_child
.parent
= self
7426 _n_args
.remove_at
(i
)
7433 redef fun visit_all
(v
: Visitor)
7442 redef fun visit_all_reverse
(v
: Visitor)
7447 var i
= _n_args
.length
7455 redef class ABraExpr
7456 redef fun n_expr
=(n
)
7462 private init empty_init
do end
7464 init init_abraexpr
(
7465 n_expr
: nullable PExpr ,
7466 n_args
: Collection[Object] , # Should be Collection[PExpr]
7467 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
7471 _n_expr
= n_expr
.as(not null)
7472 n_expr
.parent
= self
7478 for n
in n_closure_defs
do
7479 assert n
isa PClosureDef
7480 _n_closure_defs
.add
(n
)
7485 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7487 if _n_expr
== old_child
then
7488 if new_child
!= null then
7489 new_child
.parent
= self
7490 assert new_child
isa PExpr
7497 for i
in [0.._n_args
.length
[ do
7498 if _n_args
[i
] == old_child
then
7499 if new_child
!= null then
7500 assert new_child
isa PExpr
7501 _n_args
[i
] = new_child
7502 new_child
.parent
= self
7504 _n_args
.remove_at
(i
)
7509 for i
in [0.._n_closure_defs
.length
[ do
7510 if _n_closure_defs
[i
] == old_child
then
7511 if new_child
!= null then
7512 assert new_child
isa PClosureDef
7513 _n_closure_defs
[i
] = new_child
7514 new_child
.parent
= self
7516 _n_closure_defs
.remove_at
(i
)
7523 redef fun visit_all
(v
: Visitor)
7529 for n
in _n_closure_defs
do
7534 redef fun visit_all_reverse
(v
: Visitor)
7538 var i
= _n_args
.length
7545 var i
= _n_closure_defs
.length
7547 v
.visit
(_n_closure_defs
[i
])
7553 redef class ABraAssignExpr
7554 redef fun n_expr
=(n
)
7559 redef fun n_assign
=(n
)
7564 redef fun n_value
=(n
)
7570 private init empty_init
do end
7572 init init_abraassignexpr
(
7573 n_expr
: nullable PExpr ,
7574 n_args
: Collection[Object] , # Should be Collection[PExpr]
7575 n_assign
: nullable TAssign ,
7576 n_value
: nullable PExpr
7580 _n_expr
= n_expr
.as(not null)
7581 n_expr
.parent
= self
7587 _n_assign
= n_assign
.as(not null)
7588 n_assign
.parent
= self
7589 _n_value
= n_value
.as(not null)
7590 n_value
.parent
= self
7593 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7595 if _n_expr
== old_child
then
7596 if new_child
!= null then
7597 new_child
.parent
= self
7598 assert new_child
isa PExpr
7605 for i
in [0.._n_args
.length
[ do
7606 if _n_args
[i
] == old_child
then
7607 if new_child
!= null then
7608 assert new_child
isa PExpr
7609 _n_args
[i
] = new_child
7610 new_child
.parent
= self
7612 _n_args
.remove_at
(i
)
7617 if _n_assign
== old_child
then
7618 if new_child
!= null then
7619 new_child
.parent
= self
7620 assert new_child
isa TAssign
7621 _n_assign
= new_child
7627 if _n_value
== old_child
then
7628 if new_child
!= null then
7629 new_child
.parent
= self
7630 assert new_child
isa PExpr
7631 _n_value
= new_child
7639 redef fun visit_all
(v
: Visitor)
7649 redef fun visit_all_reverse
(v
: Visitor)
7653 var i
= _n_args
.length
7663 redef class ABraReassignExpr
7664 redef fun n_expr
=(n
)
7669 redef fun n_assign_op
=(n
)
7674 redef fun n_value
=(n
)
7680 private init empty_init
do end
7682 init init_abrareassignexpr
(
7683 n_expr
: nullable PExpr ,
7684 n_args
: Collection[Object] , # Should be Collection[PExpr]
7685 n_assign_op
: nullable PAssignOp ,
7686 n_value
: nullable PExpr
7690 _n_expr
= n_expr
.as(not null)
7691 n_expr
.parent
= self
7697 _n_assign_op
= n_assign_op
.as(not null)
7698 n_assign_op
.parent
= self
7699 _n_value
= n_value
.as(not null)
7700 n_value
.parent
= self
7703 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7705 if _n_expr
== old_child
then
7706 if new_child
!= null then
7707 new_child
.parent
= self
7708 assert new_child
isa PExpr
7715 for i
in [0.._n_args
.length
[ do
7716 if _n_args
[i
] == old_child
then
7717 if new_child
!= null then
7718 assert new_child
isa PExpr
7719 _n_args
[i
] = new_child
7720 new_child
.parent
= self
7722 _n_args
.remove_at
(i
)
7727 if _n_assign_op
== old_child
then
7728 if new_child
!= null then
7729 new_child
.parent
= self
7730 assert new_child
isa PAssignOp
7731 _n_assign_op
= new_child
7737 if _n_value
== old_child
then
7738 if new_child
!= null then
7739 new_child
.parent
= self
7740 assert new_child
isa PExpr
7741 _n_value
= new_child
7749 redef fun visit_all
(v
: Visitor)
7755 v
.visit
(_n_assign_op
)
7759 redef fun visit_all_reverse
(v
: Visitor)
7763 var i
= _n_args
.length
7769 v
.visit
(_n_assign_op
)
7773 redef class AClosureCallExpr
7780 private init empty_init
do end
7782 init init_aclosurecallexpr
(
7783 n_id
: nullable TId ,
7784 n_args
: Collection[Object] , # Should be Collection[PExpr]
7785 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
7789 _n_id
= n_id
.as(not null)
7796 for n
in n_closure_defs
do
7797 assert n
isa PClosureDef
7798 _n_closure_defs
.add
(n
)
7803 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7805 if _n_id
== old_child
then
7806 if new_child
!= null then
7807 new_child
.parent
= self
7808 assert new_child
isa TId
7815 for i
in [0.._n_args
.length
[ do
7816 if _n_args
[i
] == old_child
then
7817 if new_child
!= null then
7818 assert new_child
isa PExpr
7819 _n_args
[i
] = new_child
7820 new_child
.parent
= self
7822 _n_args
.remove_at
(i
)
7827 for i
in [0.._n_closure_defs
.length
[ do
7828 if _n_closure_defs
[i
] == old_child
then
7829 if new_child
!= null then
7830 assert new_child
isa PClosureDef
7831 _n_closure_defs
[i
] = new_child
7832 new_child
.parent
= self
7834 _n_closure_defs
.remove_at
(i
)
7841 redef fun visit_all
(v
: Visitor)
7847 for n
in _n_closure_defs
do
7852 redef fun visit_all_reverse
(v
: Visitor)
7856 var i
= _n_args
.length
7863 var i
= _n_closure_defs
.length
7865 v
.visit
(_n_closure_defs
[i
])
7871 redef class AVarExpr
7878 private init empty_init
do end
7880 init init_avarexpr
(
7885 _n_id
= n_id
.as(not null)
7889 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7891 if _n_id
== old_child
then
7892 if new_child
!= null then
7893 new_child
.parent
= self
7894 assert new_child
isa TId
7903 redef fun visit_all
(v
: Visitor)
7908 redef fun visit_all_reverse
(v
: Visitor)
7913 redef class AVarAssignExpr
7919 redef fun n_assign
=(n
)
7924 redef fun n_value
=(n
)
7930 private init empty_init
do end
7932 init init_avarassignexpr
(
7933 n_id
: nullable TId ,
7934 n_assign
: nullable TAssign ,
7935 n_value
: nullable PExpr
7939 _n_id
= n_id
.as(not null)
7941 _n_assign
= n_assign
.as(not null)
7942 n_assign
.parent
= self
7943 _n_value
= n_value
.as(not null)
7944 n_value
.parent
= self
7947 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7949 if _n_id
== old_child
then
7950 if new_child
!= null then
7951 new_child
.parent
= self
7952 assert new_child
isa TId
7959 if _n_assign
== old_child
then
7960 if new_child
!= null then
7961 new_child
.parent
= self
7962 assert new_child
isa TAssign
7963 _n_assign
= new_child
7969 if _n_value
== old_child
then
7970 if new_child
!= null then
7971 new_child
.parent
= self
7972 assert new_child
isa PExpr
7973 _n_value
= new_child
7981 redef fun visit_all
(v
: Visitor)
7988 redef fun visit_all_reverse
(v
: Visitor)
7995 redef class AVarReassignExpr
8001 redef fun n_assign_op
=(n
)
8006 redef fun n_value
=(n
)
8012 private init empty_init
do end
8014 init init_avarreassignexpr
(
8015 n_id
: nullable TId ,
8016 n_assign_op
: nullable PAssignOp ,
8017 n_value
: nullable PExpr
8021 _n_id
= n_id
.as(not null)
8023 _n_assign_op
= n_assign_op
.as(not null)
8024 n_assign_op
.parent
= self
8025 _n_value
= n_value
.as(not null)
8026 n_value
.parent
= self
8029 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8031 if _n_id
== old_child
then
8032 if new_child
!= null then
8033 new_child
.parent
= self
8034 assert new_child
isa TId
8041 if _n_assign_op
== old_child
then
8042 if new_child
!= null then
8043 new_child
.parent
= self
8044 assert new_child
isa PAssignOp
8045 _n_assign_op
= new_child
8051 if _n_value
== old_child
then
8052 if new_child
!= null then
8053 new_child
.parent
= self
8054 assert new_child
isa PExpr
8055 _n_value
= new_child
8063 redef fun visit_all
(v
: Visitor)
8066 v
.visit
(_n_assign_op
)
8070 redef fun visit_all_reverse
(v
: Visitor)
8073 v
.visit
(_n_assign_op
)
8077 redef class ARangeExpr
8078 redef fun n_expr
=(n
)
8083 redef fun n_expr2
=(n
)
8089 private init empty_init
do end
8091 init init_arangeexpr
(
8092 n_expr
: nullable PExpr ,
8093 n_expr2
: nullable PExpr
8097 _n_expr
= n_expr
.as(not null)
8098 n_expr
.parent
= self
8099 _n_expr2
= n_expr2
.as(not null)
8100 n_expr2
.parent
= self
8103 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8105 if _n_expr
== old_child
then
8106 if new_child
!= null then
8107 new_child
.parent
= self
8108 assert new_child
isa PExpr
8115 if _n_expr2
== old_child
then
8116 if new_child
!= null then
8117 new_child
.parent
= self
8118 assert new_child
isa PExpr
8119 _n_expr2
= new_child
8127 redef fun visit_all
(v
: Visitor)
8133 redef fun visit_all_reverse
(v
: Visitor)
8139 redef class ACrangeExpr
8140 redef fun n_expr
=(n
)
8145 redef fun n_expr2
=(n
)
8151 private init empty_init
do end
8153 init init_acrangeexpr
(
8154 n_expr
: nullable PExpr ,
8155 n_expr2
: nullable PExpr
8159 _n_expr
= n_expr
.as(not null)
8160 n_expr
.parent
= self
8161 _n_expr2
= n_expr2
.as(not null)
8162 n_expr2
.parent
= self
8165 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8167 if _n_expr
== old_child
then
8168 if new_child
!= null then
8169 new_child
.parent
= self
8170 assert new_child
isa PExpr
8177 if _n_expr2
== old_child
then
8178 if new_child
!= null then
8179 new_child
.parent
= self
8180 assert new_child
isa PExpr
8181 _n_expr2
= new_child
8189 redef fun visit_all
(v
: Visitor)
8195 redef fun visit_all_reverse
(v
: Visitor)
8201 redef class AOrangeExpr
8202 redef fun n_expr
=(n
)
8207 redef fun n_expr2
=(n
)
8213 private init empty_init
do end
8215 init init_aorangeexpr
(
8216 n_expr
: nullable PExpr ,
8217 n_expr2
: nullable PExpr
8221 _n_expr
= n_expr
.as(not null)
8222 n_expr
.parent
= self
8223 _n_expr2
= n_expr2
.as(not null)
8224 n_expr2
.parent
= self
8227 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8229 if _n_expr
== old_child
then
8230 if new_child
!= null then
8231 new_child
.parent
= self
8232 assert new_child
isa PExpr
8239 if _n_expr2
== old_child
then
8240 if new_child
!= null then
8241 new_child
.parent
= self
8242 assert new_child
isa PExpr
8243 _n_expr2
= new_child
8251 redef fun visit_all
(v
: Visitor)
8257 redef fun visit_all_reverse
(v
: Visitor)
8263 redef class AArrayExpr
8265 private init empty_init
do end
8267 init init_aarrayexpr
(
8268 n_exprs
: Collection[Object] # Should be Collection[PExpr]
8279 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8281 for i
in [0.._n_exprs
.length
[ do
8282 if _n_exprs
[i
] == old_child
then
8283 if new_child
!= null then
8284 assert new_child
isa PExpr
8285 _n_exprs
[i
] = new_child
8286 new_child
.parent
= self
8288 _n_exprs
.remove_at
(i
)
8295 redef fun visit_all
(v
: Visitor)
8297 for n
in _n_exprs
do
8302 redef fun visit_all_reverse
(v
: Visitor)
8305 var i
= _n_exprs
.length
8307 v
.visit
(_n_exprs
[i
])
8313 redef class ASelfExpr
8314 redef fun n_kwself
=(n
)
8320 private init empty_init
do end
8322 init init_aselfexpr
(
8323 n_kwself
: nullable TKwself
8327 _n_kwself
= n_kwself
.as(not null)
8328 n_kwself
.parent
= self
8331 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8333 if _n_kwself
== old_child
then
8334 if new_child
!= null then
8335 new_child
.parent
= self
8336 assert new_child
isa TKwself
8337 _n_kwself
= new_child
8345 redef fun visit_all
(v
: Visitor)
8350 redef fun visit_all_reverse
(v
: Visitor)
8355 redef class AImplicitSelfExpr
8357 private init empty_init
do end
8359 init init_aimplicitselfexpr
8364 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8368 redef fun visit_all
(v
: Visitor)
8372 redef fun visit_all_reverse
(v
: Visitor)
8376 redef class ATrueExpr
8377 redef fun n_kwtrue
=(n
)
8383 private init empty_init
do end
8385 init init_atrueexpr
(
8386 n_kwtrue
: nullable TKwtrue
8390 _n_kwtrue
= n_kwtrue
.as(not null)
8391 n_kwtrue
.parent
= self
8394 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8396 if _n_kwtrue
== old_child
then
8397 if new_child
!= null then
8398 new_child
.parent
= self
8399 assert new_child
isa TKwtrue
8400 _n_kwtrue
= new_child
8408 redef fun visit_all
(v
: Visitor)
8413 redef fun visit_all_reverse
(v
: Visitor)
8418 redef class AFalseExpr
8419 redef fun n_kwfalse
=(n
)
8425 private init empty_init
do end
8427 init init_afalseexpr
(
8428 n_kwfalse
: nullable TKwfalse
8432 _n_kwfalse
= n_kwfalse
.as(not null)
8433 n_kwfalse
.parent
= self
8436 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8438 if _n_kwfalse
== old_child
then
8439 if new_child
!= null then
8440 new_child
.parent
= self
8441 assert new_child
isa TKwfalse
8442 _n_kwfalse
= new_child
8450 redef fun visit_all
(v
: Visitor)
8455 redef fun visit_all_reverse
(v
: Visitor)
8460 redef class ANullExpr
8461 redef fun n_kwnull
=(n
)
8467 private init empty_init
do end
8469 init init_anullexpr
(
8470 n_kwnull
: nullable TKwnull
8474 _n_kwnull
= n_kwnull
.as(not null)
8475 n_kwnull
.parent
= self
8478 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8480 if _n_kwnull
== old_child
then
8481 if new_child
!= null then
8482 new_child
.parent
= self
8483 assert new_child
isa TKwnull
8484 _n_kwnull
= new_child
8492 redef fun visit_all
(v
: Visitor)
8497 redef fun visit_all_reverse
(v
: Visitor)
8502 redef class AIntExpr
8503 redef fun n_number
=(n
)
8509 private init empty_init
do end
8511 init init_aintexpr
(
8512 n_number
: nullable TNumber
8516 _n_number
= n_number
.as(not null)
8517 n_number
.parent
= self
8520 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8522 if _n_number
== old_child
then
8523 if new_child
!= null then
8524 new_child
.parent
= self
8525 assert new_child
isa TNumber
8526 _n_number
= new_child
8534 redef fun visit_all
(v
: Visitor)
8539 redef fun visit_all_reverse
(v
: Visitor)
8544 redef class AFloatExpr
8545 redef fun n_float
=(n
)
8551 private init empty_init
do end
8553 init init_afloatexpr
(
8554 n_float
: nullable TFloat
8558 _n_float
= n_float
.as(not null)
8559 n_float
.parent
= self
8562 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8564 if _n_float
== old_child
then
8565 if new_child
!= null then
8566 new_child
.parent
= self
8567 assert new_child
isa TFloat
8568 _n_float
= new_child
8576 redef fun visit_all
(v
: Visitor)
8581 redef fun visit_all_reverse
(v
: Visitor)
8586 redef class ACharExpr
8587 redef fun n_char
=(n
)
8593 private init empty_init
do end
8595 init init_acharexpr
(
8596 n_char
: nullable TChar
8600 _n_char
= n_char
.as(not null)
8601 n_char
.parent
= self
8604 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8606 if _n_char
== old_child
then
8607 if new_child
!= null then
8608 new_child
.parent
= self
8609 assert new_child
isa TChar
8618 redef fun visit_all
(v
: Visitor)
8623 redef fun visit_all_reverse
(v
: Visitor)
8628 redef class AStringExpr
8629 redef fun n_string
=(n
)
8635 private init empty_init
do end
8637 init init_astringexpr
(
8638 n_string
: nullable TString
8642 _n_string
= n_string
.as(not null)
8643 n_string
.parent
= self
8646 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8648 if _n_string
== old_child
then
8649 if new_child
!= null then
8650 new_child
.parent
= self
8651 assert new_child
isa TString
8652 _n_string
= new_child
8660 redef fun visit_all
(v
: Visitor)
8665 redef fun visit_all_reverse
(v
: Visitor)
8670 redef class AStartStringExpr
8671 redef fun n_string
=(n
)
8677 private init empty_init
do end
8679 init init_astartstringexpr
(
8680 n_string
: nullable TStartString
8684 _n_string
= n_string
.as(not null)
8685 n_string
.parent
= self
8688 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8690 if _n_string
== old_child
then
8691 if new_child
!= null then
8692 new_child
.parent
= self
8693 assert new_child
isa TStartString
8694 _n_string
= new_child
8702 redef fun visit_all
(v
: Visitor)
8707 redef fun visit_all_reverse
(v
: Visitor)
8712 redef class AMidStringExpr
8713 redef fun n_string
=(n
)
8719 private init empty_init
do end
8721 init init_amidstringexpr
(
8722 n_string
: nullable TMidString
8726 _n_string
= n_string
.as(not null)
8727 n_string
.parent
= self
8730 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8732 if _n_string
== old_child
then
8733 if new_child
!= null then
8734 new_child
.parent
= self
8735 assert new_child
isa TMidString
8736 _n_string
= new_child
8744 redef fun visit_all
(v
: Visitor)
8749 redef fun visit_all_reverse
(v
: Visitor)
8754 redef class AEndStringExpr
8755 redef fun n_string
=(n
)
8761 private init empty_init
do end
8763 init init_aendstringexpr
(
8764 n_string
: nullable TEndString
8768 _n_string
= n_string
.as(not null)
8769 n_string
.parent
= self
8772 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8774 if _n_string
== old_child
then
8775 if new_child
!= null then
8776 new_child
.parent
= self
8777 assert new_child
isa TEndString
8778 _n_string
= new_child
8786 redef fun visit_all
(v
: Visitor)
8791 redef fun visit_all_reverse
(v
: Visitor)
8796 redef class ASuperstringExpr
8798 private init empty_init
do end
8800 init init_asuperstringexpr
(
8801 n_exprs
: Collection[Object] # Should be Collection[PExpr]
8812 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8814 for i
in [0.._n_exprs
.length
[ do
8815 if _n_exprs
[i
] == old_child
then
8816 if new_child
!= null then
8817 assert new_child
isa PExpr
8818 _n_exprs
[i
] = new_child
8819 new_child
.parent
= self
8821 _n_exprs
.remove_at
(i
)
8828 redef fun visit_all
(v
: Visitor)
8830 for n
in _n_exprs
do
8835 redef fun visit_all_reverse
(v
: Visitor)
8838 var i
= _n_exprs
.length
8840 v
.visit
(_n_exprs
[i
])
8846 redef class AParExpr
8847 redef fun n_expr
=(n
)
8853 private init empty_init
do end
8855 init init_aparexpr
(
8856 n_expr
: nullable PExpr
8860 _n_expr
= n_expr
.as(not null)
8861 n_expr
.parent
= self
8864 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8866 if _n_expr
== old_child
then
8867 if new_child
!= null then
8868 new_child
.parent
= self
8869 assert new_child
isa PExpr
8878 redef fun visit_all
(v
: Visitor)
8883 redef fun visit_all_reverse
(v
: Visitor)
8888 redef class AAsCastExpr
8889 redef fun n_expr
=(n
)
8894 redef fun n_kwas
=(n
)
8899 redef fun n_type
=(n
)
8905 private init empty_init
do end
8907 init init_aascastexpr
(
8908 n_expr
: nullable PExpr ,
8909 n_kwas
: nullable TKwas ,
8910 n_type
: nullable PType
8914 _n_expr
= n_expr
.as(not null)
8915 n_expr
.parent
= self
8916 _n_kwas
= n_kwas
.as(not null)
8917 n_kwas
.parent
= self
8918 _n_type
= n_type
.as(not null)
8919 n_type
.parent
= self
8922 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8924 if _n_expr
== old_child
then
8925 if new_child
!= null then
8926 new_child
.parent
= self
8927 assert new_child
isa PExpr
8934 if _n_kwas
== old_child
then
8935 if new_child
!= null then
8936 new_child
.parent
= self
8937 assert new_child
isa TKwas
8944 if _n_type
== old_child
then
8945 if new_child
!= null then
8946 new_child
.parent
= self
8947 assert new_child
isa PType
8956 redef fun visit_all
(v
: Visitor)
8963 redef fun visit_all_reverse
(v
: Visitor)
8970 redef class AAsNotnullExpr
8971 redef fun n_expr
=(n
)
8976 redef fun n_kwas
=(n
)
8981 redef fun n_kwnot
=(n
)
8986 redef fun n_kwnull
=(n
)
8992 private init empty_init
do end
8994 init init_aasnotnullexpr
(
8995 n_expr
: nullable PExpr ,
8996 n_kwas
: nullable TKwas ,
8997 n_kwnot
: nullable TKwnot ,
8998 n_kwnull
: nullable TKwnull
9002 _n_expr
= n_expr
.as(not null)
9003 n_expr
.parent
= self
9004 _n_kwas
= n_kwas
.as(not null)
9005 n_kwas
.parent
= self
9006 _n_kwnot
= n_kwnot
.as(not null)
9007 n_kwnot
.parent
= self
9008 _n_kwnull
= n_kwnull
.as(not null)
9009 n_kwnull
.parent
= self
9012 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9014 if _n_expr
== old_child
then
9015 if new_child
!= null then
9016 new_child
.parent
= self
9017 assert new_child
isa PExpr
9024 if _n_kwas
== old_child
then
9025 if new_child
!= null then
9026 new_child
.parent
= self
9027 assert new_child
isa TKwas
9034 if _n_kwnot
== old_child
then
9035 if new_child
!= null then
9036 new_child
.parent
= self
9037 assert new_child
isa TKwnot
9038 _n_kwnot
= new_child
9044 if _n_kwnull
== old_child
then
9045 if new_child
!= null then
9046 new_child
.parent
= self
9047 assert new_child
isa TKwnull
9048 _n_kwnull
= new_child
9056 redef fun visit_all
(v
: Visitor)
9064 redef fun visit_all_reverse
(v
: Visitor)
9072 redef class AIssetAttrExpr
9073 redef fun n_kwisset
=(n
)
9078 redef fun n_expr
=(n
)
9089 private init empty_init
do end
9091 init init_aissetattrexpr
(
9092 n_kwisset
: nullable TKwisset ,
9093 n_expr
: nullable PExpr ,
9094 n_id
: nullable TAttrid
9098 _n_kwisset
= n_kwisset
.as(not null)
9099 n_kwisset
.parent
= self
9100 _n_expr
= n_expr
.as(not null)
9101 n_expr
.parent
= self
9102 _n_id
= n_id
.as(not null)
9106 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9108 if _n_kwisset
== old_child
then
9109 if new_child
!= null then
9110 new_child
.parent
= self
9111 assert new_child
isa TKwisset
9112 _n_kwisset
= new_child
9118 if _n_expr
== old_child
then
9119 if new_child
!= null then
9120 new_child
.parent
= self
9121 assert new_child
isa PExpr
9128 if _n_id
== old_child
then
9129 if new_child
!= null then
9130 new_child
.parent
= self
9131 assert new_child
isa TAttrid
9140 redef fun visit_all
(v
: Visitor)
9147 redef fun visit_all_reverse
(v
: Visitor)
9154 redef class APlusAssignOp
9155 redef fun n_pluseq
=(n
)
9161 private init empty_init
do end
9163 init init_aplusassignop
(
9164 n_pluseq
: nullable TPluseq
9168 _n_pluseq
= n_pluseq
.as(not null)
9169 n_pluseq
.parent
= self
9172 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9174 if _n_pluseq
== old_child
then
9175 if new_child
!= null then
9176 new_child
.parent
= self
9177 assert new_child
isa TPluseq
9178 _n_pluseq
= new_child
9186 redef fun visit_all
(v
: Visitor)
9191 redef fun visit_all_reverse
(v
: Visitor)
9196 redef class AMinusAssignOp
9197 redef fun n_minuseq
=(n
)
9203 private init empty_init
do end
9205 init init_aminusassignop
(
9206 n_minuseq
: nullable TMinuseq
9210 _n_minuseq
= n_minuseq
.as(not null)
9211 n_minuseq
.parent
= self
9214 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9216 if _n_minuseq
== old_child
then
9217 if new_child
!= null then
9218 new_child
.parent
= self
9219 assert new_child
isa TMinuseq
9220 _n_minuseq
= new_child
9228 redef fun visit_all
(v
: Visitor)
9233 redef fun visit_all_reverse
(v
: Visitor)
9238 redef class AClosureDef
9239 redef fun n_kwwith
=(n
)
9244 redef fun n_kwdo
=(n
)
9249 redef fun n_expr
=(n
)
9257 private init empty_init
do end
9259 init init_aclosuredef
(
9260 n_kwwith
: nullable TKwwith ,
9261 n_id
: Collection[Object] , # Should be Collection[TId]
9262 n_kwdo
: nullable TKwdo ,
9263 n_expr
: nullable PExpr
9267 _n_kwwith
= n_kwwith
.as(not null)
9268 n_kwwith
.parent
= self
9274 _n_kwdo
= n_kwdo
.as(not null)
9275 n_kwdo
.parent
= self
9277 if n_expr
!= null then
9278 n_expr
.parent
= self
9282 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9284 if _n_kwwith
== old_child
then
9285 if new_child
!= null then
9286 new_child
.parent
= self
9287 assert new_child
isa TKwwith
9288 _n_kwwith
= new_child
9294 for i
in [0.._n_id
.length
[ do
9295 if _n_id
[i
] == old_child
then
9296 if new_child
!= null then
9297 assert new_child
isa TId
9298 _n_id
[i
] = new_child
9299 new_child
.parent
= self
9306 if _n_kwdo
== old_child
then
9307 if new_child
!= null then
9308 new_child
.parent
= self
9309 assert new_child
isa TKwdo
9316 if _n_expr
== old_child
then
9317 if new_child
!= null then
9318 new_child
.parent
= self
9319 assert new_child
isa PExpr
9328 redef fun visit_all
(v
: Visitor)
9335 if _n_expr
!= null then
9336 v
.visit
(_n_expr
.as(not null))
9340 redef fun visit_all_reverse
(v
: Visitor)
9344 var i
= _n_id
.length
9351 if _n_expr
!= null then
9352 v
.visit
(_n_expr
.as(not null))
9356 redef class AQualified
9357 redef fun n_classid
=(n
)
9365 private init empty_init
do end
9367 init init_aqualified
(
9368 n_id
: Collection[Object] , # Should be Collection[TId]
9369 n_classid
: nullable TClassid
9378 _n_classid
= n_classid
9379 if n_classid
!= null then
9380 n_classid
.parent
= self
9384 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9386 for i
in [0.._n_id
.length
[ do
9387 if _n_id
[i
] == old_child
then
9388 if new_child
!= null then
9389 assert new_child
isa TId
9390 _n_id
[i
] = new_child
9391 new_child
.parent
= self
9398 if _n_classid
== old_child
then
9399 if new_child
!= null then
9400 new_child
.parent
= self
9401 assert new_child
isa TClassid
9402 _n_classid
= new_child
9410 redef fun visit_all
(v
: Visitor)
9415 if _n_classid
!= null then
9416 v
.visit
(_n_classid
.as(not null))
9420 redef fun visit_all_reverse
(v
: Visitor)
9423 var i
= _n_id
.length
9429 if _n_classid
!= null then
9430 v
.visit
(_n_classid
.as(not null))
9436 private init empty_init
do end
9439 n_comment
: Collection[Object] # Should be Collection[TComment]
9443 for n
in n_comment
do
9444 assert n
isa TComment
9450 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9452 for i
in [0.._n_comment
.length
[ do
9453 if _n_comment
[i
] == old_child
then
9454 if new_child
!= null then
9455 assert new_child
isa TComment
9456 _n_comment
[i
] = new_child
9457 new_child
.parent
= self
9459 _n_comment
.remove_at
(i
)
9466 redef fun visit_all
(v
: Visitor)
9468 for n
in _n_comment
do
9473 redef fun visit_all_reverse
(v
: Visitor)
9476 var i
= _n_comment
.length
9478 v
.visit
(_n_comment
[i
])
9487 n_base
: nullable PModule,
9494 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9496 if _n_base
== old_child
then
9497 if new_child
== null then
9499 new_child
.parent
= self
9500 assert new_child
isa PModule
9503 old_child
.parent
= null
9508 redef fun visit_all
(v
: Visitor)
9510 if _n_base
!= null then
9511 v
.visit
(_n_base
.as(not null))
9515 redef fun visit_all_reverse
(v
: Visitor)
9517 if _n_base
!= null then
9518 v
.visit
(_n_base
.as(not null))