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
47 # Return only the line number of the node
48 fun line_number
: Int is abstract
50 # Debug method: output a message prefixed with the location.
51 fun printl
(str
: String)
53 print
("{locate}: {str}\n")
58 redef fun visit_all
(v
: Visitor) do end
59 redef fun visit_all_reverse
(v
: Visitor) do end
60 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode) do end
62 redef fun line_number
do return line
66 # The first token of the production node
67 readable writable var _first_token
: nullable Token
69 # The last token of the production node
70 readable writable var _last_token
: nullable Token
72 redef fun replace_with
(n
: PNode)
76 n
.first_token
= first_token
77 n
.last_token
= last_token
78 n
._location
= location
83 if first_token
!= null then
84 return first_token
.line
91 # Abstract standard visitor
93 # Ask the visitor to visit a given node.
94 # Usually automatically called by visit_all* methods.
95 # Concrete visitors should redefine this method.
96 fun visit
(e
: nullable PNode) is abstract
100 redef fun n_packagedecl
=(n
)
108 private init empty_init
do end
111 n_packagedecl
: nullable PPackagedecl ,
112 n_imports
: Collection[Object] , # Should be Collection[PImport]
113 n_classdefs
: Collection[Object] # Should be Collection[PClassdef]
117 _n_packagedecl
= n_packagedecl
118 if n_packagedecl
!= null then
119 n_packagedecl
.parent
= self
121 for n
in n_imports
do
126 for n
in n_classdefs
do
127 assert n
isa PClassdef
133 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
135 if _n_packagedecl
== old_child
then
136 if new_child
!= null then
137 new_child
.parent
= self
138 assert new_child
isa PPackagedecl
139 _n_packagedecl
= new_child
141 _n_packagedecl
= null
145 for i
in [0.._n_imports
.length
[ do
146 if _n_imports
[i
] == old_child
then
147 if new_child
!= null then
148 assert new_child
isa PImport
149 _n_imports
[i
] = new_child
150 new_child
.parent
= self
152 _n_imports
.remove_at
(i
)
157 for i
in [0.._n_classdefs
.length
[ do
158 if _n_classdefs
[i
] == old_child
then
159 if new_child
!= null then
160 assert new_child
isa PClassdef
161 _n_classdefs
[i
] = new_child
162 new_child
.parent
= self
164 _n_classdefs
.remove_at
(i
)
171 redef fun visit_all
(v
: Visitor)
173 if _n_packagedecl
!= null then
174 v
.visit
(_n_packagedecl
.as(not null))
176 for n
in _n_imports
do
179 for n
in _n_classdefs
do
184 redef fun visit_all_reverse
(v
: Visitor)
186 if _n_packagedecl
!= null then
187 v
.visit
(_n_packagedecl
.as(not null))
190 var i
= _n_imports
.length
192 v
.visit
(_n_imports
[i
])
197 var i
= _n_classdefs
.length
199 v
.visit
(_n_classdefs
[i
])
205 redef class APackagedecl
213 redef fun n_kwpackage
=(n
)
224 private init empty_init
do end
226 init init_apackagedecl
(
227 n_doc
: nullable PDoc ,
228 n_kwpackage
: nullable TKwpackage ,
234 if n_doc
!= null then
237 _n_kwpackage
= n_kwpackage
.as(not null)
238 n_kwpackage
.parent
= self
239 _n_id
= n_id
.as(not null)
243 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
245 if _n_doc
== old_child
then
246 if new_child
!= null then
247 new_child
.parent
= self
248 assert new_child
isa PDoc
255 if _n_kwpackage
== old_child
then
256 if new_child
!= null then
257 new_child
.parent
= self
258 assert new_child
isa TKwpackage
259 _n_kwpackage
= new_child
265 if _n_id
== old_child
then
266 if new_child
!= null then
267 new_child
.parent
= self
268 assert new_child
isa TId
277 redef fun visit_all
(v
: Visitor)
279 if _n_doc
!= null then
280 v
.visit
(_n_doc
.as(not null))
282 v
.visit
(_n_kwpackage
)
286 redef fun visit_all_reverse
(v
: Visitor)
288 if _n_doc
!= null then
289 v
.visit
(_n_doc
.as(not null))
291 v
.visit
(_n_kwpackage
)
296 redef fun n_visibility
=(n
)
301 redef fun n_kwimport
=(n
)
312 private init empty_init
do end
315 n_visibility
: nullable PVisibility ,
316 n_kwimport
: nullable TKwimport ,
321 _n_visibility
= n_visibility
.as(not null)
322 n_visibility
.parent
= self
323 _n_kwimport
= n_kwimport
.as(not null)
324 n_kwimport
.parent
= self
325 _n_id
= n_id
.as(not null)
329 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
331 if _n_visibility
== old_child
then
332 if new_child
!= null then
333 new_child
.parent
= self
334 assert new_child
isa PVisibility
335 _n_visibility
= new_child
341 if _n_kwimport
== old_child
then
342 if new_child
!= null then
343 new_child
.parent
= self
344 assert new_child
isa TKwimport
345 _n_kwimport
= new_child
351 if _n_id
== old_child
then
352 if new_child
!= null then
353 new_child
.parent
= self
354 assert new_child
isa TId
363 redef fun visit_all
(v
: Visitor)
365 v
.visit
(_n_visibility
)
370 redef fun visit_all_reverse
(v
: Visitor)
372 v
.visit
(_n_visibility
)
377 redef class ANoImport
378 redef fun n_visibility
=(n
)
383 redef fun n_kwimport
=(n
)
388 redef fun n_kwend
=(n
)
394 private init empty_init
do end
396 init init_anoimport
(
397 n_visibility
: nullable PVisibility ,
398 n_kwimport
: nullable TKwimport ,
399 n_kwend
: nullable TKwend
403 _n_visibility
= n_visibility
.as(not null)
404 n_visibility
.parent
= self
405 _n_kwimport
= n_kwimport
.as(not null)
406 n_kwimport
.parent
= self
407 _n_kwend
= n_kwend
.as(not null)
408 n_kwend
.parent
= self
411 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
413 if _n_visibility
== old_child
then
414 if new_child
!= null then
415 new_child
.parent
= self
416 assert new_child
isa PVisibility
417 _n_visibility
= new_child
423 if _n_kwimport
== old_child
then
424 if new_child
!= null then
425 new_child
.parent
= self
426 assert new_child
isa TKwimport
427 _n_kwimport
= new_child
433 if _n_kwend
== old_child
then
434 if new_child
!= null then
435 new_child
.parent
= self
436 assert new_child
isa TKwend
445 redef fun visit_all
(v
: Visitor)
447 v
.visit
(_n_visibility
)
452 redef fun visit_all_reverse
(v
: Visitor)
454 v
.visit
(_n_visibility
)
459 redef class APublicVisibility
461 private init empty_init
do end
463 init init_apublicvisibility
468 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
472 redef fun visit_all
(v
: Visitor)
476 redef fun visit_all_reverse
(v
: Visitor)
480 redef class APrivateVisibility
481 redef fun n_kwprivate
=(n
)
487 private init empty_init
do end
489 init init_aprivatevisibility
(
490 n_kwprivate
: nullable TKwprivate
494 _n_kwprivate
= n_kwprivate
.as(not null)
495 n_kwprivate
.parent
= self
498 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
500 if _n_kwprivate
== old_child
then
501 if new_child
!= null then
502 new_child
.parent
= self
503 assert new_child
isa TKwprivate
504 _n_kwprivate
= new_child
512 redef fun visit_all
(v
: Visitor)
514 v
.visit
(_n_kwprivate
)
517 redef fun visit_all_reverse
(v
: Visitor)
519 v
.visit
(_n_kwprivate
)
522 redef class AProtectedVisibility
523 redef fun n_kwprotected
=(n
)
529 private init empty_init
do end
531 init init_aprotectedvisibility
(
532 n_kwprotected
: nullable TKwprotected
536 _n_kwprotected
= n_kwprotected
.as(not null)
537 n_kwprotected
.parent
= self
540 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
542 if _n_kwprotected
== old_child
then
543 if new_child
!= null then
544 new_child
.parent
= self
545 assert new_child
isa TKwprotected
546 _n_kwprotected
= new_child
554 redef fun visit_all
(v
: Visitor)
556 v
.visit
(_n_kwprotected
)
559 redef fun visit_all_reverse
(v
: Visitor)
561 v
.visit
(_n_kwprotected
)
564 redef class AIntrudeVisibility
565 redef fun n_kwintrude
=(n
)
571 private init empty_init
do end
573 init init_aintrudevisibility
(
574 n_kwintrude
: nullable TKwintrude
578 _n_kwintrude
= n_kwintrude
.as(not null)
579 n_kwintrude
.parent
= self
582 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
584 if _n_kwintrude
== old_child
then
585 if new_child
!= null then
586 new_child
.parent
= self
587 assert new_child
isa TKwintrude
588 _n_kwintrude
= new_child
596 redef fun visit_all
(v
: Visitor)
598 v
.visit
(_n_kwintrude
)
601 redef fun visit_all_reverse
(v
: Visitor)
603 v
.visit
(_n_kwintrude
)
606 redef class AClassdef
614 redef fun n_kwredef
=(n
)
621 redef fun n_visibility
=(n
)
626 redef fun n_classkind
=(n
)
639 private init empty_init
do end
641 init init_aclassdef
(
642 n_doc
: nullable PDoc ,
643 n_kwredef
: nullable TKwredef ,
644 n_visibility
: nullable PVisibility ,
645 n_classkind
: nullable PClasskind ,
646 n_id
: nullable TClassid ,
647 n_formaldefs
: Collection[Object] , # Should be Collection[PFormaldef]
648 n_superclasses
: Collection[Object] , # Should be Collection[PSuperclass]
649 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
654 if n_doc
!= null then
657 _n_kwredef
= n_kwredef
658 if n_kwredef
!= null then
659 n_kwredef
.parent
= self
661 _n_visibility
= n_visibility
.as(not null)
662 n_visibility
.parent
= self
663 _n_classkind
= n_classkind
.as(not null)
664 n_classkind
.parent
= self
669 for n
in n_formaldefs
do
670 assert n
isa PFormaldef
674 for n
in n_superclasses
do
675 assert n
isa PSuperclass
676 _n_superclasses
.add
(n
)
679 for n
in n_propdefs
do
680 assert n
isa PPropdef
686 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
688 if _n_doc
== old_child
then
689 if new_child
!= null then
690 new_child
.parent
= self
691 assert new_child
isa PDoc
698 if _n_kwredef
== old_child
then
699 if new_child
!= null then
700 new_child
.parent
= self
701 assert new_child
isa TKwredef
702 _n_kwredef
= new_child
708 if _n_visibility
== old_child
then
709 if new_child
!= null then
710 new_child
.parent
= self
711 assert new_child
isa PVisibility
712 _n_visibility
= new_child
718 if _n_classkind
== old_child
then
719 if new_child
!= null then
720 new_child
.parent
= self
721 assert new_child
isa PClasskind
722 _n_classkind
= new_child
728 if _n_id
== old_child
then
729 if new_child
!= null then
730 new_child
.parent
= self
731 assert new_child
isa TClassid
738 for i
in [0.._n_formaldefs
.length
[ do
739 if _n_formaldefs
[i
] == old_child
then
740 if new_child
!= null then
741 assert new_child
isa PFormaldef
742 _n_formaldefs
[i
] = new_child
743 new_child
.parent
= self
745 _n_formaldefs
.remove_at
(i
)
750 for i
in [0.._n_superclasses
.length
[ do
751 if _n_superclasses
[i
] == old_child
then
752 if new_child
!= null then
753 assert new_child
isa PSuperclass
754 _n_superclasses
[i
] = new_child
755 new_child
.parent
= self
757 _n_superclasses
.remove_at
(i
)
762 for i
in [0.._n_propdefs
.length
[ do
763 if _n_propdefs
[i
] == old_child
then
764 if new_child
!= null then
765 assert new_child
isa PPropdef
766 _n_propdefs
[i
] = new_child
767 new_child
.parent
= self
769 _n_propdefs
.remove_at
(i
)
776 redef fun visit_all
(v
: Visitor)
778 if _n_doc
!= null then
779 v
.visit
(_n_doc
.as(not null))
781 if _n_kwredef
!= null then
782 v
.visit
(_n_kwredef
.as(not null))
784 v
.visit
(_n_visibility
)
785 v
.visit
(_n_classkind
)
786 if _n_id
!= null then
787 v
.visit
(_n_id
.as(not null))
789 for n
in _n_formaldefs
do
792 for n
in _n_superclasses
do
795 for n
in _n_propdefs
do
800 redef fun visit_all_reverse
(v
: Visitor)
802 if _n_doc
!= null then
803 v
.visit
(_n_doc
.as(not null))
805 if _n_kwredef
!= null then
806 v
.visit
(_n_kwredef
.as(not null))
808 v
.visit
(_n_visibility
)
809 v
.visit
(_n_classkind
)
810 if _n_id
!= null then
811 v
.visit
(_n_id
.as(not null))
814 var i
= _n_formaldefs
.length
816 v
.visit
(_n_formaldefs
[i
])
821 var i
= _n_superclasses
.length
823 v
.visit
(_n_superclasses
[i
])
828 var i
= _n_propdefs
.length
830 v
.visit
(_n_propdefs
[i
])
836 redef class ATopClassdef
838 private init empty_init
do end
840 init init_atopclassdef
(
841 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
845 for n
in n_propdefs
do
846 assert n
isa PPropdef
852 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
854 for i
in [0.._n_propdefs
.length
[ do
855 if _n_propdefs
[i
] == old_child
then
856 if new_child
!= null then
857 assert new_child
isa PPropdef
858 _n_propdefs
[i
] = new_child
859 new_child
.parent
= self
861 _n_propdefs
.remove_at
(i
)
868 redef fun visit_all
(v
: Visitor)
870 for n
in _n_propdefs
do
875 redef fun visit_all_reverse
(v
: Visitor)
878 var i
= _n_propdefs
.length
880 v
.visit
(_n_propdefs
[i
])
886 redef class AMainClassdef
888 private init empty_init
do end
890 init init_amainclassdef
(
891 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
895 for n
in n_propdefs
do
896 assert n
isa PPropdef
902 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
904 for i
in [0.._n_propdefs
.length
[ do
905 if _n_propdefs
[i
] == old_child
then
906 if new_child
!= null then
907 assert new_child
isa PPropdef
908 _n_propdefs
[i
] = new_child
909 new_child
.parent
= self
911 _n_propdefs
.remove_at
(i
)
918 redef fun visit_all
(v
: Visitor)
920 for n
in _n_propdefs
do
925 redef fun visit_all_reverse
(v
: Visitor)
928 var i
= _n_propdefs
.length
930 v
.visit
(_n_propdefs
[i
])
936 redef class AConcreteClasskind
937 redef fun n_kwclass
=(n
)
943 private init empty_init
do end
945 init init_aconcreteclasskind
(
946 n_kwclass
: nullable TKwclass
950 _n_kwclass
= n_kwclass
.as(not null)
951 n_kwclass
.parent
= self
954 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
956 if _n_kwclass
== old_child
then
957 if new_child
!= null then
958 new_child
.parent
= self
959 assert new_child
isa TKwclass
960 _n_kwclass
= new_child
968 redef fun visit_all
(v
: Visitor)
973 redef fun visit_all_reverse
(v
: Visitor)
978 redef class AAbstractClasskind
979 redef fun n_kwabstract
=(n
)
984 redef fun n_kwclass
=(n
)
990 private init empty_init
do end
992 init init_aabstractclasskind
(
993 n_kwabstract
: nullable TKwabstract ,
994 n_kwclass
: nullable TKwclass
998 _n_kwabstract
= n_kwabstract
.as(not null)
999 n_kwabstract
.parent
= self
1000 _n_kwclass
= n_kwclass
.as(not null)
1001 n_kwclass
.parent
= self
1004 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1006 if _n_kwabstract
== old_child
then
1007 if new_child
!= null then
1008 new_child
.parent
= self
1009 assert new_child
isa TKwabstract
1010 _n_kwabstract
= new_child
1016 if _n_kwclass
== old_child
then
1017 if new_child
!= null then
1018 new_child
.parent
= self
1019 assert new_child
isa TKwclass
1020 _n_kwclass
= new_child
1028 redef fun visit_all
(v
: Visitor)
1030 v
.visit
(_n_kwabstract
)
1034 redef fun visit_all_reverse
(v
: Visitor)
1036 v
.visit
(_n_kwabstract
)
1040 redef class AInterfaceClasskind
1041 redef fun n_kwinterface
=(n
)
1047 private init empty_init
do end
1049 init init_ainterfaceclasskind
(
1050 n_kwinterface
: nullable TKwinterface
1054 _n_kwinterface
= n_kwinterface
.as(not null)
1055 n_kwinterface
.parent
= self
1058 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1060 if _n_kwinterface
== old_child
then
1061 if new_child
!= null then
1062 new_child
.parent
= self
1063 assert new_child
isa TKwinterface
1064 _n_kwinterface
= new_child
1072 redef fun visit_all
(v
: Visitor)
1074 v
.visit
(_n_kwinterface
)
1077 redef fun visit_all_reverse
(v
: Visitor)
1079 v
.visit
(_n_kwinterface
)
1082 redef class AUniversalClasskind
1083 redef fun n_kwuniversal
=(n
)
1089 private init empty_init
do end
1091 init init_auniversalclasskind
(
1092 n_kwuniversal
: nullable TKwuniversal
1096 _n_kwuniversal
= n_kwuniversal
.as(not null)
1097 n_kwuniversal
.parent
= self
1100 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1102 if _n_kwuniversal
== old_child
then
1103 if new_child
!= null then
1104 new_child
.parent
= self
1105 assert new_child
isa TKwuniversal
1106 _n_kwuniversal
= new_child
1114 redef fun visit_all
(v
: Visitor)
1116 v
.visit
(_n_kwuniversal
)
1119 redef fun visit_all_reverse
(v
: Visitor)
1121 v
.visit
(_n_kwuniversal
)
1124 redef class AFormaldef
1130 redef fun n_type
=(n
)
1138 private init empty_init
do end
1140 init init_aformaldef
(
1141 n_id
: nullable TClassid ,
1142 n_type
: nullable PType
1146 _n_id
= n_id
.as(not null)
1149 if n_type
!= null then
1150 n_type
.parent
= self
1154 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1156 if _n_id
== old_child
then
1157 if new_child
!= null then
1158 new_child
.parent
= self
1159 assert new_child
isa TClassid
1166 if _n_type
== old_child
then
1167 if new_child
!= null then
1168 new_child
.parent
= self
1169 assert new_child
isa PType
1178 redef fun visit_all
(v
: Visitor)
1181 if _n_type
!= null then
1182 v
.visit
(_n_type
.as(not null))
1186 redef fun visit_all_reverse
(v
: Visitor)
1189 if _n_type
!= null then
1190 v
.visit
(_n_type
.as(not null))
1194 redef class ASuperclass
1195 redef fun n_kwspecial
=(n
)
1200 redef fun n_type
=(n
)
1206 private init empty_init
do end
1208 init init_asuperclass
(
1209 n_kwspecial
: nullable TKwspecial ,
1210 n_type
: nullable PType
1214 _n_kwspecial
= n_kwspecial
.as(not null)
1215 n_kwspecial
.parent
= self
1216 _n_type
= n_type
.as(not null)
1217 n_type
.parent
= self
1220 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1222 if _n_kwspecial
== old_child
then
1223 if new_child
!= null then
1224 new_child
.parent
= self
1225 assert new_child
isa TKwspecial
1226 _n_kwspecial
= new_child
1232 if _n_type
== old_child
then
1233 if new_child
!= null then
1234 new_child
.parent
= self
1235 assert new_child
isa PType
1244 redef fun visit_all
(v
: Visitor)
1246 v
.visit
(_n_kwspecial
)
1250 redef fun visit_all_reverse
(v
: Visitor)
1252 v
.visit
(_n_kwspecial
)
1256 redef class AAttrPropdef
1264 redef fun n_readable
=(n
)
1271 redef fun n_writable
=(n
)
1278 redef fun n_kwredef
=(n
)
1285 redef fun n_visibility
=(n
)
1290 redef fun n_kwattr
=(n
)
1297 redef fun n_kwvar
=(n
)
1309 redef fun n_type
=(n
)
1316 redef fun n_expr
=(n
)
1324 private init empty_init
do end
1326 init init_aattrpropdef
(
1327 n_doc
: nullable PDoc ,
1328 n_readable
: nullable PAble ,
1329 n_writable
: nullable PAble ,
1330 n_kwredef
: nullable TKwredef ,
1331 n_visibility
: nullable PVisibility ,
1332 n_kwattr
: nullable TKwattr ,
1333 n_kwvar
: nullable TKwvar ,
1334 n_id
: nullable TAttrid ,
1335 n_type
: nullable PType ,
1336 n_expr
: nullable PExpr
1341 if n_doc
!= null then
1344 _n_readable
= n_readable
1345 if n_readable
!= null then
1346 n_readable
.parent
= self
1348 _n_writable
= n_writable
1349 if n_writable
!= null then
1350 n_writable
.parent
= self
1352 _n_kwredef
= n_kwredef
1353 if n_kwredef
!= null then
1354 n_kwredef
.parent
= self
1356 _n_visibility
= n_visibility
.as(not null)
1357 n_visibility
.parent
= self
1358 _n_kwattr
= n_kwattr
1359 if n_kwattr
!= null then
1360 n_kwattr
.parent
= self
1363 if n_kwvar
!= null then
1364 n_kwvar
.parent
= self
1366 _n_id
= n_id
.as(not null)
1369 if n_type
!= null then
1370 n_type
.parent
= self
1373 if n_expr
!= null then
1374 n_expr
.parent
= self
1378 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1380 if _n_doc
== old_child
then
1381 if new_child
!= null then
1382 new_child
.parent
= self
1383 assert new_child
isa PDoc
1390 if _n_readable
== old_child
then
1391 if new_child
!= null then
1392 new_child
.parent
= self
1393 assert new_child
isa PAble
1394 _n_readable
= new_child
1400 if _n_writable
== old_child
then
1401 if new_child
!= null then
1402 new_child
.parent
= self
1403 assert new_child
isa PAble
1404 _n_writable
= new_child
1410 if _n_kwredef
== old_child
then
1411 if new_child
!= null then
1412 new_child
.parent
= self
1413 assert new_child
isa TKwredef
1414 _n_kwredef
= new_child
1420 if _n_visibility
== old_child
then
1421 if new_child
!= null then
1422 new_child
.parent
= self
1423 assert new_child
isa PVisibility
1424 _n_visibility
= new_child
1430 if _n_kwattr
== old_child
then
1431 if new_child
!= null then
1432 new_child
.parent
= self
1433 assert new_child
isa TKwattr
1434 _n_kwattr
= new_child
1440 if _n_kwvar
== old_child
then
1441 if new_child
!= null then
1442 new_child
.parent
= self
1443 assert new_child
isa TKwvar
1444 _n_kwvar
= new_child
1450 if _n_id
== old_child
then
1451 if new_child
!= null then
1452 new_child
.parent
= self
1453 assert new_child
isa TAttrid
1460 if _n_type
== old_child
then
1461 if new_child
!= null then
1462 new_child
.parent
= self
1463 assert new_child
isa PType
1470 if _n_expr
== old_child
then
1471 if new_child
!= null then
1472 new_child
.parent
= self
1473 assert new_child
isa PExpr
1482 redef fun visit_all
(v
: Visitor)
1484 if _n_doc
!= null then
1485 v
.visit
(_n_doc
.as(not null))
1487 if _n_readable
!= null then
1488 v
.visit
(_n_readable
.as(not null))
1490 if _n_writable
!= null then
1491 v
.visit
(_n_writable
.as(not null))
1493 if _n_kwredef
!= null then
1494 v
.visit
(_n_kwredef
.as(not null))
1496 v
.visit
(_n_visibility
)
1497 if _n_kwattr
!= null then
1498 v
.visit
(_n_kwattr
.as(not null))
1500 if _n_kwvar
!= null then
1501 v
.visit
(_n_kwvar
.as(not null))
1504 if _n_type
!= null then
1505 v
.visit
(_n_type
.as(not null))
1507 if _n_expr
!= null then
1508 v
.visit
(_n_expr
.as(not null))
1512 redef fun visit_all_reverse
(v
: Visitor)
1514 if _n_doc
!= null then
1515 v
.visit
(_n_doc
.as(not null))
1517 if _n_readable
!= null then
1518 v
.visit
(_n_readable
.as(not null))
1520 if _n_writable
!= null then
1521 v
.visit
(_n_writable
.as(not null))
1523 if _n_kwredef
!= null then
1524 v
.visit
(_n_kwredef
.as(not null))
1526 v
.visit
(_n_visibility
)
1527 if _n_kwattr
!= null then
1528 v
.visit
(_n_kwattr
.as(not null))
1530 if _n_kwvar
!= null then
1531 v
.visit
(_n_kwvar
.as(not null))
1534 if _n_type
!= null then
1535 v
.visit
(_n_type
.as(not null))
1537 if _n_expr
!= null then
1538 v
.visit
(_n_expr
.as(not null))
1542 redef class AMethPropdef
1550 redef fun n_kwredef
=(n
)
1557 redef fun n_visibility
=(n
)
1562 redef fun n_methid
=(n
)
1567 redef fun n_signature
=(n
)
1573 private init empty_init
do end
1575 init init_amethpropdef
(
1576 n_doc
: nullable PDoc ,
1577 n_kwredef
: nullable TKwredef ,
1578 n_visibility
: nullable PVisibility ,
1579 n_methid
: nullable PMethid ,
1580 n_signature
: nullable PSignature
1585 if n_doc
!= null then
1588 _n_kwredef
= n_kwredef
1589 if n_kwredef
!= null then
1590 n_kwredef
.parent
= self
1592 _n_visibility
= n_visibility
.as(not null)
1593 n_visibility
.parent
= self
1594 _n_methid
= n_methid
.as(not null)
1595 n_methid
.parent
= self
1596 _n_signature
= n_signature
.as(not null)
1597 n_signature
.parent
= self
1600 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1602 if _n_doc
== old_child
then
1603 if new_child
!= null then
1604 new_child
.parent
= self
1605 assert new_child
isa PDoc
1612 if _n_kwredef
== old_child
then
1613 if new_child
!= null then
1614 new_child
.parent
= self
1615 assert new_child
isa TKwredef
1616 _n_kwredef
= new_child
1622 if _n_visibility
== old_child
then
1623 if new_child
!= null then
1624 new_child
.parent
= self
1625 assert new_child
isa PVisibility
1626 _n_visibility
= new_child
1632 if _n_methid
== old_child
then
1633 if new_child
!= null then
1634 new_child
.parent
= self
1635 assert new_child
isa PMethid
1636 _n_methid
= new_child
1642 if _n_signature
== old_child
then
1643 if new_child
!= null then
1644 new_child
.parent
= self
1645 assert new_child
isa PSignature
1646 _n_signature
= new_child
1654 redef fun visit_all
(v
: Visitor)
1656 if _n_doc
!= null then
1657 v
.visit
(_n_doc
.as(not null))
1659 if _n_kwredef
!= null then
1660 v
.visit
(_n_kwredef
.as(not null))
1662 v
.visit
(_n_visibility
)
1664 v
.visit
(_n_signature
)
1667 redef fun visit_all_reverse
(v
: Visitor)
1669 if _n_doc
!= null then
1670 v
.visit
(_n_doc
.as(not null))
1672 if _n_kwredef
!= null then
1673 v
.visit
(_n_kwredef
.as(not null))
1675 v
.visit
(_n_visibility
)
1677 v
.visit
(_n_signature
)
1680 redef class ADeferredMethPropdef
1688 redef fun n_kwredef
=(n
)
1695 redef fun n_visibility
=(n
)
1700 redef fun n_kwmeth
=(n
)
1705 redef fun n_methid
=(n
)
1710 redef fun n_signature
=(n
)
1716 private init empty_init
do end
1718 init init_adeferredmethpropdef
(
1719 n_doc
: nullable PDoc ,
1720 n_kwredef
: nullable TKwredef ,
1721 n_visibility
: nullable PVisibility ,
1722 n_kwmeth
: nullable TKwmeth ,
1723 n_methid
: nullable PMethid ,
1724 n_signature
: nullable PSignature
1729 if n_doc
!= null then
1732 _n_kwredef
= n_kwredef
1733 if n_kwredef
!= null then
1734 n_kwredef
.parent
= self
1736 _n_visibility
= n_visibility
.as(not null)
1737 n_visibility
.parent
= self
1738 _n_kwmeth
= n_kwmeth
.as(not null)
1739 n_kwmeth
.parent
= self
1740 _n_methid
= n_methid
.as(not null)
1741 n_methid
.parent
= self
1742 _n_signature
= n_signature
.as(not null)
1743 n_signature
.parent
= self
1746 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1748 if _n_doc
== old_child
then
1749 if new_child
!= null then
1750 new_child
.parent
= self
1751 assert new_child
isa PDoc
1758 if _n_kwredef
== old_child
then
1759 if new_child
!= null then
1760 new_child
.parent
= self
1761 assert new_child
isa TKwredef
1762 _n_kwredef
= new_child
1768 if _n_visibility
== old_child
then
1769 if new_child
!= null then
1770 new_child
.parent
= self
1771 assert new_child
isa PVisibility
1772 _n_visibility
= new_child
1778 if _n_kwmeth
== old_child
then
1779 if new_child
!= null then
1780 new_child
.parent
= self
1781 assert new_child
isa TKwmeth
1782 _n_kwmeth
= new_child
1788 if _n_methid
== old_child
then
1789 if new_child
!= null then
1790 new_child
.parent
= self
1791 assert new_child
isa PMethid
1792 _n_methid
= new_child
1798 if _n_signature
== old_child
then
1799 if new_child
!= null then
1800 new_child
.parent
= self
1801 assert new_child
isa PSignature
1802 _n_signature
= new_child
1810 redef fun visit_all
(v
: Visitor)
1812 if _n_doc
!= null then
1813 v
.visit
(_n_doc
.as(not null))
1815 if _n_kwredef
!= null then
1816 v
.visit
(_n_kwredef
.as(not null))
1818 v
.visit
(_n_visibility
)
1821 v
.visit
(_n_signature
)
1824 redef fun visit_all_reverse
(v
: Visitor)
1826 if _n_doc
!= null then
1827 v
.visit
(_n_doc
.as(not null))
1829 if _n_kwredef
!= null then
1830 v
.visit
(_n_kwredef
.as(not null))
1832 v
.visit
(_n_visibility
)
1835 v
.visit
(_n_signature
)
1838 redef class AInternMethPropdef
1846 redef fun n_kwredef
=(n
)
1853 redef fun n_visibility
=(n
)
1858 redef fun n_kwmeth
=(n
)
1863 redef fun n_methid
=(n
)
1868 redef fun n_signature
=(n
)
1874 private init empty_init
do end
1876 init init_ainternmethpropdef
(
1877 n_doc
: nullable PDoc ,
1878 n_kwredef
: nullable TKwredef ,
1879 n_visibility
: nullable PVisibility ,
1880 n_kwmeth
: nullable TKwmeth ,
1881 n_methid
: nullable PMethid ,
1882 n_signature
: nullable PSignature
1887 if n_doc
!= null then
1890 _n_kwredef
= n_kwredef
1891 if n_kwredef
!= null then
1892 n_kwredef
.parent
= self
1894 _n_visibility
= n_visibility
.as(not null)
1895 n_visibility
.parent
= self
1896 _n_kwmeth
= n_kwmeth
.as(not null)
1897 n_kwmeth
.parent
= self
1898 _n_methid
= n_methid
.as(not null)
1899 n_methid
.parent
= self
1900 _n_signature
= n_signature
.as(not null)
1901 n_signature
.parent
= self
1904 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1906 if _n_doc
== old_child
then
1907 if new_child
!= null then
1908 new_child
.parent
= self
1909 assert new_child
isa PDoc
1916 if _n_kwredef
== old_child
then
1917 if new_child
!= null then
1918 new_child
.parent
= self
1919 assert new_child
isa TKwredef
1920 _n_kwredef
= new_child
1926 if _n_visibility
== old_child
then
1927 if new_child
!= null then
1928 new_child
.parent
= self
1929 assert new_child
isa PVisibility
1930 _n_visibility
= new_child
1936 if _n_kwmeth
== old_child
then
1937 if new_child
!= null then
1938 new_child
.parent
= self
1939 assert new_child
isa TKwmeth
1940 _n_kwmeth
= new_child
1946 if _n_methid
== old_child
then
1947 if new_child
!= null then
1948 new_child
.parent
= self
1949 assert new_child
isa PMethid
1950 _n_methid
= new_child
1956 if _n_signature
== old_child
then
1957 if new_child
!= null then
1958 new_child
.parent
= self
1959 assert new_child
isa PSignature
1960 _n_signature
= new_child
1968 redef fun visit_all
(v
: Visitor)
1970 if _n_doc
!= null then
1971 v
.visit
(_n_doc
.as(not null))
1973 if _n_kwredef
!= null then
1974 v
.visit
(_n_kwredef
.as(not null))
1976 v
.visit
(_n_visibility
)
1979 v
.visit
(_n_signature
)
1982 redef fun visit_all_reverse
(v
: Visitor)
1984 if _n_doc
!= null then
1985 v
.visit
(_n_doc
.as(not null))
1987 if _n_kwredef
!= null then
1988 v
.visit
(_n_kwredef
.as(not null))
1990 v
.visit
(_n_visibility
)
1993 v
.visit
(_n_signature
)
1996 redef class AExternMethPropdef
2004 redef fun n_kwredef
=(n
)
2011 redef fun n_visibility
=(n
)
2016 redef fun n_kwmeth
=(n
)
2021 redef fun n_methid
=(n
)
2026 redef fun n_signature
=(n
)
2031 redef fun n_extern
=(n
)
2039 private init empty_init
do end
2041 init init_aexternmethpropdef
(
2042 n_doc
: nullable PDoc ,
2043 n_kwredef
: nullable TKwredef ,
2044 n_visibility
: nullable PVisibility ,
2045 n_kwmeth
: nullable TKwmeth ,
2046 n_methid
: nullable PMethid ,
2047 n_signature
: nullable PSignature ,
2048 n_extern
: nullable TString
2053 if n_doc
!= null then
2056 _n_kwredef
= n_kwredef
2057 if n_kwredef
!= null then
2058 n_kwredef
.parent
= self
2060 _n_visibility
= n_visibility
.as(not null)
2061 n_visibility
.parent
= self
2062 _n_kwmeth
= n_kwmeth
.as(not null)
2063 n_kwmeth
.parent
= self
2064 _n_methid
= n_methid
.as(not null)
2065 n_methid
.parent
= self
2066 _n_signature
= n_signature
.as(not null)
2067 n_signature
.parent
= self
2068 _n_extern
= n_extern
2069 if n_extern
!= null then
2070 n_extern
.parent
= self
2074 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2076 if _n_doc
== old_child
then
2077 if new_child
!= null then
2078 new_child
.parent
= self
2079 assert new_child
isa PDoc
2086 if _n_kwredef
== old_child
then
2087 if new_child
!= null then
2088 new_child
.parent
= self
2089 assert new_child
isa TKwredef
2090 _n_kwredef
= new_child
2096 if _n_visibility
== old_child
then
2097 if new_child
!= null then
2098 new_child
.parent
= self
2099 assert new_child
isa PVisibility
2100 _n_visibility
= new_child
2106 if _n_kwmeth
== old_child
then
2107 if new_child
!= null then
2108 new_child
.parent
= self
2109 assert new_child
isa TKwmeth
2110 _n_kwmeth
= new_child
2116 if _n_methid
== old_child
then
2117 if new_child
!= null then
2118 new_child
.parent
= self
2119 assert new_child
isa PMethid
2120 _n_methid
= new_child
2126 if _n_signature
== old_child
then
2127 if new_child
!= null then
2128 new_child
.parent
= self
2129 assert new_child
isa PSignature
2130 _n_signature
= new_child
2136 if _n_extern
== old_child
then
2137 if new_child
!= null then
2138 new_child
.parent
= self
2139 assert new_child
isa TString
2140 _n_extern
= new_child
2148 redef fun visit_all
(v
: Visitor)
2150 if _n_doc
!= null then
2151 v
.visit
(_n_doc
.as(not null))
2153 if _n_kwredef
!= null then
2154 v
.visit
(_n_kwredef
.as(not null))
2156 v
.visit
(_n_visibility
)
2159 v
.visit
(_n_signature
)
2160 if _n_extern
!= null then
2161 v
.visit
(_n_extern
.as(not null))
2165 redef fun visit_all_reverse
(v
: Visitor)
2167 if _n_doc
!= null then
2168 v
.visit
(_n_doc
.as(not null))
2170 if _n_kwredef
!= null then
2171 v
.visit
(_n_kwredef
.as(not null))
2173 v
.visit
(_n_visibility
)
2176 v
.visit
(_n_signature
)
2177 if _n_extern
!= null then
2178 v
.visit
(_n_extern
.as(not null))
2182 redef class AConcreteMethPropdef
2190 redef fun n_kwredef
=(n
)
2197 redef fun n_visibility
=(n
)
2202 redef fun n_kwmeth
=(n
)
2207 redef fun n_methid
=(n
)
2212 redef fun n_signature
=(n
)
2217 redef fun n_block
=(n
)
2225 private init empty_init
do end
2227 init init_aconcretemethpropdef
(
2228 n_doc
: nullable PDoc ,
2229 n_kwredef
: nullable TKwredef ,
2230 n_visibility
: nullable PVisibility ,
2231 n_kwmeth
: nullable TKwmeth ,
2232 n_methid
: nullable PMethid ,
2233 n_signature
: nullable PSignature ,
2234 n_block
: nullable PExpr
2239 if n_doc
!= null then
2242 _n_kwredef
= n_kwredef
2243 if n_kwredef
!= null then
2244 n_kwredef
.parent
= self
2246 _n_visibility
= n_visibility
.as(not null)
2247 n_visibility
.parent
= self
2248 _n_kwmeth
= n_kwmeth
.as(not null)
2249 n_kwmeth
.parent
= self
2250 _n_methid
= n_methid
.as(not null)
2251 n_methid
.parent
= self
2252 _n_signature
= n_signature
.as(not null)
2253 n_signature
.parent
= self
2255 if n_block
!= null then
2256 n_block
.parent
= self
2260 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2262 if _n_doc
== old_child
then
2263 if new_child
!= null then
2264 new_child
.parent
= self
2265 assert new_child
isa PDoc
2272 if _n_kwredef
== old_child
then
2273 if new_child
!= null then
2274 new_child
.parent
= self
2275 assert new_child
isa TKwredef
2276 _n_kwredef
= new_child
2282 if _n_visibility
== old_child
then
2283 if new_child
!= null then
2284 new_child
.parent
= self
2285 assert new_child
isa PVisibility
2286 _n_visibility
= new_child
2292 if _n_kwmeth
== old_child
then
2293 if new_child
!= null then
2294 new_child
.parent
= self
2295 assert new_child
isa TKwmeth
2296 _n_kwmeth
= new_child
2302 if _n_methid
== old_child
then
2303 if new_child
!= null then
2304 new_child
.parent
= self
2305 assert new_child
isa PMethid
2306 _n_methid
= new_child
2312 if _n_signature
== old_child
then
2313 if new_child
!= null then
2314 new_child
.parent
= self
2315 assert new_child
isa PSignature
2316 _n_signature
= new_child
2322 if _n_block
== old_child
then
2323 if new_child
!= null then
2324 new_child
.parent
= self
2325 assert new_child
isa PExpr
2326 _n_block
= new_child
2334 redef fun visit_all
(v
: Visitor)
2336 if _n_doc
!= null then
2337 v
.visit
(_n_doc
.as(not null))
2339 if _n_kwredef
!= null then
2340 v
.visit
(_n_kwredef
.as(not null))
2342 v
.visit
(_n_visibility
)
2345 v
.visit
(_n_signature
)
2346 if _n_block
!= null then
2347 v
.visit
(_n_block
.as(not null))
2351 redef fun visit_all_reverse
(v
: Visitor)
2353 if _n_doc
!= null then
2354 v
.visit
(_n_doc
.as(not null))
2356 if _n_kwredef
!= null then
2357 v
.visit
(_n_kwredef
.as(not null))
2359 v
.visit
(_n_visibility
)
2362 v
.visit
(_n_signature
)
2363 if _n_block
!= null then
2364 v
.visit
(_n_block
.as(not null))
2368 redef class AConcreteInitPropdef
2376 redef fun n_kwredef
=(n
)
2383 redef fun n_visibility
=(n
)
2388 redef fun n_kwinit
=(n
)
2393 redef fun n_methid
=(n
)
2400 redef fun n_signature
=(n
)
2405 redef fun n_block
=(n
)
2413 private init empty_init
do end
2415 init init_aconcreteinitpropdef
(
2416 n_doc
: nullable PDoc ,
2417 n_kwredef
: nullable TKwredef ,
2418 n_visibility
: nullable PVisibility ,
2419 n_kwinit
: nullable TKwinit ,
2420 n_methid
: nullable PMethid ,
2421 n_signature
: nullable PSignature ,
2422 n_block
: nullable PExpr
2427 if n_doc
!= null then
2430 _n_kwredef
= n_kwredef
2431 if n_kwredef
!= null then
2432 n_kwredef
.parent
= self
2434 _n_visibility
= n_visibility
.as(not null)
2435 n_visibility
.parent
= self
2436 _n_kwinit
= n_kwinit
.as(not null)
2437 n_kwinit
.parent
= self
2438 _n_methid
= n_methid
2439 if n_methid
!= null then
2440 n_methid
.parent
= self
2442 _n_signature
= n_signature
.as(not null)
2443 n_signature
.parent
= self
2445 if n_block
!= null then
2446 n_block
.parent
= self
2450 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2452 if _n_doc
== old_child
then
2453 if new_child
!= null then
2454 new_child
.parent
= self
2455 assert new_child
isa PDoc
2462 if _n_kwredef
== old_child
then
2463 if new_child
!= null then
2464 new_child
.parent
= self
2465 assert new_child
isa TKwredef
2466 _n_kwredef
= new_child
2472 if _n_visibility
== old_child
then
2473 if new_child
!= null then
2474 new_child
.parent
= self
2475 assert new_child
isa PVisibility
2476 _n_visibility
= new_child
2482 if _n_kwinit
== old_child
then
2483 if new_child
!= null then
2484 new_child
.parent
= self
2485 assert new_child
isa TKwinit
2486 _n_kwinit
= new_child
2492 if _n_methid
== old_child
then
2493 if new_child
!= null then
2494 new_child
.parent
= self
2495 assert new_child
isa PMethid
2496 _n_methid
= new_child
2502 if _n_signature
== old_child
then
2503 if new_child
!= null then
2504 new_child
.parent
= self
2505 assert new_child
isa PSignature
2506 _n_signature
= new_child
2512 if _n_block
== old_child
then
2513 if new_child
!= null then
2514 new_child
.parent
= self
2515 assert new_child
isa PExpr
2516 _n_block
= new_child
2524 redef fun visit_all
(v
: Visitor)
2526 if _n_doc
!= null then
2527 v
.visit
(_n_doc
.as(not null))
2529 if _n_kwredef
!= null then
2530 v
.visit
(_n_kwredef
.as(not null))
2532 v
.visit
(_n_visibility
)
2534 if _n_methid
!= null then
2535 v
.visit
(_n_methid
.as(not null))
2537 v
.visit
(_n_signature
)
2538 if _n_block
!= null then
2539 v
.visit
(_n_block
.as(not null))
2543 redef fun visit_all_reverse
(v
: Visitor)
2545 if _n_doc
!= null then
2546 v
.visit
(_n_doc
.as(not null))
2548 if _n_kwredef
!= null then
2549 v
.visit
(_n_kwredef
.as(not null))
2551 v
.visit
(_n_visibility
)
2553 if _n_methid
!= null then
2554 v
.visit
(_n_methid
.as(not null))
2556 v
.visit
(_n_signature
)
2557 if _n_block
!= null then
2558 v
.visit
(_n_block
.as(not null))
2562 redef class AMainMethPropdef
2563 redef fun n_kwredef
=(n
)
2570 redef fun n_block
=(n
)
2578 private init empty_init
do end
2580 init init_amainmethpropdef
(
2581 n_kwredef
: nullable TKwredef ,
2582 n_block
: nullable PExpr
2586 _n_kwredef
= n_kwredef
2587 if n_kwredef
!= null then
2588 n_kwredef
.parent
= self
2591 if n_block
!= null then
2592 n_block
.parent
= self
2596 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2598 if _n_kwredef
== old_child
then
2599 if new_child
!= null then
2600 new_child
.parent
= self
2601 assert new_child
isa TKwredef
2602 _n_kwredef
= new_child
2608 if _n_block
== old_child
then
2609 if new_child
!= null then
2610 new_child
.parent
= self
2611 assert new_child
isa PExpr
2612 _n_block
= new_child
2620 redef fun visit_all
(v
: Visitor)
2622 if _n_kwredef
!= null then
2623 v
.visit
(_n_kwredef
.as(not null))
2625 if _n_block
!= null then
2626 v
.visit
(_n_block
.as(not null))
2630 redef fun visit_all_reverse
(v
: Visitor)
2632 if _n_kwredef
!= null then
2633 v
.visit
(_n_kwredef
.as(not null))
2635 if _n_block
!= null then
2636 v
.visit
(_n_block
.as(not null))
2640 redef class ATypePropdef
2648 redef fun n_kwredef
=(n
)
2655 redef fun n_visibility
=(n
)
2660 redef fun n_kwtype
=(n
)
2670 redef fun n_type
=(n
)
2676 private init empty_init
do end
2678 init init_atypepropdef
(
2679 n_doc
: nullable PDoc ,
2680 n_kwredef
: nullable TKwredef ,
2681 n_visibility
: nullable PVisibility ,
2682 n_kwtype
: nullable TKwtype ,
2683 n_id
: nullable TClassid ,
2684 n_type
: nullable PType
2689 if n_doc
!= null then
2692 _n_kwredef
= n_kwredef
2693 if n_kwredef
!= null then
2694 n_kwredef
.parent
= self
2696 _n_visibility
= n_visibility
.as(not null)
2697 n_visibility
.parent
= self
2698 _n_kwtype
= n_kwtype
.as(not null)
2699 n_kwtype
.parent
= self
2700 _n_id
= n_id
.as(not null)
2702 _n_type
= n_type
.as(not null)
2703 n_type
.parent
= self
2706 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2708 if _n_doc
== old_child
then
2709 if new_child
!= null then
2710 new_child
.parent
= self
2711 assert new_child
isa PDoc
2718 if _n_kwredef
== old_child
then
2719 if new_child
!= null then
2720 new_child
.parent
= self
2721 assert new_child
isa TKwredef
2722 _n_kwredef
= new_child
2728 if _n_visibility
== old_child
then
2729 if new_child
!= null then
2730 new_child
.parent
= self
2731 assert new_child
isa PVisibility
2732 _n_visibility
= new_child
2738 if _n_kwtype
== old_child
then
2739 if new_child
!= null then
2740 new_child
.parent
= self
2741 assert new_child
isa TKwtype
2742 _n_kwtype
= new_child
2748 if _n_id
== old_child
then
2749 if new_child
!= null then
2750 new_child
.parent
= self
2751 assert new_child
isa TClassid
2758 if _n_type
== old_child
then
2759 if new_child
!= null then
2760 new_child
.parent
= self
2761 assert new_child
isa PType
2770 redef fun visit_all
(v
: Visitor)
2772 if _n_doc
!= null then
2773 v
.visit
(_n_doc
.as(not null))
2775 if _n_kwredef
!= null then
2776 v
.visit
(_n_kwredef
.as(not null))
2778 v
.visit
(_n_visibility
)
2784 redef fun visit_all_reverse
(v
: Visitor)
2786 if _n_doc
!= null then
2787 v
.visit
(_n_doc
.as(not null))
2789 if _n_kwredef
!= null then
2790 v
.visit
(_n_kwredef
.as(not null))
2792 v
.visit
(_n_visibility
)
2798 redef class AReadAble
2799 redef fun n_kwredef
=(n
)
2806 redef fun n_kwreadable
=(n
)
2812 private init empty_init
do end
2814 init init_areadable
(
2815 n_kwredef
: nullable TKwredef ,
2816 n_kwreadable
: nullable TKwreadable
2820 _n_kwredef
= n_kwredef
2821 if n_kwredef
!= null then
2822 n_kwredef
.parent
= self
2824 _n_kwreadable
= n_kwreadable
.as(not null)
2825 n_kwreadable
.parent
= self
2828 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2830 if _n_kwredef
== old_child
then
2831 if new_child
!= null then
2832 new_child
.parent
= self
2833 assert new_child
isa TKwredef
2834 _n_kwredef
= new_child
2840 if _n_kwreadable
== old_child
then
2841 if new_child
!= null then
2842 new_child
.parent
= self
2843 assert new_child
isa TKwreadable
2844 _n_kwreadable
= new_child
2852 redef fun visit_all
(v
: Visitor)
2854 if _n_kwredef
!= null then
2855 v
.visit
(_n_kwredef
.as(not null))
2857 v
.visit
(_n_kwreadable
)
2860 redef fun visit_all_reverse
(v
: Visitor)
2862 if _n_kwredef
!= null then
2863 v
.visit
(_n_kwredef
.as(not null))
2865 v
.visit
(_n_kwreadable
)
2868 redef class AWriteAble
2869 redef fun n_kwredef
=(n
)
2876 redef fun n_kwwritable
=(n
)
2882 private init empty_init
do end
2884 init init_awriteable
(
2885 n_kwredef
: nullable TKwredef ,
2886 n_kwwritable
: nullable TKwwritable
2890 _n_kwredef
= n_kwredef
2891 if n_kwredef
!= null then
2892 n_kwredef
.parent
= self
2894 _n_kwwritable
= n_kwwritable
.as(not null)
2895 n_kwwritable
.parent
= self
2898 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2900 if _n_kwredef
== old_child
then
2901 if new_child
!= null then
2902 new_child
.parent
= self
2903 assert new_child
isa TKwredef
2904 _n_kwredef
= new_child
2910 if _n_kwwritable
== old_child
then
2911 if new_child
!= null then
2912 new_child
.parent
= self
2913 assert new_child
isa TKwwritable
2914 _n_kwwritable
= new_child
2922 redef fun visit_all
(v
: Visitor)
2924 if _n_kwredef
!= null then
2925 v
.visit
(_n_kwredef
.as(not null))
2927 v
.visit
(_n_kwwritable
)
2930 redef fun visit_all_reverse
(v
: Visitor)
2932 if _n_kwredef
!= null then
2933 v
.visit
(_n_kwredef
.as(not null))
2935 v
.visit
(_n_kwwritable
)
2938 redef class AIdMethid
2945 private init empty_init
do end
2947 init init_aidmethid
(
2952 _n_id
= n_id
.as(not null)
2956 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2958 if _n_id
== old_child
then
2959 if new_child
!= null then
2960 new_child
.parent
= self
2961 assert new_child
isa TId
2970 redef fun visit_all
(v
: Visitor)
2975 redef fun visit_all_reverse
(v
: Visitor)
2980 redef class APlusMethid
2981 redef fun n_plus
=(n
)
2987 private init empty_init
do end
2989 init init_aplusmethid
(
2990 n_plus
: nullable TPlus
2994 _n_plus
= n_plus
.as(not null)
2995 n_plus
.parent
= self
2998 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3000 if _n_plus
== old_child
then
3001 if new_child
!= null then
3002 new_child
.parent
= self
3003 assert new_child
isa TPlus
3012 redef fun visit_all
(v
: Visitor)
3017 redef fun visit_all_reverse
(v
: Visitor)
3022 redef class AMinusMethid
3023 redef fun n_minus
=(n
)
3029 private init empty_init
do end
3031 init init_aminusmethid
(
3032 n_minus
: nullable TMinus
3036 _n_minus
= n_minus
.as(not null)
3037 n_minus
.parent
= self
3040 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3042 if _n_minus
== old_child
then
3043 if new_child
!= null then
3044 new_child
.parent
= self
3045 assert new_child
isa TMinus
3046 _n_minus
= new_child
3054 redef fun visit_all
(v
: Visitor)
3059 redef fun visit_all_reverse
(v
: Visitor)
3064 redef class AStarMethid
3065 redef fun n_star
=(n
)
3071 private init empty_init
do end
3073 init init_astarmethid
(
3074 n_star
: nullable TStar
3078 _n_star
= n_star
.as(not null)
3079 n_star
.parent
= self
3082 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3084 if _n_star
== old_child
then
3085 if new_child
!= null then
3086 new_child
.parent
= self
3087 assert new_child
isa TStar
3096 redef fun visit_all
(v
: Visitor)
3101 redef fun visit_all_reverse
(v
: Visitor)
3106 redef class ASlashMethid
3107 redef fun n_slash
=(n
)
3113 private init empty_init
do end
3115 init init_aslashmethid
(
3116 n_slash
: nullable TSlash
3120 _n_slash
= n_slash
.as(not null)
3121 n_slash
.parent
= self
3124 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3126 if _n_slash
== old_child
then
3127 if new_child
!= null then
3128 new_child
.parent
= self
3129 assert new_child
isa TSlash
3130 _n_slash
= new_child
3138 redef fun visit_all
(v
: Visitor)
3143 redef fun visit_all_reverse
(v
: Visitor)
3148 redef class APercentMethid
3149 redef fun n_percent
=(n
)
3155 private init empty_init
do end
3157 init init_apercentmethid
(
3158 n_percent
: nullable TPercent
3162 _n_percent
= n_percent
.as(not null)
3163 n_percent
.parent
= self
3166 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3168 if _n_percent
== old_child
then
3169 if new_child
!= null then
3170 new_child
.parent
= self
3171 assert new_child
isa TPercent
3172 _n_percent
= new_child
3180 redef fun visit_all
(v
: Visitor)
3185 redef fun visit_all_reverse
(v
: Visitor)
3190 redef class AEqMethid
3197 private init empty_init
do end
3199 init init_aeqmethid
(
3204 _n_eq
= n_eq
.as(not null)
3208 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3210 if _n_eq
== old_child
then
3211 if new_child
!= null then
3212 new_child
.parent
= self
3213 assert new_child
isa TEq
3222 redef fun visit_all
(v
: Visitor)
3227 redef fun visit_all_reverse
(v
: Visitor)
3232 redef class ANeMethid
3239 private init empty_init
do end
3241 init init_anemethid
(
3246 _n_ne
= n_ne
.as(not null)
3250 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3252 if _n_ne
== old_child
then
3253 if new_child
!= null then
3254 new_child
.parent
= self
3255 assert new_child
isa TNe
3264 redef fun visit_all
(v
: Visitor)
3269 redef fun visit_all_reverse
(v
: Visitor)
3274 redef class ALeMethid
3281 private init empty_init
do end
3283 init init_alemethid
(
3288 _n_le
= n_le
.as(not null)
3292 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3294 if _n_le
== old_child
then
3295 if new_child
!= null then
3296 new_child
.parent
= self
3297 assert new_child
isa TLe
3306 redef fun visit_all
(v
: Visitor)
3311 redef fun visit_all_reverse
(v
: Visitor)
3316 redef class AGeMethid
3323 private init empty_init
do end
3325 init init_agemethid
(
3330 _n_ge
= n_ge
.as(not null)
3334 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3336 if _n_ge
== old_child
then
3337 if new_child
!= null then
3338 new_child
.parent
= self
3339 assert new_child
isa TGe
3348 redef fun visit_all
(v
: Visitor)
3353 redef fun visit_all_reverse
(v
: Visitor)
3358 redef class ALtMethid
3365 private init empty_init
do end
3367 init init_altmethid
(
3372 _n_lt
= n_lt
.as(not null)
3376 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3378 if _n_lt
== old_child
then
3379 if new_child
!= null then
3380 new_child
.parent
= self
3381 assert new_child
isa TLt
3390 redef fun visit_all
(v
: Visitor)
3395 redef fun visit_all_reverse
(v
: Visitor)
3400 redef class AGtMethid
3407 private init empty_init
do end
3409 init init_agtmethid
(
3414 _n_gt
= n_gt
.as(not null)
3418 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3420 if _n_gt
== old_child
then
3421 if new_child
!= null then
3422 new_child
.parent
= self
3423 assert new_child
isa TGt
3432 redef fun visit_all
(v
: Visitor)
3437 redef fun visit_all_reverse
(v
: Visitor)
3442 redef class ABraMethid
3443 redef fun n_obra
=(n
)
3448 redef fun n_cbra
=(n
)
3454 private init empty_init
do end
3456 init init_abramethid
(
3457 n_obra
: nullable TObra ,
3458 n_cbra
: nullable TCbra
3462 _n_obra
= n_obra
.as(not null)
3463 n_obra
.parent
= self
3464 _n_cbra
= n_cbra
.as(not null)
3465 n_cbra
.parent
= self
3468 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3470 if _n_obra
== old_child
then
3471 if new_child
!= null then
3472 new_child
.parent
= self
3473 assert new_child
isa TObra
3480 if _n_cbra
== old_child
then
3481 if new_child
!= null then
3482 new_child
.parent
= self
3483 assert new_child
isa TCbra
3492 redef fun visit_all
(v
: Visitor)
3498 redef fun visit_all_reverse
(v
: Visitor)
3504 redef class AStarshipMethid
3505 redef fun n_starship
=(n
)
3511 private init empty_init
do end
3513 init init_astarshipmethid
(
3514 n_starship
: nullable TStarship
3518 _n_starship
= n_starship
.as(not null)
3519 n_starship
.parent
= self
3522 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3524 if _n_starship
== old_child
then
3525 if new_child
!= null then
3526 new_child
.parent
= self
3527 assert new_child
isa TStarship
3528 _n_starship
= new_child
3536 redef fun visit_all
(v
: Visitor)
3538 v
.visit
(_n_starship
)
3541 redef fun visit_all_reverse
(v
: Visitor)
3543 v
.visit
(_n_starship
)
3546 redef class AAssignMethid
3552 redef fun n_assign
=(n
)
3558 private init empty_init
do end
3560 init init_aassignmethid
(
3561 n_id
: nullable TId ,
3562 n_assign
: nullable TAssign
3566 _n_id
= n_id
.as(not null)
3568 _n_assign
= n_assign
.as(not null)
3569 n_assign
.parent
= self
3572 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3574 if _n_id
== old_child
then
3575 if new_child
!= null then
3576 new_child
.parent
= self
3577 assert new_child
isa TId
3584 if _n_assign
== old_child
then
3585 if new_child
!= null then
3586 new_child
.parent
= self
3587 assert new_child
isa TAssign
3588 _n_assign
= new_child
3596 redef fun visit_all
(v
: Visitor)
3602 redef fun visit_all_reverse
(v
: Visitor)
3608 redef class ABraassignMethid
3609 redef fun n_obra
=(n
)
3614 redef fun n_cbra
=(n
)
3619 redef fun n_assign
=(n
)
3625 private init empty_init
do end
3627 init init_abraassignmethid
(
3628 n_obra
: nullable TObra ,
3629 n_cbra
: nullable TCbra ,
3630 n_assign
: nullable TAssign
3634 _n_obra
= n_obra
.as(not null)
3635 n_obra
.parent
= self
3636 _n_cbra
= n_cbra
.as(not null)
3637 n_cbra
.parent
= self
3638 _n_assign
= n_assign
.as(not null)
3639 n_assign
.parent
= self
3642 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3644 if _n_obra
== old_child
then
3645 if new_child
!= null then
3646 new_child
.parent
= self
3647 assert new_child
isa TObra
3654 if _n_cbra
== old_child
then
3655 if new_child
!= null then
3656 new_child
.parent
= self
3657 assert new_child
isa TCbra
3664 if _n_assign
== old_child
then
3665 if new_child
!= null then
3666 new_child
.parent
= self
3667 assert new_child
isa TAssign
3668 _n_assign
= new_child
3676 redef fun visit_all
(v
: Visitor)
3683 redef fun visit_all_reverse
(v
: Visitor)
3690 redef class ASignature
3691 redef fun n_type
=(n
)
3699 private init empty_init
do end
3701 init init_asignature
(
3702 n_params
: Collection[Object] , # Should be Collection[PParam]
3703 n_type
: nullable PType ,
3704 n_closure_decls
: Collection[Object] # Should be Collection[PClosureDecl]
3708 for n
in n_params
do
3714 if n_type
!= null then
3715 n_type
.parent
= self
3717 for n
in n_closure_decls
do
3718 assert n
isa PClosureDecl
3719 _n_closure_decls
.add
(n
)
3724 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3726 for i
in [0.._n_params
.length
[ do
3727 if _n_params
[i
] == old_child
then
3728 if new_child
!= null then
3729 assert new_child
isa PParam
3730 _n_params
[i
] = new_child
3731 new_child
.parent
= self
3733 _n_params
.remove_at
(i
)
3738 if _n_type
== old_child
then
3739 if new_child
!= null then
3740 new_child
.parent
= self
3741 assert new_child
isa PType
3748 for i
in [0.._n_closure_decls
.length
[ do
3749 if _n_closure_decls
[i
] == old_child
then
3750 if new_child
!= null then
3751 assert new_child
isa PClosureDecl
3752 _n_closure_decls
[i
] = new_child
3753 new_child
.parent
= self
3755 _n_closure_decls
.remove_at
(i
)
3762 redef fun visit_all
(v
: Visitor)
3764 for n
in _n_params
do
3767 if _n_type
!= null then
3768 v
.visit
(_n_type
.as(not null))
3770 for n
in _n_closure_decls
do
3775 redef fun visit_all_reverse
(v
: Visitor)
3778 var i
= _n_params
.length
3780 v
.visit
(_n_params
[i
])
3784 if _n_type
!= null then
3785 v
.visit
(_n_type
.as(not null))
3788 var i
= _n_closure_decls
.length
3790 v
.visit
(_n_closure_decls
[i
])
3802 redef fun n_type
=(n
)
3809 redef fun n_dotdotdot
=(n
)
3817 private init empty_init
do end
3820 n_id
: nullable TId ,
3821 n_type
: nullable PType ,
3822 n_dotdotdot
: nullable TDotdotdot
3826 _n_id
= n_id
.as(not null)
3829 if n_type
!= null then
3830 n_type
.parent
= self
3832 _n_dotdotdot
= n_dotdotdot
3833 if n_dotdotdot
!= null then
3834 n_dotdotdot
.parent
= self
3838 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3840 if _n_id
== old_child
then
3841 if new_child
!= null then
3842 new_child
.parent
= self
3843 assert new_child
isa TId
3850 if _n_type
== old_child
then
3851 if new_child
!= null then
3852 new_child
.parent
= self
3853 assert new_child
isa PType
3860 if _n_dotdotdot
== old_child
then
3861 if new_child
!= null then
3862 new_child
.parent
= self
3863 assert new_child
isa TDotdotdot
3864 _n_dotdotdot
= new_child
3872 redef fun visit_all
(v
: Visitor)
3875 if _n_type
!= null then
3876 v
.visit
(_n_type
.as(not null))
3878 if _n_dotdotdot
!= null then
3879 v
.visit
(_n_dotdotdot
.as(not null))
3883 redef fun visit_all_reverse
(v
: Visitor)
3886 if _n_type
!= null then
3887 v
.visit
(_n_type
.as(not null))
3889 if _n_dotdotdot
!= null then
3890 v
.visit
(_n_dotdotdot
.as(not null))
3894 redef class AClosureDecl
3895 redef fun n_kwwith
=(n
)
3900 redef fun n_kwbreak
=(n
)
3912 redef fun n_signature
=(n
)
3917 redef fun n_expr
=(n
)
3925 private init empty_init
do end
3927 init init_aclosuredecl
(
3928 n_kwwith
: nullable TKwwith ,
3929 n_kwbreak
: nullable TKwbreak ,
3930 n_id
: nullable TId ,
3931 n_signature
: nullable PSignature ,
3932 n_expr
: nullable PExpr
3936 _n_kwwith
= n_kwwith
.as(not null)
3937 n_kwwith
.parent
= self
3938 _n_kwbreak
= n_kwbreak
3939 if n_kwbreak
!= null then
3940 n_kwbreak
.parent
= self
3942 _n_id
= n_id
.as(not null)
3944 _n_signature
= n_signature
.as(not null)
3945 n_signature
.parent
= self
3947 if n_expr
!= null then
3948 n_expr
.parent
= self
3952 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3954 if _n_kwwith
== old_child
then
3955 if new_child
!= null then
3956 new_child
.parent
= self
3957 assert new_child
isa TKwwith
3958 _n_kwwith
= new_child
3964 if _n_kwbreak
== old_child
then
3965 if new_child
!= null then
3966 new_child
.parent
= self
3967 assert new_child
isa TKwbreak
3968 _n_kwbreak
= new_child
3974 if _n_id
== old_child
then
3975 if new_child
!= null then
3976 new_child
.parent
= self
3977 assert new_child
isa TId
3984 if _n_signature
== old_child
then
3985 if new_child
!= null then
3986 new_child
.parent
= self
3987 assert new_child
isa PSignature
3988 _n_signature
= new_child
3994 if _n_expr
== old_child
then
3995 if new_child
!= null then
3996 new_child
.parent
= self
3997 assert new_child
isa PExpr
4006 redef fun visit_all
(v
: Visitor)
4009 if _n_kwbreak
!= null then
4010 v
.visit
(_n_kwbreak
.as(not null))
4013 v
.visit
(_n_signature
)
4014 if _n_expr
!= null then
4015 v
.visit
(_n_expr
.as(not null))
4019 redef fun visit_all_reverse
(v
: Visitor)
4022 if _n_kwbreak
!= null then
4023 v
.visit
(_n_kwbreak
.as(not null))
4026 v
.visit
(_n_signature
)
4027 if _n_expr
!= null then
4028 v
.visit
(_n_expr
.as(not null))
4033 redef fun n_kwnullable
=(n
)
4046 private init empty_init
do end
4049 n_kwnullable
: nullable TKwnullable ,
4050 n_id
: nullable TClassid ,
4051 n_types
: Collection[Object] # Should be Collection[PType]
4055 _n_kwnullable
= n_kwnullable
4056 if n_kwnullable
!= null then
4057 n_kwnullable
.parent
= self
4059 _n_id
= n_id
.as(not null)
4068 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4070 if _n_kwnullable
== old_child
then
4071 if new_child
!= null then
4072 new_child
.parent
= self
4073 assert new_child
isa TKwnullable
4074 _n_kwnullable
= new_child
4076 _n_kwnullable
= null
4080 if _n_id
== old_child
then
4081 if new_child
!= null then
4082 new_child
.parent
= self
4083 assert new_child
isa TClassid
4090 for i
in [0.._n_types
.length
[ do
4091 if _n_types
[i
] == old_child
then
4092 if new_child
!= null then
4093 assert new_child
isa PType
4094 _n_types
[i
] = new_child
4095 new_child
.parent
= self
4097 _n_types
.remove_at
(i
)
4104 redef fun visit_all
(v
: Visitor)
4106 if _n_kwnullable
!= null then
4107 v
.visit
(_n_kwnullable
.as(not null))
4110 for n
in _n_types
do
4115 redef fun visit_all_reverse
(v
: Visitor)
4117 if _n_kwnullable
!= null then
4118 v
.visit
(_n_kwnullable
.as(not null))
4122 var i
= _n_types
.length
4124 v
.visit
(_n_types
[i
])
4130 redef class ABlockExpr
4132 private init empty_init
do end
4134 init init_ablockexpr
(
4135 n_expr
: Collection[Object] # Should be Collection[PExpr]
4146 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4148 for i
in [0.._n_expr
.length
[ do
4149 if _n_expr
[i
] == old_child
then
4150 if new_child
!= null then
4151 assert new_child
isa PExpr
4152 _n_expr
[i
] = new_child
4153 new_child
.parent
= self
4155 _n_expr
.remove_at
(i
)
4162 redef fun visit_all
(v
: Visitor)
4169 redef fun visit_all_reverse
(v
: Visitor)
4172 var i
= _n_expr
.length
4180 redef class AVardeclExpr
4181 redef fun n_kwvar
=(n
)
4191 redef fun n_type
=(n
)
4198 redef fun n_assign
=(n
)
4205 redef fun n_expr
=(n
)
4213 private init empty_init
do end
4215 init init_avardeclexpr
(
4216 n_kwvar
: nullable TKwvar ,
4217 n_id
: nullable TId ,
4218 n_type
: nullable PType ,
4219 n_assign
: nullable TAssign ,
4220 n_expr
: nullable PExpr
4224 _n_kwvar
= n_kwvar
.as(not null)
4225 n_kwvar
.parent
= self
4226 _n_id
= n_id
.as(not null)
4229 if n_type
!= null then
4230 n_type
.parent
= self
4232 _n_assign
= n_assign
4233 if n_assign
!= null then
4234 n_assign
.parent
= self
4237 if n_expr
!= null then
4238 n_expr
.parent
= self
4242 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4244 if _n_kwvar
== old_child
then
4245 if new_child
!= null then
4246 new_child
.parent
= self
4247 assert new_child
isa TKwvar
4248 _n_kwvar
= new_child
4254 if _n_id
== old_child
then
4255 if new_child
!= null then
4256 new_child
.parent
= self
4257 assert new_child
isa TId
4264 if _n_type
== old_child
then
4265 if new_child
!= null then
4266 new_child
.parent
= self
4267 assert new_child
isa PType
4274 if _n_assign
== old_child
then
4275 if new_child
!= null then
4276 new_child
.parent
= self
4277 assert new_child
isa TAssign
4278 _n_assign
= new_child
4284 if _n_expr
== old_child
then
4285 if new_child
!= null then
4286 new_child
.parent
= self
4287 assert new_child
isa PExpr
4296 redef fun visit_all
(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 fun visit_all_reverse
(v
: Visitor)
4315 if _n_type
!= null then
4316 v
.visit
(_n_type
.as(not null))
4318 if _n_assign
!= null then
4319 v
.visit
(_n_assign
.as(not null))
4321 if _n_expr
!= null then
4322 v
.visit
(_n_expr
.as(not null))
4326 redef class AReturnExpr
4327 redef fun n_kwreturn
=(n
)
4332 redef fun n_expr
=(n
)
4340 private init empty_init
do end
4342 init init_areturnexpr
(
4343 n_kwreturn
: nullable TKwreturn ,
4344 n_expr
: nullable PExpr
4348 _n_kwreturn
= n_kwreturn
.as(not null)
4349 n_kwreturn
.parent
= self
4351 if n_expr
!= null then
4352 n_expr
.parent
= self
4356 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4358 if _n_kwreturn
== old_child
then
4359 if new_child
!= null then
4360 new_child
.parent
= self
4361 assert new_child
isa TKwreturn
4362 _n_kwreturn
= new_child
4368 if _n_expr
== old_child
then
4369 if new_child
!= null then
4370 new_child
.parent
= self
4371 assert new_child
isa PExpr
4380 redef fun visit_all
(v
: Visitor)
4382 v
.visit
(_n_kwreturn
)
4383 if _n_expr
!= null then
4384 v
.visit
(_n_expr
.as(not null))
4388 redef fun visit_all_reverse
(v
: Visitor)
4390 v
.visit
(_n_kwreturn
)
4391 if _n_expr
!= null then
4392 v
.visit
(_n_expr
.as(not null))
4396 redef class ABreakExpr
4397 redef fun n_kwbreak
=(n
)
4402 redef fun n_expr
=(n
)
4410 private init empty_init
do end
4412 init init_abreakexpr
(
4413 n_kwbreak
: nullable TKwbreak ,
4414 n_expr
: nullable PExpr
4418 _n_kwbreak
= n_kwbreak
.as(not null)
4419 n_kwbreak
.parent
= self
4421 if n_expr
!= null then
4422 n_expr
.parent
= self
4426 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4428 if _n_kwbreak
== old_child
then
4429 if new_child
!= null then
4430 new_child
.parent
= self
4431 assert new_child
isa TKwbreak
4432 _n_kwbreak
= new_child
4438 if _n_expr
== old_child
then
4439 if new_child
!= null then
4440 new_child
.parent
= self
4441 assert new_child
isa PExpr
4450 redef fun visit_all
(v
: Visitor)
4453 if _n_expr
!= null then
4454 v
.visit
(_n_expr
.as(not null))
4458 redef fun visit_all_reverse
(v
: Visitor)
4461 if _n_expr
!= null then
4462 v
.visit
(_n_expr
.as(not null))
4466 redef class AAbortExpr
4467 redef fun n_kwabort
=(n
)
4473 private init empty_init
do end
4475 init init_aabortexpr
(
4476 n_kwabort
: nullable TKwabort
4480 _n_kwabort
= n_kwabort
.as(not null)
4481 n_kwabort
.parent
= self
4484 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4486 if _n_kwabort
== old_child
then
4487 if new_child
!= null then
4488 new_child
.parent
= self
4489 assert new_child
isa TKwabort
4490 _n_kwabort
= new_child
4498 redef fun visit_all
(v
: Visitor)
4503 redef fun visit_all_reverse
(v
: Visitor)
4508 redef class AContinueExpr
4509 redef fun n_kwcontinue
=(n
)
4514 redef fun n_expr
=(n
)
4522 private init empty_init
do end
4524 init init_acontinueexpr
(
4525 n_kwcontinue
: nullable TKwcontinue ,
4526 n_expr
: nullable PExpr
4530 _n_kwcontinue
= n_kwcontinue
.as(not null)
4531 n_kwcontinue
.parent
= self
4533 if n_expr
!= null then
4534 n_expr
.parent
= self
4538 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4540 if _n_kwcontinue
== old_child
then
4541 if new_child
!= null then
4542 new_child
.parent
= self
4543 assert new_child
isa TKwcontinue
4544 _n_kwcontinue
= new_child
4550 if _n_expr
== old_child
then
4551 if new_child
!= null then
4552 new_child
.parent
= self
4553 assert new_child
isa PExpr
4562 redef fun visit_all
(v
: Visitor)
4564 v
.visit
(_n_kwcontinue
)
4565 if _n_expr
!= null then
4566 v
.visit
(_n_expr
.as(not null))
4570 redef fun visit_all_reverse
(v
: Visitor)
4572 v
.visit
(_n_kwcontinue
)
4573 if _n_expr
!= null then
4574 v
.visit
(_n_expr
.as(not null))
4579 redef fun n_kwdo
=(n
)
4584 redef fun n_block
=(n
)
4592 private init empty_init
do end
4595 n_kwdo
: nullable TKwdo ,
4596 n_block
: nullable PExpr
4600 _n_kwdo
= n_kwdo
.as(not null)
4601 n_kwdo
.parent
= self
4603 if n_block
!= null then
4604 n_block
.parent
= self
4608 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4610 if _n_kwdo
== old_child
then
4611 if new_child
!= null then
4612 new_child
.parent
= self
4613 assert new_child
isa TKwdo
4620 if _n_block
== old_child
then
4621 if new_child
!= null then
4622 new_child
.parent
= self
4623 assert new_child
isa PExpr
4624 _n_block
= new_child
4632 redef fun visit_all
(v
: Visitor)
4635 if _n_block
!= null then
4636 v
.visit
(_n_block
.as(not null))
4640 redef fun visit_all_reverse
(v
: Visitor)
4643 if _n_block
!= null then
4644 v
.visit
(_n_block
.as(not null))
4649 redef fun n_kwif
=(n
)
4654 redef fun n_expr
=(n
)
4659 redef fun n_then
=(n
)
4666 redef fun n_else
=(n
)
4674 private init empty_init
do end
4677 n_kwif
: nullable TKwif ,
4678 n_expr
: nullable PExpr ,
4679 n_then
: nullable PExpr ,
4680 n_else
: nullable PExpr
4684 _n_kwif
= n_kwif
.as(not null)
4685 n_kwif
.parent
= self
4686 _n_expr
= n_expr
.as(not null)
4687 n_expr
.parent
= self
4689 if n_then
!= null then
4690 n_then
.parent
= self
4693 if n_else
!= null then
4694 n_else
.parent
= self
4698 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4700 if _n_kwif
== old_child
then
4701 if new_child
!= null then
4702 new_child
.parent
= self
4703 assert new_child
isa TKwif
4710 if _n_expr
== old_child
then
4711 if new_child
!= null then
4712 new_child
.parent
= self
4713 assert new_child
isa PExpr
4720 if _n_then
== old_child
then
4721 if new_child
!= null then
4722 new_child
.parent
= self
4723 assert new_child
isa PExpr
4730 if _n_else
== old_child
then
4731 if new_child
!= null then
4732 new_child
.parent
= self
4733 assert new_child
isa PExpr
4742 redef fun visit_all
(v
: Visitor)
4746 if _n_then
!= null then
4747 v
.visit
(_n_then
.as(not null))
4749 if _n_else
!= null then
4750 v
.visit
(_n_else
.as(not null))
4754 redef fun visit_all_reverse
(v
: Visitor)
4758 if _n_then
!= null then
4759 v
.visit
(_n_then
.as(not null))
4761 if _n_else
!= null then
4762 v
.visit
(_n_else
.as(not null))
4766 redef class AIfexprExpr
4767 redef fun n_kwif
=(n
)
4772 redef fun n_expr
=(n
)
4777 redef fun n_kwthen
=(n
)
4782 redef fun n_then
=(n
)
4787 redef fun n_kwelse
=(n
)
4792 redef fun n_else
=(n
)
4798 private init empty_init
do end
4800 init init_aifexprexpr
(
4801 n_kwif
: nullable TKwif ,
4802 n_expr
: nullable PExpr ,
4803 n_kwthen
: nullable TKwthen ,
4804 n_then
: nullable PExpr ,
4805 n_kwelse
: nullable TKwelse ,
4806 n_else
: nullable PExpr
4810 _n_kwif
= n_kwif
.as(not null)
4811 n_kwif
.parent
= self
4812 _n_expr
= n_expr
.as(not null)
4813 n_expr
.parent
= self
4814 _n_kwthen
= n_kwthen
.as(not null)
4815 n_kwthen
.parent
= self
4816 _n_then
= n_then
.as(not null)
4817 n_then
.parent
= self
4818 _n_kwelse
= n_kwelse
.as(not null)
4819 n_kwelse
.parent
= self
4820 _n_else
= n_else
.as(not null)
4821 n_else
.parent
= self
4824 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4826 if _n_kwif
== old_child
then
4827 if new_child
!= null then
4828 new_child
.parent
= self
4829 assert new_child
isa TKwif
4836 if _n_expr
== old_child
then
4837 if new_child
!= null then
4838 new_child
.parent
= self
4839 assert new_child
isa PExpr
4846 if _n_kwthen
== old_child
then
4847 if new_child
!= null then
4848 new_child
.parent
= self
4849 assert new_child
isa TKwthen
4850 _n_kwthen
= new_child
4856 if _n_then
== old_child
then
4857 if new_child
!= null then
4858 new_child
.parent
= self
4859 assert new_child
isa PExpr
4866 if _n_kwelse
== old_child
then
4867 if new_child
!= null then
4868 new_child
.parent
= self
4869 assert new_child
isa TKwelse
4870 _n_kwelse
= new_child
4876 if _n_else
== old_child
then
4877 if new_child
!= null then
4878 new_child
.parent
= self
4879 assert new_child
isa PExpr
4888 redef fun visit_all
(v
: Visitor)
4898 redef fun visit_all_reverse
(v
: Visitor)
4908 redef class AWhileExpr
4909 redef fun n_kwwhile
=(n
)
4914 redef fun n_expr
=(n
)
4919 redef fun n_kwdo
=(n
)
4924 redef fun n_block
=(n
)
4932 private init empty_init
do end
4934 init init_awhileexpr
(
4935 n_kwwhile
: nullable TKwwhile ,
4936 n_expr
: nullable PExpr ,
4937 n_kwdo
: nullable TKwdo ,
4938 n_block
: nullable PExpr
4942 _n_kwwhile
= n_kwwhile
.as(not null)
4943 n_kwwhile
.parent
= self
4944 _n_expr
= n_expr
.as(not null)
4945 n_expr
.parent
= self
4946 _n_kwdo
= n_kwdo
.as(not null)
4947 n_kwdo
.parent
= self
4949 if n_block
!= null then
4950 n_block
.parent
= self
4954 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4956 if _n_kwwhile
== old_child
then
4957 if new_child
!= null then
4958 new_child
.parent
= self
4959 assert new_child
isa TKwwhile
4960 _n_kwwhile
= new_child
4966 if _n_expr
== old_child
then
4967 if new_child
!= null then
4968 new_child
.parent
= self
4969 assert new_child
isa PExpr
4976 if _n_kwdo
== old_child
then
4977 if new_child
!= null then
4978 new_child
.parent
= self
4979 assert new_child
isa TKwdo
4986 if _n_block
== old_child
then
4987 if new_child
!= null then
4988 new_child
.parent
= self
4989 assert new_child
isa PExpr
4990 _n_block
= new_child
4998 redef fun visit_all
(v
: Visitor)
5003 if _n_block
!= null then
5004 v
.visit
(_n_block
.as(not null))
5008 redef fun visit_all_reverse
(v
: Visitor)
5013 if _n_block
!= null then
5014 v
.visit
(_n_block
.as(not null))
5018 redef class AForExpr
5019 redef fun n_kwfor
=(n
)
5029 redef fun n_expr
=(n
)
5034 redef fun n_kwdo
=(n
)
5039 redef fun n_block
=(n
)
5047 private init empty_init
do end
5049 init init_aforexpr
(
5050 n_kwfor
: nullable TKwfor ,
5051 n_id
: nullable TId ,
5052 n_expr
: nullable PExpr ,
5053 n_kwdo
: nullable TKwdo ,
5054 n_block
: nullable PExpr
5058 _n_kwfor
= n_kwfor
.as(not null)
5059 n_kwfor
.parent
= self
5060 _n_id
= n_id
.as(not null)
5062 _n_expr
= n_expr
.as(not null)
5063 n_expr
.parent
= self
5064 _n_kwdo
= n_kwdo
.as(not null)
5065 n_kwdo
.parent
= self
5067 if n_block
!= null then
5068 n_block
.parent
= self
5072 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5074 if _n_kwfor
== old_child
then
5075 if new_child
!= null then
5076 new_child
.parent
= self
5077 assert new_child
isa TKwfor
5078 _n_kwfor
= new_child
5084 if _n_id
== old_child
then
5085 if new_child
!= null then
5086 new_child
.parent
= self
5087 assert new_child
isa TId
5094 if _n_expr
== old_child
then
5095 if new_child
!= null then
5096 new_child
.parent
= self
5097 assert new_child
isa PExpr
5104 if _n_kwdo
== old_child
then
5105 if new_child
!= null then
5106 new_child
.parent
= self
5107 assert new_child
isa TKwdo
5114 if _n_block
== old_child
then
5115 if new_child
!= null then
5116 new_child
.parent
= self
5117 assert new_child
isa PExpr
5118 _n_block
= new_child
5126 redef fun visit_all
(v
: Visitor)
5132 if _n_block
!= null then
5133 v
.visit
(_n_block
.as(not null))
5137 redef fun visit_all_reverse
(v
: Visitor)
5143 if _n_block
!= null then
5144 v
.visit
(_n_block
.as(not null))
5148 redef class AAssertExpr
5149 redef fun n_kwassert
=(n
)
5161 redef fun n_expr
=(n
)
5167 private init empty_init
do end
5169 init init_aassertexpr
(
5170 n_kwassert
: nullable TKwassert ,
5171 n_id
: nullable TId ,
5172 n_expr
: nullable PExpr
5176 _n_kwassert
= n_kwassert
.as(not null)
5177 n_kwassert
.parent
= self
5179 if n_id
!= null then
5182 _n_expr
= n_expr
.as(not null)
5183 n_expr
.parent
= self
5186 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5188 if _n_kwassert
== old_child
then
5189 if new_child
!= null then
5190 new_child
.parent
= self
5191 assert new_child
isa TKwassert
5192 _n_kwassert
= new_child
5198 if _n_id
== old_child
then
5199 if new_child
!= null then
5200 new_child
.parent
= self
5201 assert new_child
isa TId
5208 if _n_expr
== old_child
then
5209 if new_child
!= null then
5210 new_child
.parent
= self
5211 assert new_child
isa PExpr
5220 redef fun visit_all
(v
: Visitor)
5222 v
.visit
(_n_kwassert
)
5223 if _n_id
!= null then
5224 v
.visit
(_n_id
.as(not null))
5229 redef fun visit_all_reverse
(v
: Visitor)
5231 v
.visit
(_n_kwassert
)
5232 if _n_id
!= null then
5233 v
.visit
(_n_id
.as(not null))
5238 redef class AOnceExpr
5239 redef fun n_kwonce
=(n
)
5244 redef fun n_expr
=(n
)
5250 private init empty_init
do end
5252 init init_aonceexpr
(
5253 n_kwonce
: nullable TKwonce ,
5254 n_expr
: nullable PExpr
5258 _n_kwonce
= n_kwonce
.as(not null)
5259 n_kwonce
.parent
= self
5260 _n_expr
= n_expr
.as(not null)
5261 n_expr
.parent
= self
5264 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5266 if _n_kwonce
== old_child
then
5267 if new_child
!= null then
5268 new_child
.parent
= self
5269 assert new_child
isa TKwonce
5270 _n_kwonce
= new_child
5276 if _n_expr
== old_child
then
5277 if new_child
!= null then
5278 new_child
.parent
= self
5279 assert new_child
isa PExpr
5288 redef fun visit_all
(v
: Visitor)
5294 redef fun visit_all_reverse
(v
: Visitor)
5300 redef class ASendExpr
5301 redef fun n_expr
=(n
)
5307 private init empty_init
do end
5309 init init_asendexpr
(
5310 n_expr
: nullable PExpr
5314 _n_expr
= n_expr
.as(not null)
5315 n_expr
.parent
= self
5318 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5320 if _n_expr
== old_child
then
5321 if new_child
!= null then
5322 new_child
.parent
= self
5323 assert new_child
isa PExpr
5332 redef fun visit_all
(v
: Visitor)
5337 redef fun visit_all_reverse
(v
: Visitor)
5342 redef class ABinopExpr
5343 redef fun n_expr
=(n
)
5348 redef fun n_expr2
=(n
)
5354 private init empty_init
do end
5356 init init_abinopexpr
(
5357 n_expr
: nullable PExpr ,
5358 n_expr2
: nullable PExpr
5362 _n_expr
= n_expr
.as(not null)
5363 n_expr
.parent
= self
5364 _n_expr2
= n_expr2
.as(not null)
5365 n_expr2
.parent
= self
5368 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5370 if _n_expr
== old_child
then
5371 if new_child
!= null then
5372 new_child
.parent
= self
5373 assert new_child
isa PExpr
5380 if _n_expr2
== old_child
then
5381 if new_child
!= null then
5382 new_child
.parent
= self
5383 assert new_child
isa PExpr
5384 _n_expr2
= new_child
5392 redef fun visit_all
(v
: Visitor)
5398 redef fun visit_all_reverse
(v
: Visitor)
5405 redef fun n_expr
=(n
)
5410 redef fun n_expr2
=(n
)
5416 private init empty_init
do end
5419 n_expr
: nullable PExpr ,
5420 n_expr2
: nullable PExpr
5424 _n_expr
= n_expr
.as(not null)
5425 n_expr
.parent
= self
5426 _n_expr2
= n_expr2
.as(not null)
5427 n_expr2
.parent
= self
5430 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5432 if _n_expr
== old_child
then
5433 if new_child
!= null then
5434 new_child
.parent
= self
5435 assert new_child
isa PExpr
5442 if _n_expr2
== old_child
then
5443 if new_child
!= null then
5444 new_child
.parent
= self
5445 assert new_child
isa PExpr
5446 _n_expr2
= new_child
5454 redef fun visit_all
(v
: Visitor)
5460 redef fun visit_all_reverse
(v
: Visitor)
5466 redef class AAndExpr
5467 redef fun n_expr
=(n
)
5472 redef fun n_expr2
=(n
)
5478 private init empty_init
do end
5480 init init_aandexpr
(
5481 n_expr
: nullable PExpr ,
5482 n_expr2
: nullable PExpr
5486 _n_expr
= n_expr
.as(not null)
5487 n_expr
.parent
= self
5488 _n_expr2
= n_expr2
.as(not null)
5489 n_expr2
.parent
= self
5492 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5494 if _n_expr
== old_child
then
5495 if new_child
!= null then
5496 new_child
.parent
= self
5497 assert new_child
isa PExpr
5504 if _n_expr2
== old_child
then
5505 if new_child
!= null then
5506 new_child
.parent
= self
5507 assert new_child
isa PExpr
5508 _n_expr2
= new_child
5516 redef fun visit_all
(v
: Visitor)
5522 redef fun visit_all_reverse
(v
: Visitor)
5528 redef class ANotExpr
5529 redef fun n_kwnot
=(n
)
5534 redef fun n_expr
=(n
)
5540 private init empty_init
do end
5542 init init_anotexpr
(
5543 n_kwnot
: nullable TKwnot ,
5544 n_expr
: nullable PExpr
5548 _n_kwnot
= n_kwnot
.as(not null)
5549 n_kwnot
.parent
= self
5550 _n_expr
= n_expr
.as(not null)
5551 n_expr
.parent
= self
5554 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5556 if _n_kwnot
== old_child
then
5557 if new_child
!= null then
5558 new_child
.parent
= self
5559 assert new_child
isa TKwnot
5560 _n_kwnot
= new_child
5566 if _n_expr
== old_child
then
5567 if new_child
!= null then
5568 new_child
.parent
= self
5569 assert new_child
isa PExpr
5578 redef fun visit_all
(v
: Visitor)
5584 redef fun visit_all_reverse
(v
: Visitor)
5591 redef fun n_expr
=(n
)
5596 redef fun n_expr2
=(n
)
5602 private init empty_init
do end
5605 n_expr
: nullable PExpr ,
5606 n_expr2
: nullable PExpr
5610 _n_expr
= n_expr
.as(not null)
5611 n_expr
.parent
= self
5612 _n_expr2
= n_expr2
.as(not null)
5613 n_expr2
.parent
= self
5616 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5618 if _n_expr
== old_child
then
5619 if new_child
!= null then
5620 new_child
.parent
= self
5621 assert new_child
isa PExpr
5628 if _n_expr2
== old_child
then
5629 if new_child
!= null then
5630 new_child
.parent
= self
5631 assert new_child
isa PExpr
5632 _n_expr2
= new_child
5640 redef fun visit_all
(v
: Visitor)
5646 redef fun visit_all_reverse
(v
: Visitor)
5653 redef fun n_expr
=(n
)
5658 redef fun n_expr2
=(n
)
5664 private init empty_init
do end
5667 n_expr
: nullable PExpr ,
5668 n_expr2
: nullable PExpr
5672 _n_expr
= n_expr
.as(not null)
5673 n_expr
.parent
= self
5674 _n_expr2
= n_expr2
.as(not null)
5675 n_expr2
.parent
= self
5678 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5680 if _n_expr
== old_child
then
5681 if new_child
!= null then
5682 new_child
.parent
= self
5683 assert new_child
isa PExpr
5690 if _n_expr2
== old_child
then
5691 if new_child
!= null then
5692 new_child
.parent
= self
5693 assert new_child
isa PExpr
5694 _n_expr2
= new_child
5702 redef fun visit_all
(v
: Visitor)
5708 redef fun visit_all_reverse
(v
: Visitor)
5715 redef fun n_expr
=(n
)
5720 redef fun n_expr2
=(n
)
5726 private init empty_init
do end
5729 n_expr
: nullable PExpr ,
5730 n_expr2
: nullable PExpr
5734 _n_expr
= n_expr
.as(not null)
5735 n_expr
.parent
= self
5736 _n_expr2
= n_expr2
.as(not null)
5737 n_expr2
.parent
= self
5740 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5742 if _n_expr
== old_child
then
5743 if new_child
!= null then
5744 new_child
.parent
= self
5745 assert new_child
isa PExpr
5752 if _n_expr2
== old_child
then
5753 if new_child
!= null then
5754 new_child
.parent
= self
5755 assert new_child
isa PExpr
5756 _n_expr2
= new_child
5764 redef fun visit_all
(v
: Visitor)
5770 redef fun visit_all_reverse
(v
: Visitor)
5777 redef fun n_expr
=(n
)
5782 redef fun n_expr2
=(n
)
5788 private init empty_init
do end
5791 n_expr
: nullable PExpr ,
5792 n_expr2
: nullable PExpr
5796 _n_expr
= n_expr
.as(not null)
5797 n_expr
.parent
= self
5798 _n_expr2
= n_expr2
.as(not null)
5799 n_expr2
.parent
= self
5802 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5804 if _n_expr
== old_child
then
5805 if new_child
!= null then
5806 new_child
.parent
= self
5807 assert new_child
isa PExpr
5814 if _n_expr2
== old_child
then
5815 if new_child
!= null then
5816 new_child
.parent
= self
5817 assert new_child
isa PExpr
5818 _n_expr2
= new_child
5826 redef fun visit_all
(v
: Visitor)
5832 redef fun visit_all_reverse
(v
: Visitor)
5839 redef fun n_expr
=(n
)
5844 redef fun n_expr2
=(n
)
5850 private init empty_init
do end
5853 n_expr
: nullable PExpr ,
5854 n_expr2
: nullable PExpr
5858 _n_expr
= n_expr
.as(not null)
5859 n_expr
.parent
= self
5860 _n_expr2
= n_expr2
.as(not null)
5861 n_expr2
.parent
= self
5864 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5866 if _n_expr
== old_child
then
5867 if new_child
!= null then
5868 new_child
.parent
= self
5869 assert new_child
isa PExpr
5876 if _n_expr2
== old_child
then
5877 if new_child
!= null then
5878 new_child
.parent
= self
5879 assert new_child
isa PExpr
5880 _n_expr2
= new_child
5888 redef fun visit_all
(v
: Visitor)
5894 redef fun visit_all_reverse
(v
: Visitor)
5901 redef fun n_expr
=(n
)
5906 redef fun n_expr2
=(n
)
5912 private init empty_init
do end
5915 n_expr
: nullable PExpr ,
5916 n_expr2
: nullable PExpr
5920 _n_expr
= n_expr
.as(not null)
5921 n_expr
.parent
= self
5922 _n_expr2
= n_expr2
.as(not null)
5923 n_expr2
.parent
= self
5926 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5928 if _n_expr
== old_child
then
5929 if new_child
!= null then
5930 new_child
.parent
= self
5931 assert new_child
isa PExpr
5938 if _n_expr2
== old_child
then
5939 if new_child
!= null then
5940 new_child
.parent
= self
5941 assert new_child
isa PExpr
5942 _n_expr2
= new_child
5950 redef fun visit_all
(v
: Visitor)
5956 redef fun visit_all_reverse
(v
: Visitor)
5963 redef fun n_expr
=(n
)
5968 redef fun n_expr2
=(n
)
5974 private init empty_init
do end
5977 n_expr
: nullable PExpr ,
5978 n_expr2
: nullable PExpr
5982 _n_expr
= n_expr
.as(not null)
5983 n_expr
.parent
= self
5984 _n_expr2
= n_expr2
.as(not null)
5985 n_expr2
.parent
= self
5988 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5990 if _n_expr
== old_child
then
5991 if new_child
!= null then
5992 new_child
.parent
= self
5993 assert new_child
isa PExpr
6000 if _n_expr2
== old_child
then
6001 if new_child
!= null then
6002 new_child
.parent
= self
6003 assert new_child
isa PExpr
6004 _n_expr2
= new_child
6012 redef fun visit_all
(v
: Visitor)
6018 redef fun visit_all_reverse
(v
: Visitor)
6024 redef class AIsaExpr
6025 redef fun n_expr
=(n
)
6030 redef fun n_type
=(n
)
6036 private init empty_init
do end
6038 init init_aisaexpr
(
6039 n_expr
: nullable PExpr ,
6040 n_type
: nullable PType
6044 _n_expr
= n_expr
.as(not null)
6045 n_expr
.parent
= self
6046 _n_type
= n_type
.as(not null)
6047 n_type
.parent
= self
6050 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6052 if _n_expr
== old_child
then
6053 if new_child
!= null then
6054 new_child
.parent
= self
6055 assert new_child
isa PExpr
6062 if _n_type
== old_child
then
6063 if new_child
!= null then
6064 new_child
.parent
= self
6065 assert new_child
isa PType
6074 redef fun visit_all
(v
: Visitor)
6080 redef fun visit_all_reverse
(v
: Visitor)
6086 redef class APlusExpr
6087 redef fun n_expr
=(n
)
6092 redef fun n_expr2
=(n
)
6098 private init empty_init
do end
6100 init init_aplusexpr
(
6101 n_expr
: nullable PExpr ,
6102 n_expr2
: nullable PExpr
6106 _n_expr
= n_expr
.as(not null)
6107 n_expr
.parent
= self
6108 _n_expr2
= n_expr2
.as(not null)
6109 n_expr2
.parent
= self
6112 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6114 if _n_expr
== old_child
then
6115 if new_child
!= null then
6116 new_child
.parent
= self
6117 assert new_child
isa PExpr
6124 if _n_expr2
== old_child
then
6125 if new_child
!= null then
6126 new_child
.parent
= self
6127 assert new_child
isa PExpr
6128 _n_expr2
= new_child
6136 redef fun visit_all
(v
: Visitor)
6142 redef fun visit_all_reverse
(v
: Visitor)
6148 redef class AMinusExpr
6149 redef fun n_expr
=(n
)
6154 redef fun n_expr2
=(n
)
6160 private init empty_init
do end
6162 init init_aminusexpr
(
6163 n_expr
: nullable PExpr ,
6164 n_expr2
: nullable PExpr
6168 _n_expr
= n_expr
.as(not null)
6169 n_expr
.parent
= self
6170 _n_expr2
= n_expr2
.as(not null)
6171 n_expr2
.parent
= self
6174 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6176 if _n_expr
== old_child
then
6177 if new_child
!= null then
6178 new_child
.parent
= self
6179 assert new_child
isa PExpr
6186 if _n_expr2
== old_child
then
6187 if new_child
!= null then
6188 new_child
.parent
= self
6189 assert new_child
isa PExpr
6190 _n_expr2
= new_child
6198 redef fun visit_all
(v
: Visitor)
6204 redef fun visit_all_reverse
(v
: Visitor)
6210 redef class AStarshipExpr
6211 redef fun n_expr
=(n
)
6216 redef fun n_expr2
=(n
)
6222 private init empty_init
do end
6224 init init_astarshipexpr
(
6225 n_expr
: nullable PExpr ,
6226 n_expr2
: nullable PExpr
6230 _n_expr
= n_expr
.as(not null)
6231 n_expr
.parent
= self
6232 _n_expr2
= n_expr2
.as(not null)
6233 n_expr2
.parent
= self
6236 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6238 if _n_expr
== old_child
then
6239 if new_child
!= null then
6240 new_child
.parent
= self
6241 assert new_child
isa PExpr
6248 if _n_expr2
== old_child
then
6249 if new_child
!= null then
6250 new_child
.parent
= self
6251 assert new_child
isa PExpr
6252 _n_expr2
= new_child
6260 redef fun visit_all
(v
: Visitor)
6266 redef fun visit_all_reverse
(v
: Visitor)
6272 redef class AStarExpr
6273 redef fun n_expr
=(n
)
6278 redef fun n_expr2
=(n
)
6284 private init empty_init
do end
6286 init init_astarexpr
(
6287 n_expr
: nullable PExpr ,
6288 n_expr2
: nullable PExpr
6292 _n_expr
= n_expr
.as(not null)
6293 n_expr
.parent
= self
6294 _n_expr2
= n_expr2
.as(not null)
6295 n_expr2
.parent
= self
6298 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6300 if _n_expr
== old_child
then
6301 if new_child
!= null then
6302 new_child
.parent
= self
6303 assert new_child
isa PExpr
6310 if _n_expr2
== old_child
then
6311 if new_child
!= null then
6312 new_child
.parent
= self
6313 assert new_child
isa PExpr
6314 _n_expr2
= new_child
6322 redef fun visit_all
(v
: Visitor)
6328 redef fun visit_all_reverse
(v
: Visitor)
6334 redef class ASlashExpr
6335 redef fun n_expr
=(n
)
6340 redef fun n_expr2
=(n
)
6346 private init empty_init
do end
6348 init init_aslashexpr
(
6349 n_expr
: nullable PExpr ,
6350 n_expr2
: nullable PExpr
6354 _n_expr
= n_expr
.as(not null)
6355 n_expr
.parent
= self
6356 _n_expr2
= n_expr2
.as(not null)
6357 n_expr2
.parent
= self
6360 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6362 if _n_expr
== old_child
then
6363 if new_child
!= null then
6364 new_child
.parent
= self
6365 assert new_child
isa PExpr
6372 if _n_expr2
== old_child
then
6373 if new_child
!= null then
6374 new_child
.parent
= self
6375 assert new_child
isa PExpr
6376 _n_expr2
= new_child
6384 redef fun visit_all
(v
: Visitor)
6390 redef fun visit_all_reverse
(v
: Visitor)
6396 redef class APercentExpr
6397 redef fun n_expr
=(n
)
6402 redef fun n_expr2
=(n
)
6408 private init empty_init
do end
6410 init init_apercentexpr
(
6411 n_expr
: nullable PExpr ,
6412 n_expr2
: nullable PExpr
6416 _n_expr
= n_expr
.as(not null)
6417 n_expr
.parent
= self
6418 _n_expr2
= n_expr2
.as(not null)
6419 n_expr2
.parent
= self
6422 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6424 if _n_expr
== old_child
then
6425 if new_child
!= null then
6426 new_child
.parent
= self
6427 assert new_child
isa PExpr
6434 if _n_expr2
== old_child
then
6435 if new_child
!= null then
6436 new_child
.parent
= self
6437 assert new_child
isa PExpr
6438 _n_expr2
= new_child
6446 redef fun visit_all
(v
: Visitor)
6452 redef fun visit_all_reverse
(v
: Visitor)
6458 redef class AUminusExpr
6459 redef fun n_minus
=(n
)
6464 redef fun n_expr
=(n
)
6470 private init empty_init
do end
6472 init init_auminusexpr
(
6473 n_minus
: nullable TMinus ,
6474 n_expr
: nullable PExpr
6478 _n_minus
= n_minus
.as(not null)
6479 n_minus
.parent
= self
6480 _n_expr
= n_expr
.as(not null)
6481 n_expr
.parent
= self
6484 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6486 if _n_minus
== old_child
then
6487 if new_child
!= null then
6488 new_child
.parent
= self
6489 assert new_child
isa TMinus
6490 _n_minus
= new_child
6496 if _n_expr
== old_child
then
6497 if new_child
!= null then
6498 new_child
.parent
= self
6499 assert new_child
isa PExpr
6508 redef fun visit_all
(v
: Visitor)
6514 redef fun visit_all_reverse
(v
: Visitor)
6520 redef class ANewExpr
6521 redef fun n_kwnew
=(n
)
6526 redef fun n_type
=(n
)
6539 private init empty_init
do end
6541 init init_anewexpr
(
6542 n_kwnew
: nullable TKwnew ,
6543 n_type
: nullable PType ,
6544 n_id
: nullable TId ,
6545 n_args
: Collection[Object] # Should be Collection[PExpr]
6549 _n_kwnew
= n_kwnew
.as(not null)
6550 n_kwnew
.parent
= self
6551 _n_type
= n_type
.as(not null)
6552 n_type
.parent
= self
6554 if n_id
!= null then
6564 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6566 if _n_kwnew
== old_child
then
6567 if new_child
!= null then
6568 new_child
.parent
= self
6569 assert new_child
isa TKwnew
6570 _n_kwnew
= new_child
6576 if _n_type
== old_child
then
6577 if new_child
!= null then
6578 new_child
.parent
= self
6579 assert new_child
isa PType
6586 if _n_id
== old_child
then
6587 if new_child
!= null then
6588 new_child
.parent
= self
6589 assert new_child
isa TId
6596 for i
in [0.._n_args
.length
[ do
6597 if _n_args
[i
] == old_child
then
6598 if new_child
!= null then
6599 assert new_child
isa PExpr
6600 _n_args
[i
] = new_child
6601 new_child
.parent
= self
6603 _n_args
.remove_at
(i
)
6610 redef fun visit_all
(v
: Visitor)
6614 if _n_id
!= null then
6615 v
.visit
(_n_id
.as(not null))
6622 redef fun visit_all_reverse
(v
: Visitor)
6626 if _n_id
!= null then
6627 v
.visit
(_n_id
.as(not null))
6630 var i
= _n_args
.length
6638 redef class AAttrExpr
6639 redef fun n_expr
=(n
)
6650 private init empty_init
do end
6652 init init_aattrexpr
(
6653 n_expr
: nullable PExpr ,
6654 n_id
: nullable TAttrid
6658 _n_expr
= n_expr
.as(not null)
6659 n_expr
.parent
= self
6660 _n_id
= n_id
.as(not null)
6664 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6666 if _n_expr
== old_child
then
6667 if new_child
!= null then
6668 new_child
.parent
= self
6669 assert new_child
isa PExpr
6676 if _n_id
== old_child
then
6677 if new_child
!= null then
6678 new_child
.parent
= self
6679 assert new_child
isa TAttrid
6688 redef fun visit_all
(v
: Visitor)
6694 redef fun visit_all_reverse
(v
: Visitor)
6700 redef class AAttrAssignExpr
6701 redef fun n_expr
=(n
)
6711 redef fun n_assign
=(n
)
6716 redef fun n_value
=(n
)
6722 private init empty_init
do end
6724 init init_aattrassignexpr
(
6725 n_expr
: nullable PExpr ,
6726 n_id
: nullable TAttrid ,
6727 n_assign
: nullable TAssign ,
6728 n_value
: nullable PExpr
6732 _n_expr
= n_expr
.as(not null)
6733 n_expr
.parent
= self
6734 _n_id
= n_id
.as(not null)
6736 _n_assign
= n_assign
.as(not null)
6737 n_assign
.parent
= self
6738 _n_value
= n_value
.as(not null)
6739 n_value
.parent
= self
6742 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6744 if _n_expr
== old_child
then
6745 if new_child
!= null then
6746 new_child
.parent
= self
6747 assert new_child
isa PExpr
6754 if _n_id
== old_child
then
6755 if new_child
!= null then
6756 new_child
.parent
= self
6757 assert new_child
isa TAttrid
6764 if _n_assign
== old_child
then
6765 if new_child
!= null then
6766 new_child
.parent
= self
6767 assert new_child
isa TAssign
6768 _n_assign
= new_child
6774 if _n_value
== old_child
then
6775 if new_child
!= null then
6776 new_child
.parent
= self
6777 assert new_child
isa PExpr
6778 _n_value
= new_child
6786 redef fun visit_all
(v
: Visitor)
6794 redef fun visit_all_reverse
(v
: Visitor)
6802 redef class AAttrReassignExpr
6803 redef fun n_expr
=(n
)
6813 redef fun n_assign_op
=(n
)
6818 redef fun n_value
=(n
)
6824 private init empty_init
do end
6826 init init_aattrreassignexpr
(
6827 n_expr
: nullable PExpr ,
6828 n_id
: nullable TAttrid ,
6829 n_assign_op
: nullable PAssignOp ,
6830 n_value
: nullable PExpr
6834 _n_expr
= n_expr
.as(not null)
6835 n_expr
.parent
= self
6836 _n_id
= n_id
.as(not null)
6838 _n_assign_op
= n_assign_op
.as(not null)
6839 n_assign_op
.parent
= self
6840 _n_value
= n_value
.as(not null)
6841 n_value
.parent
= self
6844 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6846 if _n_expr
== old_child
then
6847 if new_child
!= null then
6848 new_child
.parent
= self
6849 assert new_child
isa PExpr
6856 if _n_id
== old_child
then
6857 if new_child
!= null then
6858 new_child
.parent
= self
6859 assert new_child
isa TAttrid
6866 if _n_assign_op
== old_child
then
6867 if new_child
!= null then
6868 new_child
.parent
= self
6869 assert new_child
isa PAssignOp
6870 _n_assign_op
= new_child
6876 if _n_value
== old_child
then
6877 if new_child
!= null then
6878 new_child
.parent
= self
6879 assert new_child
isa PExpr
6880 _n_value
= new_child
6888 redef fun visit_all
(v
: Visitor)
6892 v
.visit
(_n_assign_op
)
6896 redef fun visit_all_reverse
(v
: Visitor)
6900 v
.visit
(_n_assign_op
)
6904 redef class ACallExpr
6905 redef fun n_expr
=(n
)
6916 private init empty_init
do end
6918 init init_acallexpr
(
6919 n_expr
: nullable PExpr ,
6920 n_id
: nullable TId ,
6921 n_args
: Collection[Object] , # Should be Collection[PExpr]
6922 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
6926 _n_expr
= n_expr
.as(not null)
6927 n_expr
.parent
= self
6928 _n_id
= n_id
.as(not null)
6935 for n
in n_closure_defs
do
6936 assert n
isa PClosureDef
6937 _n_closure_defs
.add
(n
)
6942 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6944 if _n_expr
== old_child
then
6945 if new_child
!= null then
6946 new_child
.parent
= self
6947 assert new_child
isa PExpr
6954 if _n_id
== old_child
then
6955 if new_child
!= null then
6956 new_child
.parent
= self
6957 assert new_child
isa TId
6964 for i
in [0.._n_args
.length
[ do
6965 if _n_args
[i
] == old_child
then
6966 if new_child
!= null then
6967 assert new_child
isa PExpr
6968 _n_args
[i
] = new_child
6969 new_child
.parent
= self
6971 _n_args
.remove_at
(i
)
6976 for i
in [0.._n_closure_defs
.length
[ do
6977 if _n_closure_defs
[i
] == old_child
then
6978 if new_child
!= null then
6979 assert new_child
isa PClosureDef
6980 _n_closure_defs
[i
] = new_child
6981 new_child
.parent
= self
6983 _n_closure_defs
.remove_at
(i
)
6990 redef fun visit_all
(v
: Visitor)
6997 for n
in _n_closure_defs
do
7002 redef fun visit_all_reverse
(v
: Visitor)
7007 var i
= _n_args
.length
7014 var i
= _n_closure_defs
.length
7016 v
.visit
(_n_closure_defs
[i
])
7022 redef class ACallAssignExpr
7023 redef fun n_expr
=(n
)
7033 redef fun n_assign
=(n
)
7038 redef fun n_value
=(n
)
7044 private init empty_init
do end
7046 init init_acallassignexpr
(
7047 n_expr
: nullable PExpr ,
7048 n_id
: nullable TId ,
7049 n_args
: Collection[Object] , # Should be Collection[PExpr]
7050 n_assign
: nullable TAssign ,
7051 n_value
: nullable PExpr
7055 _n_expr
= n_expr
.as(not null)
7056 n_expr
.parent
= self
7057 _n_id
= n_id
.as(not null)
7064 _n_assign
= n_assign
.as(not null)
7065 n_assign
.parent
= self
7066 _n_value
= n_value
.as(not null)
7067 n_value
.parent
= self
7070 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7072 if _n_expr
== old_child
then
7073 if new_child
!= null then
7074 new_child
.parent
= self
7075 assert new_child
isa PExpr
7082 if _n_id
== old_child
then
7083 if new_child
!= null then
7084 new_child
.parent
= self
7085 assert new_child
isa TId
7092 for i
in [0.._n_args
.length
[ do
7093 if _n_args
[i
] == old_child
then
7094 if new_child
!= null then
7095 assert new_child
isa PExpr
7096 _n_args
[i
] = new_child
7097 new_child
.parent
= self
7099 _n_args
.remove_at
(i
)
7104 if _n_assign
== old_child
then
7105 if new_child
!= null then
7106 new_child
.parent
= self
7107 assert new_child
isa TAssign
7108 _n_assign
= new_child
7114 if _n_value
== old_child
then
7115 if new_child
!= null then
7116 new_child
.parent
= self
7117 assert new_child
isa PExpr
7118 _n_value
= new_child
7126 redef fun visit_all
(v
: Visitor)
7137 redef fun visit_all_reverse
(v
: Visitor)
7142 var i
= _n_args
.length
7152 redef class ACallReassignExpr
7153 redef fun n_expr
=(n
)
7163 redef fun n_assign_op
=(n
)
7168 redef fun n_value
=(n
)
7174 private init empty_init
do end
7176 init init_acallreassignexpr
(
7177 n_expr
: nullable PExpr ,
7178 n_id
: nullable TId ,
7179 n_args
: Collection[Object] , # Should be Collection[PExpr]
7180 n_assign_op
: nullable PAssignOp ,
7181 n_value
: nullable PExpr
7185 _n_expr
= n_expr
.as(not null)
7186 n_expr
.parent
= self
7187 _n_id
= n_id
.as(not null)
7194 _n_assign_op
= n_assign_op
.as(not null)
7195 n_assign_op
.parent
= self
7196 _n_value
= n_value
.as(not null)
7197 n_value
.parent
= self
7200 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7202 if _n_expr
== old_child
then
7203 if new_child
!= null then
7204 new_child
.parent
= self
7205 assert new_child
isa PExpr
7212 if _n_id
== old_child
then
7213 if new_child
!= null then
7214 new_child
.parent
= self
7215 assert new_child
isa TId
7222 for i
in [0.._n_args
.length
[ do
7223 if _n_args
[i
] == old_child
then
7224 if new_child
!= null then
7225 assert new_child
isa PExpr
7226 _n_args
[i
] = new_child
7227 new_child
.parent
= self
7229 _n_args
.remove_at
(i
)
7234 if _n_assign_op
== old_child
then
7235 if new_child
!= null then
7236 new_child
.parent
= self
7237 assert new_child
isa PAssignOp
7238 _n_assign_op
= new_child
7244 if _n_value
== old_child
then
7245 if new_child
!= null then
7246 new_child
.parent
= self
7247 assert new_child
isa PExpr
7248 _n_value
= new_child
7256 redef fun visit_all
(v
: Visitor)
7263 v
.visit
(_n_assign_op
)
7267 redef fun visit_all_reverse
(v
: Visitor)
7272 var i
= _n_args
.length
7278 v
.visit
(_n_assign_op
)
7282 redef class ASuperExpr
7283 redef fun n_qualified
=(n
)
7290 redef fun n_kwsuper
=(n
)
7296 private init empty_init
do end
7298 init init_asuperexpr
(
7299 n_qualified
: nullable PQualified ,
7300 n_kwsuper
: nullable TKwsuper ,
7301 n_args
: Collection[Object] # Should be Collection[PExpr]
7305 _n_qualified
= n_qualified
7306 if n_qualified
!= null then
7307 n_qualified
.parent
= self
7309 _n_kwsuper
= n_kwsuper
.as(not null)
7310 n_kwsuper
.parent
= self
7318 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7320 if _n_qualified
== old_child
then
7321 if new_child
!= null then
7322 new_child
.parent
= self
7323 assert new_child
isa PQualified
7324 _n_qualified
= new_child
7330 if _n_kwsuper
== old_child
then
7331 if new_child
!= null then
7332 new_child
.parent
= self
7333 assert new_child
isa TKwsuper
7334 _n_kwsuper
= new_child
7340 for i
in [0.._n_args
.length
[ do
7341 if _n_args
[i
] == old_child
then
7342 if new_child
!= null then
7343 assert new_child
isa PExpr
7344 _n_args
[i
] = new_child
7345 new_child
.parent
= self
7347 _n_args
.remove_at
(i
)
7354 redef fun visit_all
(v
: Visitor)
7356 if _n_qualified
!= null then
7357 v
.visit
(_n_qualified
.as(not null))
7365 redef fun visit_all_reverse
(v
: Visitor)
7367 if _n_qualified
!= null then
7368 v
.visit
(_n_qualified
.as(not null))
7372 var i
= _n_args
.length
7380 redef class AInitExpr
7381 redef fun n_expr
=(n
)
7386 redef fun n_kwinit
=(n
)
7392 private init empty_init
do end
7394 init init_ainitexpr
(
7395 n_expr
: nullable PExpr ,
7396 n_kwinit
: nullable TKwinit ,
7397 n_args
: Collection[Object] # Should be Collection[PExpr]
7401 _n_expr
= n_expr
.as(not null)
7402 n_expr
.parent
= self
7403 _n_kwinit
= n_kwinit
.as(not null)
7404 n_kwinit
.parent
= self
7412 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7414 if _n_expr
== old_child
then
7415 if new_child
!= null then
7416 new_child
.parent
= self
7417 assert new_child
isa PExpr
7424 if _n_kwinit
== old_child
then
7425 if new_child
!= null then
7426 new_child
.parent
= self
7427 assert new_child
isa TKwinit
7428 _n_kwinit
= new_child
7434 for i
in [0.._n_args
.length
[ do
7435 if _n_args
[i
] == old_child
then
7436 if new_child
!= null then
7437 assert new_child
isa PExpr
7438 _n_args
[i
] = new_child
7439 new_child
.parent
= self
7441 _n_args
.remove_at
(i
)
7448 redef fun visit_all
(v
: Visitor)
7457 redef fun visit_all_reverse
(v
: Visitor)
7462 var i
= _n_args
.length
7470 redef class ABraExpr
7471 redef fun n_expr
=(n
)
7477 private init empty_init
do end
7479 init init_abraexpr
(
7480 n_expr
: nullable PExpr ,
7481 n_args
: Collection[Object] , # Should be Collection[PExpr]
7482 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
7486 _n_expr
= n_expr
.as(not null)
7487 n_expr
.parent
= self
7493 for n
in n_closure_defs
do
7494 assert n
isa PClosureDef
7495 _n_closure_defs
.add
(n
)
7500 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7502 if _n_expr
== old_child
then
7503 if new_child
!= null then
7504 new_child
.parent
= self
7505 assert new_child
isa PExpr
7512 for i
in [0.._n_args
.length
[ do
7513 if _n_args
[i
] == old_child
then
7514 if new_child
!= null then
7515 assert new_child
isa PExpr
7516 _n_args
[i
] = new_child
7517 new_child
.parent
= self
7519 _n_args
.remove_at
(i
)
7524 for i
in [0.._n_closure_defs
.length
[ do
7525 if _n_closure_defs
[i
] == old_child
then
7526 if new_child
!= null then
7527 assert new_child
isa PClosureDef
7528 _n_closure_defs
[i
] = new_child
7529 new_child
.parent
= self
7531 _n_closure_defs
.remove_at
(i
)
7538 redef fun visit_all
(v
: Visitor)
7544 for n
in _n_closure_defs
do
7549 redef fun visit_all_reverse
(v
: Visitor)
7553 var i
= _n_args
.length
7560 var i
= _n_closure_defs
.length
7562 v
.visit
(_n_closure_defs
[i
])
7568 redef class ABraAssignExpr
7569 redef fun n_expr
=(n
)
7574 redef fun n_assign
=(n
)
7579 redef fun n_value
=(n
)
7585 private init empty_init
do end
7587 init init_abraassignexpr
(
7588 n_expr
: nullable PExpr ,
7589 n_args
: Collection[Object] , # Should be Collection[PExpr]
7590 n_assign
: nullable TAssign ,
7591 n_value
: nullable PExpr
7595 _n_expr
= n_expr
.as(not null)
7596 n_expr
.parent
= self
7602 _n_assign
= n_assign
.as(not null)
7603 n_assign
.parent
= self
7604 _n_value
= n_value
.as(not null)
7605 n_value
.parent
= self
7608 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7610 if _n_expr
== old_child
then
7611 if new_child
!= null then
7612 new_child
.parent
= self
7613 assert new_child
isa PExpr
7620 for i
in [0.._n_args
.length
[ do
7621 if _n_args
[i
] == old_child
then
7622 if new_child
!= null then
7623 assert new_child
isa PExpr
7624 _n_args
[i
] = new_child
7625 new_child
.parent
= self
7627 _n_args
.remove_at
(i
)
7632 if _n_assign
== old_child
then
7633 if new_child
!= null then
7634 new_child
.parent
= self
7635 assert new_child
isa TAssign
7636 _n_assign
= new_child
7642 if _n_value
== old_child
then
7643 if new_child
!= null then
7644 new_child
.parent
= self
7645 assert new_child
isa PExpr
7646 _n_value
= new_child
7654 redef fun visit_all
(v
: Visitor)
7664 redef fun visit_all_reverse
(v
: Visitor)
7668 var i
= _n_args
.length
7678 redef class ABraReassignExpr
7679 redef fun n_expr
=(n
)
7684 redef fun n_assign_op
=(n
)
7689 redef fun n_value
=(n
)
7695 private init empty_init
do end
7697 init init_abrareassignexpr
(
7698 n_expr
: nullable PExpr ,
7699 n_args
: Collection[Object] , # Should be Collection[PExpr]
7700 n_assign_op
: nullable PAssignOp ,
7701 n_value
: nullable PExpr
7705 _n_expr
= n_expr
.as(not null)
7706 n_expr
.parent
= self
7712 _n_assign_op
= n_assign_op
.as(not null)
7713 n_assign_op
.parent
= self
7714 _n_value
= n_value
.as(not null)
7715 n_value
.parent
= self
7718 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7720 if _n_expr
== old_child
then
7721 if new_child
!= null then
7722 new_child
.parent
= self
7723 assert new_child
isa PExpr
7730 for i
in [0.._n_args
.length
[ do
7731 if _n_args
[i
] == old_child
then
7732 if new_child
!= null then
7733 assert new_child
isa PExpr
7734 _n_args
[i
] = new_child
7735 new_child
.parent
= self
7737 _n_args
.remove_at
(i
)
7742 if _n_assign_op
== old_child
then
7743 if new_child
!= null then
7744 new_child
.parent
= self
7745 assert new_child
isa PAssignOp
7746 _n_assign_op
= new_child
7752 if _n_value
== old_child
then
7753 if new_child
!= null then
7754 new_child
.parent
= self
7755 assert new_child
isa PExpr
7756 _n_value
= new_child
7764 redef fun visit_all
(v
: Visitor)
7770 v
.visit
(_n_assign_op
)
7774 redef fun visit_all_reverse
(v
: Visitor)
7778 var i
= _n_args
.length
7784 v
.visit
(_n_assign_op
)
7788 redef class AClosureCallExpr
7795 private init empty_init
do end
7797 init init_aclosurecallexpr
(
7798 n_id
: nullable TId ,
7799 n_args
: Collection[Object] , # Should be Collection[PExpr]
7800 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
7804 _n_id
= n_id
.as(not null)
7811 for n
in n_closure_defs
do
7812 assert n
isa PClosureDef
7813 _n_closure_defs
.add
(n
)
7818 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7820 if _n_id
== old_child
then
7821 if new_child
!= null then
7822 new_child
.parent
= self
7823 assert new_child
isa TId
7830 for i
in [0.._n_args
.length
[ do
7831 if _n_args
[i
] == old_child
then
7832 if new_child
!= null then
7833 assert new_child
isa PExpr
7834 _n_args
[i
] = new_child
7835 new_child
.parent
= self
7837 _n_args
.remove_at
(i
)
7842 for i
in [0.._n_closure_defs
.length
[ do
7843 if _n_closure_defs
[i
] == old_child
then
7844 if new_child
!= null then
7845 assert new_child
isa PClosureDef
7846 _n_closure_defs
[i
] = new_child
7847 new_child
.parent
= self
7849 _n_closure_defs
.remove_at
(i
)
7856 redef fun visit_all
(v
: Visitor)
7862 for n
in _n_closure_defs
do
7867 redef fun visit_all_reverse
(v
: Visitor)
7871 var i
= _n_args
.length
7878 var i
= _n_closure_defs
.length
7880 v
.visit
(_n_closure_defs
[i
])
7886 redef class AVarExpr
7893 private init empty_init
do end
7895 init init_avarexpr
(
7900 _n_id
= n_id
.as(not null)
7904 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7906 if _n_id
== old_child
then
7907 if new_child
!= null then
7908 new_child
.parent
= self
7909 assert new_child
isa TId
7918 redef fun visit_all
(v
: Visitor)
7923 redef fun visit_all_reverse
(v
: Visitor)
7928 redef class AVarAssignExpr
7934 redef fun n_assign
=(n
)
7939 redef fun n_value
=(n
)
7945 private init empty_init
do end
7947 init init_avarassignexpr
(
7948 n_id
: nullable TId ,
7949 n_assign
: nullable TAssign ,
7950 n_value
: nullable PExpr
7954 _n_id
= n_id
.as(not null)
7956 _n_assign
= n_assign
.as(not null)
7957 n_assign
.parent
= self
7958 _n_value
= n_value
.as(not null)
7959 n_value
.parent
= self
7962 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7964 if _n_id
== old_child
then
7965 if new_child
!= null then
7966 new_child
.parent
= self
7967 assert new_child
isa TId
7974 if _n_assign
== old_child
then
7975 if new_child
!= null then
7976 new_child
.parent
= self
7977 assert new_child
isa TAssign
7978 _n_assign
= new_child
7984 if _n_value
== old_child
then
7985 if new_child
!= null then
7986 new_child
.parent
= self
7987 assert new_child
isa PExpr
7988 _n_value
= new_child
7996 redef fun visit_all
(v
: Visitor)
8003 redef fun visit_all_reverse
(v
: Visitor)
8010 redef class AVarReassignExpr
8016 redef fun n_assign_op
=(n
)
8021 redef fun n_value
=(n
)
8027 private init empty_init
do end
8029 init init_avarreassignexpr
(
8030 n_id
: nullable TId ,
8031 n_assign_op
: nullable PAssignOp ,
8032 n_value
: nullable PExpr
8036 _n_id
= n_id
.as(not null)
8038 _n_assign_op
= n_assign_op
.as(not null)
8039 n_assign_op
.parent
= self
8040 _n_value
= n_value
.as(not null)
8041 n_value
.parent
= self
8044 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8046 if _n_id
== old_child
then
8047 if new_child
!= null then
8048 new_child
.parent
= self
8049 assert new_child
isa TId
8056 if _n_assign_op
== old_child
then
8057 if new_child
!= null then
8058 new_child
.parent
= self
8059 assert new_child
isa PAssignOp
8060 _n_assign_op
= new_child
8066 if _n_value
== old_child
then
8067 if new_child
!= null then
8068 new_child
.parent
= self
8069 assert new_child
isa PExpr
8070 _n_value
= new_child
8078 redef fun visit_all
(v
: Visitor)
8081 v
.visit
(_n_assign_op
)
8085 redef fun visit_all_reverse
(v
: Visitor)
8088 v
.visit
(_n_assign_op
)
8092 redef class ARangeExpr
8093 redef fun n_expr
=(n
)
8098 redef fun n_expr2
=(n
)
8104 private init empty_init
do end
8106 init init_arangeexpr
(
8107 n_expr
: nullable PExpr ,
8108 n_expr2
: nullable PExpr
8112 _n_expr
= n_expr
.as(not null)
8113 n_expr
.parent
= self
8114 _n_expr2
= n_expr2
.as(not null)
8115 n_expr2
.parent
= self
8118 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8120 if _n_expr
== old_child
then
8121 if new_child
!= null then
8122 new_child
.parent
= self
8123 assert new_child
isa PExpr
8130 if _n_expr2
== old_child
then
8131 if new_child
!= null then
8132 new_child
.parent
= self
8133 assert new_child
isa PExpr
8134 _n_expr2
= new_child
8142 redef fun visit_all
(v
: Visitor)
8148 redef fun visit_all_reverse
(v
: Visitor)
8154 redef class ACrangeExpr
8155 redef fun n_expr
=(n
)
8160 redef fun n_expr2
=(n
)
8166 private init empty_init
do end
8168 init init_acrangeexpr
(
8169 n_expr
: nullable PExpr ,
8170 n_expr2
: nullable PExpr
8174 _n_expr
= n_expr
.as(not null)
8175 n_expr
.parent
= self
8176 _n_expr2
= n_expr2
.as(not null)
8177 n_expr2
.parent
= self
8180 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8182 if _n_expr
== old_child
then
8183 if new_child
!= null then
8184 new_child
.parent
= self
8185 assert new_child
isa PExpr
8192 if _n_expr2
== old_child
then
8193 if new_child
!= null then
8194 new_child
.parent
= self
8195 assert new_child
isa PExpr
8196 _n_expr2
= new_child
8204 redef fun visit_all
(v
: Visitor)
8210 redef fun visit_all_reverse
(v
: Visitor)
8216 redef class AOrangeExpr
8217 redef fun n_expr
=(n
)
8222 redef fun n_expr2
=(n
)
8228 private init empty_init
do end
8230 init init_aorangeexpr
(
8231 n_expr
: nullable PExpr ,
8232 n_expr2
: nullable PExpr
8236 _n_expr
= n_expr
.as(not null)
8237 n_expr
.parent
= self
8238 _n_expr2
= n_expr2
.as(not null)
8239 n_expr2
.parent
= self
8242 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8244 if _n_expr
== old_child
then
8245 if new_child
!= null then
8246 new_child
.parent
= self
8247 assert new_child
isa PExpr
8254 if _n_expr2
== old_child
then
8255 if new_child
!= null then
8256 new_child
.parent
= self
8257 assert new_child
isa PExpr
8258 _n_expr2
= new_child
8266 redef fun visit_all
(v
: Visitor)
8272 redef fun visit_all_reverse
(v
: Visitor)
8278 redef class AArrayExpr
8280 private init empty_init
do end
8282 init init_aarrayexpr
(
8283 n_exprs
: Collection[Object] # Should be Collection[PExpr]
8294 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8296 for i
in [0.._n_exprs
.length
[ do
8297 if _n_exprs
[i
] == old_child
then
8298 if new_child
!= null then
8299 assert new_child
isa PExpr
8300 _n_exprs
[i
] = new_child
8301 new_child
.parent
= self
8303 _n_exprs
.remove_at
(i
)
8310 redef fun visit_all
(v
: Visitor)
8312 for n
in _n_exprs
do
8317 redef fun visit_all_reverse
(v
: Visitor)
8320 var i
= _n_exprs
.length
8322 v
.visit
(_n_exprs
[i
])
8328 redef class ASelfExpr
8329 redef fun n_kwself
=(n
)
8335 private init empty_init
do end
8337 init init_aselfexpr
(
8338 n_kwself
: nullable TKwself
8342 _n_kwself
= n_kwself
.as(not null)
8343 n_kwself
.parent
= self
8346 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8348 if _n_kwself
== old_child
then
8349 if new_child
!= null then
8350 new_child
.parent
= self
8351 assert new_child
isa TKwself
8352 _n_kwself
= new_child
8360 redef fun visit_all
(v
: Visitor)
8365 redef fun visit_all_reverse
(v
: Visitor)
8370 redef class AImplicitSelfExpr
8372 private init empty_init
do end
8374 init init_aimplicitselfexpr
8379 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8383 redef fun visit_all
(v
: Visitor)
8387 redef fun visit_all_reverse
(v
: Visitor)
8391 redef class ATrueExpr
8392 redef fun n_kwtrue
=(n
)
8398 private init empty_init
do end
8400 init init_atrueexpr
(
8401 n_kwtrue
: nullable TKwtrue
8405 _n_kwtrue
= n_kwtrue
.as(not null)
8406 n_kwtrue
.parent
= self
8409 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8411 if _n_kwtrue
== old_child
then
8412 if new_child
!= null then
8413 new_child
.parent
= self
8414 assert new_child
isa TKwtrue
8415 _n_kwtrue
= new_child
8423 redef fun visit_all
(v
: Visitor)
8428 redef fun visit_all_reverse
(v
: Visitor)
8433 redef class AFalseExpr
8434 redef fun n_kwfalse
=(n
)
8440 private init empty_init
do end
8442 init init_afalseexpr
(
8443 n_kwfalse
: nullable TKwfalse
8447 _n_kwfalse
= n_kwfalse
.as(not null)
8448 n_kwfalse
.parent
= self
8451 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8453 if _n_kwfalse
== old_child
then
8454 if new_child
!= null then
8455 new_child
.parent
= self
8456 assert new_child
isa TKwfalse
8457 _n_kwfalse
= new_child
8465 redef fun visit_all
(v
: Visitor)
8470 redef fun visit_all_reverse
(v
: Visitor)
8475 redef class ANullExpr
8476 redef fun n_kwnull
=(n
)
8482 private init empty_init
do end
8484 init init_anullexpr
(
8485 n_kwnull
: nullable TKwnull
8489 _n_kwnull
= n_kwnull
.as(not null)
8490 n_kwnull
.parent
= self
8493 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8495 if _n_kwnull
== old_child
then
8496 if new_child
!= null then
8497 new_child
.parent
= self
8498 assert new_child
isa TKwnull
8499 _n_kwnull
= new_child
8507 redef fun visit_all
(v
: Visitor)
8512 redef fun visit_all_reverse
(v
: Visitor)
8517 redef class AIntExpr
8518 redef fun n_number
=(n
)
8524 private init empty_init
do end
8526 init init_aintexpr
(
8527 n_number
: nullable TNumber
8531 _n_number
= n_number
.as(not null)
8532 n_number
.parent
= self
8535 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8537 if _n_number
== old_child
then
8538 if new_child
!= null then
8539 new_child
.parent
= self
8540 assert new_child
isa TNumber
8541 _n_number
= new_child
8549 redef fun visit_all
(v
: Visitor)
8554 redef fun visit_all_reverse
(v
: Visitor)
8559 redef class AFloatExpr
8560 redef fun n_float
=(n
)
8566 private init empty_init
do end
8568 init init_afloatexpr
(
8569 n_float
: nullable TFloat
8573 _n_float
= n_float
.as(not null)
8574 n_float
.parent
= self
8577 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8579 if _n_float
== old_child
then
8580 if new_child
!= null then
8581 new_child
.parent
= self
8582 assert new_child
isa TFloat
8583 _n_float
= new_child
8591 redef fun visit_all
(v
: Visitor)
8596 redef fun visit_all_reverse
(v
: Visitor)
8601 redef class ACharExpr
8602 redef fun n_char
=(n
)
8608 private init empty_init
do end
8610 init init_acharexpr
(
8611 n_char
: nullable TChar
8615 _n_char
= n_char
.as(not null)
8616 n_char
.parent
= self
8619 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8621 if _n_char
== old_child
then
8622 if new_child
!= null then
8623 new_child
.parent
= self
8624 assert new_child
isa TChar
8633 redef fun visit_all
(v
: Visitor)
8638 redef fun visit_all_reverse
(v
: Visitor)
8643 redef class AStringExpr
8644 redef fun n_string
=(n
)
8650 private init empty_init
do end
8652 init init_astringexpr
(
8653 n_string
: nullable TString
8657 _n_string
= n_string
.as(not null)
8658 n_string
.parent
= self
8661 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8663 if _n_string
== old_child
then
8664 if new_child
!= null then
8665 new_child
.parent
= self
8666 assert new_child
isa TString
8667 _n_string
= new_child
8675 redef fun visit_all
(v
: Visitor)
8680 redef fun visit_all_reverse
(v
: Visitor)
8685 redef class AStartStringExpr
8686 redef fun n_string
=(n
)
8692 private init empty_init
do end
8694 init init_astartstringexpr
(
8695 n_string
: nullable TStartString
8699 _n_string
= n_string
.as(not null)
8700 n_string
.parent
= self
8703 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8705 if _n_string
== old_child
then
8706 if new_child
!= null then
8707 new_child
.parent
= self
8708 assert new_child
isa TStartString
8709 _n_string
= new_child
8717 redef fun visit_all
(v
: Visitor)
8722 redef fun visit_all_reverse
(v
: Visitor)
8727 redef class AMidStringExpr
8728 redef fun n_string
=(n
)
8734 private init empty_init
do end
8736 init init_amidstringexpr
(
8737 n_string
: nullable TMidString
8741 _n_string
= n_string
.as(not null)
8742 n_string
.parent
= self
8745 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8747 if _n_string
== old_child
then
8748 if new_child
!= null then
8749 new_child
.parent
= self
8750 assert new_child
isa TMidString
8751 _n_string
= new_child
8759 redef fun visit_all
(v
: Visitor)
8764 redef fun visit_all_reverse
(v
: Visitor)
8769 redef class AEndStringExpr
8770 redef fun n_string
=(n
)
8776 private init empty_init
do end
8778 init init_aendstringexpr
(
8779 n_string
: nullable TEndString
8783 _n_string
= n_string
.as(not null)
8784 n_string
.parent
= self
8787 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8789 if _n_string
== old_child
then
8790 if new_child
!= null then
8791 new_child
.parent
= self
8792 assert new_child
isa TEndString
8793 _n_string
= new_child
8801 redef fun visit_all
(v
: Visitor)
8806 redef fun visit_all_reverse
(v
: Visitor)
8811 redef class ASuperstringExpr
8813 private init empty_init
do end
8815 init init_asuperstringexpr
(
8816 n_exprs
: Collection[Object] # Should be Collection[PExpr]
8827 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8829 for i
in [0.._n_exprs
.length
[ do
8830 if _n_exprs
[i
] == old_child
then
8831 if new_child
!= null then
8832 assert new_child
isa PExpr
8833 _n_exprs
[i
] = new_child
8834 new_child
.parent
= self
8836 _n_exprs
.remove_at
(i
)
8843 redef fun visit_all
(v
: Visitor)
8845 for n
in _n_exprs
do
8850 redef fun visit_all_reverse
(v
: Visitor)
8853 var i
= _n_exprs
.length
8855 v
.visit
(_n_exprs
[i
])
8861 redef class AParExpr
8862 redef fun n_expr
=(n
)
8868 private init empty_init
do end
8870 init init_aparexpr
(
8871 n_expr
: nullable PExpr
8875 _n_expr
= n_expr
.as(not null)
8876 n_expr
.parent
= self
8879 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8881 if _n_expr
== old_child
then
8882 if new_child
!= null then
8883 new_child
.parent
= self
8884 assert new_child
isa PExpr
8893 redef fun visit_all
(v
: Visitor)
8898 redef fun visit_all_reverse
(v
: Visitor)
8903 redef class AAsCastExpr
8904 redef fun n_expr
=(n
)
8909 redef fun n_kwas
=(n
)
8914 redef fun n_type
=(n
)
8920 private init empty_init
do end
8922 init init_aascastexpr
(
8923 n_expr
: nullable PExpr ,
8924 n_kwas
: nullable TKwas ,
8925 n_type
: nullable PType
8929 _n_expr
= n_expr
.as(not null)
8930 n_expr
.parent
= self
8931 _n_kwas
= n_kwas
.as(not null)
8932 n_kwas
.parent
= self
8933 _n_type
= n_type
.as(not null)
8934 n_type
.parent
= self
8937 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8939 if _n_expr
== old_child
then
8940 if new_child
!= null then
8941 new_child
.parent
= self
8942 assert new_child
isa PExpr
8949 if _n_kwas
== old_child
then
8950 if new_child
!= null then
8951 new_child
.parent
= self
8952 assert new_child
isa TKwas
8959 if _n_type
== old_child
then
8960 if new_child
!= null then
8961 new_child
.parent
= self
8962 assert new_child
isa PType
8971 redef fun visit_all
(v
: Visitor)
8978 redef fun visit_all_reverse
(v
: Visitor)
8985 redef class AAsNotnullExpr
8986 redef fun n_expr
=(n
)
8991 redef fun n_kwas
=(n
)
8996 redef fun n_kwnot
=(n
)
9001 redef fun n_kwnull
=(n
)
9007 private init empty_init
do end
9009 init init_aasnotnullexpr
(
9010 n_expr
: nullable PExpr ,
9011 n_kwas
: nullable TKwas ,
9012 n_kwnot
: nullable TKwnot ,
9013 n_kwnull
: nullable TKwnull
9017 _n_expr
= n_expr
.as(not null)
9018 n_expr
.parent
= self
9019 _n_kwas
= n_kwas
.as(not null)
9020 n_kwas
.parent
= self
9021 _n_kwnot
= n_kwnot
.as(not null)
9022 n_kwnot
.parent
= self
9023 _n_kwnull
= n_kwnull
.as(not null)
9024 n_kwnull
.parent
= self
9027 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9029 if _n_expr
== old_child
then
9030 if new_child
!= null then
9031 new_child
.parent
= self
9032 assert new_child
isa PExpr
9039 if _n_kwas
== old_child
then
9040 if new_child
!= null then
9041 new_child
.parent
= self
9042 assert new_child
isa TKwas
9049 if _n_kwnot
== old_child
then
9050 if new_child
!= null then
9051 new_child
.parent
= self
9052 assert new_child
isa TKwnot
9053 _n_kwnot
= new_child
9059 if _n_kwnull
== old_child
then
9060 if new_child
!= null then
9061 new_child
.parent
= self
9062 assert new_child
isa TKwnull
9063 _n_kwnull
= new_child
9071 redef fun visit_all
(v
: Visitor)
9079 redef fun visit_all_reverse
(v
: Visitor)
9087 redef class AIssetAttrExpr
9088 redef fun n_kwisset
=(n
)
9093 redef fun n_expr
=(n
)
9104 private init empty_init
do end
9106 init init_aissetattrexpr
(
9107 n_kwisset
: nullable TKwisset ,
9108 n_expr
: nullable PExpr ,
9109 n_id
: nullable TAttrid
9113 _n_kwisset
= n_kwisset
.as(not null)
9114 n_kwisset
.parent
= self
9115 _n_expr
= n_expr
.as(not null)
9116 n_expr
.parent
= self
9117 _n_id
= n_id
.as(not null)
9121 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9123 if _n_kwisset
== old_child
then
9124 if new_child
!= null then
9125 new_child
.parent
= self
9126 assert new_child
isa TKwisset
9127 _n_kwisset
= new_child
9133 if _n_expr
== old_child
then
9134 if new_child
!= null then
9135 new_child
.parent
= self
9136 assert new_child
isa PExpr
9143 if _n_id
== old_child
then
9144 if new_child
!= null then
9145 new_child
.parent
= self
9146 assert new_child
isa TAttrid
9155 redef fun visit_all
(v
: Visitor)
9162 redef fun visit_all_reverse
(v
: Visitor)
9169 redef class APlusAssignOp
9170 redef fun n_pluseq
=(n
)
9176 private init empty_init
do end
9178 init init_aplusassignop
(
9179 n_pluseq
: nullable TPluseq
9183 _n_pluseq
= n_pluseq
.as(not null)
9184 n_pluseq
.parent
= self
9187 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9189 if _n_pluseq
== old_child
then
9190 if new_child
!= null then
9191 new_child
.parent
= self
9192 assert new_child
isa TPluseq
9193 _n_pluseq
= new_child
9201 redef fun visit_all
(v
: Visitor)
9206 redef fun visit_all_reverse
(v
: Visitor)
9211 redef class AMinusAssignOp
9212 redef fun n_minuseq
=(n
)
9218 private init empty_init
do end
9220 init init_aminusassignop
(
9221 n_minuseq
: nullable TMinuseq
9225 _n_minuseq
= n_minuseq
.as(not null)
9226 n_minuseq
.parent
= self
9229 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9231 if _n_minuseq
== old_child
then
9232 if new_child
!= null then
9233 new_child
.parent
= self
9234 assert new_child
isa TMinuseq
9235 _n_minuseq
= new_child
9243 redef fun visit_all
(v
: Visitor)
9248 redef fun visit_all_reverse
(v
: Visitor)
9253 redef class AClosureDef
9254 redef fun n_kwwith
=(n
)
9259 redef fun n_kwdo
=(n
)
9264 redef fun n_expr
=(n
)
9272 private init empty_init
do end
9274 init init_aclosuredef
(
9275 n_kwwith
: nullable TKwwith ,
9276 n_id
: Collection[Object] , # Should be Collection[TId]
9277 n_kwdo
: nullable TKwdo ,
9278 n_expr
: nullable PExpr
9282 _n_kwwith
= n_kwwith
.as(not null)
9283 n_kwwith
.parent
= self
9289 _n_kwdo
= n_kwdo
.as(not null)
9290 n_kwdo
.parent
= self
9292 if n_expr
!= null then
9293 n_expr
.parent
= self
9297 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9299 if _n_kwwith
== old_child
then
9300 if new_child
!= null then
9301 new_child
.parent
= self
9302 assert new_child
isa TKwwith
9303 _n_kwwith
= new_child
9309 for i
in [0.._n_id
.length
[ do
9310 if _n_id
[i
] == old_child
then
9311 if new_child
!= null then
9312 assert new_child
isa TId
9313 _n_id
[i
] = new_child
9314 new_child
.parent
= self
9321 if _n_kwdo
== old_child
then
9322 if new_child
!= null then
9323 new_child
.parent
= self
9324 assert new_child
isa TKwdo
9331 if _n_expr
== old_child
then
9332 if new_child
!= null then
9333 new_child
.parent
= self
9334 assert new_child
isa PExpr
9343 redef fun visit_all
(v
: Visitor)
9350 if _n_expr
!= null then
9351 v
.visit
(_n_expr
.as(not null))
9355 redef fun visit_all_reverse
(v
: Visitor)
9359 var i
= _n_id
.length
9366 if _n_expr
!= null then
9367 v
.visit
(_n_expr
.as(not null))
9371 redef class AQualified
9372 redef fun n_classid
=(n
)
9380 private init empty_init
do end
9382 init init_aqualified
(
9383 n_id
: Collection[Object] , # Should be Collection[TId]
9384 n_classid
: nullable TClassid
9393 _n_classid
= n_classid
9394 if n_classid
!= null then
9395 n_classid
.parent
= self
9399 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9401 for i
in [0.._n_id
.length
[ do
9402 if _n_id
[i
] == old_child
then
9403 if new_child
!= null then
9404 assert new_child
isa TId
9405 _n_id
[i
] = new_child
9406 new_child
.parent
= self
9413 if _n_classid
== old_child
then
9414 if new_child
!= null then
9415 new_child
.parent
= self
9416 assert new_child
isa TClassid
9417 _n_classid
= new_child
9425 redef fun visit_all
(v
: Visitor)
9430 if _n_classid
!= null then
9431 v
.visit
(_n_classid
.as(not null))
9435 redef fun visit_all_reverse
(v
: Visitor)
9438 var i
= _n_id
.length
9444 if _n_classid
!= null then
9445 v
.visit
(_n_classid
.as(not null))
9451 private init empty_init
do end
9454 n_comment
: Collection[Object] # Should be Collection[TComment]
9458 for n
in n_comment
do
9459 assert n
isa TComment
9465 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9467 for i
in [0.._n_comment
.length
[ do
9468 if _n_comment
[i
] == old_child
then
9469 if new_child
!= null then
9470 assert new_child
isa TComment
9471 _n_comment
[i
] = new_child
9472 new_child
.parent
= self
9474 _n_comment
.remove_at
(i
)
9481 redef fun visit_all
(v
: Visitor)
9483 for n
in _n_comment
do
9488 redef fun visit_all_reverse
(v
: Visitor)
9491 var i
= _n_comment
.length
9493 v
.visit
(_n_comment
[i
])
9502 n_base
: nullable PModule,
9509 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9511 if _n_base
== old_child
then
9512 if new_child
== null then
9514 new_child
.parent
= self
9515 assert new_child
isa PModule
9518 old_child
.parent
= null
9523 redef fun visit_all
(v
: Visitor)
9525 if _n_base
!= null then
9526 v
.visit
(_n_base
.as(not null))
9530 redef fun visit_all_reverse
(v
: Visitor)
9532 if _n_base
!= null then
9533 v
.visit
(_n_base
.as(not null))