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.
38 fun locate
: String is abstract
40 # Return only the line number of the node
41 fun line_number
: Int is abstract
43 # Debug method: output a message prefixed with the location.
44 fun printl
(str
: String)
46 print
("{locate}: {str}\n")
51 redef fun visit_all
(v
: Visitor) do end
52 redef fun visit_all_reverse
(v
: Visitor) do end
53 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode) do end
55 redef fun locate
: String
57 return "{filename}:{line},{pos}"
60 redef fun line_number
do return line
64 # The first token of the production node
65 readable writable var _first_token
: nullable Token
67 # The last token of the production node
68 readable writable var _last_token
: nullable Token
70 redef fun locate
: String
72 if first_token
== null then
75 if last_token
== null then
76 return "{first_token.locate}--????"
78 var lastpos
= last_token
.pos
+ last_token
.text
.length
- 1
79 if first_token
.line
== last_token
.line
then
80 return "{first_token.locate}--{lastpos}"
82 return "{first_token.locate}--{last_token.line}:{lastpos}"
86 redef fun replace_with
(n
: PNode)
90 n
.first_token
= first_token
91 n
.last_token
= last_token
96 if first_token
!= null then
97 return first_token
.line
104 # Abstract standard visitor
106 # Ask the visitor to visit a given node.
107 # Usually automatically called by visit_all* methods.
108 # Concrete visitors should redefine this method.
109 fun visit
(e
: nullable PNode) is abstract
113 redef fun n_packagedecl
=(n
)
121 private init empty_init
do end
124 n_packagedecl
: nullable PPackagedecl ,
125 n_imports
: Collection[Object] , # Should be Collection[PImport]
126 n_classdefs
: Collection[Object] # Should be Collection[PClassdef]
130 _n_packagedecl
= n_packagedecl
131 if n_packagedecl
!= null then
132 n_packagedecl
.parent
= self
134 for n
in n_imports
do
139 for n
in n_classdefs
do
140 assert n
isa PClassdef
146 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
148 if _n_packagedecl
== old_child
then
149 if new_child
!= null then
150 new_child
.parent
= self
151 assert new_child
isa PPackagedecl
152 _n_packagedecl
= new_child
154 _n_packagedecl
= null
158 for i
in [0.._n_imports
.length
[ do
159 if _n_imports
[i
] == old_child
then
160 if new_child
!= null then
161 assert new_child
isa PImport
162 _n_imports
[i
] = new_child
163 new_child
.parent
= self
165 _n_imports
.remove_at
(i
)
170 for i
in [0.._n_classdefs
.length
[ do
171 if _n_classdefs
[i
] == old_child
then
172 if new_child
!= null then
173 assert new_child
isa PClassdef
174 _n_classdefs
[i
] = new_child
175 new_child
.parent
= self
177 _n_classdefs
.remove_at
(i
)
184 redef fun visit_all
(v
: Visitor)
186 if _n_packagedecl
!= null then
187 v
.visit
(_n_packagedecl
.as(not null))
189 for n
in _n_imports
do
192 for n
in _n_classdefs
do
197 redef fun visit_all_reverse
(v
: Visitor)
199 if _n_packagedecl
!= null then
200 v
.visit
(_n_packagedecl
.as(not null))
203 var i
= _n_imports
.length
205 v
.visit
(_n_imports
[i
])
210 var i
= _n_classdefs
.length
212 v
.visit
(_n_classdefs
[i
])
218 redef class APackagedecl
226 redef fun n_kwpackage
=(n
)
237 private init empty_init
do end
239 init init_apackagedecl
(
240 n_doc
: nullable PDoc ,
241 n_kwpackage
: nullable TKwpackage ,
247 if n_doc
!= null then
250 _n_kwpackage
= n_kwpackage
.as(not null)
251 n_kwpackage
.parent
= self
252 _n_id
= n_id
.as(not null)
256 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
258 if _n_doc
== old_child
then
259 if new_child
!= null then
260 new_child
.parent
= self
261 assert new_child
isa PDoc
268 if _n_kwpackage
== old_child
then
269 if new_child
!= null then
270 new_child
.parent
= self
271 assert new_child
isa TKwpackage
272 _n_kwpackage
= new_child
278 if _n_id
== old_child
then
279 if new_child
!= null then
280 new_child
.parent
= self
281 assert new_child
isa TId
290 redef fun visit_all
(v
: Visitor)
292 if _n_doc
!= null then
293 v
.visit
(_n_doc
.as(not null))
295 v
.visit
(_n_kwpackage
)
299 redef fun visit_all_reverse
(v
: Visitor)
301 if _n_doc
!= null then
302 v
.visit
(_n_doc
.as(not null))
304 v
.visit
(_n_kwpackage
)
309 redef fun n_visibility
=(n
)
314 redef fun n_kwimport
=(n
)
325 private init empty_init
do end
328 n_visibility
: nullable PVisibility ,
329 n_kwimport
: nullable TKwimport ,
334 _n_visibility
= n_visibility
.as(not null)
335 n_visibility
.parent
= self
336 _n_kwimport
= n_kwimport
.as(not null)
337 n_kwimport
.parent
= self
338 _n_id
= n_id
.as(not null)
342 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
344 if _n_visibility
== old_child
then
345 if new_child
!= null then
346 new_child
.parent
= self
347 assert new_child
isa PVisibility
348 _n_visibility
= new_child
354 if _n_kwimport
== old_child
then
355 if new_child
!= null then
356 new_child
.parent
= self
357 assert new_child
isa TKwimport
358 _n_kwimport
= new_child
364 if _n_id
== old_child
then
365 if new_child
!= null then
366 new_child
.parent
= self
367 assert new_child
isa TId
376 redef fun visit_all
(v
: Visitor)
378 v
.visit
(_n_visibility
)
383 redef fun visit_all_reverse
(v
: Visitor)
385 v
.visit
(_n_visibility
)
390 redef class ANoImport
391 redef fun n_visibility
=(n
)
396 redef fun n_kwimport
=(n
)
401 redef fun n_kwend
=(n
)
407 private init empty_init
do end
409 init init_anoimport
(
410 n_visibility
: nullable PVisibility ,
411 n_kwimport
: nullable TKwimport ,
412 n_kwend
: nullable TKwend
416 _n_visibility
= n_visibility
.as(not null)
417 n_visibility
.parent
= self
418 _n_kwimport
= n_kwimport
.as(not null)
419 n_kwimport
.parent
= self
420 _n_kwend
= n_kwend
.as(not null)
421 n_kwend
.parent
= self
424 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
426 if _n_visibility
== old_child
then
427 if new_child
!= null then
428 new_child
.parent
= self
429 assert new_child
isa PVisibility
430 _n_visibility
= new_child
436 if _n_kwimport
== old_child
then
437 if new_child
!= null then
438 new_child
.parent
= self
439 assert new_child
isa TKwimport
440 _n_kwimport
= new_child
446 if _n_kwend
== old_child
then
447 if new_child
!= null then
448 new_child
.parent
= self
449 assert new_child
isa TKwend
458 redef fun visit_all
(v
: Visitor)
460 v
.visit
(_n_visibility
)
465 redef fun visit_all_reverse
(v
: Visitor)
467 v
.visit
(_n_visibility
)
472 redef class APublicVisibility
474 private init empty_init
do end
476 init init_apublicvisibility
481 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
485 redef fun visit_all
(v
: Visitor)
489 redef fun visit_all_reverse
(v
: Visitor)
493 redef class APrivateVisibility
494 redef fun n_kwprivate
=(n
)
500 private init empty_init
do end
502 init init_aprivatevisibility
(
503 n_kwprivate
: nullable TKwprivate
507 _n_kwprivate
= n_kwprivate
.as(not null)
508 n_kwprivate
.parent
= self
511 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
513 if _n_kwprivate
== old_child
then
514 if new_child
!= null then
515 new_child
.parent
= self
516 assert new_child
isa TKwprivate
517 _n_kwprivate
= new_child
525 redef fun visit_all
(v
: Visitor)
527 v
.visit
(_n_kwprivate
)
530 redef fun visit_all_reverse
(v
: Visitor)
532 v
.visit
(_n_kwprivate
)
535 redef class AProtectedVisibility
536 redef fun n_kwprotected
=(n
)
542 private init empty_init
do end
544 init init_aprotectedvisibility
(
545 n_kwprotected
: nullable TKwprotected
549 _n_kwprotected
= n_kwprotected
.as(not null)
550 n_kwprotected
.parent
= self
553 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
555 if _n_kwprotected
== old_child
then
556 if new_child
!= null then
557 new_child
.parent
= self
558 assert new_child
isa TKwprotected
559 _n_kwprotected
= new_child
567 redef fun visit_all
(v
: Visitor)
569 v
.visit
(_n_kwprotected
)
572 redef fun visit_all_reverse
(v
: Visitor)
574 v
.visit
(_n_kwprotected
)
577 redef class AIntrudeVisibility
578 redef fun n_kwintrude
=(n
)
584 private init empty_init
do end
586 init init_aintrudevisibility
(
587 n_kwintrude
: nullable TKwintrude
591 _n_kwintrude
= n_kwintrude
.as(not null)
592 n_kwintrude
.parent
= self
595 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
597 if _n_kwintrude
== old_child
then
598 if new_child
!= null then
599 new_child
.parent
= self
600 assert new_child
isa TKwintrude
601 _n_kwintrude
= new_child
609 redef fun visit_all
(v
: Visitor)
611 v
.visit
(_n_kwintrude
)
614 redef fun visit_all_reverse
(v
: Visitor)
616 v
.visit
(_n_kwintrude
)
619 redef class AClassdef
627 redef fun n_kwredef
=(n
)
634 redef fun n_visibility
=(n
)
639 redef fun n_classkind
=(n
)
652 private init empty_init
do end
654 init init_aclassdef
(
655 n_doc
: nullable PDoc ,
656 n_kwredef
: nullable TKwredef ,
657 n_visibility
: nullable PVisibility ,
658 n_classkind
: nullable PClasskind ,
659 n_id
: nullable TClassid ,
660 n_formaldefs
: Collection[Object] , # Should be Collection[PFormaldef]
661 n_superclasses
: Collection[Object] , # Should be Collection[PSuperclass]
662 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
667 if n_doc
!= null then
670 _n_kwredef
= n_kwredef
671 if n_kwredef
!= null then
672 n_kwredef
.parent
= self
674 _n_visibility
= n_visibility
.as(not null)
675 n_visibility
.parent
= self
676 _n_classkind
= n_classkind
.as(not null)
677 n_classkind
.parent
= self
682 for n
in n_formaldefs
do
683 assert n
isa PFormaldef
687 for n
in n_superclasses
do
688 assert n
isa PSuperclass
689 _n_superclasses
.add
(n
)
692 for n
in n_propdefs
do
693 assert n
isa PPropdef
699 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
701 if _n_doc
== old_child
then
702 if new_child
!= null then
703 new_child
.parent
= self
704 assert new_child
isa PDoc
711 if _n_kwredef
== old_child
then
712 if new_child
!= null then
713 new_child
.parent
= self
714 assert new_child
isa TKwredef
715 _n_kwredef
= new_child
721 if _n_visibility
== old_child
then
722 if new_child
!= null then
723 new_child
.parent
= self
724 assert new_child
isa PVisibility
725 _n_visibility
= new_child
731 if _n_classkind
== old_child
then
732 if new_child
!= null then
733 new_child
.parent
= self
734 assert new_child
isa PClasskind
735 _n_classkind
= new_child
741 if _n_id
== old_child
then
742 if new_child
!= null then
743 new_child
.parent
= self
744 assert new_child
isa TClassid
751 for i
in [0.._n_formaldefs
.length
[ do
752 if _n_formaldefs
[i
] == old_child
then
753 if new_child
!= null then
754 assert new_child
isa PFormaldef
755 _n_formaldefs
[i
] = new_child
756 new_child
.parent
= self
758 _n_formaldefs
.remove_at
(i
)
763 for i
in [0.._n_superclasses
.length
[ do
764 if _n_superclasses
[i
] == old_child
then
765 if new_child
!= null then
766 assert new_child
isa PSuperclass
767 _n_superclasses
[i
] = new_child
768 new_child
.parent
= self
770 _n_superclasses
.remove_at
(i
)
775 for i
in [0.._n_propdefs
.length
[ do
776 if _n_propdefs
[i
] == old_child
then
777 if new_child
!= null then
778 assert new_child
isa PPropdef
779 _n_propdefs
[i
] = new_child
780 new_child
.parent
= self
782 _n_propdefs
.remove_at
(i
)
789 redef fun visit_all
(v
: Visitor)
791 if _n_doc
!= null then
792 v
.visit
(_n_doc
.as(not null))
794 if _n_kwredef
!= null then
795 v
.visit
(_n_kwredef
.as(not null))
797 v
.visit
(_n_visibility
)
798 v
.visit
(_n_classkind
)
799 if _n_id
!= null then
800 v
.visit
(_n_id
.as(not null))
802 for n
in _n_formaldefs
do
805 for n
in _n_superclasses
do
808 for n
in _n_propdefs
do
813 redef fun visit_all_reverse
(v
: Visitor)
815 if _n_doc
!= null then
816 v
.visit
(_n_doc
.as(not null))
818 if _n_kwredef
!= null then
819 v
.visit
(_n_kwredef
.as(not null))
821 v
.visit
(_n_visibility
)
822 v
.visit
(_n_classkind
)
823 if _n_id
!= null then
824 v
.visit
(_n_id
.as(not null))
827 var i
= _n_formaldefs
.length
829 v
.visit
(_n_formaldefs
[i
])
834 var i
= _n_superclasses
.length
836 v
.visit
(_n_superclasses
[i
])
841 var i
= _n_propdefs
.length
843 v
.visit
(_n_propdefs
[i
])
849 redef class ATopClassdef
851 private init empty_init
do end
853 init init_atopclassdef
(
854 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
858 for n
in n_propdefs
do
859 assert n
isa PPropdef
865 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
867 for i
in [0.._n_propdefs
.length
[ do
868 if _n_propdefs
[i
] == old_child
then
869 if new_child
!= null then
870 assert new_child
isa PPropdef
871 _n_propdefs
[i
] = new_child
872 new_child
.parent
= self
874 _n_propdefs
.remove_at
(i
)
881 redef fun visit_all
(v
: Visitor)
883 for n
in _n_propdefs
do
888 redef fun visit_all_reverse
(v
: Visitor)
891 var i
= _n_propdefs
.length
893 v
.visit
(_n_propdefs
[i
])
899 redef class AMainClassdef
901 private init empty_init
do end
903 init init_amainclassdef
(
904 n_propdefs
: Collection[Object] # Should be Collection[PPropdef]
908 for n
in n_propdefs
do
909 assert n
isa PPropdef
915 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
917 for i
in [0.._n_propdefs
.length
[ do
918 if _n_propdefs
[i
] == old_child
then
919 if new_child
!= null then
920 assert new_child
isa PPropdef
921 _n_propdefs
[i
] = new_child
922 new_child
.parent
= self
924 _n_propdefs
.remove_at
(i
)
931 redef fun visit_all
(v
: Visitor)
933 for n
in _n_propdefs
do
938 redef fun visit_all_reverse
(v
: Visitor)
941 var i
= _n_propdefs
.length
943 v
.visit
(_n_propdefs
[i
])
949 redef class AConcreteClasskind
950 redef fun n_kwclass
=(n
)
956 private init empty_init
do end
958 init init_aconcreteclasskind
(
959 n_kwclass
: nullable TKwclass
963 _n_kwclass
= n_kwclass
.as(not null)
964 n_kwclass
.parent
= self
967 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
969 if _n_kwclass
== old_child
then
970 if new_child
!= null then
971 new_child
.parent
= self
972 assert new_child
isa TKwclass
973 _n_kwclass
= new_child
981 redef fun visit_all
(v
: Visitor)
986 redef fun visit_all_reverse
(v
: Visitor)
991 redef class AAbstractClasskind
992 redef fun n_kwabstract
=(n
)
997 redef fun n_kwclass
=(n
)
1003 private init empty_init
do end
1005 init init_aabstractclasskind
(
1006 n_kwabstract
: nullable TKwabstract ,
1007 n_kwclass
: nullable TKwclass
1011 _n_kwabstract
= n_kwabstract
.as(not null)
1012 n_kwabstract
.parent
= self
1013 _n_kwclass
= n_kwclass
.as(not null)
1014 n_kwclass
.parent
= self
1017 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1019 if _n_kwabstract
== old_child
then
1020 if new_child
!= null then
1021 new_child
.parent
= self
1022 assert new_child
isa TKwabstract
1023 _n_kwabstract
= new_child
1029 if _n_kwclass
== old_child
then
1030 if new_child
!= null then
1031 new_child
.parent
= self
1032 assert new_child
isa TKwclass
1033 _n_kwclass
= new_child
1041 redef fun visit_all
(v
: Visitor)
1043 v
.visit
(_n_kwabstract
)
1047 redef fun visit_all_reverse
(v
: Visitor)
1049 v
.visit
(_n_kwabstract
)
1053 redef class AInterfaceClasskind
1054 redef fun n_kwinterface
=(n
)
1060 private init empty_init
do end
1062 init init_ainterfaceclasskind
(
1063 n_kwinterface
: nullable TKwinterface
1067 _n_kwinterface
= n_kwinterface
.as(not null)
1068 n_kwinterface
.parent
= self
1071 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1073 if _n_kwinterface
== old_child
then
1074 if new_child
!= null then
1075 new_child
.parent
= self
1076 assert new_child
isa TKwinterface
1077 _n_kwinterface
= new_child
1085 redef fun visit_all
(v
: Visitor)
1087 v
.visit
(_n_kwinterface
)
1090 redef fun visit_all_reverse
(v
: Visitor)
1092 v
.visit
(_n_kwinterface
)
1095 redef class AUniversalClasskind
1096 redef fun n_kwuniversal
=(n
)
1102 private init empty_init
do end
1104 init init_auniversalclasskind
(
1105 n_kwuniversal
: nullable TKwuniversal
1109 _n_kwuniversal
= n_kwuniversal
.as(not null)
1110 n_kwuniversal
.parent
= self
1113 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1115 if _n_kwuniversal
== old_child
then
1116 if new_child
!= null then
1117 new_child
.parent
= self
1118 assert new_child
isa TKwuniversal
1119 _n_kwuniversal
= new_child
1127 redef fun visit_all
(v
: Visitor)
1129 v
.visit
(_n_kwuniversal
)
1132 redef fun visit_all_reverse
(v
: Visitor)
1134 v
.visit
(_n_kwuniversal
)
1137 redef class AFormaldef
1143 redef fun n_type
=(n
)
1151 private init empty_init
do end
1153 init init_aformaldef
(
1154 n_id
: nullable TClassid ,
1155 n_type
: nullable PType
1159 _n_id
= n_id
.as(not null)
1162 if n_type
!= null then
1163 n_type
.parent
= self
1167 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1169 if _n_id
== old_child
then
1170 if new_child
!= null then
1171 new_child
.parent
= self
1172 assert new_child
isa TClassid
1179 if _n_type
== old_child
then
1180 if new_child
!= null then
1181 new_child
.parent
= self
1182 assert new_child
isa PType
1191 redef fun visit_all
(v
: Visitor)
1194 if _n_type
!= null then
1195 v
.visit
(_n_type
.as(not null))
1199 redef fun visit_all_reverse
(v
: Visitor)
1202 if _n_type
!= null then
1203 v
.visit
(_n_type
.as(not null))
1207 redef class ASuperclass
1208 redef fun n_kwspecial
=(n
)
1213 redef fun n_type
=(n
)
1219 private init empty_init
do end
1221 init init_asuperclass
(
1222 n_kwspecial
: nullable TKwspecial ,
1223 n_type
: nullable PType
1227 _n_kwspecial
= n_kwspecial
.as(not null)
1228 n_kwspecial
.parent
= self
1229 _n_type
= n_type
.as(not null)
1230 n_type
.parent
= self
1233 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1235 if _n_kwspecial
== old_child
then
1236 if new_child
!= null then
1237 new_child
.parent
= self
1238 assert new_child
isa TKwspecial
1239 _n_kwspecial
= new_child
1245 if _n_type
== old_child
then
1246 if new_child
!= null then
1247 new_child
.parent
= self
1248 assert new_child
isa PType
1257 redef fun visit_all
(v
: Visitor)
1259 v
.visit
(_n_kwspecial
)
1263 redef fun visit_all_reverse
(v
: Visitor)
1265 v
.visit
(_n_kwspecial
)
1269 redef class AAttrPropdef
1277 redef fun n_readable
=(n
)
1284 redef fun n_writable
=(n
)
1291 redef fun n_kwredef
=(n
)
1298 redef fun n_visibility
=(n
)
1303 redef fun n_kwattr
=(n
)
1310 redef fun n_kwvar
=(n
)
1322 redef fun n_type
=(n
)
1329 redef fun n_expr
=(n
)
1337 private init empty_init
do end
1339 init init_aattrpropdef
(
1340 n_doc
: nullable PDoc ,
1341 n_readable
: nullable PAble ,
1342 n_writable
: nullable PAble ,
1343 n_kwredef
: nullable TKwredef ,
1344 n_visibility
: nullable PVisibility ,
1345 n_kwattr
: nullable TKwattr ,
1346 n_kwvar
: nullable TKwvar ,
1347 n_id
: nullable TAttrid ,
1348 n_type
: nullable PType ,
1349 n_expr
: nullable PExpr
1354 if n_doc
!= null then
1357 _n_readable
= n_readable
1358 if n_readable
!= null then
1359 n_readable
.parent
= self
1361 _n_writable
= n_writable
1362 if n_writable
!= null then
1363 n_writable
.parent
= self
1365 _n_kwredef
= n_kwredef
1366 if n_kwredef
!= null then
1367 n_kwredef
.parent
= self
1369 _n_visibility
= n_visibility
.as(not null)
1370 n_visibility
.parent
= self
1371 _n_kwattr
= n_kwattr
1372 if n_kwattr
!= null then
1373 n_kwattr
.parent
= self
1376 if n_kwvar
!= null then
1377 n_kwvar
.parent
= self
1379 _n_id
= n_id
.as(not null)
1382 if n_type
!= null then
1383 n_type
.parent
= self
1386 if n_expr
!= null then
1387 n_expr
.parent
= self
1391 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1393 if _n_doc
== old_child
then
1394 if new_child
!= null then
1395 new_child
.parent
= self
1396 assert new_child
isa PDoc
1403 if _n_readable
== old_child
then
1404 if new_child
!= null then
1405 new_child
.parent
= self
1406 assert new_child
isa PAble
1407 _n_readable
= new_child
1413 if _n_writable
== old_child
then
1414 if new_child
!= null then
1415 new_child
.parent
= self
1416 assert new_child
isa PAble
1417 _n_writable
= new_child
1423 if _n_kwredef
== old_child
then
1424 if new_child
!= null then
1425 new_child
.parent
= self
1426 assert new_child
isa TKwredef
1427 _n_kwredef
= new_child
1433 if _n_visibility
== old_child
then
1434 if new_child
!= null then
1435 new_child
.parent
= self
1436 assert new_child
isa PVisibility
1437 _n_visibility
= new_child
1443 if _n_kwattr
== old_child
then
1444 if new_child
!= null then
1445 new_child
.parent
= self
1446 assert new_child
isa TKwattr
1447 _n_kwattr
= new_child
1453 if _n_kwvar
== old_child
then
1454 if new_child
!= null then
1455 new_child
.parent
= self
1456 assert new_child
isa TKwvar
1457 _n_kwvar
= new_child
1463 if _n_id
== old_child
then
1464 if new_child
!= null then
1465 new_child
.parent
= self
1466 assert new_child
isa TAttrid
1473 if _n_type
== old_child
then
1474 if new_child
!= null then
1475 new_child
.parent
= self
1476 assert new_child
isa PType
1483 if _n_expr
== old_child
then
1484 if new_child
!= null then
1485 new_child
.parent
= self
1486 assert new_child
isa PExpr
1495 redef fun visit_all
(v
: Visitor)
1497 if _n_doc
!= null then
1498 v
.visit
(_n_doc
.as(not null))
1500 if _n_readable
!= null then
1501 v
.visit
(_n_readable
.as(not null))
1503 if _n_writable
!= null then
1504 v
.visit
(_n_writable
.as(not null))
1506 if _n_kwredef
!= null then
1507 v
.visit
(_n_kwredef
.as(not null))
1509 v
.visit
(_n_visibility
)
1510 if _n_kwattr
!= null then
1511 v
.visit
(_n_kwattr
.as(not null))
1513 if _n_kwvar
!= null then
1514 v
.visit
(_n_kwvar
.as(not null))
1517 if _n_type
!= null then
1518 v
.visit
(_n_type
.as(not null))
1520 if _n_expr
!= null then
1521 v
.visit
(_n_expr
.as(not null))
1525 redef fun visit_all_reverse
(v
: Visitor)
1527 if _n_doc
!= null then
1528 v
.visit
(_n_doc
.as(not null))
1530 if _n_readable
!= null then
1531 v
.visit
(_n_readable
.as(not null))
1533 if _n_writable
!= null then
1534 v
.visit
(_n_writable
.as(not null))
1536 if _n_kwredef
!= null then
1537 v
.visit
(_n_kwredef
.as(not null))
1539 v
.visit
(_n_visibility
)
1540 if _n_kwattr
!= null then
1541 v
.visit
(_n_kwattr
.as(not null))
1543 if _n_kwvar
!= null then
1544 v
.visit
(_n_kwvar
.as(not null))
1547 if _n_type
!= null then
1548 v
.visit
(_n_type
.as(not null))
1550 if _n_expr
!= null then
1551 v
.visit
(_n_expr
.as(not null))
1555 redef class AMethPropdef
1563 redef fun n_kwredef
=(n
)
1570 redef fun n_visibility
=(n
)
1575 redef fun n_methid
=(n
)
1580 redef fun n_signature
=(n
)
1586 private init empty_init
do end
1588 init init_amethpropdef
(
1589 n_doc
: nullable PDoc ,
1590 n_kwredef
: nullable TKwredef ,
1591 n_visibility
: nullable PVisibility ,
1592 n_methid
: nullable PMethid ,
1593 n_signature
: nullable PSignature
1598 if n_doc
!= null then
1601 _n_kwredef
= n_kwredef
1602 if n_kwredef
!= null then
1603 n_kwredef
.parent
= self
1605 _n_visibility
= n_visibility
.as(not null)
1606 n_visibility
.parent
= self
1607 _n_methid
= n_methid
.as(not null)
1608 n_methid
.parent
= self
1609 _n_signature
= n_signature
.as(not null)
1610 n_signature
.parent
= self
1613 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1615 if _n_doc
== old_child
then
1616 if new_child
!= null then
1617 new_child
.parent
= self
1618 assert new_child
isa PDoc
1625 if _n_kwredef
== old_child
then
1626 if new_child
!= null then
1627 new_child
.parent
= self
1628 assert new_child
isa TKwredef
1629 _n_kwredef
= new_child
1635 if _n_visibility
== old_child
then
1636 if new_child
!= null then
1637 new_child
.parent
= self
1638 assert new_child
isa PVisibility
1639 _n_visibility
= new_child
1645 if _n_methid
== old_child
then
1646 if new_child
!= null then
1647 new_child
.parent
= self
1648 assert new_child
isa PMethid
1649 _n_methid
= new_child
1655 if _n_signature
== old_child
then
1656 if new_child
!= null then
1657 new_child
.parent
= self
1658 assert new_child
isa PSignature
1659 _n_signature
= new_child
1667 redef fun visit_all
(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 fun visit_all_reverse
(v
: Visitor)
1682 if _n_doc
!= null then
1683 v
.visit
(_n_doc
.as(not null))
1685 if _n_kwredef
!= null then
1686 v
.visit
(_n_kwredef
.as(not null))
1688 v
.visit
(_n_visibility
)
1690 v
.visit
(_n_signature
)
1693 redef class ADeferredMethPropdef
1701 redef fun n_kwredef
=(n
)
1708 redef fun n_visibility
=(n
)
1713 redef fun n_kwmeth
=(n
)
1718 redef fun n_methid
=(n
)
1723 redef fun n_signature
=(n
)
1729 private init empty_init
do end
1731 init init_adeferredmethpropdef
(
1732 n_doc
: nullable PDoc ,
1733 n_kwredef
: nullable TKwredef ,
1734 n_visibility
: nullable PVisibility ,
1735 n_kwmeth
: nullable TKwmeth ,
1736 n_methid
: nullable PMethid ,
1737 n_signature
: nullable PSignature
1742 if n_doc
!= null then
1745 _n_kwredef
= n_kwredef
1746 if n_kwredef
!= null then
1747 n_kwredef
.parent
= self
1749 _n_visibility
= n_visibility
.as(not null)
1750 n_visibility
.parent
= self
1751 _n_kwmeth
= n_kwmeth
.as(not null)
1752 n_kwmeth
.parent
= self
1753 _n_methid
= n_methid
.as(not null)
1754 n_methid
.parent
= self
1755 _n_signature
= n_signature
.as(not null)
1756 n_signature
.parent
= self
1759 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1761 if _n_doc
== old_child
then
1762 if new_child
!= null then
1763 new_child
.parent
= self
1764 assert new_child
isa PDoc
1771 if _n_kwredef
== old_child
then
1772 if new_child
!= null then
1773 new_child
.parent
= self
1774 assert new_child
isa TKwredef
1775 _n_kwredef
= new_child
1781 if _n_visibility
== old_child
then
1782 if new_child
!= null then
1783 new_child
.parent
= self
1784 assert new_child
isa PVisibility
1785 _n_visibility
= new_child
1791 if _n_kwmeth
== old_child
then
1792 if new_child
!= null then
1793 new_child
.parent
= self
1794 assert new_child
isa TKwmeth
1795 _n_kwmeth
= new_child
1801 if _n_methid
== old_child
then
1802 if new_child
!= null then
1803 new_child
.parent
= self
1804 assert new_child
isa PMethid
1805 _n_methid
= new_child
1811 if _n_signature
== old_child
then
1812 if new_child
!= null then
1813 new_child
.parent
= self
1814 assert new_child
isa PSignature
1815 _n_signature
= new_child
1823 redef fun visit_all
(v
: Visitor)
1825 if _n_doc
!= null then
1826 v
.visit
(_n_doc
.as(not null))
1828 if _n_kwredef
!= null then
1829 v
.visit
(_n_kwredef
.as(not null))
1831 v
.visit
(_n_visibility
)
1834 v
.visit
(_n_signature
)
1837 redef fun visit_all_reverse
(v
: Visitor)
1839 if _n_doc
!= null then
1840 v
.visit
(_n_doc
.as(not null))
1842 if _n_kwredef
!= null then
1843 v
.visit
(_n_kwredef
.as(not null))
1845 v
.visit
(_n_visibility
)
1848 v
.visit
(_n_signature
)
1851 redef class AInternMethPropdef
1859 redef fun n_kwredef
=(n
)
1866 redef fun n_visibility
=(n
)
1871 redef fun n_kwmeth
=(n
)
1876 redef fun n_methid
=(n
)
1881 redef fun n_signature
=(n
)
1887 private init empty_init
do end
1889 init init_ainternmethpropdef
(
1890 n_doc
: nullable PDoc ,
1891 n_kwredef
: nullable TKwredef ,
1892 n_visibility
: nullable PVisibility ,
1893 n_kwmeth
: nullable TKwmeth ,
1894 n_methid
: nullable PMethid ,
1895 n_signature
: nullable PSignature
1900 if n_doc
!= null then
1903 _n_kwredef
= n_kwredef
1904 if n_kwredef
!= null then
1905 n_kwredef
.parent
= self
1907 _n_visibility
= n_visibility
.as(not null)
1908 n_visibility
.parent
= self
1909 _n_kwmeth
= n_kwmeth
.as(not null)
1910 n_kwmeth
.parent
= self
1911 _n_methid
= n_methid
.as(not null)
1912 n_methid
.parent
= self
1913 _n_signature
= n_signature
.as(not null)
1914 n_signature
.parent
= self
1917 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
1919 if _n_doc
== old_child
then
1920 if new_child
!= null then
1921 new_child
.parent
= self
1922 assert new_child
isa PDoc
1929 if _n_kwredef
== old_child
then
1930 if new_child
!= null then
1931 new_child
.parent
= self
1932 assert new_child
isa TKwredef
1933 _n_kwredef
= new_child
1939 if _n_visibility
== old_child
then
1940 if new_child
!= null then
1941 new_child
.parent
= self
1942 assert new_child
isa PVisibility
1943 _n_visibility
= new_child
1949 if _n_kwmeth
== old_child
then
1950 if new_child
!= null then
1951 new_child
.parent
= self
1952 assert new_child
isa TKwmeth
1953 _n_kwmeth
= new_child
1959 if _n_methid
== old_child
then
1960 if new_child
!= null then
1961 new_child
.parent
= self
1962 assert new_child
isa PMethid
1963 _n_methid
= new_child
1969 if _n_signature
== old_child
then
1970 if new_child
!= null then
1971 new_child
.parent
= self
1972 assert new_child
isa PSignature
1973 _n_signature
= new_child
1981 redef fun visit_all
(v
: Visitor)
1983 if _n_doc
!= null then
1984 v
.visit
(_n_doc
.as(not null))
1986 if _n_kwredef
!= null then
1987 v
.visit
(_n_kwredef
.as(not null))
1989 v
.visit
(_n_visibility
)
1992 v
.visit
(_n_signature
)
1995 redef fun visit_all_reverse
(v
: Visitor)
1997 if _n_doc
!= null then
1998 v
.visit
(_n_doc
.as(not null))
2000 if _n_kwredef
!= null then
2001 v
.visit
(_n_kwredef
.as(not null))
2003 v
.visit
(_n_visibility
)
2006 v
.visit
(_n_signature
)
2009 redef class AExternMethPropdef
2017 redef fun n_kwredef
=(n
)
2024 redef fun n_visibility
=(n
)
2029 redef fun n_kwmeth
=(n
)
2034 redef fun n_methid
=(n
)
2039 redef fun n_signature
=(n
)
2044 redef fun n_extern
=(n
)
2052 private init empty_init
do end
2054 init init_aexternmethpropdef
(
2055 n_doc
: nullable PDoc ,
2056 n_kwredef
: nullable TKwredef ,
2057 n_visibility
: nullable PVisibility ,
2058 n_kwmeth
: nullable TKwmeth ,
2059 n_methid
: nullable PMethid ,
2060 n_signature
: nullable PSignature ,
2061 n_extern
: nullable TString
2066 if n_doc
!= null then
2069 _n_kwredef
= n_kwredef
2070 if n_kwredef
!= null then
2071 n_kwredef
.parent
= self
2073 _n_visibility
= n_visibility
.as(not null)
2074 n_visibility
.parent
= self
2075 _n_kwmeth
= n_kwmeth
.as(not null)
2076 n_kwmeth
.parent
= self
2077 _n_methid
= n_methid
.as(not null)
2078 n_methid
.parent
= self
2079 _n_signature
= n_signature
.as(not null)
2080 n_signature
.parent
= self
2081 _n_extern
= n_extern
2082 if n_extern
!= null then
2083 n_extern
.parent
= self
2087 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2089 if _n_doc
== old_child
then
2090 if new_child
!= null then
2091 new_child
.parent
= self
2092 assert new_child
isa PDoc
2099 if _n_kwredef
== old_child
then
2100 if new_child
!= null then
2101 new_child
.parent
= self
2102 assert new_child
isa TKwredef
2103 _n_kwredef
= new_child
2109 if _n_visibility
== old_child
then
2110 if new_child
!= null then
2111 new_child
.parent
= self
2112 assert new_child
isa PVisibility
2113 _n_visibility
= new_child
2119 if _n_kwmeth
== old_child
then
2120 if new_child
!= null then
2121 new_child
.parent
= self
2122 assert new_child
isa TKwmeth
2123 _n_kwmeth
= new_child
2129 if _n_methid
== old_child
then
2130 if new_child
!= null then
2131 new_child
.parent
= self
2132 assert new_child
isa PMethid
2133 _n_methid
= new_child
2139 if _n_signature
== old_child
then
2140 if new_child
!= null then
2141 new_child
.parent
= self
2142 assert new_child
isa PSignature
2143 _n_signature
= new_child
2149 if _n_extern
== old_child
then
2150 if new_child
!= null then
2151 new_child
.parent
= self
2152 assert new_child
isa TString
2153 _n_extern
= new_child
2161 redef fun visit_all
(v
: Visitor)
2163 if _n_doc
!= null then
2164 v
.visit
(_n_doc
.as(not null))
2166 if _n_kwredef
!= null then
2167 v
.visit
(_n_kwredef
.as(not null))
2169 v
.visit
(_n_visibility
)
2172 v
.visit
(_n_signature
)
2173 if _n_extern
!= null then
2174 v
.visit
(_n_extern
.as(not null))
2178 redef fun visit_all_reverse
(v
: Visitor)
2180 if _n_doc
!= null then
2181 v
.visit
(_n_doc
.as(not null))
2183 if _n_kwredef
!= null then
2184 v
.visit
(_n_kwredef
.as(not null))
2186 v
.visit
(_n_visibility
)
2189 v
.visit
(_n_signature
)
2190 if _n_extern
!= null then
2191 v
.visit
(_n_extern
.as(not null))
2195 redef class AConcreteMethPropdef
2203 redef fun n_kwredef
=(n
)
2210 redef fun n_visibility
=(n
)
2215 redef fun n_kwmeth
=(n
)
2220 redef fun n_methid
=(n
)
2225 redef fun n_signature
=(n
)
2230 redef fun n_block
=(n
)
2238 private init empty_init
do end
2240 init init_aconcretemethpropdef
(
2241 n_doc
: nullable PDoc ,
2242 n_kwredef
: nullable TKwredef ,
2243 n_visibility
: nullable PVisibility ,
2244 n_kwmeth
: nullable TKwmeth ,
2245 n_methid
: nullable PMethid ,
2246 n_signature
: nullable PSignature ,
2247 n_block
: nullable PExpr
2252 if n_doc
!= null then
2255 _n_kwredef
= n_kwredef
2256 if n_kwredef
!= null then
2257 n_kwredef
.parent
= self
2259 _n_visibility
= n_visibility
.as(not null)
2260 n_visibility
.parent
= self
2261 _n_kwmeth
= n_kwmeth
.as(not null)
2262 n_kwmeth
.parent
= self
2263 _n_methid
= n_methid
.as(not null)
2264 n_methid
.parent
= self
2265 _n_signature
= n_signature
.as(not null)
2266 n_signature
.parent
= self
2268 if n_block
!= null then
2269 n_block
.parent
= self
2273 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2275 if _n_doc
== old_child
then
2276 if new_child
!= null then
2277 new_child
.parent
= self
2278 assert new_child
isa PDoc
2285 if _n_kwredef
== old_child
then
2286 if new_child
!= null then
2287 new_child
.parent
= self
2288 assert new_child
isa TKwredef
2289 _n_kwredef
= new_child
2295 if _n_visibility
== old_child
then
2296 if new_child
!= null then
2297 new_child
.parent
= self
2298 assert new_child
isa PVisibility
2299 _n_visibility
= new_child
2305 if _n_kwmeth
== old_child
then
2306 if new_child
!= null then
2307 new_child
.parent
= self
2308 assert new_child
isa TKwmeth
2309 _n_kwmeth
= new_child
2315 if _n_methid
== old_child
then
2316 if new_child
!= null then
2317 new_child
.parent
= self
2318 assert new_child
isa PMethid
2319 _n_methid
= new_child
2325 if _n_signature
== old_child
then
2326 if new_child
!= null then
2327 new_child
.parent
= self
2328 assert new_child
isa PSignature
2329 _n_signature
= new_child
2335 if _n_block
== old_child
then
2336 if new_child
!= null then
2337 new_child
.parent
= self
2338 assert new_child
isa PExpr
2339 _n_block
= new_child
2347 redef fun visit_all
(v
: Visitor)
2349 if _n_doc
!= null then
2350 v
.visit
(_n_doc
.as(not null))
2352 if _n_kwredef
!= null then
2353 v
.visit
(_n_kwredef
.as(not null))
2355 v
.visit
(_n_visibility
)
2358 v
.visit
(_n_signature
)
2359 if _n_block
!= null then
2360 v
.visit
(_n_block
.as(not null))
2364 redef fun visit_all_reverse
(v
: Visitor)
2366 if _n_doc
!= null then
2367 v
.visit
(_n_doc
.as(not null))
2369 if _n_kwredef
!= null then
2370 v
.visit
(_n_kwredef
.as(not null))
2372 v
.visit
(_n_visibility
)
2375 v
.visit
(_n_signature
)
2376 if _n_block
!= null then
2377 v
.visit
(_n_block
.as(not null))
2381 redef class AConcreteInitPropdef
2389 redef fun n_kwredef
=(n
)
2396 redef fun n_visibility
=(n
)
2401 redef fun n_kwinit
=(n
)
2406 redef fun n_methid
=(n
)
2413 redef fun n_signature
=(n
)
2418 redef fun n_block
=(n
)
2426 private init empty_init
do end
2428 init init_aconcreteinitpropdef
(
2429 n_doc
: nullable PDoc ,
2430 n_kwredef
: nullable TKwredef ,
2431 n_visibility
: nullable PVisibility ,
2432 n_kwinit
: nullable TKwinit ,
2433 n_methid
: nullable PMethid ,
2434 n_signature
: nullable PSignature ,
2435 n_block
: nullable PExpr
2440 if n_doc
!= null then
2443 _n_kwredef
= n_kwredef
2444 if n_kwredef
!= null then
2445 n_kwredef
.parent
= self
2447 _n_visibility
= n_visibility
.as(not null)
2448 n_visibility
.parent
= self
2449 _n_kwinit
= n_kwinit
.as(not null)
2450 n_kwinit
.parent
= self
2451 _n_methid
= n_methid
2452 if n_methid
!= null then
2453 n_methid
.parent
= self
2455 _n_signature
= n_signature
.as(not null)
2456 n_signature
.parent
= self
2458 if n_block
!= null then
2459 n_block
.parent
= self
2463 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2465 if _n_doc
== old_child
then
2466 if new_child
!= null then
2467 new_child
.parent
= self
2468 assert new_child
isa PDoc
2475 if _n_kwredef
== old_child
then
2476 if new_child
!= null then
2477 new_child
.parent
= self
2478 assert new_child
isa TKwredef
2479 _n_kwredef
= new_child
2485 if _n_visibility
== old_child
then
2486 if new_child
!= null then
2487 new_child
.parent
= self
2488 assert new_child
isa PVisibility
2489 _n_visibility
= new_child
2495 if _n_kwinit
== old_child
then
2496 if new_child
!= null then
2497 new_child
.parent
= self
2498 assert new_child
isa TKwinit
2499 _n_kwinit
= new_child
2505 if _n_methid
== old_child
then
2506 if new_child
!= null then
2507 new_child
.parent
= self
2508 assert new_child
isa PMethid
2509 _n_methid
= new_child
2515 if _n_signature
== old_child
then
2516 if new_child
!= null then
2517 new_child
.parent
= self
2518 assert new_child
isa PSignature
2519 _n_signature
= new_child
2525 if _n_block
== old_child
then
2526 if new_child
!= null then
2527 new_child
.parent
= self
2528 assert new_child
isa PExpr
2529 _n_block
= new_child
2537 redef fun visit_all
(v
: Visitor)
2539 if _n_doc
!= null then
2540 v
.visit
(_n_doc
.as(not null))
2542 if _n_kwredef
!= null then
2543 v
.visit
(_n_kwredef
.as(not null))
2545 v
.visit
(_n_visibility
)
2547 if _n_methid
!= null then
2548 v
.visit
(_n_methid
.as(not null))
2550 v
.visit
(_n_signature
)
2551 if _n_block
!= null then
2552 v
.visit
(_n_block
.as(not null))
2556 redef fun visit_all_reverse
(v
: Visitor)
2558 if _n_doc
!= null then
2559 v
.visit
(_n_doc
.as(not null))
2561 if _n_kwredef
!= null then
2562 v
.visit
(_n_kwredef
.as(not null))
2564 v
.visit
(_n_visibility
)
2566 if _n_methid
!= null then
2567 v
.visit
(_n_methid
.as(not null))
2569 v
.visit
(_n_signature
)
2570 if _n_block
!= null then
2571 v
.visit
(_n_block
.as(not null))
2575 redef class AMainMethPropdef
2576 redef fun n_kwredef
=(n
)
2583 redef fun n_block
=(n
)
2591 private init empty_init
do end
2593 init init_amainmethpropdef
(
2594 n_kwredef
: nullable TKwredef ,
2595 n_block
: nullable PExpr
2599 _n_kwredef
= n_kwredef
2600 if n_kwredef
!= null then
2601 n_kwredef
.parent
= self
2604 if n_block
!= null then
2605 n_block
.parent
= self
2609 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2611 if _n_kwredef
== old_child
then
2612 if new_child
!= null then
2613 new_child
.parent
= self
2614 assert new_child
isa TKwredef
2615 _n_kwredef
= new_child
2621 if _n_block
== old_child
then
2622 if new_child
!= null then
2623 new_child
.parent
= self
2624 assert new_child
isa PExpr
2625 _n_block
= new_child
2633 redef fun visit_all
(v
: Visitor)
2635 if _n_kwredef
!= null then
2636 v
.visit
(_n_kwredef
.as(not null))
2638 if _n_block
!= null then
2639 v
.visit
(_n_block
.as(not null))
2643 redef fun visit_all_reverse
(v
: Visitor)
2645 if _n_kwredef
!= null then
2646 v
.visit
(_n_kwredef
.as(not null))
2648 if _n_block
!= null then
2649 v
.visit
(_n_block
.as(not null))
2653 redef class ATypePropdef
2661 redef fun n_kwredef
=(n
)
2668 redef fun n_visibility
=(n
)
2673 redef fun n_kwtype
=(n
)
2683 redef fun n_type
=(n
)
2689 private init empty_init
do end
2691 init init_atypepropdef
(
2692 n_doc
: nullable PDoc ,
2693 n_kwredef
: nullable TKwredef ,
2694 n_visibility
: nullable PVisibility ,
2695 n_kwtype
: nullable TKwtype ,
2696 n_id
: nullable TClassid ,
2697 n_type
: nullable PType
2702 if n_doc
!= null then
2705 _n_kwredef
= n_kwredef
2706 if n_kwredef
!= null then
2707 n_kwredef
.parent
= self
2709 _n_visibility
= n_visibility
.as(not null)
2710 n_visibility
.parent
= self
2711 _n_kwtype
= n_kwtype
.as(not null)
2712 n_kwtype
.parent
= self
2713 _n_id
= n_id
.as(not null)
2715 _n_type
= n_type
.as(not null)
2716 n_type
.parent
= self
2719 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2721 if _n_doc
== old_child
then
2722 if new_child
!= null then
2723 new_child
.parent
= self
2724 assert new_child
isa PDoc
2731 if _n_kwredef
== old_child
then
2732 if new_child
!= null then
2733 new_child
.parent
= self
2734 assert new_child
isa TKwredef
2735 _n_kwredef
= new_child
2741 if _n_visibility
== old_child
then
2742 if new_child
!= null then
2743 new_child
.parent
= self
2744 assert new_child
isa PVisibility
2745 _n_visibility
= new_child
2751 if _n_kwtype
== old_child
then
2752 if new_child
!= null then
2753 new_child
.parent
= self
2754 assert new_child
isa TKwtype
2755 _n_kwtype
= new_child
2761 if _n_id
== old_child
then
2762 if new_child
!= null then
2763 new_child
.parent
= self
2764 assert new_child
isa TClassid
2771 if _n_type
== old_child
then
2772 if new_child
!= null then
2773 new_child
.parent
= self
2774 assert new_child
isa PType
2783 redef fun visit_all
(v
: Visitor)
2785 if _n_doc
!= null then
2786 v
.visit
(_n_doc
.as(not null))
2788 if _n_kwredef
!= null then
2789 v
.visit
(_n_kwredef
.as(not null))
2791 v
.visit
(_n_visibility
)
2797 redef fun visit_all_reverse
(v
: Visitor)
2799 if _n_doc
!= null then
2800 v
.visit
(_n_doc
.as(not null))
2802 if _n_kwredef
!= null then
2803 v
.visit
(_n_kwredef
.as(not null))
2805 v
.visit
(_n_visibility
)
2811 redef class AReadAble
2812 redef fun n_kwredef
=(n
)
2819 redef fun n_kwreadable
=(n
)
2825 private init empty_init
do end
2827 init init_areadable
(
2828 n_kwredef
: nullable TKwredef ,
2829 n_kwreadable
: nullable TKwreadable
2833 _n_kwredef
= n_kwredef
2834 if n_kwredef
!= null then
2835 n_kwredef
.parent
= self
2837 _n_kwreadable
= n_kwreadable
.as(not null)
2838 n_kwreadable
.parent
= self
2841 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2843 if _n_kwredef
== old_child
then
2844 if new_child
!= null then
2845 new_child
.parent
= self
2846 assert new_child
isa TKwredef
2847 _n_kwredef
= new_child
2853 if _n_kwreadable
== old_child
then
2854 if new_child
!= null then
2855 new_child
.parent
= self
2856 assert new_child
isa TKwreadable
2857 _n_kwreadable
= new_child
2865 redef fun visit_all
(v
: Visitor)
2867 if _n_kwredef
!= null then
2868 v
.visit
(_n_kwredef
.as(not null))
2870 v
.visit
(_n_kwreadable
)
2873 redef fun visit_all_reverse
(v
: Visitor)
2875 if _n_kwredef
!= null then
2876 v
.visit
(_n_kwredef
.as(not null))
2878 v
.visit
(_n_kwreadable
)
2881 redef class AWriteAble
2882 redef fun n_kwredef
=(n
)
2889 redef fun n_kwwritable
=(n
)
2895 private init empty_init
do end
2897 init init_awriteable
(
2898 n_kwredef
: nullable TKwredef ,
2899 n_kwwritable
: nullable TKwwritable
2903 _n_kwredef
= n_kwredef
2904 if n_kwredef
!= null then
2905 n_kwredef
.parent
= self
2907 _n_kwwritable
= n_kwwritable
.as(not null)
2908 n_kwwritable
.parent
= self
2911 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2913 if _n_kwredef
== old_child
then
2914 if new_child
!= null then
2915 new_child
.parent
= self
2916 assert new_child
isa TKwredef
2917 _n_kwredef
= new_child
2923 if _n_kwwritable
== old_child
then
2924 if new_child
!= null then
2925 new_child
.parent
= self
2926 assert new_child
isa TKwwritable
2927 _n_kwwritable
= new_child
2935 redef fun visit_all
(v
: Visitor)
2937 if _n_kwredef
!= null then
2938 v
.visit
(_n_kwredef
.as(not null))
2940 v
.visit
(_n_kwwritable
)
2943 redef fun visit_all_reverse
(v
: Visitor)
2945 if _n_kwredef
!= null then
2946 v
.visit
(_n_kwredef
.as(not null))
2948 v
.visit
(_n_kwwritable
)
2951 redef class AIdMethid
2958 private init empty_init
do end
2960 init init_aidmethid
(
2965 _n_id
= n_id
.as(not null)
2969 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
2971 if _n_id
== old_child
then
2972 if new_child
!= null then
2973 new_child
.parent
= self
2974 assert new_child
isa TId
2983 redef fun visit_all
(v
: Visitor)
2988 redef fun visit_all_reverse
(v
: Visitor)
2993 redef class APlusMethid
2994 redef fun n_plus
=(n
)
3000 private init empty_init
do end
3002 init init_aplusmethid
(
3003 n_plus
: nullable TPlus
3007 _n_plus
= n_plus
.as(not null)
3008 n_plus
.parent
= self
3011 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3013 if _n_plus
== old_child
then
3014 if new_child
!= null then
3015 new_child
.parent
= self
3016 assert new_child
isa TPlus
3025 redef fun visit_all
(v
: Visitor)
3030 redef fun visit_all_reverse
(v
: Visitor)
3035 redef class AMinusMethid
3036 redef fun n_minus
=(n
)
3042 private init empty_init
do end
3044 init init_aminusmethid
(
3045 n_minus
: nullable TMinus
3049 _n_minus
= n_minus
.as(not null)
3050 n_minus
.parent
= self
3053 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3055 if _n_minus
== old_child
then
3056 if new_child
!= null then
3057 new_child
.parent
= self
3058 assert new_child
isa TMinus
3059 _n_minus
= new_child
3067 redef fun visit_all
(v
: Visitor)
3072 redef fun visit_all_reverse
(v
: Visitor)
3077 redef class AStarMethid
3078 redef fun n_star
=(n
)
3084 private init empty_init
do end
3086 init init_astarmethid
(
3087 n_star
: nullable TStar
3091 _n_star
= n_star
.as(not null)
3092 n_star
.parent
= self
3095 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3097 if _n_star
== old_child
then
3098 if new_child
!= null then
3099 new_child
.parent
= self
3100 assert new_child
isa TStar
3109 redef fun visit_all
(v
: Visitor)
3114 redef fun visit_all_reverse
(v
: Visitor)
3119 redef class ASlashMethid
3120 redef fun n_slash
=(n
)
3126 private init empty_init
do end
3128 init init_aslashmethid
(
3129 n_slash
: nullable TSlash
3133 _n_slash
= n_slash
.as(not null)
3134 n_slash
.parent
= self
3137 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3139 if _n_slash
== old_child
then
3140 if new_child
!= null then
3141 new_child
.parent
= self
3142 assert new_child
isa TSlash
3143 _n_slash
= new_child
3151 redef fun visit_all
(v
: Visitor)
3156 redef fun visit_all_reverse
(v
: Visitor)
3161 redef class APercentMethid
3162 redef fun n_percent
=(n
)
3168 private init empty_init
do end
3170 init init_apercentmethid
(
3171 n_percent
: nullable TPercent
3175 _n_percent
= n_percent
.as(not null)
3176 n_percent
.parent
= self
3179 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3181 if _n_percent
== old_child
then
3182 if new_child
!= null then
3183 new_child
.parent
= self
3184 assert new_child
isa TPercent
3185 _n_percent
= new_child
3193 redef fun visit_all
(v
: Visitor)
3198 redef fun visit_all_reverse
(v
: Visitor)
3203 redef class AEqMethid
3210 private init empty_init
do end
3212 init init_aeqmethid
(
3217 _n_eq
= n_eq
.as(not null)
3221 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3223 if _n_eq
== old_child
then
3224 if new_child
!= null then
3225 new_child
.parent
= self
3226 assert new_child
isa TEq
3235 redef fun visit_all
(v
: Visitor)
3240 redef fun visit_all_reverse
(v
: Visitor)
3245 redef class ANeMethid
3252 private init empty_init
do end
3254 init init_anemethid
(
3259 _n_ne
= n_ne
.as(not null)
3263 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3265 if _n_ne
== old_child
then
3266 if new_child
!= null then
3267 new_child
.parent
= self
3268 assert new_child
isa TNe
3277 redef fun visit_all
(v
: Visitor)
3282 redef fun visit_all_reverse
(v
: Visitor)
3287 redef class ALeMethid
3294 private init empty_init
do end
3296 init init_alemethid
(
3301 _n_le
= n_le
.as(not null)
3305 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3307 if _n_le
== old_child
then
3308 if new_child
!= null then
3309 new_child
.parent
= self
3310 assert new_child
isa TLe
3319 redef fun visit_all
(v
: Visitor)
3324 redef fun visit_all_reverse
(v
: Visitor)
3329 redef class AGeMethid
3336 private init empty_init
do end
3338 init init_agemethid
(
3343 _n_ge
= n_ge
.as(not null)
3347 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3349 if _n_ge
== old_child
then
3350 if new_child
!= null then
3351 new_child
.parent
= self
3352 assert new_child
isa TGe
3361 redef fun visit_all
(v
: Visitor)
3366 redef fun visit_all_reverse
(v
: Visitor)
3371 redef class ALtMethid
3378 private init empty_init
do end
3380 init init_altmethid
(
3385 _n_lt
= n_lt
.as(not null)
3389 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3391 if _n_lt
== old_child
then
3392 if new_child
!= null then
3393 new_child
.parent
= self
3394 assert new_child
isa TLt
3403 redef fun visit_all
(v
: Visitor)
3408 redef fun visit_all_reverse
(v
: Visitor)
3413 redef class AGtMethid
3420 private init empty_init
do end
3422 init init_agtmethid
(
3427 _n_gt
= n_gt
.as(not null)
3431 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3433 if _n_gt
== old_child
then
3434 if new_child
!= null then
3435 new_child
.parent
= self
3436 assert new_child
isa TGt
3445 redef fun visit_all
(v
: Visitor)
3450 redef fun visit_all_reverse
(v
: Visitor)
3455 redef class ABraMethid
3456 redef fun n_obra
=(n
)
3461 redef fun n_cbra
=(n
)
3467 private init empty_init
do end
3469 init init_abramethid
(
3470 n_obra
: nullable TObra ,
3471 n_cbra
: nullable TCbra
3475 _n_obra
= n_obra
.as(not null)
3476 n_obra
.parent
= self
3477 _n_cbra
= n_cbra
.as(not null)
3478 n_cbra
.parent
= self
3481 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3483 if _n_obra
== old_child
then
3484 if new_child
!= null then
3485 new_child
.parent
= self
3486 assert new_child
isa TObra
3493 if _n_cbra
== old_child
then
3494 if new_child
!= null then
3495 new_child
.parent
= self
3496 assert new_child
isa TCbra
3505 redef fun visit_all
(v
: Visitor)
3511 redef fun visit_all_reverse
(v
: Visitor)
3517 redef class AStarshipMethid
3518 redef fun n_starship
=(n
)
3524 private init empty_init
do end
3526 init init_astarshipmethid
(
3527 n_starship
: nullable TStarship
3531 _n_starship
= n_starship
.as(not null)
3532 n_starship
.parent
= self
3535 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3537 if _n_starship
== old_child
then
3538 if new_child
!= null then
3539 new_child
.parent
= self
3540 assert new_child
isa TStarship
3541 _n_starship
= new_child
3549 redef fun visit_all
(v
: Visitor)
3551 v
.visit
(_n_starship
)
3554 redef fun visit_all_reverse
(v
: Visitor)
3556 v
.visit
(_n_starship
)
3559 redef class AAssignMethid
3565 redef fun n_assign
=(n
)
3571 private init empty_init
do end
3573 init init_aassignmethid
(
3574 n_id
: nullable TId ,
3575 n_assign
: nullable TAssign
3579 _n_id
= n_id
.as(not null)
3581 _n_assign
= n_assign
.as(not null)
3582 n_assign
.parent
= self
3585 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3587 if _n_id
== old_child
then
3588 if new_child
!= null then
3589 new_child
.parent
= self
3590 assert new_child
isa TId
3597 if _n_assign
== old_child
then
3598 if new_child
!= null then
3599 new_child
.parent
= self
3600 assert new_child
isa TAssign
3601 _n_assign
= new_child
3609 redef fun visit_all
(v
: Visitor)
3615 redef fun visit_all_reverse
(v
: Visitor)
3621 redef class ABraassignMethid
3622 redef fun n_obra
=(n
)
3627 redef fun n_cbra
=(n
)
3632 redef fun n_assign
=(n
)
3638 private init empty_init
do end
3640 init init_abraassignmethid
(
3641 n_obra
: nullable TObra ,
3642 n_cbra
: nullable TCbra ,
3643 n_assign
: nullable TAssign
3647 _n_obra
= n_obra
.as(not null)
3648 n_obra
.parent
= self
3649 _n_cbra
= n_cbra
.as(not null)
3650 n_cbra
.parent
= self
3651 _n_assign
= n_assign
.as(not null)
3652 n_assign
.parent
= self
3655 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3657 if _n_obra
== old_child
then
3658 if new_child
!= null then
3659 new_child
.parent
= self
3660 assert new_child
isa TObra
3667 if _n_cbra
== old_child
then
3668 if new_child
!= null then
3669 new_child
.parent
= self
3670 assert new_child
isa TCbra
3677 if _n_assign
== old_child
then
3678 if new_child
!= null then
3679 new_child
.parent
= self
3680 assert new_child
isa TAssign
3681 _n_assign
= new_child
3689 redef fun visit_all
(v
: Visitor)
3696 redef fun visit_all_reverse
(v
: Visitor)
3703 redef class ASignature
3704 redef fun n_type
=(n
)
3712 private init empty_init
do end
3714 init init_asignature
(
3715 n_params
: Collection[Object] , # Should be Collection[PParam]
3716 n_type
: nullable PType ,
3717 n_closure_decls
: Collection[Object] # Should be Collection[PClosureDecl]
3721 for n
in n_params
do
3727 if n_type
!= null then
3728 n_type
.parent
= self
3730 for n
in n_closure_decls
do
3731 assert n
isa PClosureDecl
3732 _n_closure_decls
.add
(n
)
3737 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3739 for i
in [0.._n_params
.length
[ do
3740 if _n_params
[i
] == old_child
then
3741 if new_child
!= null then
3742 assert new_child
isa PParam
3743 _n_params
[i
] = new_child
3744 new_child
.parent
= self
3746 _n_params
.remove_at
(i
)
3751 if _n_type
== old_child
then
3752 if new_child
!= null then
3753 new_child
.parent
= self
3754 assert new_child
isa PType
3761 for i
in [0.._n_closure_decls
.length
[ do
3762 if _n_closure_decls
[i
] == old_child
then
3763 if new_child
!= null then
3764 assert new_child
isa PClosureDecl
3765 _n_closure_decls
[i
] = new_child
3766 new_child
.parent
= self
3768 _n_closure_decls
.remove_at
(i
)
3775 redef fun visit_all
(v
: Visitor)
3777 for n
in _n_params
do
3780 if _n_type
!= null then
3781 v
.visit
(_n_type
.as(not null))
3783 for n
in _n_closure_decls
do
3788 redef fun visit_all_reverse
(v
: Visitor)
3791 var i
= _n_params
.length
3793 v
.visit
(_n_params
[i
])
3797 if _n_type
!= null then
3798 v
.visit
(_n_type
.as(not null))
3801 var i
= _n_closure_decls
.length
3803 v
.visit
(_n_closure_decls
[i
])
3815 redef fun n_type
=(n
)
3822 redef fun n_dotdotdot
=(n
)
3830 private init empty_init
do end
3833 n_id
: nullable TId ,
3834 n_type
: nullable PType ,
3835 n_dotdotdot
: nullable TDotdotdot
3839 _n_id
= n_id
.as(not null)
3842 if n_type
!= null then
3843 n_type
.parent
= self
3845 _n_dotdotdot
= n_dotdotdot
3846 if n_dotdotdot
!= null then
3847 n_dotdotdot
.parent
= self
3851 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3853 if _n_id
== old_child
then
3854 if new_child
!= null then
3855 new_child
.parent
= self
3856 assert new_child
isa TId
3863 if _n_type
== old_child
then
3864 if new_child
!= null then
3865 new_child
.parent
= self
3866 assert new_child
isa PType
3873 if _n_dotdotdot
== old_child
then
3874 if new_child
!= null then
3875 new_child
.parent
= self
3876 assert new_child
isa TDotdotdot
3877 _n_dotdotdot
= new_child
3885 redef fun visit_all
(v
: Visitor)
3888 if _n_type
!= null then
3889 v
.visit
(_n_type
.as(not null))
3891 if _n_dotdotdot
!= null then
3892 v
.visit
(_n_dotdotdot
.as(not null))
3896 redef fun visit_all_reverse
(v
: Visitor)
3899 if _n_type
!= null then
3900 v
.visit
(_n_type
.as(not null))
3902 if _n_dotdotdot
!= null then
3903 v
.visit
(_n_dotdotdot
.as(not null))
3907 redef class AClosureDecl
3908 redef fun n_kwwith
=(n
)
3913 redef fun n_kwbreak
=(n
)
3925 redef fun n_signature
=(n
)
3930 redef fun n_expr
=(n
)
3938 private init empty_init
do end
3940 init init_aclosuredecl
(
3941 n_kwwith
: nullable TKwwith ,
3942 n_kwbreak
: nullable TKwbreak ,
3943 n_id
: nullable TId ,
3944 n_signature
: nullable PSignature ,
3945 n_expr
: nullable PExpr
3949 _n_kwwith
= n_kwwith
.as(not null)
3950 n_kwwith
.parent
= self
3951 _n_kwbreak
= n_kwbreak
3952 if n_kwbreak
!= null then
3953 n_kwbreak
.parent
= self
3955 _n_id
= n_id
.as(not null)
3957 _n_signature
= n_signature
.as(not null)
3958 n_signature
.parent
= self
3960 if n_expr
!= null then
3961 n_expr
.parent
= self
3965 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
3967 if _n_kwwith
== old_child
then
3968 if new_child
!= null then
3969 new_child
.parent
= self
3970 assert new_child
isa TKwwith
3971 _n_kwwith
= new_child
3977 if _n_kwbreak
== old_child
then
3978 if new_child
!= null then
3979 new_child
.parent
= self
3980 assert new_child
isa TKwbreak
3981 _n_kwbreak
= new_child
3987 if _n_id
== old_child
then
3988 if new_child
!= null then
3989 new_child
.parent
= self
3990 assert new_child
isa TId
3997 if _n_signature
== old_child
then
3998 if new_child
!= null then
3999 new_child
.parent
= self
4000 assert new_child
isa PSignature
4001 _n_signature
= new_child
4007 if _n_expr
== old_child
then
4008 if new_child
!= null then
4009 new_child
.parent
= self
4010 assert new_child
isa PExpr
4019 redef fun visit_all
(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))
4032 redef fun visit_all_reverse
(v
: Visitor)
4035 if _n_kwbreak
!= null then
4036 v
.visit
(_n_kwbreak
.as(not null))
4039 v
.visit
(_n_signature
)
4040 if _n_expr
!= null then
4041 v
.visit
(_n_expr
.as(not null))
4046 redef fun n_kwnullable
=(n
)
4059 private init empty_init
do end
4062 n_kwnullable
: nullable TKwnullable ,
4063 n_id
: nullable TClassid ,
4064 n_types
: Collection[Object] # Should be Collection[PType]
4068 _n_kwnullable
= n_kwnullable
4069 if n_kwnullable
!= null then
4070 n_kwnullable
.parent
= self
4072 _n_id
= n_id
.as(not null)
4081 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4083 if _n_kwnullable
== old_child
then
4084 if new_child
!= null then
4085 new_child
.parent
= self
4086 assert new_child
isa TKwnullable
4087 _n_kwnullable
= new_child
4089 _n_kwnullable
= null
4093 if _n_id
== old_child
then
4094 if new_child
!= null then
4095 new_child
.parent
= self
4096 assert new_child
isa TClassid
4103 for i
in [0.._n_types
.length
[ do
4104 if _n_types
[i
] == old_child
then
4105 if new_child
!= null then
4106 assert new_child
isa PType
4107 _n_types
[i
] = new_child
4108 new_child
.parent
= self
4110 _n_types
.remove_at
(i
)
4117 redef fun visit_all
(v
: Visitor)
4119 if _n_kwnullable
!= null then
4120 v
.visit
(_n_kwnullable
.as(not null))
4123 for n
in _n_types
do
4128 redef fun visit_all_reverse
(v
: Visitor)
4130 if _n_kwnullable
!= null then
4131 v
.visit
(_n_kwnullable
.as(not null))
4135 var i
= _n_types
.length
4137 v
.visit
(_n_types
[i
])
4143 redef class ABlockExpr
4145 private init empty_init
do end
4147 init init_ablockexpr
(
4148 n_expr
: Collection[Object] # Should be Collection[PExpr]
4159 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4161 for i
in [0.._n_expr
.length
[ do
4162 if _n_expr
[i
] == old_child
then
4163 if new_child
!= null then
4164 assert new_child
isa PExpr
4165 _n_expr
[i
] = new_child
4166 new_child
.parent
= self
4168 _n_expr
.remove_at
(i
)
4175 redef fun visit_all
(v
: Visitor)
4182 redef fun visit_all_reverse
(v
: Visitor)
4185 var i
= _n_expr
.length
4193 redef class AVardeclExpr
4194 redef fun n_kwvar
=(n
)
4204 redef fun n_type
=(n
)
4211 redef fun n_assign
=(n
)
4218 redef fun n_expr
=(n
)
4226 private init empty_init
do end
4228 init init_avardeclexpr
(
4229 n_kwvar
: nullable TKwvar ,
4230 n_id
: nullable TId ,
4231 n_type
: nullable PType ,
4232 n_assign
: nullable TAssign ,
4233 n_expr
: nullable PExpr
4237 _n_kwvar
= n_kwvar
.as(not null)
4238 n_kwvar
.parent
= self
4239 _n_id
= n_id
.as(not null)
4242 if n_type
!= null then
4243 n_type
.parent
= self
4245 _n_assign
= n_assign
4246 if n_assign
!= null then
4247 n_assign
.parent
= self
4250 if n_expr
!= null then
4251 n_expr
.parent
= self
4255 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4257 if _n_kwvar
== old_child
then
4258 if new_child
!= null then
4259 new_child
.parent
= self
4260 assert new_child
isa TKwvar
4261 _n_kwvar
= new_child
4267 if _n_id
== old_child
then
4268 if new_child
!= null then
4269 new_child
.parent
= self
4270 assert new_child
isa TId
4277 if _n_type
== old_child
then
4278 if new_child
!= null then
4279 new_child
.parent
= self
4280 assert new_child
isa PType
4287 if _n_assign
== old_child
then
4288 if new_child
!= null then
4289 new_child
.parent
= self
4290 assert new_child
isa TAssign
4291 _n_assign
= new_child
4297 if _n_expr
== old_child
then
4298 if new_child
!= null then
4299 new_child
.parent
= self
4300 assert new_child
isa PExpr
4309 redef fun visit_all
(v
: Visitor)
4313 if _n_type
!= null then
4314 v
.visit
(_n_type
.as(not null))
4316 if _n_assign
!= null then
4317 v
.visit
(_n_assign
.as(not null))
4319 if _n_expr
!= null then
4320 v
.visit
(_n_expr
.as(not null))
4324 redef fun visit_all_reverse
(v
: Visitor)
4328 if _n_type
!= null then
4329 v
.visit
(_n_type
.as(not null))
4331 if _n_assign
!= null then
4332 v
.visit
(_n_assign
.as(not null))
4334 if _n_expr
!= null then
4335 v
.visit
(_n_expr
.as(not null))
4339 redef class AReturnExpr
4340 redef fun n_kwreturn
=(n
)
4345 redef fun n_expr
=(n
)
4353 private init empty_init
do end
4355 init init_areturnexpr
(
4356 n_kwreturn
: nullable TKwreturn ,
4357 n_expr
: nullable PExpr
4361 _n_kwreturn
= n_kwreturn
.as(not null)
4362 n_kwreturn
.parent
= self
4364 if n_expr
!= null then
4365 n_expr
.parent
= self
4369 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4371 if _n_kwreturn
== old_child
then
4372 if new_child
!= null then
4373 new_child
.parent
= self
4374 assert new_child
isa TKwreturn
4375 _n_kwreturn
= new_child
4381 if _n_expr
== old_child
then
4382 if new_child
!= null then
4383 new_child
.parent
= self
4384 assert new_child
isa PExpr
4393 redef fun visit_all
(v
: Visitor)
4395 v
.visit
(_n_kwreturn
)
4396 if _n_expr
!= null then
4397 v
.visit
(_n_expr
.as(not null))
4401 redef fun visit_all_reverse
(v
: Visitor)
4403 v
.visit
(_n_kwreturn
)
4404 if _n_expr
!= null then
4405 v
.visit
(_n_expr
.as(not null))
4409 redef class ABreakExpr
4410 redef fun n_kwbreak
=(n
)
4415 redef fun n_expr
=(n
)
4423 private init empty_init
do end
4425 init init_abreakexpr
(
4426 n_kwbreak
: nullable TKwbreak ,
4427 n_expr
: nullable PExpr
4431 _n_kwbreak
= n_kwbreak
.as(not null)
4432 n_kwbreak
.parent
= self
4434 if n_expr
!= null then
4435 n_expr
.parent
= self
4439 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4441 if _n_kwbreak
== old_child
then
4442 if new_child
!= null then
4443 new_child
.parent
= self
4444 assert new_child
isa TKwbreak
4445 _n_kwbreak
= new_child
4451 if _n_expr
== old_child
then
4452 if new_child
!= null then
4453 new_child
.parent
= self
4454 assert new_child
isa PExpr
4463 redef fun visit_all
(v
: Visitor)
4466 if _n_expr
!= null then
4467 v
.visit
(_n_expr
.as(not null))
4471 redef fun visit_all_reverse
(v
: Visitor)
4474 if _n_expr
!= null then
4475 v
.visit
(_n_expr
.as(not null))
4479 redef class AAbortExpr
4480 redef fun n_kwabort
=(n
)
4486 private init empty_init
do end
4488 init init_aabortexpr
(
4489 n_kwabort
: nullable TKwabort
4493 _n_kwabort
= n_kwabort
.as(not null)
4494 n_kwabort
.parent
= self
4497 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4499 if _n_kwabort
== old_child
then
4500 if new_child
!= null then
4501 new_child
.parent
= self
4502 assert new_child
isa TKwabort
4503 _n_kwabort
= new_child
4511 redef fun visit_all
(v
: Visitor)
4516 redef fun visit_all_reverse
(v
: Visitor)
4521 redef class AContinueExpr
4522 redef fun n_kwcontinue
=(n
)
4527 redef fun n_expr
=(n
)
4535 private init empty_init
do end
4537 init init_acontinueexpr
(
4538 n_kwcontinue
: nullable TKwcontinue ,
4539 n_expr
: nullable PExpr
4543 _n_kwcontinue
= n_kwcontinue
.as(not null)
4544 n_kwcontinue
.parent
= self
4546 if n_expr
!= null then
4547 n_expr
.parent
= self
4551 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4553 if _n_kwcontinue
== old_child
then
4554 if new_child
!= null then
4555 new_child
.parent
= self
4556 assert new_child
isa TKwcontinue
4557 _n_kwcontinue
= new_child
4563 if _n_expr
== old_child
then
4564 if new_child
!= null then
4565 new_child
.parent
= self
4566 assert new_child
isa PExpr
4575 redef fun visit_all
(v
: Visitor)
4577 v
.visit
(_n_kwcontinue
)
4578 if _n_expr
!= null then
4579 v
.visit
(_n_expr
.as(not null))
4583 redef fun visit_all_reverse
(v
: Visitor)
4585 v
.visit
(_n_kwcontinue
)
4586 if _n_expr
!= null then
4587 v
.visit
(_n_expr
.as(not null))
4592 redef fun n_kwdo
=(n
)
4597 redef fun n_block
=(n
)
4605 private init empty_init
do end
4608 n_kwdo
: nullable TKwdo ,
4609 n_block
: nullable PExpr
4613 _n_kwdo
= n_kwdo
.as(not null)
4614 n_kwdo
.parent
= self
4616 if n_block
!= null then
4617 n_block
.parent
= self
4621 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4623 if _n_kwdo
== old_child
then
4624 if new_child
!= null then
4625 new_child
.parent
= self
4626 assert new_child
isa TKwdo
4633 if _n_block
== old_child
then
4634 if new_child
!= null then
4635 new_child
.parent
= self
4636 assert new_child
isa PExpr
4637 _n_block
= new_child
4645 redef fun visit_all
(v
: Visitor)
4648 if _n_block
!= null then
4649 v
.visit
(_n_block
.as(not null))
4653 redef fun visit_all_reverse
(v
: Visitor)
4656 if _n_block
!= null then
4657 v
.visit
(_n_block
.as(not null))
4662 redef fun n_kwif
=(n
)
4667 redef fun n_expr
=(n
)
4672 redef fun n_then
=(n
)
4679 redef fun n_else
=(n
)
4687 private init empty_init
do end
4690 n_kwif
: nullable TKwif ,
4691 n_expr
: nullable PExpr ,
4692 n_then
: nullable PExpr ,
4693 n_else
: nullable PExpr
4697 _n_kwif
= n_kwif
.as(not null)
4698 n_kwif
.parent
= self
4699 _n_expr
= n_expr
.as(not null)
4700 n_expr
.parent
= self
4702 if n_then
!= null then
4703 n_then
.parent
= self
4706 if n_else
!= null then
4707 n_else
.parent
= self
4711 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4713 if _n_kwif
== old_child
then
4714 if new_child
!= null then
4715 new_child
.parent
= self
4716 assert new_child
isa TKwif
4723 if _n_expr
== old_child
then
4724 if new_child
!= null then
4725 new_child
.parent
= self
4726 assert new_child
isa PExpr
4733 if _n_then
== old_child
then
4734 if new_child
!= null then
4735 new_child
.parent
= self
4736 assert new_child
isa PExpr
4743 if _n_else
== old_child
then
4744 if new_child
!= null then
4745 new_child
.parent
= self
4746 assert new_child
isa PExpr
4755 redef fun visit_all
(v
: Visitor)
4759 if _n_then
!= null then
4760 v
.visit
(_n_then
.as(not null))
4762 if _n_else
!= null then
4763 v
.visit
(_n_else
.as(not null))
4767 redef fun visit_all_reverse
(v
: Visitor)
4771 if _n_then
!= null then
4772 v
.visit
(_n_then
.as(not null))
4774 if _n_else
!= null then
4775 v
.visit
(_n_else
.as(not null))
4779 redef class AIfexprExpr
4780 redef fun n_kwif
=(n
)
4785 redef fun n_expr
=(n
)
4790 redef fun n_kwthen
=(n
)
4795 redef fun n_then
=(n
)
4800 redef fun n_kwelse
=(n
)
4805 redef fun n_else
=(n
)
4811 private init empty_init
do end
4813 init init_aifexprexpr
(
4814 n_kwif
: nullable TKwif ,
4815 n_expr
: nullable PExpr ,
4816 n_kwthen
: nullable TKwthen ,
4817 n_then
: nullable PExpr ,
4818 n_kwelse
: nullable TKwelse ,
4819 n_else
: nullable PExpr
4823 _n_kwif
= n_kwif
.as(not null)
4824 n_kwif
.parent
= self
4825 _n_expr
= n_expr
.as(not null)
4826 n_expr
.parent
= self
4827 _n_kwthen
= n_kwthen
.as(not null)
4828 n_kwthen
.parent
= self
4829 _n_then
= n_then
.as(not null)
4830 n_then
.parent
= self
4831 _n_kwelse
= n_kwelse
.as(not null)
4832 n_kwelse
.parent
= self
4833 _n_else
= n_else
.as(not null)
4834 n_else
.parent
= self
4837 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4839 if _n_kwif
== old_child
then
4840 if new_child
!= null then
4841 new_child
.parent
= self
4842 assert new_child
isa TKwif
4849 if _n_expr
== old_child
then
4850 if new_child
!= null then
4851 new_child
.parent
= self
4852 assert new_child
isa PExpr
4859 if _n_kwthen
== old_child
then
4860 if new_child
!= null then
4861 new_child
.parent
= self
4862 assert new_child
isa TKwthen
4863 _n_kwthen
= new_child
4869 if _n_then
== old_child
then
4870 if new_child
!= null then
4871 new_child
.parent
= self
4872 assert new_child
isa PExpr
4879 if _n_kwelse
== old_child
then
4880 if new_child
!= null then
4881 new_child
.parent
= self
4882 assert new_child
isa TKwelse
4883 _n_kwelse
= new_child
4889 if _n_else
== old_child
then
4890 if new_child
!= null then
4891 new_child
.parent
= self
4892 assert new_child
isa PExpr
4901 redef fun visit_all
(v
: Visitor)
4911 redef fun visit_all_reverse
(v
: Visitor)
4921 redef class AWhileExpr
4922 redef fun n_kwwhile
=(n
)
4927 redef fun n_expr
=(n
)
4932 redef fun n_kwdo
=(n
)
4937 redef fun n_block
=(n
)
4945 private init empty_init
do end
4947 init init_awhileexpr
(
4948 n_kwwhile
: nullable TKwwhile ,
4949 n_expr
: nullable PExpr ,
4950 n_kwdo
: nullable TKwdo ,
4951 n_block
: nullable PExpr
4955 _n_kwwhile
= n_kwwhile
.as(not null)
4956 n_kwwhile
.parent
= self
4957 _n_expr
= n_expr
.as(not null)
4958 n_expr
.parent
= self
4959 _n_kwdo
= n_kwdo
.as(not null)
4960 n_kwdo
.parent
= self
4962 if n_block
!= null then
4963 n_block
.parent
= self
4967 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
4969 if _n_kwwhile
== old_child
then
4970 if new_child
!= null then
4971 new_child
.parent
= self
4972 assert new_child
isa TKwwhile
4973 _n_kwwhile
= new_child
4979 if _n_expr
== old_child
then
4980 if new_child
!= null then
4981 new_child
.parent
= self
4982 assert new_child
isa PExpr
4989 if _n_kwdo
== old_child
then
4990 if new_child
!= null then
4991 new_child
.parent
= self
4992 assert new_child
isa TKwdo
4999 if _n_block
== old_child
then
5000 if new_child
!= null then
5001 new_child
.parent
= self
5002 assert new_child
isa PExpr
5003 _n_block
= new_child
5011 redef fun visit_all
(v
: Visitor)
5016 if _n_block
!= null then
5017 v
.visit
(_n_block
.as(not null))
5021 redef fun visit_all_reverse
(v
: Visitor)
5026 if _n_block
!= null then
5027 v
.visit
(_n_block
.as(not null))
5031 redef class AForExpr
5032 redef fun n_kwfor
=(n
)
5042 redef fun n_expr
=(n
)
5047 redef fun n_kwdo
=(n
)
5052 redef fun n_block
=(n
)
5060 private init empty_init
do end
5062 init init_aforexpr
(
5063 n_kwfor
: nullable TKwfor ,
5064 n_id
: nullable TId ,
5065 n_expr
: nullable PExpr ,
5066 n_kwdo
: nullable TKwdo ,
5067 n_block
: nullable PExpr
5071 _n_kwfor
= n_kwfor
.as(not null)
5072 n_kwfor
.parent
= self
5073 _n_id
= n_id
.as(not null)
5075 _n_expr
= n_expr
.as(not null)
5076 n_expr
.parent
= self
5077 _n_kwdo
= n_kwdo
.as(not null)
5078 n_kwdo
.parent
= self
5080 if n_block
!= null then
5081 n_block
.parent
= self
5085 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5087 if _n_kwfor
== old_child
then
5088 if new_child
!= null then
5089 new_child
.parent
= self
5090 assert new_child
isa TKwfor
5091 _n_kwfor
= new_child
5097 if _n_id
== old_child
then
5098 if new_child
!= null then
5099 new_child
.parent
= self
5100 assert new_child
isa TId
5107 if _n_expr
== old_child
then
5108 if new_child
!= null then
5109 new_child
.parent
= self
5110 assert new_child
isa PExpr
5117 if _n_kwdo
== old_child
then
5118 if new_child
!= null then
5119 new_child
.parent
= self
5120 assert new_child
isa TKwdo
5127 if _n_block
== old_child
then
5128 if new_child
!= null then
5129 new_child
.parent
= self
5130 assert new_child
isa PExpr
5131 _n_block
= new_child
5139 redef fun visit_all
(v
: Visitor)
5145 if _n_block
!= null then
5146 v
.visit
(_n_block
.as(not null))
5150 redef fun visit_all_reverse
(v
: Visitor)
5156 if _n_block
!= null then
5157 v
.visit
(_n_block
.as(not null))
5161 redef class AAssertExpr
5162 redef fun n_kwassert
=(n
)
5174 redef fun n_expr
=(n
)
5180 private init empty_init
do end
5182 init init_aassertexpr
(
5183 n_kwassert
: nullable TKwassert ,
5184 n_id
: nullable TId ,
5185 n_expr
: nullable PExpr
5189 _n_kwassert
= n_kwassert
.as(not null)
5190 n_kwassert
.parent
= self
5192 if n_id
!= null then
5195 _n_expr
= n_expr
.as(not null)
5196 n_expr
.parent
= self
5199 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5201 if _n_kwassert
== old_child
then
5202 if new_child
!= null then
5203 new_child
.parent
= self
5204 assert new_child
isa TKwassert
5205 _n_kwassert
= new_child
5211 if _n_id
== old_child
then
5212 if new_child
!= null then
5213 new_child
.parent
= self
5214 assert new_child
isa TId
5221 if _n_expr
== old_child
then
5222 if new_child
!= null then
5223 new_child
.parent
= self
5224 assert new_child
isa PExpr
5233 redef fun visit_all
(v
: Visitor)
5235 v
.visit
(_n_kwassert
)
5236 if _n_id
!= null then
5237 v
.visit
(_n_id
.as(not null))
5242 redef fun visit_all_reverse
(v
: Visitor)
5244 v
.visit
(_n_kwassert
)
5245 if _n_id
!= null then
5246 v
.visit
(_n_id
.as(not null))
5251 redef class AOnceExpr
5252 redef fun n_kwonce
=(n
)
5257 redef fun n_expr
=(n
)
5263 private init empty_init
do end
5265 init init_aonceexpr
(
5266 n_kwonce
: nullable TKwonce ,
5267 n_expr
: nullable PExpr
5271 _n_kwonce
= n_kwonce
.as(not null)
5272 n_kwonce
.parent
= self
5273 _n_expr
= n_expr
.as(not null)
5274 n_expr
.parent
= self
5277 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5279 if _n_kwonce
== old_child
then
5280 if new_child
!= null then
5281 new_child
.parent
= self
5282 assert new_child
isa TKwonce
5283 _n_kwonce
= new_child
5289 if _n_expr
== old_child
then
5290 if new_child
!= null then
5291 new_child
.parent
= self
5292 assert new_child
isa PExpr
5301 redef fun visit_all
(v
: Visitor)
5307 redef fun visit_all_reverse
(v
: Visitor)
5313 redef class ASendExpr
5314 redef fun n_expr
=(n
)
5320 private init empty_init
do end
5322 init init_asendexpr
(
5323 n_expr
: nullable PExpr
5327 _n_expr
= n_expr
.as(not null)
5328 n_expr
.parent
= self
5331 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5333 if _n_expr
== old_child
then
5334 if new_child
!= null then
5335 new_child
.parent
= self
5336 assert new_child
isa PExpr
5345 redef fun visit_all
(v
: Visitor)
5350 redef fun visit_all_reverse
(v
: Visitor)
5355 redef class ABinopExpr
5356 redef fun n_expr
=(n
)
5361 redef fun n_expr2
=(n
)
5367 private init empty_init
do end
5369 init init_abinopexpr
(
5370 n_expr
: nullable PExpr ,
5371 n_expr2
: nullable PExpr
5375 _n_expr
= n_expr
.as(not null)
5376 n_expr
.parent
= self
5377 _n_expr2
= n_expr2
.as(not null)
5378 n_expr2
.parent
= self
5381 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5383 if _n_expr
== old_child
then
5384 if new_child
!= null then
5385 new_child
.parent
= self
5386 assert new_child
isa PExpr
5393 if _n_expr2
== old_child
then
5394 if new_child
!= null then
5395 new_child
.parent
= self
5396 assert new_child
isa PExpr
5397 _n_expr2
= new_child
5405 redef fun visit_all
(v
: Visitor)
5411 redef fun visit_all_reverse
(v
: Visitor)
5418 redef fun n_expr
=(n
)
5423 redef fun n_expr2
=(n
)
5429 private init empty_init
do end
5432 n_expr
: nullable PExpr ,
5433 n_expr2
: nullable PExpr
5437 _n_expr
= n_expr
.as(not null)
5438 n_expr
.parent
= self
5439 _n_expr2
= n_expr2
.as(not null)
5440 n_expr2
.parent
= self
5443 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5445 if _n_expr
== old_child
then
5446 if new_child
!= null then
5447 new_child
.parent
= self
5448 assert new_child
isa PExpr
5455 if _n_expr2
== old_child
then
5456 if new_child
!= null then
5457 new_child
.parent
= self
5458 assert new_child
isa PExpr
5459 _n_expr2
= new_child
5467 redef fun visit_all
(v
: Visitor)
5473 redef fun visit_all_reverse
(v
: Visitor)
5479 redef class AAndExpr
5480 redef fun n_expr
=(n
)
5485 redef fun n_expr2
=(n
)
5491 private init empty_init
do end
5493 init init_aandexpr
(
5494 n_expr
: nullable PExpr ,
5495 n_expr2
: nullable PExpr
5499 _n_expr
= n_expr
.as(not null)
5500 n_expr
.parent
= self
5501 _n_expr2
= n_expr2
.as(not null)
5502 n_expr2
.parent
= self
5505 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5507 if _n_expr
== old_child
then
5508 if new_child
!= null then
5509 new_child
.parent
= self
5510 assert new_child
isa PExpr
5517 if _n_expr2
== old_child
then
5518 if new_child
!= null then
5519 new_child
.parent
= self
5520 assert new_child
isa PExpr
5521 _n_expr2
= new_child
5529 redef fun visit_all
(v
: Visitor)
5535 redef fun visit_all_reverse
(v
: Visitor)
5541 redef class ANotExpr
5542 redef fun n_kwnot
=(n
)
5547 redef fun n_expr
=(n
)
5553 private init empty_init
do end
5555 init init_anotexpr
(
5556 n_kwnot
: nullable TKwnot ,
5557 n_expr
: nullable PExpr
5561 _n_kwnot
= n_kwnot
.as(not null)
5562 n_kwnot
.parent
= self
5563 _n_expr
= n_expr
.as(not null)
5564 n_expr
.parent
= self
5567 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5569 if _n_kwnot
== old_child
then
5570 if new_child
!= null then
5571 new_child
.parent
= self
5572 assert new_child
isa TKwnot
5573 _n_kwnot
= new_child
5579 if _n_expr
== old_child
then
5580 if new_child
!= null then
5581 new_child
.parent
= self
5582 assert new_child
isa PExpr
5591 redef fun visit_all
(v
: Visitor)
5597 redef fun visit_all_reverse
(v
: Visitor)
5604 redef fun n_expr
=(n
)
5609 redef fun n_expr2
=(n
)
5615 private init empty_init
do end
5618 n_expr
: nullable PExpr ,
5619 n_expr2
: nullable PExpr
5623 _n_expr
= n_expr
.as(not null)
5624 n_expr
.parent
= self
5625 _n_expr2
= n_expr2
.as(not null)
5626 n_expr2
.parent
= self
5629 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5631 if _n_expr
== old_child
then
5632 if new_child
!= null then
5633 new_child
.parent
= self
5634 assert new_child
isa PExpr
5641 if _n_expr2
== old_child
then
5642 if new_child
!= null then
5643 new_child
.parent
= self
5644 assert new_child
isa PExpr
5645 _n_expr2
= new_child
5653 redef fun visit_all
(v
: Visitor)
5659 redef fun visit_all_reverse
(v
: Visitor)
5666 redef fun n_expr
=(n
)
5671 redef fun n_expr2
=(n
)
5677 private init empty_init
do end
5680 n_expr
: nullable PExpr ,
5681 n_expr2
: nullable PExpr
5685 _n_expr
= n_expr
.as(not null)
5686 n_expr
.parent
= self
5687 _n_expr2
= n_expr2
.as(not null)
5688 n_expr2
.parent
= self
5691 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5693 if _n_expr
== old_child
then
5694 if new_child
!= null then
5695 new_child
.parent
= self
5696 assert new_child
isa PExpr
5703 if _n_expr2
== old_child
then
5704 if new_child
!= null then
5705 new_child
.parent
= self
5706 assert new_child
isa PExpr
5707 _n_expr2
= new_child
5715 redef fun visit_all
(v
: Visitor)
5721 redef fun visit_all_reverse
(v
: Visitor)
5728 redef fun n_expr
=(n
)
5733 redef fun n_expr2
=(n
)
5739 private init empty_init
do end
5742 n_expr
: nullable PExpr ,
5743 n_expr2
: nullable PExpr
5747 _n_expr
= n_expr
.as(not null)
5748 n_expr
.parent
= self
5749 _n_expr2
= n_expr2
.as(not null)
5750 n_expr2
.parent
= self
5753 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5755 if _n_expr
== old_child
then
5756 if new_child
!= null then
5757 new_child
.parent
= self
5758 assert new_child
isa PExpr
5765 if _n_expr2
== old_child
then
5766 if new_child
!= null then
5767 new_child
.parent
= self
5768 assert new_child
isa PExpr
5769 _n_expr2
= new_child
5777 redef fun visit_all
(v
: Visitor)
5783 redef fun visit_all_reverse
(v
: Visitor)
5790 redef fun n_expr
=(n
)
5795 redef fun n_expr2
=(n
)
5801 private init empty_init
do end
5804 n_expr
: nullable PExpr ,
5805 n_expr2
: nullable PExpr
5809 _n_expr
= n_expr
.as(not null)
5810 n_expr
.parent
= self
5811 _n_expr2
= n_expr2
.as(not null)
5812 n_expr2
.parent
= self
5815 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5817 if _n_expr
== old_child
then
5818 if new_child
!= null then
5819 new_child
.parent
= self
5820 assert new_child
isa PExpr
5827 if _n_expr2
== old_child
then
5828 if new_child
!= null then
5829 new_child
.parent
= self
5830 assert new_child
isa PExpr
5831 _n_expr2
= new_child
5839 redef fun visit_all
(v
: Visitor)
5845 redef fun visit_all_reverse
(v
: Visitor)
5852 redef fun n_expr
=(n
)
5857 redef fun n_expr2
=(n
)
5863 private init empty_init
do end
5866 n_expr
: nullable PExpr ,
5867 n_expr2
: nullable PExpr
5871 _n_expr
= n_expr
.as(not null)
5872 n_expr
.parent
= self
5873 _n_expr2
= n_expr2
.as(not null)
5874 n_expr2
.parent
= self
5877 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5879 if _n_expr
== old_child
then
5880 if new_child
!= null then
5881 new_child
.parent
= self
5882 assert new_child
isa PExpr
5889 if _n_expr2
== old_child
then
5890 if new_child
!= null then
5891 new_child
.parent
= self
5892 assert new_child
isa PExpr
5893 _n_expr2
= new_child
5901 redef fun visit_all
(v
: Visitor)
5907 redef fun visit_all_reverse
(v
: Visitor)
5914 redef fun n_expr
=(n
)
5919 redef fun n_expr2
=(n
)
5925 private init empty_init
do end
5928 n_expr
: nullable PExpr ,
5929 n_expr2
: nullable PExpr
5933 _n_expr
= n_expr
.as(not null)
5934 n_expr
.parent
= self
5935 _n_expr2
= n_expr2
.as(not null)
5936 n_expr2
.parent
= self
5939 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
5941 if _n_expr
== old_child
then
5942 if new_child
!= null then
5943 new_child
.parent
= self
5944 assert new_child
isa PExpr
5951 if _n_expr2
== old_child
then
5952 if new_child
!= null then
5953 new_child
.parent
= self
5954 assert new_child
isa PExpr
5955 _n_expr2
= new_child
5963 redef fun visit_all
(v
: Visitor)
5969 redef fun visit_all_reverse
(v
: Visitor)
5976 redef fun n_expr
=(n
)
5981 redef fun n_expr2
=(n
)
5987 private init empty_init
do end
5990 n_expr
: nullable PExpr ,
5991 n_expr2
: nullable PExpr
5995 _n_expr
= n_expr
.as(not null)
5996 n_expr
.parent
= self
5997 _n_expr2
= n_expr2
.as(not null)
5998 n_expr2
.parent
= self
6001 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6003 if _n_expr
== old_child
then
6004 if new_child
!= null then
6005 new_child
.parent
= self
6006 assert new_child
isa PExpr
6013 if _n_expr2
== old_child
then
6014 if new_child
!= null then
6015 new_child
.parent
= self
6016 assert new_child
isa PExpr
6017 _n_expr2
= new_child
6025 redef fun visit_all
(v
: Visitor)
6031 redef fun visit_all_reverse
(v
: Visitor)
6037 redef class AIsaExpr
6038 redef fun n_expr
=(n
)
6043 redef fun n_type
=(n
)
6049 private init empty_init
do end
6051 init init_aisaexpr
(
6052 n_expr
: nullable PExpr ,
6053 n_type
: nullable PType
6057 _n_expr
= n_expr
.as(not null)
6058 n_expr
.parent
= self
6059 _n_type
= n_type
.as(not null)
6060 n_type
.parent
= self
6063 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6065 if _n_expr
== old_child
then
6066 if new_child
!= null then
6067 new_child
.parent
= self
6068 assert new_child
isa PExpr
6075 if _n_type
== old_child
then
6076 if new_child
!= null then
6077 new_child
.parent
= self
6078 assert new_child
isa PType
6087 redef fun visit_all
(v
: Visitor)
6093 redef fun visit_all_reverse
(v
: Visitor)
6099 redef class APlusExpr
6100 redef fun n_expr
=(n
)
6105 redef fun n_expr2
=(n
)
6111 private init empty_init
do end
6113 init init_aplusexpr
(
6114 n_expr
: nullable PExpr ,
6115 n_expr2
: nullable PExpr
6119 _n_expr
= n_expr
.as(not null)
6120 n_expr
.parent
= self
6121 _n_expr2
= n_expr2
.as(not null)
6122 n_expr2
.parent
= self
6125 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6127 if _n_expr
== old_child
then
6128 if new_child
!= null then
6129 new_child
.parent
= self
6130 assert new_child
isa PExpr
6137 if _n_expr2
== old_child
then
6138 if new_child
!= null then
6139 new_child
.parent
= self
6140 assert new_child
isa PExpr
6141 _n_expr2
= new_child
6149 redef fun visit_all
(v
: Visitor)
6155 redef fun visit_all_reverse
(v
: Visitor)
6161 redef class AMinusExpr
6162 redef fun n_expr
=(n
)
6167 redef fun n_expr2
=(n
)
6173 private init empty_init
do end
6175 init init_aminusexpr
(
6176 n_expr
: nullable PExpr ,
6177 n_expr2
: nullable PExpr
6181 _n_expr
= n_expr
.as(not null)
6182 n_expr
.parent
= self
6183 _n_expr2
= n_expr2
.as(not null)
6184 n_expr2
.parent
= self
6187 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6189 if _n_expr
== old_child
then
6190 if new_child
!= null then
6191 new_child
.parent
= self
6192 assert new_child
isa PExpr
6199 if _n_expr2
== old_child
then
6200 if new_child
!= null then
6201 new_child
.parent
= self
6202 assert new_child
isa PExpr
6203 _n_expr2
= new_child
6211 redef fun visit_all
(v
: Visitor)
6217 redef fun visit_all_reverse
(v
: Visitor)
6223 redef class AStarshipExpr
6224 redef fun n_expr
=(n
)
6229 redef fun n_expr2
=(n
)
6235 private init empty_init
do end
6237 init init_astarshipexpr
(
6238 n_expr
: nullable PExpr ,
6239 n_expr2
: nullable PExpr
6243 _n_expr
= n_expr
.as(not null)
6244 n_expr
.parent
= self
6245 _n_expr2
= n_expr2
.as(not null)
6246 n_expr2
.parent
= self
6249 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6251 if _n_expr
== old_child
then
6252 if new_child
!= null then
6253 new_child
.parent
= self
6254 assert new_child
isa PExpr
6261 if _n_expr2
== old_child
then
6262 if new_child
!= null then
6263 new_child
.parent
= self
6264 assert new_child
isa PExpr
6265 _n_expr2
= new_child
6273 redef fun visit_all
(v
: Visitor)
6279 redef fun visit_all_reverse
(v
: Visitor)
6285 redef class AStarExpr
6286 redef fun n_expr
=(n
)
6291 redef fun n_expr2
=(n
)
6297 private init empty_init
do end
6299 init init_astarexpr
(
6300 n_expr
: nullable PExpr ,
6301 n_expr2
: nullable PExpr
6305 _n_expr
= n_expr
.as(not null)
6306 n_expr
.parent
= self
6307 _n_expr2
= n_expr2
.as(not null)
6308 n_expr2
.parent
= self
6311 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6313 if _n_expr
== old_child
then
6314 if new_child
!= null then
6315 new_child
.parent
= self
6316 assert new_child
isa PExpr
6323 if _n_expr2
== old_child
then
6324 if new_child
!= null then
6325 new_child
.parent
= self
6326 assert new_child
isa PExpr
6327 _n_expr2
= new_child
6335 redef fun visit_all
(v
: Visitor)
6341 redef fun visit_all_reverse
(v
: Visitor)
6347 redef class ASlashExpr
6348 redef fun n_expr
=(n
)
6353 redef fun n_expr2
=(n
)
6359 private init empty_init
do end
6361 init init_aslashexpr
(
6362 n_expr
: nullable PExpr ,
6363 n_expr2
: nullable PExpr
6367 _n_expr
= n_expr
.as(not null)
6368 n_expr
.parent
= self
6369 _n_expr2
= n_expr2
.as(not null)
6370 n_expr2
.parent
= self
6373 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6375 if _n_expr
== old_child
then
6376 if new_child
!= null then
6377 new_child
.parent
= self
6378 assert new_child
isa PExpr
6385 if _n_expr2
== old_child
then
6386 if new_child
!= null then
6387 new_child
.parent
= self
6388 assert new_child
isa PExpr
6389 _n_expr2
= new_child
6397 redef fun visit_all
(v
: Visitor)
6403 redef fun visit_all_reverse
(v
: Visitor)
6409 redef class APercentExpr
6410 redef fun n_expr
=(n
)
6415 redef fun n_expr2
=(n
)
6421 private init empty_init
do end
6423 init init_apercentexpr
(
6424 n_expr
: nullable PExpr ,
6425 n_expr2
: nullable PExpr
6429 _n_expr
= n_expr
.as(not null)
6430 n_expr
.parent
= self
6431 _n_expr2
= n_expr2
.as(not null)
6432 n_expr2
.parent
= self
6435 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6437 if _n_expr
== old_child
then
6438 if new_child
!= null then
6439 new_child
.parent
= self
6440 assert new_child
isa PExpr
6447 if _n_expr2
== old_child
then
6448 if new_child
!= null then
6449 new_child
.parent
= self
6450 assert new_child
isa PExpr
6451 _n_expr2
= new_child
6459 redef fun visit_all
(v
: Visitor)
6465 redef fun visit_all_reverse
(v
: Visitor)
6471 redef class AUminusExpr
6472 redef fun n_minus
=(n
)
6477 redef fun n_expr
=(n
)
6483 private init empty_init
do end
6485 init init_auminusexpr
(
6486 n_minus
: nullable TMinus ,
6487 n_expr
: nullable PExpr
6491 _n_minus
= n_minus
.as(not null)
6492 n_minus
.parent
= self
6493 _n_expr
= n_expr
.as(not null)
6494 n_expr
.parent
= self
6497 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6499 if _n_minus
== old_child
then
6500 if new_child
!= null then
6501 new_child
.parent
= self
6502 assert new_child
isa TMinus
6503 _n_minus
= new_child
6509 if _n_expr
== old_child
then
6510 if new_child
!= null then
6511 new_child
.parent
= self
6512 assert new_child
isa PExpr
6521 redef fun visit_all
(v
: Visitor)
6527 redef fun visit_all_reverse
(v
: Visitor)
6533 redef class ANewExpr
6534 redef fun n_kwnew
=(n
)
6539 redef fun n_type
=(n
)
6552 private init empty_init
do end
6554 init init_anewexpr
(
6555 n_kwnew
: nullable TKwnew ,
6556 n_type
: nullable PType ,
6557 n_id
: nullable TId ,
6558 n_args
: Collection[Object] # Should be Collection[PExpr]
6562 _n_kwnew
= n_kwnew
.as(not null)
6563 n_kwnew
.parent
= self
6564 _n_type
= n_type
.as(not null)
6565 n_type
.parent
= self
6567 if n_id
!= null then
6577 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6579 if _n_kwnew
== old_child
then
6580 if new_child
!= null then
6581 new_child
.parent
= self
6582 assert new_child
isa TKwnew
6583 _n_kwnew
= new_child
6589 if _n_type
== old_child
then
6590 if new_child
!= null then
6591 new_child
.parent
= self
6592 assert new_child
isa PType
6599 if _n_id
== old_child
then
6600 if new_child
!= null then
6601 new_child
.parent
= self
6602 assert new_child
isa TId
6609 for i
in [0.._n_args
.length
[ do
6610 if _n_args
[i
] == old_child
then
6611 if new_child
!= null then
6612 assert new_child
isa PExpr
6613 _n_args
[i
] = new_child
6614 new_child
.parent
= self
6616 _n_args
.remove_at
(i
)
6623 redef fun visit_all
(v
: Visitor)
6627 if _n_id
!= null then
6628 v
.visit
(_n_id
.as(not null))
6635 redef fun visit_all_reverse
(v
: Visitor)
6639 if _n_id
!= null then
6640 v
.visit
(_n_id
.as(not null))
6643 var i
= _n_args
.length
6651 redef class AAttrExpr
6652 redef fun n_expr
=(n
)
6663 private init empty_init
do end
6665 init init_aattrexpr
(
6666 n_expr
: nullable PExpr ,
6667 n_id
: nullable TAttrid
6671 _n_expr
= n_expr
.as(not null)
6672 n_expr
.parent
= self
6673 _n_id
= n_id
.as(not null)
6677 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6679 if _n_expr
== old_child
then
6680 if new_child
!= null then
6681 new_child
.parent
= self
6682 assert new_child
isa PExpr
6689 if _n_id
== old_child
then
6690 if new_child
!= null then
6691 new_child
.parent
= self
6692 assert new_child
isa TAttrid
6701 redef fun visit_all
(v
: Visitor)
6707 redef fun visit_all_reverse
(v
: Visitor)
6713 redef class AAttrAssignExpr
6714 redef fun n_expr
=(n
)
6724 redef fun n_assign
=(n
)
6729 redef fun n_value
=(n
)
6735 private init empty_init
do end
6737 init init_aattrassignexpr
(
6738 n_expr
: nullable PExpr ,
6739 n_id
: nullable TAttrid ,
6740 n_assign
: nullable TAssign ,
6741 n_value
: nullable PExpr
6745 _n_expr
= n_expr
.as(not null)
6746 n_expr
.parent
= self
6747 _n_id
= n_id
.as(not null)
6749 _n_assign
= n_assign
.as(not null)
6750 n_assign
.parent
= self
6751 _n_value
= n_value
.as(not null)
6752 n_value
.parent
= self
6755 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6757 if _n_expr
== old_child
then
6758 if new_child
!= null then
6759 new_child
.parent
= self
6760 assert new_child
isa PExpr
6767 if _n_id
== old_child
then
6768 if new_child
!= null then
6769 new_child
.parent
= self
6770 assert new_child
isa TAttrid
6777 if _n_assign
== old_child
then
6778 if new_child
!= null then
6779 new_child
.parent
= self
6780 assert new_child
isa TAssign
6781 _n_assign
= new_child
6787 if _n_value
== old_child
then
6788 if new_child
!= null then
6789 new_child
.parent
= self
6790 assert new_child
isa PExpr
6791 _n_value
= new_child
6799 redef fun visit_all
(v
: Visitor)
6807 redef fun visit_all_reverse
(v
: Visitor)
6815 redef class AAttrReassignExpr
6816 redef fun n_expr
=(n
)
6826 redef fun n_assign_op
=(n
)
6831 redef fun n_value
=(n
)
6837 private init empty_init
do end
6839 init init_aattrreassignexpr
(
6840 n_expr
: nullable PExpr ,
6841 n_id
: nullable TAttrid ,
6842 n_assign_op
: nullable PAssignOp ,
6843 n_value
: nullable PExpr
6847 _n_expr
= n_expr
.as(not null)
6848 n_expr
.parent
= self
6849 _n_id
= n_id
.as(not null)
6851 _n_assign_op
= n_assign_op
.as(not null)
6852 n_assign_op
.parent
= self
6853 _n_value
= n_value
.as(not null)
6854 n_value
.parent
= self
6857 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6859 if _n_expr
== old_child
then
6860 if new_child
!= null then
6861 new_child
.parent
= self
6862 assert new_child
isa PExpr
6869 if _n_id
== old_child
then
6870 if new_child
!= null then
6871 new_child
.parent
= self
6872 assert new_child
isa TAttrid
6879 if _n_assign_op
== old_child
then
6880 if new_child
!= null then
6881 new_child
.parent
= self
6882 assert new_child
isa PAssignOp
6883 _n_assign_op
= new_child
6889 if _n_value
== old_child
then
6890 if new_child
!= null then
6891 new_child
.parent
= self
6892 assert new_child
isa PExpr
6893 _n_value
= new_child
6901 redef fun visit_all
(v
: Visitor)
6905 v
.visit
(_n_assign_op
)
6909 redef fun visit_all_reverse
(v
: Visitor)
6913 v
.visit
(_n_assign_op
)
6917 redef class ACallExpr
6918 redef fun n_expr
=(n
)
6929 private init empty_init
do end
6931 init init_acallexpr
(
6932 n_expr
: nullable PExpr ,
6933 n_id
: nullable TId ,
6934 n_args
: Collection[Object] , # Should be Collection[PExpr]
6935 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
6939 _n_expr
= n_expr
.as(not null)
6940 n_expr
.parent
= self
6941 _n_id
= n_id
.as(not null)
6948 for n
in n_closure_defs
do
6949 assert n
isa PClosureDef
6950 _n_closure_defs
.add
(n
)
6955 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
6957 if _n_expr
== old_child
then
6958 if new_child
!= null then
6959 new_child
.parent
= self
6960 assert new_child
isa PExpr
6967 if _n_id
== old_child
then
6968 if new_child
!= null then
6969 new_child
.parent
= self
6970 assert new_child
isa TId
6977 for i
in [0.._n_args
.length
[ do
6978 if _n_args
[i
] == old_child
then
6979 if new_child
!= null then
6980 assert new_child
isa PExpr
6981 _n_args
[i
] = new_child
6982 new_child
.parent
= self
6984 _n_args
.remove_at
(i
)
6989 for i
in [0.._n_closure_defs
.length
[ do
6990 if _n_closure_defs
[i
] == old_child
then
6991 if new_child
!= null then
6992 assert new_child
isa PClosureDef
6993 _n_closure_defs
[i
] = new_child
6994 new_child
.parent
= self
6996 _n_closure_defs
.remove_at
(i
)
7003 redef fun visit_all
(v
: Visitor)
7010 for n
in _n_closure_defs
do
7015 redef fun visit_all_reverse
(v
: Visitor)
7020 var i
= _n_args
.length
7027 var i
= _n_closure_defs
.length
7029 v
.visit
(_n_closure_defs
[i
])
7035 redef class ACallAssignExpr
7036 redef fun n_expr
=(n
)
7046 redef fun n_assign
=(n
)
7051 redef fun n_value
=(n
)
7057 private init empty_init
do end
7059 init init_acallassignexpr
(
7060 n_expr
: nullable PExpr ,
7061 n_id
: nullable TId ,
7062 n_args
: Collection[Object] , # Should be Collection[PExpr]
7063 n_assign
: nullable TAssign ,
7064 n_value
: nullable PExpr
7068 _n_expr
= n_expr
.as(not null)
7069 n_expr
.parent
= self
7070 _n_id
= n_id
.as(not null)
7077 _n_assign
= n_assign
.as(not null)
7078 n_assign
.parent
= self
7079 _n_value
= n_value
.as(not null)
7080 n_value
.parent
= self
7083 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7085 if _n_expr
== old_child
then
7086 if new_child
!= null then
7087 new_child
.parent
= self
7088 assert new_child
isa PExpr
7095 if _n_id
== old_child
then
7096 if new_child
!= null then
7097 new_child
.parent
= self
7098 assert new_child
isa TId
7105 for i
in [0.._n_args
.length
[ do
7106 if _n_args
[i
] == old_child
then
7107 if new_child
!= null then
7108 assert new_child
isa PExpr
7109 _n_args
[i
] = new_child
7110 new_child
.parent
= self
7112 _n_args
.remove_at
(i
)
7117 if _n_assign
== old_child
then
7118 if new_child
!= null then
7119 new_child
.parent
= self
7120 assert new_child
isa TAssign
7121 _n_assign
= new_child
7127 if _n_value
== old_child
then
7128 if new_child
!= null then
7129 new_child
.parent
= self
7130 assert new_child
isa PExpr
7131 _n_value
= new_child
7139 redef fun visit_all
(v
: Visitor)
7150 redef fun visit_all_reverse
(v
: Visitor)
7155 var i
= _n_args
.length
7165 redef class ACallReassignExpr
7166 redef fun n_expr
=(n
)
7176 redef fun n_assign_op
=(n
)
7181 redef fun n_value
=(n
)
7187 private init empty_init
do end
7189 init init_acallreassignexpr
(
7190 n_expr
: nullable PExpr ,
7191 n_id
: nullable TId ,
7192 n_args
: Collection[Object] , # Should be Collection[PExpr]
7193 n_assign_op
: nullable PAssignOp ,
7194 n_value
: nullable PExpr
7198 _n_expr
= n_expr
.as(not null)
7199 n_expr
.parent
= self
7200 _n_id
= n_id
.as(not null)
7207 _n_assign_op
= n_assign_op
.as(not null)
7208 n_assign_op
.parent
= self
7209 _n_value
= n_value
.as(not null)
7210 n_value
.parent
= self
7213 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7215 if _n_expr
== old_child
then
7216 if new_child
!= null then
7217 new_child
.parent
= self
7218 assert new_child
isa PExpr
7225 if _n_id
== old_child
then
7226 if new_child
!= null then
7227 new_child
.parent
= self
7228 assert new_child
isa TId
7235 for i
in [0.._n_args
.length
[ do
7236 if _n_args
[i
] == old_child
then
7237 if new_child
!= null then
7238 assert new_child
isa PExpr
7239 _n_args
[i
] = new_child
7240 new_child
.parent
= self
7242 _n_args
.remove_at
(i
)
7247 if _n_assign_op
== old_child
then
7248 if new_child
!= null then
7249 new_child
.parent
= self
7250 assert new_child
isa PAssignOp
7251 _n_assign_op
= new_child
7257 if _n_value
== old_child
then
7258 if new_child
!= null then
7259 new_child
.parent
= self
7260 assert new_child
isa PExpr
7261 _n_value
= new_child
7269 redef fun visit_all
(v
: Visitor)
7276 v
.visit
(_n_assign_op
)
7280 redef fun visit_all_reverse
(v
: Visitor)
7285 var i
= _n_args
.length
7291 v
.visit
(_n_assign_op
)
7295 redef class ASuperExpr
7296 redef fun n_qualified
=(n
)
7303 redef fun n_kwsuper
=(n
)
7309 private init empty_init
do end
7311 init init_asuperexpr
(
7312 n_qualified
: nullable PQualified ,
7313 n_kwsuper
: nullable TKwsuper ,
7314 n_args
: Collection[Object] # Should be Collection[PExpr]
7318 _n_qualified
= n_qualified
7319 if n_qualified
!= null then
7320 n_qualified
.parent
= self
7322 _n_kwsuper
= n_kwsuper
.as(not null)
7323 n_kwsuper
.parent
= self
7331 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7333 if _n_qualified
== old_child
then
7334 if new_child
!= null then
7335 new_child
.parent
= self
7336 assert new_child
isa PQualified
7337 _n_qualified
= new_child
7343 if _n_kwsuper
== old_child
then
7344 if new_child
!= null then
7345 new_child
.parent
= self
7346 assert new_child
isa TKwsuper
7347 _n_kwsuper
= new_child
7353 for i
in [0.._n_args
.length
[ do
7354 if _n_args
[i
] == old_child
then
7355 if new_child
!= null then
7356 assert new_child
isa PExpr
7357 _n_args
[i
] = new_child
7358 new_child
.parent
= self
7360 _n_args
.remove_at
(i
)
7367 redef fun visit_all
(v
: Visitor)
7369 if _n_qualified
!= null then
7370 v
.visit
(_n_qualified
.as(not null))
7378 redef fun visit_all_reverse
(v
: Visitor)
7380 if _n_qualified
!= null then
7381 v
.visit
(_n_qualified
.as(not null))
7385 var i
= _n_args
.length
7393 redef class AInitExpr
7394 redef fun n_expr
=(n
)
7399 redef fun n_kwinit
=(n
)
7405 private init empty_init
do end
7407 init init_ainitexpr
(
7408 n_expr
: nullable PExpr ,
7409 n_kwinit
: nullable TKwinit ,
7410 n_args
: Collection[Object] # Should be Collection[PExpr]
7414 _n_expr
= n_expr
.as(not null)
7415 n_expr
.parent
= self
7416 _n_kwinit
= n_kwinit
.as(not null)
7417 n_kwinit
.parent
= self
7425 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7427 if _n_expr
== old_child
then
7428 if new_child
!= null then
7429 new_child
.parent
= self
7430 assert new_child
isa PExpr
7437 if _n_kwinit
== old_child
then
7438 if new_child
!= null then
7439 new_child
.parent
= self
7440 assert new_child
isa TKwinit
7441 _n_kwinit
= new_child
7447 for i
in [0.._n_args
.length
[ do
7448 if _n_args
[i
] == old_child
then
7449 if new_child
!= null then
7450 assert new_child
isa PExpr
7451 _n_args
[i
] = new_child
7452 new_child
.parent
= self
7454 _n_args
.remove_at
(i
)
7461 redef fun visit_all
(v
: Visitor)
7470 redef fun visit_all_reverse
(v
: Visitor)
7475 var i
= _n_args
.length
7483 redef class ABraExpr
7484 redef fun n_expr
=(n
)
7490 private init empty_init
do end
7492 init init_abraexpr
(
7493 n_expr
: nullable PExpr ,
7494 n_args
: Collection[Object] , # Should be Collection[PExpr]
7495 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
7499 _n_expr
= n_expr
.as(not null)
7500 n_expr
.parent
= self
7506 for n
in n_closure_defs
do
7507 assert n
isa PClosureDef
7508 _n_closure_defs
.add
(n
)
7513 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7515 if _n_expr
== old_child
then
7516 if new_child
!= null then
7517 new_child
.parent
= self
7518 assert new_child
isa PExpr
7525 for i
in [0.._n_args
.length
[ do
7526 if _n_args
[i
] == old_child
then
7527 if new_child
!= null then
7528 assert new_child
isa PExpr
7529 _n_args
[i
] = new_child
7530 new_child
.parent
= self
7532 _n_args
.remove_at
(i
)
7537 for i
in [0.._n_closure_defs
.length
[ do
7538 if _n_closure_defs
[i
] == old_child
then
7539 if new_child
!= null then
7540 assert new_child
isa PClosureDef
7541 _n_closure_defs
[i
] = new_child
7542 new_child
.parent
= self
7544 _n_closure_defs
.remove_at
(i
)
7551 redef fun visit_all
(v
: Visitor)
7557 for n
in _n_closure_defs
do
7562 redef fun visit_all_reverse
(v
: Visitor)
7566 var i
= _n_args
.length
7573 var i
= _n_closure_defs
.length
7575 v
.visit
(_n_closure_defs
[i
])
7581 redef class ABraAssignExpr
7582 redef fun n_expr
=(n
)
7587 redef fun n_assign
=(n
)
7592 redef fun n_value
=(n
)
7598 private init empty_init
do end
7600 init init_abraassignexpr
(
7601 n_expr
: nullable PExpr ,
7602 n_args
: Collection[Object] , # Should be Collection[PExpr]
7603 n_assign
: nullable TAssign ,
7604 n_value
: nullable PExpr
7608 _n_expr
= n_expr
.as(not null)
7609 n_expr
.parent
= self
7615 _n_assign
= n_assign
.as(not null)
7616 n_assign
.parent
= self
7617 _n_value
= n_value
.as(not null)
7618 n_value
.parent
= self
7621 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7623 if _n_expr
== old_child
then
7624 if new_child
!= null then
7625 new_child
.parent
= self
7626 assert new_child
isa PExpr
7633 for i
in [0.._n_args
.length
[ do
7634 if _n_args
[i
] == old_child
then
7635 if new_child
!= null then
7636 assert new_child
isa PExpr
7637 _n_args
[i
] = new_child
7638 new_child
.parent
= self
7640 _n_args
.remove_at
(i
)
7645 if _n_assign
== old_child
then
7646 if new_child
!= null then
7647 new_child
.parent
= self
7648 assert new_child
isa TAssign
7649 _n_assign
= new_child
7655 if _n_value
== old_child
then
7656 if new_child
!= null then
7657 new_child
.parent
= self
7658 assert new_child
isa PExpr
7659 _n_value
= new_child
7667 redef fun visit_all
(v
: Visitor)
7677 redef fun visit_all_reverse
(v
: Visitor)
7681 var i
= _n_args
.length
7691 redef class ABraReassignExpr
7692 redef fun n_expr
=(n
)
7697 redef fun n_assign_op
=(n
)
7702 redef fun n_value
=(n
)
7708 private init empty_init
do end
7710 init init_abrareassignexpr
(
7711 n_expr
: nullable PExpr ,
7712 n_args
: Collection[Object] , # Should be Collection[PExpr]
7713 n_assign_op
: nullable PAssignOp ,
7714 n_value
: nullable PExpr
7718 _n_expr
= n_expr
.as(not null)
7719 n_expr
.parent
= self
7725 _n_assign_op
= n_assign_op
.as(not null)
7726 n_assign_op
.parent
= self
7727 _n_value
= n_value
.as(not null)
7728 n_value
.parent
= self
7731 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7733 if _n_expr
== old_child
then
7734 if new_child
!= null then
7735 new_child
.parent
= self
7736 assert new_child
isa PExpr
7743 for i
in [0.._n_args
.length
[ do
7744 if _n_args
[i
] == old_child
then
7745 if new_child
!= null then
7746 assert new_child
isa PExpr
7747 _n_args
[i
] = new_child
7748 new_child
.parent
= self
7750 _n_args
.remove_at
(i
)
7755 if _n_assign_op
== old_child
then
7756 if new_child
!= null then
7757 new_child
.parent
= self
7758 assert new_child
isa PAssignOp
7759 _n_assign_op
= new_child
7765 if _n_value
== old_child
then
7766 if new_child
!= null then
7767 new_child
.parent
= self
7768 assert new_child
isa PExpr
7769 _n_value
= new_child
7777 redef fun visit_all
(v
: Visitor)
7783 v
.visit
(_n_assign_op
)
7787 redef fun visit_all_reverse
(v
: Visitor)
7791 var i
= _n_args
.length
7797 v
.visit
(_n_assign_op
)
7801 redef class AClosureCallExpr
7808 private init empty_init
do end
7810 init init_aclosurecallexpr
(
7811 n_id
: nullable TId ,
7812 n_args
: Collection[Object] , # Should be Collection[PExpr]
7813 n_closure_defs
: Collection[Object] # Should be Collection[PClosureDef]
7817 _n_id
= n_id
.as(not null)
7824 for n
in n_closure_defs
do
7825 assert n
isa PClosureDef
7826 _n_closure_defs
.add
(n
)
7831 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7833 if _n_id
== old_child
then
7834 if new_child
!= null then
7835 new_child
.parent
= self
7836 assert new_child
isa TId
7843 for i
in [0.._n_args
.length
[ do
7844 if _n_args
[i
] == old_child
then
7845 if new_child
!= null then
7846 assert new_child
isa PExpr
7847 _n_args
[i
] = new_child
7848 new_child
.parent
= self
7850 _n_args
.remove_at
(i
)
7855 for i
in [0.._n_closure_defs
.length
[ do
7856 if _n_closure_defs
[i
] == old_child
then
7857 if new_child
!= null then
7858 assert new_child
isa PClosureDef
7859 _n_closure_defs
[i
] = new_child
7860 new_child
.parent
= self
7862 _n_closure_defs
.remove_at
(i
)
7869 redef fun visit_all
(v
: Visitor)
7875 for n
in _n_closure_defs
do
7880 redef fun visit_all_reverse
(v
: Visitor)
7884 var i
= _n_args
.length
7891 var i
= _n_closure_defs
.length
7893 v
.visit
(_n_closure_defs
[i
])
7899 redef class AVarExpr
7906 private init empty_init
do end
7908 init init_avarexpr
(
7913 _n_id
= n_id
.as(not null)
7917 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7919 if _n_id
== old_child
then
7920 if new_child
!= null then
7921 new_child
.parent
= self
7922 assert new_child
isa TId
7931 redef fun visit_all
(v
: Visitor)
7936 redef fun visit_all_reverse
(v
: Visitor)
7941 redef class AVarAssignExpr
7947 redef fun n_assign
=(n
)
7952 redef fun n_value
=(n
)
7958 private init empty_init
do end
7960 init init_avarassignexpr
(
7961 n_id
: nullable TId ,
7962 n_assign
: nullable TAssign ,
7963 n_value
: nullable PExpr
7967 _n_id
= n_id
.as(not null)
7969 _n_assign
= n_assign
.as(not null)
7970 n_assign
.parent
= self
7971 _n_value
= n_value
.as(not null)
7972 n_value
.parent
= self
7975 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
7977 if _n_id
== old_child
then
7978 if new_child
!= null then
7979 new_child
.parent
= self
7980 assert new_child
isa TId
7987 if _n_assign
== old_child
then
7988 if new_child
!= null then
7989 new_child
.parent
= self
7990 assert new_child
isa TAssign
7991 _n_assign
= new_child
7997 if _n_value
== old_child
then
7998 if new_child
!= null then
7999 new_child
.parent
= self
8000 assert new_child
isa PExpr
8001 _n_value
= new_child
8009 redef fun visit_all
(v
: Visitor)
8016 redef fun visit_all_reverse
(v
: Visitor)
8023 redef class AVarReassignExpr
8029 redef fun n_assign_op
=(n
)
8034 redef fun n_value
=(n
)
8040 private init empty_init
do end
8042 init init_avarreassignexpr
(
8043 n_id
: nullable TId ,
8044 n_assign_op
: nullable PAssignOp ,
8045 n_value
: nullable PExpr
8049 _n_id
= n_id
.as(not null)
8051 _n_assign_op
= n_assign_op
.as(not null)
8052 n_assign_op
.parent
= self
8053 _n_value
= n_value
.as(not null)
8054 n_value
.parent
= self
8057 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8059 if _n_id
== old_child
then
8060 if new_child
!= null then
8061 new_child
.parent
= self
8062 assert new_child
isa TId
8069 if _n_assign_op
== old_child
then
8070 if new_child
!= null then
8071 new_child
.parent
= self
8072 assert new_child
isa PAssignOp
8073 _n_assign_op
= new_child
8079 if _n_value
== old_child
then
8080 if new_child
!= null then
8081 new_child
.parent
= self
8082 assert new_child
isa PExpr
8083 _n_value
= new_child
8091 redef fun visit_all
(v
: Visitor)
8094 v
.visit
(_n_assign_op
)
8098 redef fun visit_all_reverse
(v
: Visitor)
8101 v
.visit
(_n_assign_op
)
8105 redef class ARangeExpr
8106 redef fun n_expr
=(n
)
8111 redef fun n_expr2
=(n
)
8117 private init empty_init
do end
8119 init init_arangeexpr
(
8120 n_expr
: nullable PExpr ,
8121 n_expr2
: nullable PExpr
8125 _n_expr
= n_expr
.as(not null)
8126 n_expr
.parent
= self
8127 _n_expr2
= n_expr2
.as(not null)
8128 n_expr2
.parent
= self
8131 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8133 if _n_expr
== old_child
then
8134 if new_child
!= null then
8135 new_child
.parent
= self
8136 assert new_child
isa PExpr
8143 if _n_expr2
== old_child
then
8144 if new_child
!= null then
8145 new_child
.parent
= self
8146 assert new_child
isa PExpr
8147 _n_expr2
= new_child
8155 redef fun visit_all
(v
: Visitor)
8161 redef fun visit_all_reverse
(v
: Visitor)
8167 redef class ACrangeExpr
8168 redef fun n_expr
=(n
)
8173 redef fun n_expr2
=(n
)
8179 private init empty_init
do end
8181 init init_acrangeexpr
(
8182 n_expr
: nullable PExpr ,
8183 n_expr2
: nullable PExpr
8187 _n_expr
= n_expr
.as(not null)
8188 n_expr
.parent
= self
8189 _n_expr2
= n_expr2
.as(not null)
8190 n_expr2
.parent
= self
8193 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8195 if _n_expr
== old_child
then
8196 if new_child
!= null then
8197 new_child
.parent
= self
8198 assert new_child
isa PExpr
8205 if _n_expr2
== old_child
then
8206 if new_child
!= null then
8207 new_child
.parent
= self
8208 assert new_child
isa PExpr
8209 _n_expr2
= new_child
8217 redef fun visit_all
(v
: Visitor)
8223 redef fun visit_all_reverse
(v
: Visitor)
8229 redef class AOrangeExpr
8230 redef fun n_expr
=(n
)
8235 redef fun n_expr2
=(n
)
8241 private init empty_init
do end
8243 init init_aorangeexpr
(
8244 n_expr
: nullable PExpr ,
8245 n_expr2
: nullable PExpr
8249 _n_expr
= n_expr
.as(not null)
8250 n_expr
.parent
= self
8251 _n_expr2
= n_expr2
.as(not null)
8252 n_expr2
.parent
= self
8255 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8257 if _n_expr
== old_child
then
8258 if new_child
!= null then
8259 new_child
.parent
= self
8260 assert new_child
isa PExpr
8267 if _n_expr2
== old_child
then
8268 if new_child
!= null then
8269 new_child
.parent
= self
8270 assert new_child
isa PExpr
8271 _n_expr2
= new_child
8279 redef fun visit_all
(v
: Visitor)
8285 redef fun visit_all_reverse
(v
: Visitor)
8291 redef class AArrayExpr
8293 private init empty_init
do end
8295 init init_aarrayexpr
(
8296 n_exprs
: Collection[Object] # Should be Collection[PExpr]
8307 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8309 for i
in [0.._n_exprs
.length
[ do
8310 if _n_exprs
[i
] == old_child
then
8311 if new_child
!= null then
8312 assert new_child
isa PExpr
8313 _n_exprs
[i
] = new_child
8314 new_child
.parent
= self
8316 _n_exprs
.remove_at
(i
)
8323 redef fun visit_all
(v
: Visitor)
8325 for n
in _n_exprs
do
8330 redef fun visit_all_reverse
(v
: Visitor)
8333 var i
= _n_exprs
.length
8335 v
.visit
(_n_exprs
[i
])
8341 redef class ASelfExpr
8342 redef fun n_kwself
=(n
)
8348 private init empty_init
do end
8350 init init_aselfexpr
(
8351 n_kwself
: nullable TKwself
8355 _n_kwself
= n_kwself
.as(not null)
8356 n_kwself
.parent
= self
8359 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8361 if _n_kwself
== old_child
then
8362 if new_child
!= null then
8363 new_child
.parent
= self
8364 assert new_child
isa TKwself
8365 _n_kwself
= new_child
8373 redef fun visit_all
(v
: Visitor)
8378 redef fun visit_all_reverse
(v
: Visitor)
8383 redef class AImplicitSelfExpr
8385 private init empty_init
do end
8387 init init_aimplicitselfexpr
8392 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8396 redef fun visit_all
(v
: Visitor)
8400 redef fun visit_all_reverse
(v
: Visitor)
8404 redef class ATrueExpr
8405 redef fun n_kwtrue
=(n
)
8411 private init empty_init
do end
8413 init init_atrueexpr
(
8414 n_kwtrue
: nullable TKwtrue
8418 _n_kwtrue
= n_kwtrue
.as(not null)
8419 n_kwtrue
.parent
= self
8422 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8424 if _n_kwtrue
== old_child
then
8425 if new_child
!= null then
8426 new_child
.parent
= self
8427 assert new_child
isa TKwtrue
8428 _n_kwtrue
= new_child
8436 redef fun visit_all
(v
: Visitor)
8441 redef fun visit_all_reverse
(v
: Visitor)
8446 redef class AFalseExpr
8447 redef fun n_kwfalse
=(n
)
8453 private init empty_init
do end
8455 init init_afalseexpr
(
8456 n_kwfalse
: nullable TKwfalse
8460 _n_kwfalse
= n_kwfalse
.as(not null)
8461 n_kwfalse
.parent
= self
8464 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8466 if _n_kwfalse
== old_child
then
8467 if new_child
!= null then
8468 new_child
.parent
= self
8469 assert new_child
isa TKwfalse
8470 _n_kwfalse
= new_child
8478 redef fun visit_all
(v
: Visitor)
8483 redef fun visit_all_reverse
(v
: Visitor)
8488 redef class ANullExpr
8489 redef fun n_kwnull
=(n
)
8495 private init empty_init
do end
8497 init init_anullexpr
(
8498 n_kwnull
: nullable TKwnull
8502 _n_kwnull
= n_kwnull
.as(not null)
8503 n_kwnull
.parent
= self
8506 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8508 if _n_kwnull
== old_child
then
8509 if new_child
!= null then
8510 new_child
.parent
= self
8511 assert new_child
isa TKwnull
8512 _n_kwnull
= new_child
8520 redef fun visit_all
(v
: Visitor)
8525 redef fun visit_all_reverse
(v
: Visitor)
8530 redef class AIntExpr
8531 redef fun n_number
=(n
)
8537 private init empty_init
do end
8539 init init_aintexpr
(
8540 n_number
: nullable TNumber
8544 _n_number
= n_number
.as(not null)
8545 n_number
.parent
= self
8548 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8550 if _n_number
== old_child
then
8551 if new_child
!= null then
8552 new_child
.parent
= self
8553 assert new_child
isa TNumber
8554 _n_number
= new_child
8562 redef fun visit_all
(v
: Visitor)
8567 redef fun visit_all_reverse
(v
: Visitor)
8572 redef class AFloatExpr
8573 redef fun n_float
=(n
)
8579 private init empty_init
do end
8581 init init_afloatexpr
(
8582 n_float
: nullable TFloat
8586 _n_float
= n_float
.as(not null)
8587 n_float
.parent
= self
8590 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8592 if _n_float
== old_child
then
8593 if new_child
!= null then
8594 new_child
.parent
= self
8595 assert new_child
isa TFloat
8596 _n_float
= new_child
8604 redef fun visit_all
(v
: Visitor)
8609 redef fun visit_all_reverse
(v
: Visitor)
8614 redef class ACharExpr
8615 redef fun n_char
=(n
)
8621 private init empty_init
do end
8623 init init_acharexpr
(
8624 n_char
: nullable TChar
8628 _n_char
= n_char
.as(not null)
8629 n_char
.parent
= self
8632 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8634 if _n_char
== old_child
then
8635 if new_child
!= null then
8636 new_child
.parent
= self
8637 assert new_child
isa TChar
8646 redef fun visit_all
(v
: Visitor)
8651 redef fun visit_all_reverse
(v
: Visitor)
8656 redef class AStringExpr
8657 redef fun n_string
=(n
)
8663 private init empty_init
do end
8665 init init_astringexpr
(
8666 n_string
: nullable TString
8670 _n_string
= n_string
.as(not null)
8671 n_string
.parent
= self
8674 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8676 if _n_string
== old_child
then
8677 if new_child
!= null then
8678 new_child
.parent
= self
8679 assert new_child
isa TString
8680 _n_string
= new_child
8688 redef fun visit_all
(v
: Visitor)
8693 redef fun visit_all_reverse
(v
: Visitor)
8698 redef class AStartStringExpr
8699 redef fun n_string
=(n
)
8705 private init empty_init
do end
8707 init init_astartstringexpr
(
8708 n_string
: nullable TStartString
8712 _n_string
= n_string
.as(not null)
8713 n_string
.parent
= self
8716 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8718 if _n_string
== old_child
then
8719 if new_child
!= null then
8720 new_child
.parent
= self
8721 assert new_child
isa TStartString
8722 _n_string
= new_child
8730 redef fun visit_all
(v
: Visitor)
8735 redef fun visit_all_reverse
(v
: Visitor)
8740 redef class AMidStringExpr
8741 redef fun n_string
=(n
)
8747 private init empty_init
do end
8749 init init_amidstringexpr
(
8750 n_string
: nullable TMidString
8754 _n_string
= n_string
.as(not null)
8755 n_string
.parent
= self
8758 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8760 if _n_string
== old_child
then
8761 if new_child
!= null then
8762 new_child
.parent
= self
8763 assert new_child
isa TMidString
8764 _n_string
= new_child
8772 redef fun visit_all
(v
: Visitor)
8777 redef fun visit_all_reverse
(v
: Visitor)
8782 redef class AEndStringExpr
8783 redef fun n_string
=(n
)
8789 private init empty_init
do end
8791 init init_aendstringexpr
(
8792 n_string
: nullable TEndString
8796 _n_string
= n_string
.as(not null)
8797 n_string
.parent
= self
8800 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8802 if _n_string
== old_child
then
8803 if new_child
!= null then
8804 new_child
.parent
= self
8805 assert new_child
isa TEndString
8806 _n_string
= new_child
8814 redef fun visit_all
(v
: Visitor)
8819 redef fun visit_all_reverse
(v
: Visitor)
8824 redef class ASuperstringExpr
8826 private init empty_init
do end
8828 init init_asuperstringexpr
(
8829 n_exprs
: Collection[Object] # Should be Collection[PExpr]
8840 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8842 for i
in [0.._n_exprs
.length
[ do
8843 if _n_exprs
[i
] == old_child
then
8844 if new_child
!= null then
8845 assert new_child
isa PExpr
8846 _n_exprs
[i
] = new_child
8847 new_child
.parent
= self
8849 _n_exprs
.remove_at
(i
)
8856 redef fun visit_all
(v
: Visitor)
8858 for n
in _n_exprs
do
8863 redef fun visit_all_reverse
(v
: Visitor)
8866 var i
= _n_exprs
.length
8868 v
.visit
(_n_exprs
[i
])
8874 redef class AParExpr
8875 redef fun n_expr
=(n
)
8881 private init empty_init
do end
8883 init init_aparexpr
(
8884 n_expr
: nullable PExpr
8888 _n_expr
= n_expr
.as(not null)
8889 n_expr
.parent
= self
8892 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8894 if _n_expr
== old_child
then
8895 if new_child
!= null then
8896 new_child
.parent
= self
8897 assert new_child
isa PExpr
8906 redef fun visit_all
(v
: Visitor)
8911 redef fun visit_all_reverse
(v
: Visitor)
8916 redef class AAsCastExpr
8917 redef fun n_expr
=(n
)
8922 redef fun n_kwas
=(n
)
8927 redef fun n_type
=(n
)
8933 private init empty_init
do end
8935 init init_aascastexpr
(
8936 n_expr
: nullable PExpr ,
8937 n_kwas
: nullable TKwas ,
8938 n_type
: nullable PType
8942 _n_expr
= n_expr
.as(not null)
8943 n_expr
.parent
= self
8944 _n_kwas
= n_kwas
.as(not null)
8945 n_kwas
.parent
= self
8946 _n_type
= n_type
.as(not null)
8947 n_type
.parent
= self
8950 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
8952 if _n_expr
== old_child
then
8953 if new_child
!= null then
8954 new_child
.parent
= self
8955 assert new_child
isa PExpr
8962 if _n_kwas
== old_child
then
8963 if new_child
!= null then
8964 new_child
.parent
= self
8965 assert new_child
isa TKwas
8972 if _n_type
== old_child
then
8973 if new_child
!= null then
8974 new_child
.parent
= self
8975 assert new_child
isa PType
8984 redef fun visit_all
(v
: Visitor)
8991 redef fun visit_all_reverse
(v
: Visitor)
8998 redef class AAsNotnullExpr
8999 redef fun n_expr
=(n
)
9004 redef fun n_kwas
=(n
)
9009 redef fun n_kwnot
=(n
)
9014 redef fun n_kwnull
=(n
)
9020 private init empty_init
do end
9022 init init_aasnotnullexpr
(
9023 n_expr
: nullable PExpr ,
9024 n_kwas
: nullable TKwas ,
9025 n_kwnot
: nullable TKwnot ,
9026 n_kwnull
: nullable TKwnull
9030 _n_expr
= n_expr
.as(not null)
9031 n_expr
.parent
= self
9032 _n_kwas
= n_kwas
.as(not null)
9033 n_kwas
.parent
= self
9034 _n_kwnot
= n_kwnot
.as(not null)
9035 n_kwnot
.parent
= self
9036 _n_kwnull
= n_kwnull
.as(not null)
9037 n_kwnull
.parent
= self
9040 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9042 if _n_expr
== old_child
then
9043 if new_child
!= null then
9044 new_child
.parent
= self
9045 assert new_child
isa PExpr
9052 if _n_kwas
== old_child
then
9053 if new_child
!= null then
9054 new_child
.parent
= self
9055 assert new_child
isa TKwas
9062 if _n_kwnot
== old_child
then
9063 if new_child
!= null then
9064 new_child
.parent
= self
9065 assert new_child
isa TKwnot
9066 _n_kwnot
= new_child
9072 if _n_kwnull
== old_child
then
9073 if new_child
!= null then
9074 new_child
.parent
= self
9075 assert new_child
isa TKwnull
9076 _n_kwnull
= new_child
9084 redef fun visit_all
(v
: Visitor)
9092 redef fun visit_all_reverse
(v
: Visitor)
9100 redef class AIssetAttrExpr
9101 redef fun n_kwisset
=(n
)
9106 redef fun n_expr
=(n
)
9117 private init empty_init
do end
9119 init init_aissetattrexpr
(
9120 n_kwisset
: nullable TKwisset ,
9121 n_expr
: nullable PExpr ,
9122 n_id
: nullable TAttrid
9126 _n_kwisset
= n_kwisset
.as(not null)
9127 n_kwisset
.parent
= self
9128 _n_expr
= n_expr
.as(not null)
9129 n_expr
.parent
= self
9130 _n_id
= n_id
.as(not null)
9134 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9136 if _n_kwisset
== old_child
then
9137 if new_child
!= null then
9138 new_child
.parent
= self
9139 assert new_child
isa TKwisset
9140 _n_kwisset
= new_child
9146 if _n_expr
== old_child
then
9147 if new_child
!= null then
9148 new_child
.parent
= self
9149 assert new_child
isa PExpr
9156 if _n_id
== old_child
then
9157 if new_child
!= null then
9158 new_child
.parent
= self
9159 assert new_child
isa TAttrid
9168 redef fun visit_all
(v
: Visitor)
9175 redef fun visit_all_reverse
(v
: Visitor)
9182 redef class APlusAssignOp
9183 redef fun n_pluseq
=(n
)
9189 private init empty_init
do end
9191 init init_aplusassignop
(
9192 n_pluseq
: nullable TPluseq
9196 _n_pluseq
= n_pluseq
.as(not null)
9197 n_pluseq
.parent
= self
9200 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9202 if _n_pluseq
== old_child
then
9203 if new_child
!= null then
9204 new_child
.parent
= self
9205 assert new_child
isa TPluseq
9206 _n_pluseq
= new_child
9214 redef fun visit_all
(v
: Visitor)
9219 redef fun visit_all_reverse
(v
: Visitor)
9224 redef class AMinusAssignOp
9225 redef fun n_minuseq
=(n
)
9231 private init empty_init
do end
9233 init init_aminusassignop
(
9234 n_minuseq
: nullable TMinuseq
9238 _n_minuseq
= n_minuseq
.as(not null)
9239 n_minuseq
.parent
= self
9242 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9244 if _n_minuseq
== old_child
then
9245 if new_child
!= null then
9246 new_child
.parent
= self
9247 assert new_child
isa TMinuseq
9248 _n_minuseq
= new_child
9256 redef fun visit_all
(v
: Visitor)
9261 redef fun visit_all_reverse
(v
: Visitor)
9266 redef class AClosureDef
9267 redef fun n_kwwith
=(n
)
9272 redef fun n_kwdo
=(n
)
9277 redef fun n_expr
=(n
)
9285 private init empty_init
do end
9287 init init_aclosuredef
(
9288 n_kwwith
: nullable TKwwith ,
9289 n_id
: Collection[Object] , # Should be Collection[TId]
9290 n_kwdo
: nullable TKwdo ,
9291 n_expr
: nullable PExpr
9295 _n_kwwith
= n_kwwith
.as(not null)
9296 n_kwwith
.parent
= self
9302 _n_kwdo
= n_kwdo
.as(not null)
9303 n_kwdo
.parent
= self
9305 if n_expr
!= null then
9306 n_expr
.parent
= self
9310 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9312 if _n_kwwith
== old_child
then
9313 if new_child
!= null then
9314 new_child
.parent
= self
9315 assert new_child
isa TKwwith
9316 _n_kwwith
= new_child
9322 for i
in [0.._n_id
.length
[ do
9323 if _n_id
[i
] == old_child
then
9324 if new_child
!= null then
9325 assert new_child
isa TId
9326 _n_id
[i
] = new_child
9327 new_child
.parent
= self
9334 if _n_kwdo
== old_child
then
9335 if new_child
!= null then
9336 new_child
.parent
= self
9337 assert new_child
isa TKwdo
9344 if _n_expr
== old_child
then
9345 if new_child
!= null then
9346 new_child
.parent
= self
9347 assert new_child
isa PExpr
9356 redef fun visit_all
(v
: Visitor)
9363 if _n_expr
!= null then
9364 v
.visit
(_n_expr
.as(not null))
9368 redef fun visit_all_reverse
(v
: Visitor)
9372 var i
= _n_id
.length
9379 if _n_expr
!= null then
9380 v
.visit
(_n_expr
.as(not null))
9384 redef class AQualified
9385 redef fun n_classid
=(n
)
9393 private init empty_init
do end
9395 init init_aqualified
(
9396 n_id
: Collection[Object] , # Should be Collection[TId]
9397 n_classid
: nullable TClassid
9406 _n_classid
= n_classid
9407 if n_classid
!= null then
9408 n_classid
.parent
= self
9412 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9414 for i
in [0.._n_id
.length
[ do
9415 if _n_id
[i
] == old_child
then
9416 if new_child
!= null then
9417 assert new_child
isa TId
9418 _n_id
[i
] = new_child
9419 new_child
.parent
= self
9426 if _n_classid
== old_child
then
9427 if new_child
!= null then
9428 new_child
.parent
= self
9429 assert new_child
isa TClassid
9430 _n_classid
= new_child
9438 redef fun visit_all
(v
: Visitor)
9443 if _n_classid
!= null then
9444 v
.visit
(_n_classid
.as(not null))
9448 redef fun visit_all_reverse
(v
: Visitor)
9451 var i
= _n_id
.length
9457 if _n_classid
!= null then
9458 v
.visit
(_n_classid
.as(not null))
9464 private init empty_init
do end
9467 n_comment
: Collection[Object] # Should be Collection[TComment]
9471 for n
in n_comment
do
9472 assert n
isa TComment
9478 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9480 for i
in [0.._n_comment
.length
[ do
9481 if _n_comment
[i
] == old_child
then
9482 if new_child
!= null then
9483 assert new_child
isa TComment
9484 _n_comment
[i
] = new_child
9485 new_child
.parent
= self
9487 _n_comment
.remove_at
(i
)
9494 redef fun visit_all
(v
: Visitor)
9496 for n
in _n_comment
do
9501 redef fun visit_all_reverse
(v
: Visitor)
9504 var i
= _n_comment
.length
9506 v
.visit
(_n_comment
[i
])
9515 n_base
: nullable PModule,
9522 redef fun replace_child
(old_child
: PNode, new_child
: nullable PNode)
9524 if _n_base
== old_child
then
9525 if new_child
== null then
9527 new_child
.parent
= self
9528 assert new_child
isa PModule
9531 old_child
.parent
= null
9536 redef fun visit_all
(v
: Visitor)
9538 if _n_base
!= null then
9539 v
.visit
(_n_base
.as(not null))
9543 redef fun visit_all_reverse
(v
: Visitor)
9545 if _n_base
!= null then
9546 v
.visit
(_n_base
.as(not null))