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 ANode
12 # Remove a child from the AST
13 fun remove_child
(child
: ANode)
15 replace_child
(child
, null)
18 # Replace a child with an other node in the AST
19 fun replace_child
(old_child
: ANode, new_child
: nullable ANode) is abstract
21 # Replace itself with an other node in the AST
22 fun replace_with
(node
: ANode)
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
35 redef fun visit_all
(v
: Visitor) do end
36 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode) do end
40 redef fun replace_with
(n
: ANode)
48 # Abstract standard visitor
50 # What the visitor do when a node is visited
51 # Concrete visitors should redefine this method.
52 protected fun visit
(e
: nullable ANode) is abstract
54 # Ask the visitor to visit a given node.
55 # Usually automatically called by visit_all* methods.
56 # This methos should not be redefined
57 fun enter_visit
(e
: nullable ANode)
59 var old
= _current_node
65 # The current visited node
66 readable var _current_node
: nullable ANode = null
70 private init empty_init
do end
73 n_packagedecl
: nullable APackagedecl,
74 n_imports
: Collection[Object], # Should be Collection[AImport]
75 n_classdefs
: Collection[Object] # Should be Collection[AClassdef]
79 _n_packagedecl
= n_packagedecl
80 if n_packagedecl
!= null then
81 n_packagedecl
.parent
= self
88 for n
in n_classdefs
do
89 assert n
isa AClassdef
95 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
97 if _n_packagedecl
== old_child
then
98 if new_child
!= null then
99 new_child
.parent
= self
100 assert new_child
isa APackagedecl
101 _n_packagedecl
= new_child
103 _n_packagedecl
= null
107 for i
in [0.._n_imports
.length
[ do
108 if _n_imports
[i
] == old_child
then
109 if new_child
!= null then
110 assert new_child
isa AImport
111 _n_imports
[i
] = new_child
112 new_child
.parent
= self
114 _n_imports
.remove_at
(i
)
119 for i
in [0.._n_classdefs
.length
[ do
120 if _n_classdefs
[i
] == old_child
then
121 if new_child
!= null then
122 assert new_child
isa AClassdef
123 _n_classdefs
[i
] = new_child
124 new_child
.parent
= self
126 _n_classdefs
.remove_at
(i
)
133 redef fun visit_all
(v
: Visitor)
135 if _n_packagedecl
!= null then
136 v
.enter_visit
(_n_packagedecl
.as(not null))
138 for n
in _n_imports
do
141 for n
in _n_classdefs
do
146 redef class APackagedecl
147 private init empty_init
do end
149 init init_apackagedecl
(
150 n_doc
: nullable ADoc,
151 n_kwpackage
: nullable TKwpackage,
157 if n_doc
!= null then
160 _n_kwpackage
= n_kwpackage
.as(not null)
161 n_kwpackage
.parent
= self
162 _n_id
= n_id
.as(not null)
166 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
168 if _n_doc
== old_child
then
169 if new_child
!= null then
170 new_child
.parent
= self
171 assert new_child
isa ADoc
178 if _n_kwpackage
== old_child
then
179 if new_child
!= null then
180 new_child
.parent
= self
181 assert new_child
isa TKwpackage
182 _n_kwpackage
= new_child
188 if _n_id
== old_child
then
189 if new_child
!= null then
190 new_child
.parent
= self
191 assert new_child
isa TId
200 redef fun visit_all
(v
: Visitor)
202 if _n_doc
!= null then
203 v
.enter_visit
(_n_doc
.as(not null))
205 v
.enter_visit
(_n_kwpackage
)
209 redef class AStdImport
210 private init empty_init
do end
212 init init_astdimport
(
213 n_visibility
: nullable AVisibility,
214 n_kwimport
: nullable TKwimport,
219 _n_visibility
= n_visibility
.as(not null)
220 n_visibility
.parent
= self
221 _n_kwimport
= n_kwimport
.as(not null)
222 n_kwimport
.parent
= self
223 _n_id
= n_id
.as(not null)
227 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
229 if _n_visibility
== old_child
then
230 if new_child
!= null then
231 new_child
.parent
= self
232 assert new_child
isa AVisibility
233 _n_visibility
= new_child
239 if _n_kwimport
== old_child
then
240 if new_child
!= null then
241 new_child
.parent
= self
242 assert new_child
isa TKwimport
243 _n_kwimport
= new_child
249 if _n_id
== old_child
then
250 if new_child
!= null then
251 new_child
.parent
= self
252 assert new_child
isa TId
261 redef fun visit_all
(v
: Visitor)
263 v
.enter_visit
(_n_visibility
)
264 v
.enter_visit
(_n_kwimport
)
268 redef class ANoImport
269 private init empty_init
do end
271 init init_anoimport
(
272 n_visibility
: nullable AVisibility,
273 n_kwimport
: nullable TKwimport,
274 n_kwend
: nullable TKwend
278 _n_visibility
= n_visibility
.as(not null)
279 n_visibility
.parent
= self
280 _n_kwimport
= n_kwimport
.as(not null)
281 n_kwimport
.parent
= self
282 _n_kwend
= n_kwend
.as(not null)
283 n_kwend
.parent
= self
286 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
288 if _n_visibility
== old_child
then
289 if new_child
!= null then
290 new_child
.parent
= self
291 assert new_child
isa AVisibility
292 _n_visibility
= new_child
298 if _n_kwimport
== old_child
then
299 if new_child
!= null then
300 new_child
.parent
= self
301 assert new_child
isa TKwimport
302 _n_kwimport
= new_child
308 if _n_kwend
== old_child
then
309 if new_child
!= null then
310 new_child
.parent
= self
311 assert new_child
isa TKwend
320 redef fun visit_all
(v
: Visitor)
322 v
.enter_visit
(_n_visibility
)
323 v
.enter_visit
(_n_kwimport
)
324 v
.enter_visit
(_n_kwend
)
327 redef class APublicVisibility
328 private init empty_init
do end
330 init init_apublicvisibility
335 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
339 redef fun visit_all
(v
: Visitor)
343 redef class APrivateVisibility
344 private init empty_init
do end
346 init init_aprivatevisibility
(
347 n_kwprivate
: nullable TKwprivate
351 _n_kwprivate
= n_kwprivate
.as(not null)
352 n_kwprivate
.parent
= self
355 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
357 if _n_kwprivate
== old_child
then
358 if new_child
!= null then
359 new_child
.parent
= self
360 assert new_child
isa TKwprivate
361 _n_kwprivate
= new_child
369 redef fun visit_all
(v
: Visitor)
371 v
.enter_visit
(_n_kwprivate
)
374 redef class AProtectedVisibility
375 private init empty_init
do end
377 init init_aprotectedvisibility
(
378 n_kwprotected
: nullable TKwprotected
382 _n_kwprotected
= n_kwprotected
.as(not null)
383 n_kwprotected
.parent
= self
386 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
388 if _n_kwprotected
== old_child
then
389 if new_child
!= null then
390 new_child
.parent
= self
391 assert new_child
isa TKwprotected
392 _n_kwprotected
= new_child
400 redef fun visit_all
(v
: Visitor)
402 v
.enter_visit
(_n_kwprotected
)
405 redef class AIntrudeVisibility
406 private init empty_init
do end
408 init init_aintrudevisibility
(
409 n_kwintrude
: nullable TKwintrude
413 _n_kwintrude
= n_kwintrude
.as(not null)
414 n_kwintrude
.parent
= self
417 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
419 if _n_kwintrude
== old_child
then
420 if new_child
!= null then
421 new_child
.parent
= self
422 assert new_child
isa TKwintrude
423 _n_kwintrude
= new_child
431 redef fun visit_all
(v
: Visitor)
433 v
.enter_visit
(_n_kwintrude
)
436 redef class AStdClassdef
437 private init empty_init
do end
439 init init_astdclassdef
(
440 n_doc
: nullable ADoc,
441 n_kwredef
: nullable TKwredef,
442 n_visibility
: nullable AVisibility,
443 n_classkind
: nullable AClasskind,
444 n_id
: nullable TClassid,
445 n_formaldefs
: Collection[Object], # Should be Collection[AFormaldef]
446 n_superclasses
: Collection[Object], # Should be Collection[ASuperclass]
447 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
452 if n_doc
!= null then
455 _n_kwredef
= n_kwredef
456 if n_kwredef
!= null then
457 n_kwredef
.parent
= self
459 _n_visibility
= n_visibility
.as(not null)
460 n_visibility
.parent
= self
461 _n_classkind
= n_classkind
.as(not null)
462 n_classkind
.parent
= self
467 for n
in n_formaldefs
do
468 assert n
isa AFormaldef
472 for n
in n_superclasses
do
473 assert n
isa ASuperclass
474 _n_superclasses
.add
(n
)
477 for n
in n_propdefs
do
478 assert n
isa APropdef
484 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
486 if _n_doc
== old_child
then
487 if new_child
!= null then
488 new_child
.parent
= self
489 assert new_child
isa ADoc
496 if _n_kwredef
== old_child
then
497 if new_child
!= null then
498 new_child
.parent
= self
499 assert new_child
isa TKwredef
500 _n_kwredef
= new_child
506 if _n_visibility
== old_child
then
507 if new_child
!= null then
508 new_child
.parent
= self
509 assert new_child
isa AVisibility
510 _n_visibility
= new_child
516 if _n_classkind
== old_child
then
517 if new_child
!= null then
518 new_child
.parent
= self
519 assert new_child
isa AClasskind
520 _n_classkind
= new_child
526 if _n_id
== old_child
then
527 if new_child
!= null then
528 new_child
.parent
= self
529 assert new_child
isa TClassid
536 for i
in [0.._n_formaldefs
.length
[ do
537 if _n_formaldefs
[i
] == old_child
then
538 if new_child
!= null then
539 assert new_child
isa AFormaldef
540 _n_formaldefs
[i
] = new_child
541 new_child
.parent
= self
543 _n_formaldefs
.remove_at
(i
)
548 for i
in [0.._n_superclasses
.length
[ do
549 if _n_superclasses
[i
] == old_child
then
550 if new_child
!= null then
551 assert new_child
isa ASuperclass
552 _n_superclasses
[i
] = new_child
553 new_child
.parent
= self
555 _n_superclasses
.remove_at
(i
)
560 for i
in [0.._n_propdefs
.length
[ do
561 if _n_propdefs
[i
] == old_child
then
562 if new_child
!= null then
563 assert new_child
isa APropdef
564 _n_propdefs
[i
] = new_child
565 new_child
.parent
= self
567 _n_propdefs
.remove_at
(i
)
574 redef fun visit_all
(v
: Visitor)
576 if _n_doc
!= null then
577 v
.enter_visit
(_n_doc
.as(not null))
579 if _n_kwredef
!= null then
580 v
.enter_visit
(_n_kwredef
.as(not null))
582 v
.enter_visit
(_n_visibility
)
583 v
.enter_visit
(_n_classkind
)
584 if _n_id
!= null then
585 v
.enter_visit
(_n_id
.as(not null))
587 for n
in _n_formaldefs
do
590 for n
in _n_superclasses
do
593 for n
in _n_propdefs
do
598 redef class ATopClassdef
599 private init empty_init
do end
601 init init_atopclassdef
(
602 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
606 for n
in n_propdefs
do
607 assert n
isa APropdef
613 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
615 for i
in [0.._n_propdefs
.length
[ do
616 if _n_propdefs
[i
] == old_child
then
617 if new_child
!= null then
618 assert new_child
isa APropdef
619 _n_propdefs
[i
] = new_child
620 new_child
.parent
= self
622 _n_propdefs
.remove_at
(i
)
629 redef fun visit_all
(v
: Visitor)
631 for n
in _n_propdefs
do
636 redef class AMainClassdef
637 private init empty_init
do end
639 init init_amainclassdef
(
640 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
644 for n
in n_propdefs
do
645 assert n
isa APropdef
651 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
653 for i
in [0.._n_propdefs
.length
[ do
654 if _n_propdefs
[i
] == old_child
then
655 if new_child
!= null then
656 assert new_child
isa APropdef
657 _n_propdefs
[i
] = new_child
658 new_child
.parent
= self
660 _n_propdefs
.remove_at
(i
)
667 redef fun visit_all
(v
: Visitor)
669 for n
in _n_propdefs
do
674 redef class AConcreteClasskind
675 private init empty_init
do end
677 init init_aconcreteclasskind
(
678 n_kwclass
: nullable TKwclass
682 _n_kwclass
= n_kwclass
.as(not null)
683 n_kwclass
.parent
= self
686 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
688 if _n_kwclass
== old_child
then
689 if new_child
!= null then
690 new_child
.parent
= self
691 assert new_child
isa TKwclass
692 _n_kwclass
= new_child
700 redef fun visit_all
(v
: Visitor)
702 v
.enter_visit
(_n_kwclass
)
705 redef class AAbstractClasskind
706 private init empty_init
do end
708 init init_aabstractclasskind
(
709 n_kwabstract
: nullable TKwabstract,
710 n_kwclass
: nullable TKwclass
714 _n_kwabstract
= n_kwabstract
.as(not null)
715 n_kwabstract
.parent
= self
716 _n_kwclass
= n_kwclass
.as(not null)
717 n_kwclass
.parent
= self
720 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
722 if _n_kwabstract
== old_child
then
723 if new_child
!= null then
724 new_child
.parent
= self
725 assert new_child
isa TKwabstract
726 _n_kwabstract
= new_child
732 if _n_kwclass
== old_child
then
733 if new_child
!= null then
734 new_child
.parent
= self
735 assert new_child
isa TKwclass
736 _n_kwclass
= new_child
744 redef fun visit_all
(v
: Visitor)
746 v
.enter_visit
(_n_kwabstract
)
747 v
.enter_visit
(_n_kwclass
)
750 redef class AInterfaceClasskind
751 private init empty_init
do end
753 init init_ainterfaceclasskind
(
754 n_kwinterface
: nullable TKwinterface
758 _n_kwinterface
= n_kwinterface
.as(not null)
759 n_kwinterface
.parent
= self
762 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
764 if _n_kwinterface
== old_child
then
765 if new_child
!= null then
766 new_child
.parent
= self
767 assert new_child
isa TKwinterface
768 _n_kwinterface
= new_child
776 redef fun visit_all
(v
: Visitor)
778 v
.enter_visit
(_n_kwinterface
)
781 redef class AUniversalClasskind
782 private init empty_init
do end
784 init init_auniversalclasskind
(
785 n_kwuniversal
: nullable TKwuniversal
789 _n_kwuniversal
= n_kwuniversal
.as(not null)
790 n_kwuniversal
.parent
= self
793 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
795 if _n_kwuniversal
== old_child
then
796 if new_child
!= null then
797 new_child
.parent
= self
798 assert new_child
isa TKwuniversal
799 _n_kwuniversal
= new_child
807 redef fun visit_all
(v
: Visitor)
809 v
.enter_visit
(_n_kwuniversal
)
812 redef class AFormaldef
813 private init empty_init
do end
815 init init_aformaldef
(
816 n_id
: nullable TClassid,
817 n_type
: nullable AType
821 _n_id
= n_id
.as(not null)
824 if n_type
!= null then
829 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
831 if _n_id
== old_child
then
832 if new_child
!= null then
833 new_child
.parent
= self
834 assert new_child
isa TClassid
841 if _n_type
== old_child
then
842 if new_child
!= null then
843 new_child
.parent
= self
844 assert new_child
isa AType
853 redef fun visit_all
(v
: Visitor)
856 if _n_type
!= null then
857 v
.enter_visit
(_n_type
.as(not null))
861 redef class ASuperclass
862 private init empty_init
do end
864 init init_asuperclass
(
865 n_kwspecial
: nullable TKwspecial,
866 n_kwsuper
: nullable TKwsuper,
867 n_type
: nullable AType
871 _n_kwspecial
= n_kwspecial
872 if n_kwspecial
!= null then
873 n_kwspecial
.parent
= self
875 _n_kwsuper
= n_kwsuper
876 if n_kwsuper
!= null then
877 n_kwsuper
.parent
= self
879 _n_type
= n_type
.as(not null)
883 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
885 if _n_kwspecial
== old_child
then
886 if new_child
!= null then
887 new_child
.parent
= self
888 assert new_child
isa TKwspecial
889 _n_kwspecial
= new_child
895 if _n_kwsuper
== old_child
then
896 if new_child
!= null then
897 new_child
.parent
= self
898 assert new_child
isa TKwsuper
899 _n_kwsuper
= new_child
905 if _n_type
== old_child
then
906 if new_child
!= null then
907 new_child
.parent
= self
908 assert new_child
isa AType
917 redef fun visit_all
(v
: Visitor)
919 if _n_kwspecial
!= null then
920 v
.enter_visit
(_n_kwspecial
.as(not null))
922 if _n_kwsuper
!= null then
923 v
.enter_visit
(_n_kwsuper
.as(not null))
925 v
.enter_visit
(_n_type
)
928 redef class AAttrPropdef
929 private init empty_init
do end
931 init init_aattrpropdef
(
932 n_doc
: nullable ADoc,
933 n_readable
: nullable AAble,
934 n_writable
: nullable AAble,
935 n_kwredef
: nullable TKwredef,
936 n_visibility
: nullable AVisibility,
937 n_kwvar
: nullable TKwvar,
938 n_id
: nullable TAttrid,
940 n_type
: nullable AType,
941 n_expr
: nullable AExpr
946 if n_doc
!= null then
949 _n_readable
= n_readable
950 if n_readable
!= null then
951 n_readable
.parent
= self
953 _n_writable
= n_writable
954 if n_writable
!= null then
955 n_writable
.parent
= self
957 _n_kwredef
= n_kwredef
958 if n_kwredef
!= null then
959 n_kwredef
.parent
= self
961 _n_visibility
= n_visibility
.as(not null)
962 n_visibility
.parent
= self
963 _n_kwvar
= n_kwvar
.as(not null)
964 n_kwvar
.parent
= self
970 if n_id2
!= null then
974 if n_type
!= null then
978 if n_expr
!= null then
983 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
985 if _n_doc
== old_child
then
986 if new_child
!= null then
987 new_child
.parent
= self
988 assert new_child
isa ADoc
995 if _n_readable
== old_child
then
996 if new_child
!= null then
997 new_child
.parent
= self
998 assert new_child
isa AAble
999 _n_readable
= new_child
1005 if _n_writable
== old_child
then
1006 if new_child
!= null then
1007 new_child
.parent
= self
1008 assert new_child
isa AAble
1009 _n_writable
= new_child
1015 if _n_kwredef
== old_child
then
1016 if new_child
!= null then
1017 new_child
.parent
= self
1018 assert new_child
isa TKwredef
1019 _n_kwredef
= new_child
1025 if _n_visibility
== old_child
then
1026 if new_child
!= null then
1027 new_child
.parent
= self
1028 assert new_child
isa AVisibility
1029 _n_visibility
= new_child
1035 if _n_kwvar
== old_child
then
1036 if new_child
!= null then
1037 new_child
.parent
= self
1038 assert new_child
isa TKwvar
1039 _n_kwvar
= new_child
1045 if _n_id
== old_child
then
1046 if new_child
!= null then
1047 new_child
.parent
= self
1048 assert new_child
isa TAttrid
1055 if _n_id2
== old_child
then
1056 if new_child
!= null then
1057 new_child
.parent
= self
1058 assert new_child
isa TId
1065 if _n_type
== old_child
then
1066 if new_child
!= null then
1067 new_child
.parent
= self
1068 assert new_child
isa AType
1075 if _n_expr
== old_child
then
1076 if new_child
!= null then
1077 new_child
.parent
= self
1078 assert new_child
isa AExpr
1087 redef fun visit_all
(v
: Visitor)
1089 if _n_doc
!= null then
1090 v
.enter_visit
(_n_doc
.as(not null))
1092 if _n_readable
!= null then
1093 v
.enter_visit
(_n_readable
.as(not null))
1095 if _n_writable
!= null then
1096 v
.enter_visit
(_n_writable
.as(not null))
1098 if _n_kwredef
!= null then
1099 v
.enter_visit
(_n_kwredef
.as(not null))
1101 v
.enter_visit
(_n_visibility
)
1102 v
.enter_visit
(_n_kwvar
)
1103 if _n_id
!= null then
1104 v
.enter_visit
(_n_id
.as(not null))
1106 if _n_id2
!= null then
1107 v
.enter_visit
(_n_id2
.as(not null))
1109 if _n_type
!= null then
1110 v
.enter_visit
(_n_type
.as(not null))
1112 if _n_expr
!= null then
1113 v
.enter_visit
(_n_expr
.as(not null))
1117 redef class AMethPropdef
1118 private init empty_init
do end
1120 init init_amethpropdef
(
1121 n_doc
: nullable ADoc,
1122 n_kwredef
: nullable TKwredef,
1123 n_visibility
: nullable AVisibility,
1124 n_methid
: nullable AMethid,
1125 n_signature
: nullable ASignature
1130 if n_doc
!= null then
1133 _n_kwredef
= n_kwredef
1134 if n_kwredef
!= null then
1135 n_kwredef
.parent
= self
1137 _n_visibility
= n_visibility
.as(not null)
1138 n_visibility
.parent
= self
1139 _n_methid
= n_methid
.as(not null)
1140 n_methid
.parent
= self
1141 _n_signature
= n_signature
.as(not null)
1142 n_signature
.parent
= self
1145 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1147 if _n_doc
== old_child
then
1148 if new_child
!= null then
1149 new_child
.parent
= self
1150 assert new_child
isa ADoc
1157 if _n_kwredef
== old_child
then
1158 if new_child
!= null then
1159 new_child
.parent
= self
1160 assert new_child
isa TKwredef
1161 _n_kwredef
= new_child
1167 if _n_visibility
== old_child
then
1168 if new_child
!= null then
1169 new_child
.parent
= self
1170 assert new_child
isa AVisibility
1171 _n_visibility
= new_child
1177 if _n_methid
== old_child
then
1178 if new_child
!= null then
1179 new_child
.parent
= self
1180 assert new_child
isa AMethid
1181 _n_methid
= new_child
1187 if _n_signature
== old_child
then
1188 if new_child
!= null then
1189 new_child
.parent
= self
1190 assert new_child
isa ASignature
1191 _n_signature
= new_child
1199 redef fun visit_all
(v
: Visitor)
1201 if _n_doc
!= null then
1202 v
.enter_visit
(_n_doc
.as(not null))
1204 if _n_kwredef
!= null then
1205 v
.enter_visit
(_n_kwredef
.as(not null))
1207 v
.enter_visit
(_n_visibility
)
1208 v
.enter_visit
(_n_methid
)
1209 v
.enter_visit
(_n_signature
)
1212 redef class ADeferredMethPropdef
1213 private init empty_init
do end
1215 init init_adeferredmethpropdef
(
1216 n_doc
: nullable ADoc,
1217 n_kwredef
: nullable TKwredef,
1218 n_visibility
: nullable AVisibility,
1219 n_kwmeth
: nullable TKwmeth,
1220 n_methid
: nullable AMethid,
1221 n_signature
: nullable ASignature
1226 if n_doc
!= null then
1229 _n_kwredef
= n_kwredef
1230 if n_kwredef
!= null then
1231 n_kwredef
.parent
= self
1233 _n_visibility
= n_visibility
.as(not null)
1234 n_visibility
.parent
= self
1235 _n_kwmeth
= n_kwmeth
.as(not null)
1236 n_kwmeth
.parent
= self
1237 _n_methid
= n_methid
.as(not null)
1238 n_methid
.parent
= self
1239 _n_signature
= n_signature
.as(not null)
1240 n_signature
.parent
= self
1243 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1245 if _n_doc
== old_child
then
1246 if new_child
!= null then
1247 new_child
.parent
= self
1248 assert new_child
isa ADoc
1255 if _n_kwredef
== old_child
then
1256 if new_child
!= null then
1257 new_child
.parent
= self
1258 assert new_child
isa TKwredef
1259 _n_kwredef
= new_child
1265 if _n_visibility
== old_child
then
1266 if new_child
!= null then
1267 new_child
.parent
= self
1268 assert new_child
isa AVisibility
1269 _n_visibility
= new_child
1275 if _n_kwmeth
== old_child
then
1276 if new_child
!= null then
1277 new_child
.parent
= self
1278 assert new_child
isa TKwmeth
1279 _n_kwmeth
= new_child
1285 if _n_methid
== old_child
then
1286 if new_child
!= null then
1287 new_child
.parent
= self
1288 assert new_child
isa AMethid
1289 _n_methid
= new_child
1295 if _n_signature
== old_child
then
1296 if new_child
!= null then
1297 new_child
.parent
= self
1298 assert new_child
isa ASignature
1299 _n_signature
= new_child
1307 redef fun visit_all
(v
: Visitor)
1309 if _n_doc
!= null then
1310 v
.enter_visit
(_n_doc
.as(not null))
1312 if _n_kwredef
!= null then
1313 v
.enter_visit
(_n_kwredef
.as(not null))
1315 v
.enter_visit
(_n_visibility
)
1316 v
.enter_visit
(_n_kwmeth
)
1317 v
.enter_visit
(_n_methid
)
1318 v
.enter_visit
(_n_signature
)
1321 redef class AInternMethPropdef
1322 private init empty_init
do end
1324 init init_ainternmethpropdef
(
1325 n_doc
: nullable ADoc,
1326 n_kwredef
: nullable TKwredef,
1327 n_visibility
: nullable AVisibility,
1328 n_kwmeth
: nullable TKwmeth,
1329 n_methid
: nullable AMethid,
1330 n_signature
: nullable ASignature
1335 if n_doc
!= null then
1338 _n_kwredef
= n_kwredef
1339 if n_kwredef
!= null then
1340 n_kwredef
.parent
= self
1342 _n_visibility
= n_visibility
.as(not null)
1343 n_visibility
.parent
= self
1344 _n_kwmeth
= n_kwmeth
.as(not null)
1345 n_kwmeth
.parent
= self
1346 _n_methid
= n_methid
.as(not null)
1347 n_methid
.parent
= self
1348 _n_signature
= n_signature
.as(not null)
1349 n_signature
.parent
= self
1352 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1354 if _n_doc
== old_child
then
1355 if new_child
!= null then
1356 new_child
.parent
= self
1357 assert new_child
isa ADoc
1364 if _n_kwredef
== old_child
then
1365 if new_child
!= null then
1366 new_child
.parent
= self
1367 assert new_child
isa TKwredef
1368 _n_kwredef
= new_child
1374 if _n_visibility
== old_child
then
1375 if new_child
!= null then
1376 new_child
.parent
= self
1377 assert new_child
isa AVisibility
1378 _n_visibility
= new_child
1384 if _n_kwmeth
== old_child
then
1385 if new_child
!= null then
1386 new_child
.parent
= self
1387 assert new_child
isa TKwmeth
1388 _n_kwmeth
= new_child
1394 if _n_methid
== old_child
then
1395 if new_child
!= null then
1396 new_child
.parent
= self
1397 assert new_child
isa AMethid
1398 _n_methid
= new_child
1404 if _n_signature
== old_child
then
1405 if new_child
!= null then
1406 new_child
.parent
= self
1407 assert new_child
isa ASignature
1408 _n_signature
= new_child
1416 redef fun visit_all
(v
: Visitor)
1418 if _n_doc
!= null then
1419 v
.enter_visit
(_n_doc
.as(not null))
1421 if _n_kwredef
!= null then
1422 v
.enter_visit
(_n_kwredef
.as(not null))
1424 v
.enter_visit
(_n_visibility
)
1425 v
.enter_visit
(_n_kwmeth
)
1426 v
.enter_visit
(_n_methid
)
1427 v
.enter_visit
(_n_signature
)
1430 redef class AExternMethPropdef
1431 private init empty_init
do end
1433 init init_aexternmethpropdef
(
1434 n_doc
: nullable ADoc,
1435 n_kwredef
: nullable TKwredef,
1436 n_visibility
: nullable AVisibility,
1437 n_kwmeth
: nullable TKwmeth,
1438 n_methid
: nullable AMethid,
1439 n_signature
: nullable ASignature,
1440 n_extern
: nullable TString
1445 if n_doc
!= null then
1448 _n_kwredef
= n_kwredef
1449 if n_kwredef
!= null then
1450 n_kwredef
.parent
= self
1452 _n_visibility
= n_visibility
.as(not null)
1453 n_visibility
.parent
= self
1454 _n_kwmeth
= n_kwmeth
.as(not null)
1455 n_kwmeth
.parent
= self
1456 _n_methid
= n_methid
.as(not null)
1457 n_methid
.parent
= self
1458 _n_signature
= n_signature
.as(not null)
1459 n_signature
.parent
= self
1460 _n_extern
= n_extern
1461 if n_extern
!= null then
1462 n_extern
.parent
= self
1466 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1468 if _n_doc
== old_child
then
1469 if new_child
!= null then
1470 new_child
.parent
= self
1471 assert new_child
isa ADoc
1478 if _n_kwredef
== old_child
then
1479 if new_child
!= null then
1480 new_child
.parent
= self
1481 assert new_child
isa TKwredef
1482 _n_kwredef
= new_child
1488 if _n_visibility
== old_child
then
1489 if new_child
!= null then
1490 new_child
.parent
= self
1491 assert new_child
isa AVisibility
1492 _n_visibility
= new_child
1498 if _n_kwmeth
== old_child
then
1499 if new_child
!= null then
1500 new_child
.parent
= self
1501 assert new_child
isa TKwmeth
1502 _n_kwmeth
= new_child
1508 if _n_methid
== old_child
then
1509 if new_child
!= null then
1510 new_child
.parent
= self
1511 assert new_child
isa AMethid
1512 _n_methid
= new_child
1518 if _n_signature
== old_child
then
1519 if new_child
!= null then
1520 new_child
.parent
= self
1521 assert new_child
isa ASignature
1522 _n_signature
= new_child
1528 if _n_extern
== old_child
then
1529 if new_child
!= null then
1530 new_child
.parent
= self
1531 assert new_child
isa TString
1532 _n_extern
= new_child
1540 redef fun visit_all
(v
: Visitor)
1542 if _n_doc
!= null then
1543 v
.enter_visit
(_n_doc
.as(not null))
1545 if _n_kwredef
!= null then
1546 v
.enter_visit
(_n_kwredef
.as(not null))
1548 v
.enter_visit
(_n_visibility
)
1549 v
.enter_visit
(_n_kwmeth
)
1550 v
.enter_visit
(_n_methid
)
1551 v
.enter_visit
(_n_signature
)
1552 if _n_extern
!= null then
1553 v
.enter_visit
(_n_extern
.as(not null))
1557 redef class AConcreteMethPropdef
1558 private init empty_init
do end
1560 init init_aconcretemethpropdef
(
1561 n_doc
: nullable ADoc,
1562 n_kwredef
: nullable TKwredef,
1563 n_visibility
: nullable AVisibility,
1564 n_kwmeth
: nullable TKwmeth,
1565 n_methid
: nullable AMethid,
1566 n_signature
: nullable ASignature,
1567 n_block
: nullable AExpr
1572 if n_doc
!= null then
1575 _n_kwredef
= n_kwredef
1576 if n_kwredef
!= null then
1577 n_kwredef
.parent
= self
1579 _n_visibility
= n_visibility
.as(not null)
1580 n_visibility
.parent
= self
1581 _n_kwmeth
= n_kwmeth
.as(not null)
1582 n_kwmeth
.parent
= self
1583 _n_methid
= n_methid
.as(not null)
1584 n_methid
.parent
= self
1585 _n_signature
= n_signature
.as(not null)
1586 n_signature
.parent
= self
1588 if n_block
!= null then
1589 n_block
.parent
= self
1593 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1595 if _n_doc
== old_child
then
1596 if new_child
!= null then
1597 new_child
.parent
= self
1598 assert new_child
isa ADoc
1605 if _n_kwredef
== old_child
then
1606 if new_child
!= null then
1607 new_child
.parent
= self
1608 assert new_child
isa TKwredef
1609 _n_kwredef
= new_child
1615 if _n_visibility
== old_child
then
1616 if new_child
!= null then
1617 new_child
.parent
= self
1618 assert new_child
isa AVisibility
1619 _n_visibility
= new_child
1625 if _n_kwmeth
== old_child
then
1626 if new_child
!= null then
1627 new_child
.parent
= self
1628 assert new_child
isa TKwmeth
1629 _n_kwmeth
= new_child
1635 if _n_methid
== old_child
then
1636 if new_child
!= null then
1637 new_child
.parent
= self
1638 assert new_child
isa AMethid
1639 _n_methid
= new_child
1645 if _n_signature
== old_child
then
1646 if new_child
!= null then
1647 new_child
.parent
= self
1648 assert new_child
isa ASignature
1649 _n_signature
= new_child
1655 if _n_block
== old_child
then
1656 if new_child
!= null then
1657 new_child
.parent
= self
1658 assert new_child
isa AExpr
1659 _n_block
= new_child
1667 redef fun visit_all
(v
: Visitor)
1669 if _n_doc
!= null then
1670 v
.enter_visit
(_n_doc
.as(not null))
1672 if _n_kwredef
!= null then
1673 v
.enter_visit
(_n_kwredef
.as(not null))
1675 v
.enter_visit
(_n_visibility
)
1676 v
.enter_visit
(_n_kwmeth
)
1677 v
.enter_visit
(_n_methid
)
1678 v
.enter_visit
(_n_signature
)
1679 if _n_block
!= null then
1680 v
.enter_visit
(_n_block
.as(not null))
1684 redef class AConcreteInitPropdef
1685 private init empty_init
do end
1687 init init_aconcreteinitpropdef
(
1688 n_doc
: nullable ADoc,
1689 n_kwredef
: nullable TKwredef,
1690 n_visibility
: nullable AVisibility,
1691 n_kwinit
: nullable TKwinit,
1692 n_methid
: nullable AMethid,
1693 n_signature
: nullable ASignature,
1694 n_block
: nullable AExpr
1699 if n_doc
!= null then
1702 _n_kwredef
= n_kwredef
1703 if n_kwredef
!= null then
1704 n_kwredef
.parent
= self
1706 _n_visibility
= n_visibility
.as(not null)
1707 n_visibility
.parent
= self
1708 _n_kwinit
= n_kwinit
.as(not null)
1709 n_kwinit
.parent
= self
1710 _n_methid
= n_methid
1711 if n_methid
!= null then
1712 n_methid
.parent
= self
1714 _n_signature
= n_signature
.as(not null)
1715 n_signature
.parent
= self
1717 if n_block
!= null then
1718 n_block
.parent
= self
1722 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1724 if _n_doc
== old_child
then
1725 if new_child
!= null then
1726 new_child
.parent
= self
1727 assert new_child
isa ADoc
1734 if _n_kwredef
== old_child
then
1735 if new_child
!= null then
1736 new_child
.parent
= self
1737 assert new_child
isa TKwredef
1738 _n_kwredef
= new_child
1744 if _n_visibility
== old_child
then
1745 if new_child
!= null then
1746 new_child
.parent
= self
1747 assert new_child
isa AVisibility
1748 _n_visibility
= new_child
1754 if _n_kwinit
== old_child
then
1755 if new_child
!= null then
1756 new_child
.parent
= self
1757 assert new_child
isa TKwinit
1758 _n_kwinit
= new_child
1764 if _n_methid
== old_child
then
1765 if new_child
!= null then
1766 new_child
.parent
= self
1767 assert new_child
isa AMethid
1768 _n_methid
= new_child
1774 if _n_signature
== old_child
then
1775 if new_child
!= null then
1776 new_child
.parent
= self
1777 assert new_child
isa ASignature
1778 _n_signature
= new_child
1784 if _n_block
== old_child
then
1785 if new_child
!= null then
1786 new_child
.parent
= self
1787 assert new_child
isa AExpr
1788 _n_block
= new_child
1796 redef fun visit_all
(v
: Visitor)
1798 if _n_doc
!= null then
1799 v
.enter_visit
(_n_doc
.as(not null))
1801 if _n_kwredef
!= null then
1802 v
.enter_visit
(_n_kwredef
.as(not null))
1804 v
.enter_visit
(_n_visibility
)
1805 v
.enter_visit
(_n_kwinit
)
1806 if _n_methid
!= null then
1807 v
.enter_visit
(_n_methid
.as(not null))
1809 v
.enter_visit
(_n_signature
)
1810 if _n_block
!= null then
1811 v
.enter_visit
(_n_block
.as(not null))
1815 redef class AMainMethPropdef
1816 private init empty_init
do end
1818 init init_amainmethpropdef
(
1819 n_kwredef
: nullable TKwredef,
1820 n_block
: nullable AExpr
1824 _n_kwredef
= n_kwredef
1825 if n_kwredef
!= null then
1826 n_kwredef
.parent
= self
1829 if n_block
!= null then
1830 n_block
.parent
= self
1834 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1836 if _n_kwredef
== old_child
then
1837 if new_child
!= null then
1838 new_child
.parent
= self
1839 assert new_child
isa TKwredef
1840 _n_kwredef
= new_child
1846 if _n_block
== old_child
then
1847 if new_child
!= null then
1848 new_child
.parent
= self
1849 assert new_child
isa AExpr
1850 _n_block
= new_child
1858 redef fun visit_all
(v
: Visitor)
1860 if _n_kwredef
!= null then
1861 v
.enter_visit
(_n_kwredef
.as(not null))
1863 if _n_block
!= null then
1864 v
.enter_visit
(_n_block
.as(not null))
1868 redef class ATypePropdef
1869 private init empty_init
do end
1871 init init_atypepropdef
(
1872 n_doc
: nullable ADoc,
1873 n_kwredef
: nullable TKwredef,
1874 n_visibility
: nullable AVisibility,
1875 n_kwtype
: nullable TKwtype,
1876 n_id
: nullable TClassid,
1877 n_type
: nullable AType
1882 if n_doc
!= null then
1885 _n_kwredef
= n_kwredef
1886 if n_kwredef
!= null then
1887 n_kwredef
.parent
= self
1889 _n_visibility
= n_visibility
.as(not null)
1890 n_visibility
.parent
= self
1891 _n_kwtype
= n_kwtype
.as(not null)
1892 n_kwtype
.parent
= self
1893 _n_id
= n_id
.as(not null)
1895 _n_type
= n_type
.as(not null)
1896 n_type
.parent
= self
1899 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1901 if _n_doc
== old_child
then
1902 if new_child
!= null then
1903 new_child
.parent
= self
1904 assert new_child
isa ADoc
1911 if _n_kwredef
== old_child
then
1912 if new_child
!= null then
1913 new_child
.parent
= self
1914 assert new_child
isa TKwredef
1915 _n_kwredef
= new_child
1921 if _n_visibility
== old_child
then
1922 if new_child
!= null then
1923 new_child
.parent
= self
1924 assert new_child
isa AVisibility
1925 _n_visibility
= new_child
1931 if _n_kwtype
== old_child
then
1932 if new_child
!= null then
1933 new_child
.parent
= self
1934 assert new_child
isa TKwtype
1935 _n_kwtype
= new_child
1941 if _n_id
== old_child
then
1942 if new_child
!= null then
1943 new_child
.parent
= self
1944 assert new_child
isa TClassid
1951 if _n_type
== old_child
then
1952 if new_child
!= null then
1953 new_child
.parent
= self
1954 assert new_child
isa AType
1963 redef fun visit_all
(v
: Visitor)
1965 if _n_doc
!= null then
1966 v
.enter_visit
(_n_doc
.as(not null))
1968 if _n_kwredef
!= null then
1969 v
.enter_visit
(_n_kwredef
.as(not null))
1971 v
.enter_visit
(_n_visibility
)
1972 v
.enter_visit
(_n_kwtype
)
1973 v
.enter_visit
(_n_id
)
1974 v
.enter_visit
(_n_type
)
1977 redef class AReadAble
1978 private init empty_init
do end
1980 init init_areadable
(
1981 n_kwredef
: nullable TKwredef,
1982 n_kwreadable
: nullable TKwreadable
1986 _n_kwredef
= n_kwredef
1987 if n_kwredef
!= null then
1988 n_kwredef
.parent
= self
1990 _n_kwreadable
= n_kwreadable
.as(not null)
1991 n_kwreadable
.parent
= self
1994 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1996 if _n_kwredef
== old_child
then
1997 if new_child
!= null then
1998 new_child
.parent
= self
1999 assert new_child
isa TKwredef
2000 _n_kwredef
= new_child
2006 if _n_kwreadable
== old_child
then
2007 if new_child
!= null then
2008 new_child
.parent
= self
2009 assert new_child
isa TKwreadable
2010 _n_kwreadable
= new_child
2018 redef fun visit_all
(v
: Visitor)
2020 if _n_kwredef
!= null then
2021 v
.enter_visit
(_n_kwredef
.as(not null))
2023 v
.enter_visit
(_n_kwreadable
)
2026 redef class AWriteAble
2027 private init empty_init
do end
2029 init init_awriteable
(
2030 n_kwredef
: nullable TKwredef,
2031 n_visibility
: nullable AVisibility,
2032 n_kwwritable
: nullable TKwwritable
2036 _n_kwredef
= n_kwredef
2037 if n_kwredef
!= null then
2038 n_kwredef
.parent
= self
2040 _n_visibility
= n_visibility
2041 if n_visibility
!= null then
2042 n_visibility
.parent
= self
2044 _n_kwwritable
= n_kwwritable
.as(not null)
2045 n_kwwritable
.parent
= self
2048 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2050 if _n_kwredef
== old_child
then
2051 if new_child
!= null then
2052 new_child
.parent
= self
2053 assert new_child
isa TKwredef
2054 _n_kwredef
= new_child
2060 if _n_visibility
== old_child
then
2061 if new_child
!= null then
2062 new_child
.parent
= self
2063 assert new_child
isa AVisibility
2064 _n_visibility
= new_child
2066 _n_visibility
= null
2070 if _n_kwwritable
== old_child
then
2071 if new_child
!= null then
2072 new_child
.parent
= self
2073 assert new_child
isa TKwwritable
2074 _n_kwwritable
= new_child
2082 redef fun visit_all
(v
: Visitor)
2084 if _n_kwredef
!= null then
2085 v
.enter_visit
(_n_kwredef
.as(not null))
2087 if _n_visibility
!= null then
2088 v
.enter_visit
(_n_visibility
.as(not null))
2090 v
.enter_visit
(_n_kwwritable
)
2093 redef class AIdMethid
2094 private init empty_init
do end
2096 init init_aidmethid
(
2101 _n_id
= n_id
.as(not null)
2105 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2107 if _n_id
== old_child
then
2108 if new_child
!= null then
2109 new_child
.parent
= self
2110 assert new_child
isa TId
2119 redef fun visit_all
(v
: Visitor)
2121 v
.enter_visit
(_n_id
)
2124 redef class APlusMethid
2125 private init empty_init
do end
2127 init init_aplusmethid
(
2128 n_plus
: nullable TPlus
2132 _n_plus
= n_plus
.as(not null)
2133 n_plus
.parent
= self
2136 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2138 if _n_plus
== old_child
then
2139 if new_child
!= null then
2140 new_child
.parent
= self
2141 assert new_child
isa TPlus
2150 redef fun visit_all
(v
: Visitor)
2152 v
.enter_visit
(_n_plus
)
2155 redef class AMinusMethid
2156 private init empty_init
do end
2158 init init_aminusmethid
(
2159 n_minus
: nullable TMinus
2163 _n_minus
= n_minus
.as(not null)
2164 n_minus
.parent
= self
2167 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2169 if _n_minus
== old_child
then
2170 if new_child
!= null then
2171 new_child
.parent
= self
2172 assert new_child
isa TMinus
2173 _n_minus
= new_child
2181 redef fun visit_all
(v
: Visitor)
2183 v
.enter_visit
(_n_minus
)
2186 redef class AStarMethid
2187 private init empty_init
do end
2189 init init_astarmethid
(
2190 n_star
: nullable TStar
2194 _n_star
= n_star
.as(not null)
2195 n_star
.parent
= self
2198 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2200 if _n_star
== old_child
then
2201 if new_child
!= null then
2202 new_child
.parent
= self
2203 assert new_child
isa TStar
2212 redef fun visit_all
(v
: Visitor)
2214 v
.enter_visit
(_n_star
)
2217 redef class ASlashMethid
2218 private init empty_init
do end
2220 init init_aslashmethid
(
2221 n_slash
: nullable TSlash
2225 _n_slash
= n_slash
.as(not null)
2226 n_slash
.parent
= self
2229 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2231 if _n_slash
== old_child
then
2232 if new_child
!= null then
2233 new_child
.parent
= self
2234 assert new_child
isa TSlash
2235 _n_slash
= new_child
2243 redef fun visit_all
(v
: Visitor)
2245 v
.enter_visit
(_n_slash
)
2248 redef class APercentMethid
2249 private init empty_init
do end
2251 init init_apercentmethid
(
2252 n_percent
: nullable TPercent
2256 _n_percent
= n_percent
.as(not null)
2257 n_percent
.parent
= self
2260 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2262 if _n_percent
== old_child
then
2263 if new_child
!= null then
2264 new_child
.parent
= self
2265 assert new_child
isa TPercent
2266 _n_percent
= new_child
2274 redef fun visit_all
(v
: Visitor)
2276 v
.enter_visit
(_n_percent
)
2279 redef class AEqMethid
2280 private init empty_init
do end
2282 init init_aeqmethid
(
2287 _n_eq
= n_eq
.as(not null)
2291 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2293 if _n_eq
== old_child
then
2294 if new_child
!= null then
2295 new_child
.parent
= self
2296 assert new_child
isa TEq
2305 redef fun visit_all
(v
: Visitor)
2307 v
.enter_visit
(_n_eq
)
2310 redef class ANeMethid
2311 private init empty_init
do end
2313 init init_anemethid
(
2318 _n_ne
= n_ne
.as(not null)
2322 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2324 if _n_ne
== old_child
then
2325 if new_child
!= null then
2326 new_child
.parent
= self
2327 assert new_child
isa TNe
2336 redef fun visit_all
(v
: Visitor)
2338 v
.enter_visit
(_n_ne
)
2341 redef class ALeMethid
2342 private init empty_init
do end
2344 init init_alemethid
(
2349 _n_le
= n_le
.as(not null)
2353 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2355 if _n_le
== old_child
then
2356 if new_child
!= null then
2357 new_child
.parent
= self
2358 assert new_child
isa TLe
2367 redef fun visit_all
(v
: Visitor)
2369 v
.enter_visit
(_n_le
)
2372 redef class AGeMethid
2373 private init empty_init
do end
2375 init init_agemethid
(
2380 _n_ge
= n_ge
.as(not null)
2384 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2386 if _n_ge
== old_child
then
2387 if new_child
!= null then
2388 new_child
.parent
= self
2389 assert new_child
isa TGe
2398 redef fun visit_all
(v
: Visitor)
2400 v
.enter_visit
(_n_ge
)
2403 redef class ALtMethid
2404 private init empty_init
do end
2406 init init_altmethid
(
2411 _n_lt
= n_lt
.as(not null)
2415 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2417 if _n_lt
== old_child
then
2418 if new_child
!= null then
2419 new_child
.parent
= self
2420 assert new_child
isa TLt
2429 redef fun visit_all
(v
: Visitor)
2431 v
.enter_visit
(_n_lt
)
2434 redef class AGtMethid
2435 private init empty_init
do end
2437 init init_agtmethid
(
2442 _n_gt
= n_gt
.as(not null)
2446 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2448 if _n_gt
== old_child
then
2449 if new_child
!= null then
2450 new_child
.parent
= self
2451 assert new_child
isa TGt
2460 redef fun visit_all
(v
: Visitor)
2462 v
.enter_visit
(_n_gt
)
2465 redef class ABraMethid
2466 private init empty_init
do end
2468 init init_abramethid
(
2469 n_obra
: nullable TObra,
2470 n_cbra
: nullable TCbra
2474 _n_obra
= n_obra
.as(not null)
2475 n_obra
.parent
= self
2476 _n_cbra
= n_cbra
.as(not null)
2477 n_cbra
.parent
= self
2480 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2482 if _n_obra
== old_child
then
2483 if new_child
!= null then
2484 new_child
.parent
= self
2485 assert new_child
isa TObra
2492 if _n_cbra
== old_child
then
2493 if new_child
!= null then
2494 new_child
.parent
= self
2495 assert new_child
isa TCbra
2504 redef fun visit_all
(v
: Visitor)
2506 v
.enter_visit
(_n_obra
)
2507 v
.enter_visit
(_n_cbra
)
2510 redef class AStarshipMethid
2511 private init empty_init
do end
2513 init init_astarshipmethid
(
2514 n_starship
: nullable TStarship
2518 _n_starship
= n_starship
.as(not null)
2519 n_starship
.parent
= self
2522 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2524 if _n_starship
== old_child
then
2525 if new_child
!= null then
2526 new_child
.parent
= self
2527 assert new_child
isa TStarship
2528 _n_starship
= new_child
2536 redef fun visit_all
(v
: Visitor)
2538 v
.enter_visit
(_n_starship
)
2541 redef class AAssignMethid
2542 private init empty_init
do end
2544 init init_aassignmethid
(
2546 n_assign
: nullable TAssign
2550 _n_id
= n_id
.as(not null)
2552 _n_assign
= n_assign
.as(not null)
2553 n_assign
.parent
= self
2556 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2558 if _n_id
== old_child
then
2559 if new_child
!= null then
2560 new_child
.parent
= self
2561 assert new_child
isa TId
2568 if _n_assign
== old_child
then
2569 if new_child
!= null then
2570 new_child
.parent
= self
2571 assert new_child
isa TAssign
2572 _n_assign
= new_child
2580 redef fun visit_all
(v
: Visitor)
2582 v
.enter_visit
(_n_id
)
2583 v
.enter_visit
(_n_assign
)
2586 redef class ABraassignMethid
2587 private init empty_init
do end
2589 init init_abraassignmethid
(
2590 n_obra
: nullable TObra,
2591 n_cbra
: nullable TCbra,
2592 n_assign
: nullable TAssign
2596 _n_obra
= n_obra
.as(not null)
2597 n_obra
.parent
= self
2598 _n_cbra
= n_cbra
.as(not null)
2599 n_cbra
.parent
= self
2600 _n_assign
= n_assign
.as(not null)
2601 n_assign
.parent
= self
2604 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2606 if _n_obra
== old_child
then
2607 if new_child
!= null then
2608 new_child
.parent
= self
2609 assert new_child
isa TObra
2616 if _n_cbra
== old_child
then
2617 if new_child
!= null then
2618 new_child
.parent
= self
2619 assert new_child
isa TCbra
2626 if _n_assign
== old_child
then
2627 if new_child
!= null then
2628 new_child
.parent
= self
2629 assert new_child
isa TAssign
2630 _n_assign
= new_child
2638 redef fun visit_all
(v
: Visitor)
2640 v
.enter_visit
(_n_obra
)
2641 v
.enter_visit
(_n_cbra
)
2642 v
.enter_visit
(_n_assign
)
2645 redef class ASignature
2646 private init empty_init
do end
2648 init init_asignature
(
2649 n_params
: Collection[Object], # Should be Collection[AParam]
2650 n_type
: nullable AType,
2651 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2655 for n
in n_params
do
2661 if n_type
!= null then
2662 n_type
.parent
= self
2664 for n
in n_closure_decls
do
2665 assert n
isa AClosureDecl
2666 _n_closure_decls
.add
(n
)
2671 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2673 for i
in [0.._n_params
.length
[ do
2674 if _n_params
[i
] == old_child
then
2675 if new_child
!= null then
2676 assert new_child
isa AParam
2677 _n_params
[i
] = new_child
2678 new_child
.parent
= self
2680 _n_params
.remove_at
(i
)
2685 if _n_type
== old_child
then
2686 if new_child
!= null then
2687 new_child
.parent
= self
2688 assert new_child
isa AType
2695 for i
in [0.._n_closure_decls
.length
[ do
2696 if _n_closure_decls
[i
] == old_child
then
2697 if new_child
!= null then
2698 assert new_child
isa AClosureDecl
2699 _n_closure_decls
[i
] = new_child
2700 new_child
.parent
= self
2702 _n_closure_decls
.remove_at
(i
)
2709 redef fun visit_all
(v
: Visitor)
2711 for n
in _n_params
do
2714 if _n_type
!= null then
2715 v
.enter_visit
(_n_type
.as(not null))
2717 for n
in _n_closure_decls
do
2723 private init empty_init
do end
2727 n_type
: nullable AType,
2728 n_dotdotdot
: nullable TDotdotdot
2732 _n_id
= n_id
.as(not null)
2735 if n_type
!= null then
2736 n_type
.parent
= self
2738 _n_dotdotdot
= n_dotdotdot
2739 if n_dotdotdot
!= null then
2740 n_dotdotdot
.parent
= self
2744 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2746 if _n_id
== old_child
then
2747 if new_child
!= null then
2748 new_child
.parent
= self
2749 assert new_child
isa TId
2756 if _n_type
== old_child
then
2757 if new_child
!= null then
2758 new_child
.parent
= self
2759 assert new_child
isa AType
2766 if _n_dotdotdot
== old_child
then
2767 if new_child
!= null then
2768 new_child
.parent
= self
2769 assert new_child
isa TDotdotdot
2770 _n_dotdotdot
= new_child
2778 redef fun visit_all
(v
: Visitor)
2780 v
.enter_visit
(_n_id
)
2781 if _n_type
!= null then
2782 v
.enter_visit
(_n_type
.as(not null))
2784 if _n_dotdotdot
!= null then
2785 v
.enter_visit
(_n_dotdotdot
.as(not null))
2789 redef class AClosureDecl
2790 private init empty_init
do end
2792 init init_aclosuredecl
(
2793 n_kwbreak
: nullable TKwbreak,
2794 n_bang
: nullable TBang,
2796 n_signature
: nullable ASignature,
2797 n_expr
: nullable AExpr
2801 _n_kwbreak
= n_kwbreak
2802 if n_kwbreak
!= null then
2803 n_kwbreak
.parent
= self
2805 _n_bang
= n_bang
.as(not null)
2806 n_bang
.parent
= self
2807 _n_id
= n_id
.as(not null)
2809 _n_signature
= n_signature
.as(not null)
2810 n_signature
.parent
= self
2812 if n_expr
!= null then
2813 n_expr
.parent
= self
2817 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2819 if _n_kwbreak
== old_child
then
2820 if new_child
!= null then
2821 new_child
.parent
= self
2822 assert new_child
isa TKwbreak
2823 _n_kwbreak
= new_child
2829 if _n_bang
== old_child
then
2830 if new_child
!= null then
2831 new_child
.parent
= self
2832 assert new_child
isa TBang
2839 if _n_id
== old_child
then
2840 if new_child
!= null then
2841 new_child
.parent
= self
2842 assert new_child
isa TId
2849 if _n_signature
== old_child
then
2850 if new_child
!= null then
2851 new_child
.parent
= self
2852 assert new_child
isa ASignature
2853 _n_signature
= new_child
2859 if _n_expr
== old_child
then
2860 if new_child
!= null then
2861 new_child
.parent
= self
2862 assert new_child
isa AExpr
2871 redef fun visit_all
(v
: Visitor)
2873 if _n_kwbreak
!= null then
2874 v
.enter_visit
(_n_kwbreak
.as(not null))
2876 v
.enter_visit
(_n_bang
)
2877 v
.enter_visit
(_n_id
)
2878 v
.enter_visit
(_n_signature
)
2879 if _n_expr
!= null then
2880 v
.enter_visit
(_n_expr
.as(not null))
2885 private init empty_init
do end
2888 n_kwnullable
: nullable TKwnullable,
2889 n_id
: nullable TClassid,
2890 n_types
: Collection[Object] # Should be Collection[AType]
2894 _n_kwnullable
= n_kwnullable
2895 if n_kwnullable
!= null then
2896 n_kwnullable
.parent
= self
2898 _n_id
= n_id
.as(not null)
2907 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2909 if _n_kwnullable
== old_child
then
2910 if new_child
!= null then
2911 new_child
.parent
= self
2912 assert new_child
isa TKwnullable
2913 _n_kwnullable
= new_child
2915 _n_kwnullable
= null
2919 if _n_id
== old_child
then
2920 if new_child
!= null then
2921 new_child
.parent
= self
2922 assert new_child
isa TClassid
2929 for i
in [0.._n_types
.length
[ do
2930 if _n_types
[i
] == old_child
then
2931 if new_child
!= null then
2932 assert new_child
isa AType
2933 _n_types
[i
] = new_child
2934 new_child
.parent
= self
2936 _n_types
.remove_at
(i
)
2943 redef fun visit_all
(v
: Visitor)
2945 if _n_kwnullable
!= null then
2946 v
.enter_visit
(_n_kwnullable
.as(not null))
2948 v
.enter_visit
(_n_id
)
2949 for n
in _n_types
do
2955 private init empty_init
do end
2958 n_kwlabel
: nullable TKwlabel,
2963 _n_kwlabel
= n_kwlabel
.as(not null)
2964 n_kwlabel
.parent
= self
2965 _n_id
= n_id
.as(not null)
2969 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2971 if _n_kwlabel
== old_child
then
2972 if new_child
!= null then
2973 new_child
.parent
= self
2974 assert new_child
isa TKwlabel
2975 _n_kwlabel
= new_child
2981 if _n_id
== old_child
then
2982 if new_child
!= null then
2983 new_child
.parent
= self
2984 assert new_child
isa TId
2993 redef fun visit_all
(v
: Visitor)
2995 v
.enter_visit
(_n_kwlabel
)
2996 v
.enter_visit
(_n_id
)
2999 redef class ABlockExpr
3000 private init empty_init
do end
3002 init init_ablockexpr
(
3003 n_expr
: Collection[Object] # Should be Collection[AExpr]
3014 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3016 for i
in [0.._n_expr
.length
[ do
3017 if _n_expr
[i
] == old_child
then
3018 if new_child
!= null then
3019 assert new_child
isa AExpr
3020 _n_expr
[i
] = new_child
3021 new_child
.parent
= self
3023 _n_expr
.remove_at
(i
)
3030 redef fun visit_all
(v
: Visitor)
3037 redef class AVardeclExpr
3038 private init empty_init
do end
3040 init init_avardeclexpr
(
3041 n_kwvar
: nullable TKwvar,
3043 n_type
: nullable AType,
3044 n_assign
: nullable TAssign,
3045 n_expr
: nullable AExpr
3049 _n_kwvar
= n_kwvar
.as(not null)
3050 n_kwvar
.parent
= self
3051 _n_id
= n_id
.as(not null)
3054 if n_type
!= null then
3055 n_type
.parent
= self
3057 _n_assign
= n_assign
3058 if n_assign
!= null then
3059 n_assign
.parent
= self
3062 if n_expr
!= null then
3063 n_expr
.parent
= self
3067 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3069 if _n_kwvar
== old_child
then
3070 if new_child
!= null then
3071 new_child
.parent
= self
3072 assert new_child
isa TKwvar
3073 _n_kwvar
= new_child
3079 if _n_id
== old_child
then
3080 if new_child
!= null then
3081 new_child
.parent
= self
3082 assert new_child
isa TId
3089 if _n_type
== old_child
then
3090 if new_child
!= null then
3091 new_child
.parent
= self
3092 assert new_child
isa AType
3099 if _n_assign
== old_child
then
3100 if new_child
!= null then
3101 new_child
.parent
= self
3102 assert new_child
isa TAssign
3103 _n_assign
= new_child
3109 if _n_expr
== old_child
then
3110 if new_child
!= null then
3111 new_child
.parent
= self
3112 assert new_child
isa AExpr
3121 redef fun visit_all
(v
: Visitor)
3123 v
.enter_visit
(_n_kwvar
)
3124 v
.enter_visit
(_n_id
)
3125 if _n_type
!= null then
3126 v
.enter_visit
(_n_type
.as(not null))
3128 if _n_assign
!= null then
3129 v
.enter_visit
(_n_assign
.as(not null))
3131 if _n_expr
!= null then
3132 v
.enter_visit
(_n_expr
.as(not null))
3136 redef class AReturnExpr
3137 private init empty_init
do end
3139 init init_areturnexpr
(
3140 n_kwreturn
: nullable TKwreturn,
3141 n_expr
: nullable AExpr
3145 _n_kwreturn
= n_kwreturn
3146 if n_kwreturn
!= null then
3147 n_kwreturn
.parent
= self
3150 if n_expr
!= null then
3151 n_expr
.parent
= self
3155 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3157 if _n_kwreturn
== old_child
then
3158 if new_child
!= null then
3159 new_child
.parent
= self
3160 assert new_child
isa TKwreturn
3161 _n_kwreturn
= new_child
3167 if _n_expr
== old_child
then
3168 if new_child
!= null then
3169 new_child
.parent
= self
3170 assert new_child
isa AExpr
3179 redef fun visit_all
(v
: Visitor)
3181 if _n_kwreturn
!= null then
3182 v
.enter_visit
(_n_kwreturn
.as(not null))
3184 if _n_expr
!= null then
3185 v
.enter_visit
(_n_expr
.as(not null))
3189 redef class ABreakExpr
3190 private init empty_init
do end
3192 init init_abreakexpr
(
3193 n_kwbreak
: nullable TKwbreak,
3194 n_label
: nullable ALabel,
3195 n_expr
: nullable AExpr
3199 _n_kwbreak
= n_kwbreak
.as(not null)
3200 n_kwbreak
.parent
= self
3202 if n_label
!= null then
3203 n_label
.parent
= self
3206 if n_expr
!= null then
3207 n_expr
.parent
= self
3211 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3213 if _n_kwbreak
== old_child
then
3214 if new_child
!= null then
3215 new_child
.parent
= self
3216 assert new_child
isa TKwbreak
3217 _n_kwbreak
= new_child
3223 if _n_label
== old_child
then
3224 if new_child
!= null then
3225 new_child
.parent
= self
3226 assert new_child
isa ALabel
3227 _n_label
= new_child
3233 if _n_expr
== old_child
then
3234 if new_child
!= null then
3235 new_child
.parent
= self
3236 assert new_child
isa AExpr
3245 redef fun visit_all
(v
: Visitor)
3247 v
.enter_visit
(_n_kwbreak
)
3248 if _n_label
!= null then
3249 v
.enter_visit
(_n_label
.as(not null))
3251 if _n_expr
!= null then
3252 v
.enter_visit
(_n_expr
.as(not null))
3256 redef class AAbortExpr
3257 private init empty_init
do end
3259 init init_aabortexpr
(
3260 n_kwabort
: nullable TKwabort
3264 _n_kwabort
= n_kwabort
.as(not null)
3265 n_kwabort
.parent
= self
3268 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3270 if _n_kwabort
== old_child
then
3271 if new_child
!= null then
3272 new_child
.parent
= self
3273 assert new_child
isa TKwabort
3274 _n_kwabort
= new_child
3282 redef fun visit_all
(v
: Visitor)
3284 v
.enter_visit
(_n_kwabort
)
3287 redef class AContinueExpr
3288 private init empty_init
do end
3290 init init_acontinueexpr
(
3291 n_kwcontinue
: nullable TKwcontinue,
3292 n_label
: nullable ALabel,
3293 n_expr
: nullable AExpr
3297 _n_kwcontinue
= n_kwcontinue
3298 if n_kwcontinue
!= null then
3299 n_kwcontinue
.parent
= self
3302 if n_label
!= null then
3303 n_label
.parent
= self
3306 if n_expr
!= null then
3307 n_expr
.parent
= self
3311 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3313 if _n_kwcontinue
== old_child
then
3314 if new_child
!= null then
3315 new_child
.parent
= self
3316 assert new_child
isa TKwcontinue
3317 _n_kwcontinue
= new_child
3319 _n_kwcontinue
= null
3323 if _n_label
== old_child
then
3324 if new_child
!= null then
3325 new_child
.parent
= self
3326 assert new_child
isa ALabel
3327 _n_label
= new_child
3333 if _n_expr
== old_child
then
3334 if new_child
!= null then
3335 new_child
.parent
= self
3336 assert new_child
isa AExpr
3345 redef fun visit_all
(v
: Visitor)
3347 if _n_kwcontinue
!= null then
3348 v
.enter_visit
(_n_kwcontinue
.as(not null))
3350 if _n_label
!= null then
3351 v
.enter_visit
(_n_label
.as(not null))
3353 if _n_expr
!= null then
3354 v
.enter_visit
(_n_expr
.as(not null))
3359 private init empty_init
do end
3362 n_kwdo
: nullable TKwdo,
3363 n_block
: nullable AExpr,
3364 n_label
: nullable ALabel
3368 _n_kwdo
= n_kwdo
.as(not null)
3369 n_kwdo
.parent
= self
3371 if n_block
!= null then
3372 n_block
.parent
= self
3375 if n_label
!= null then
3376 n_label
.parent
= self
3380 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3382 if _n_kwdo
== old_child
then
3383 if new_child
!= null then
3384 new_child
.parent
= self
3385 assert new_child
isa TKwdo
3392 if _n_block
== old_child
then
3393 if new_child
!= null then
3394 new_child
.parent
= self
3395 assert new_child
isa AExpr
3396 _n_block
= new_child
3402 if _n_label
== old_child
then
3403 if new_child
!= null then
3404 new_child
.parent
= self
3405 assert new_child
isa ALabel
3406 _n_label
= new_child
3414 redef fun visit_all
(v
: Visitor)
3416 v
.enter_visit
(_n_kwdo
)
3417 if _n_block
!= null then
3418 v
.enter_visit
(_n_block
.as(not null))
3420 if _n_label
!= null then
3421 v
.enter_visit
(_n_label
.as(not null))
3426 private init empty_init
do end
3429 n_kwif
: nullable TKwif,
3430 n_expr
: nullable AExpr,
3431 n_then
: nullable AExpr,
3432 n_else
: nullable AExpr
3436 _n_kwif
= n_kwif
.as(not null)
3437 n_kwif
.parent
= self
3438 _n_expr
= n_expr
.as(not null)
3439 n_expr
.parent
= self
3441 if n_then
!= null then
3442 n_then
.parent
= self
3445 if n_else
!= null then
3446 n_else
.parent
= self
3450 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3452 if _n_kwif
== old_child
then
3453 if new_child
!= null then
3454 new_child
.parent
= self
3455 assert new_child
isa TKwif
3462 if _n_expr
== old_child
then
3463 if new_child
!= null then
3464 new_child
.parent
= self
3465 assert new_child
isa AExpr
3472 if _n_then
== old_child
then
3473 if new_child
!= null then
3474 new_child
.parent
= self
3475 assert new_child
isa AExpr
3482 if _n_else
== old_child
then
3483 if new_child
!= null then
3484 new_child
.parent
= self
3485 assert new_child
isa AExpr
3494 redef fun visit_all
(v
: Visitor)
3496 v
.enter_visit
(_n_kwif
)
3497 v
.enter_visit
(_n_expr
)
3498 if _n_then
!= null then
3499 v
.enter_visit
(_n_then
.as(not null))
3501 if _n_else
!= null then
3502 v
.enter_visit
(_n_else
.as(not null))
3506 redef class AIfexprExpr
3507 private init empty_init
do end
3509 init init_aifexprexpr
(
3510 n_kwif
: nullable TKwif,
3511 n_expr
: nullable AExpr,
3512 n_kwthen
: nullable TKwthen,
3513 n_then
: nullable AExpr,
3514 n_kwelse
: nullable TKwelse,
3515 n_else
: nullable AExpr
3519 _n_kwif
= n_kwif
.as(not null)
3520 n_kwif
.parent
= self
3521 _n_expr
= n_expr
.as(not null)
3522 n_expr
.parent
= self
3523 _n_kwthen
= n_kwthen
.as(not null)
3524 n_kwthen
.parent
= self
3525 _n_then
= n_then
.as(not null)
3526 n_then
.parent
= self
3527 _n_kwelse
= n_kwelse
.as(not null)
3528 n_kwelse
.parent
= self
3529 _n_else
= n_else
.as(not null)
3530 n_else
.parent
= self
3533 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3535 if _n_kwif
== old_child
then
3536 if new_child
!= null then
3537 new_child
.parent
= self
3538 assert new_child
isa TKwif
3545 if _n_expr
== old_child
then
3546 if new_child
!= null then
3547 new_child
.parent
= self
3548 assert new_child
isa AExpr
3555 if _n_kwthen
== old_child
then
3556 if new_child
!= null then
3557 new_child
.parent
= self
3558 assert new_child
isa TKwthen
3559 _n_kwthen
= new_child
3565 if _n_then
== old_child
then
3566 if new_child
!= null then
3567 new_child
.parent
= self
3568 assert new_child
isa AExpr
3575 if _n_kwelse
== old_child
then
3576 if new_child
!= null then
3577 new_child
.parent
= self
3578 assert new_child
isa TKwelse
3579 _n_kwelse
= new_child
3585 if _n_else
== old_child
then
3586 if new_child
!= null then
3587 new_child
.parent
= self
3588 assert new_child
isa AExpr
3597 redef fun visit_all
(v
: Visitor)
3599 v
.enter_visit
(_n_kwif
)
3600 v
.enter_visit
(_n_expr
)
3601 v
.enter_visit
(_n_kwthen
)
3602 v
.enter_visit
(_n_then
)
3603 v
.enter_visit
(_n_kwelse
)
3604 v
.enter_visit
(_n_else
)
3607 redef class AWhileExpr
3608 private init empty_init
do end
3610 init init_awhileexpr
(
3611 n_kwwhile
: nullable TKwwhile,
3612 n_expr
: nullable AExpr,
3613 n_kwdo
: nullable TKwdo,
3614 n_block
: nullable AExpr,
3615 n_label
: nullable ALabel
3619 _n_kwwhile
= n_kwwhile
.as(not null)
3620 n_kwwhile
.parent
= self
3621 _n_expr
= n_expr
.as(not null)
3622 n_expr
.parent
= self
3623 _n_kwdo
= n_kwdo
.as(not null)
3624 n_kwdo
.parent
= self
3626 if n_block
!= null then
3627 n_block
.parent
= self
3630 if n_label
!= null then
3631 n_label
.parent
= self
3635 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3637 if _n_kwwhile
== old_child
then
3638 if new_child
!= null then
3639 new_child
.parent
= self
3640 assert new_child
isa TKwwhile
3641 _n_kwwhile
= new_child
3647 if _n_expr
== old_child
then
3648 if new_child
!= null then
3649 new_child
.parent
= self
3650 assert new_child
isa AExpr
3657 if _n_kwdo
== old_child
then
3658 if new_child
!= null then
3659 new_child
.parent
= self
3660 assert new_child
isa TKwdo
3667 if _n_block
== old_child
then
3668 if new_child
!= null then
3669 new_child
.parent
= self
3670 assert new_child
isa AExpr
3671 _n_block
= new_child
3677 if _n_label
== old_child
then
3678 if new_child
!= null then
3679 new_child
.parent
= self
3680 assert new_child
isa ALabel
3681 _n_label
= new_child
3689 redef fun visit_all
(v
: Visitor)
3691 v
.enter_visit
(_n_kwwhile
)
3692 v
.enter_visit
(_n_expr
)
3693 v
.enter_visit
(_n_kwdo
)
3694 if _n_block
!= null then
3695 v
.enter_visit
(_n_block
.as(not null))
3697 if _n_label
!= null then
3698 v
.enter_visit
(_n_label
.as(not null))
3702 redef class ALoopExpr
3703 private init empty_init
do end
3705 init init_aloopexpr
(
3706 n_kwloop
: nullable TKwloop,
3707 n_block
: nullable AExpr,
3708 n_label
: nullable ALabel
3712 _n_kwloop
= n_kwloop
.as(not null)
3713 n_kwloop
.parent
= self
3715 if n_block
!= null then
3716 n_block
.parent
= self
3719 if n_label
!= null then
3720 n_label
.parent
= self
3724 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3726 if _n_kwloop
== old_child
then
3727 if new_child
!= null then
3728 new_child
.parent
= self
3729 assert new_child
isa TKwloop
3730 _n_kwloop
= new_child
3736 if _n_block
== old_child
then
3737 if new_child
!= null then
3738 new_child
.parent
= self
3739 assert new_child
isa AExpr
3740 _n_block
= new_child
3746 if _n_label
== old_child
then
3747 if new_child
!= null then
3748 new_child
.parent
= self
3749 assert new_child
isa ALabel
3750 _n_label
= new_child
3758 redef fun visit_all
(v
: Visitor)
3760 v
.enter_visit
(_n_kwloop
)
3761 if _n_block
!= null then
3762 v
.enter_visit
(_n_block
.as(not null))
3764 if _n_label
!= null then
3765 v
.enter_visit
(_n_label
.as(not null))
3769 redef class AForExpr
3770 private init empty_init
do end
3772 init init_aforexpr
(
3773 n_kwfor
: nullable TKwfor,
3775 n_expr
: nullable AExpr,
3776 n_kwdo
: nullable TKwdo,
3777 n_block
: nullable AExpr,
3778 n_label
: nullable ALabel
3782 _n_kwfor
= n_kwfor
.as(not null)
3783 n_kwfor
.parent
= self
3784 _n_id
= n_id
.as(not null)
3786 _n_expr
= n_expr
.as(not null)
3787 n_expr
.parent
= self
3788 _n_kwdo
= n_kwdo
.as(not null)
3789 n_kwdo
.parent
= self
3791 if n_block
!= null then
3792 n_block
.parent
= self
3795 if n_label
!= null then
3796 n_label
.parent
= self
3800 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3802 if _n_kwfor
== old_child
then
3803 if new_child
!= null then
3804 new_child
.parent
= self
3805 assert new_child
isa TKwfor
3806 _n_kwfor
= new_child
3812 if _n_id
== old_child
then
3813 if new_child
!= null then
3814 new_child
.parent
= self
3815 assert new_child
isa TId
3822 if _n_expr
== old_child
then
3823 if new_child
!= null then
3824 new_child
.parent
= self
3825 assert new_child
isa AExpr
3832 if _n_kwdo
== old_child
then
3833 if new_child
!= null then
3834 new_child
.parent
= self
3835 assert new_child
isa TKwdo
3842 if _n_block
== old_child
then
3843 if new_child
!= null then
3844 new_child
.parent
= self
3845 assert new_child
isa AExpr
3846 _n_block
= new_child
3852 if _n_label
== old_child
then
3853 if new_child
!= null then
3854 new_child
.parent
= self
3855 assert new_child
isa ALabel
3856 _n_label
= new_child
3864 redef fun visit_all
(v
: Visitor)
3866 v
.enter_visit
(_n_kwfor
)
3867 v
.enter_visit
(_n_id
)
3868 v
.enter_visit
(_n_expr
)
3869 v
.enter_visit
(_n_kwdo
)
3870 if _n_block
!= null then
3871 v
.enter_visit
(_n_block
.as(not null))
3873 if _n_label
!= null then
3874 v
.enter_visit
(_n_label
.as(not null))
3878 redef class AAssertExpr
3879 private init empty_init
do end
3881 init init_aassertexpr
(
3882 n_kwassert
: nullable TKwassert,
3884 n_expr
: nullable AExpr,
3885 n_else
: nullable AExpr
3889 _n_kwassert
= n_kwassert
.as(not null)
3890 n_kwassert
.parent
= self
3892 if n_id
!= null then
3895 _n_expr
= n_expr
.as(not null)
3896 n_expr
.parent
= self
3898 if n_else
!= null then
3899 n_else
.parent
= self
3903 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3905 if _n_kwassert
== old_child
then
3906 if new_child
!= null then
3907 new_child
.parent
= self
3908 assert new_child
isa TKwassert
3909 _n_kwassert
= new_child
3915 if _n_id
== old_child
then
3916 if new_child
!= null then
3917 new_child
.parent
= self
3918 assert new_child
isa TId
3925 if _n_expr
== old_child
then
3926 if new_child
!= null then
3927 new_child
.parent
= self
3928 assert new_child
isa AExpr
3935 if _n_else
== old_child
then
3936 if new_child
!= null then
3937 new_child
.parent
= self
3938 assert new_child
isa AExpr
3947 redef fun visit_all
(v
: Visitor)
3949 v
.enter_visit
(_n_kwassert
)
3950 if _n_id
!= null then
3951 v
.enter_visit
(_n_id
.as(not null))
3953 v
.enter_visit
(_n_expr
)
3954 if _n_else
!= null then
3955 v
.enter_visit
(_n_else
.as(not null))
3959 redef class AOnceExpr
3960 private init empty_init
do end
3962 init init_aonceexpr
(
3963 n_kwonce
: nullable TKwonce,
3964 n_expr
: nullable AExpr
3968 _n_kwonce
= n_kwonce
.as(not null)
3969 n_kwonce
.parent
= self
3970 _n_expr
= n_expr
.as(not null)
3971 n_expr
.parent
= self
3974 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3976 if _n_kwonce
== old_child
then
3977 if new_child
!= null then
3978 new_child
.parent
= self
3979 assert new_child
isa TKwonce
3980 _n_kwonce
= new_child
3986 if _n_expr
== old_child
then
3987 if new_child
!= null then
3988 new_child
.parent
= self
3989 assert new_child
isa AExpr
3998 redef fun visit_all
(v
: Visitor)
4000 v
.enter_visit
(_n_kwonce
)
4001 v
.enter_visit
(_n_expr
)
4004 redef class ASendExpr
4005 private init empty_init
do end
4007 init init_asendexpr
(
4008 n_expr
: nullable AExpr
4012 _n_expr
= n_expr
.as(not null)
4013 n_expr
.parent
= self
4016 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4018 if _n_expr
== old_child
then
4019 if new_child
!= null then
4020 new_child
.parent
= self
4021 assert new_child
isa AExpr
4030 redef fun visit_all
(v
: Visitor)
4032 v
.enter_visit
(_n_expr
)
4035 redef class ABinopExpr
4036 private init empty_init
do end
4038 init init_abinopexpr
(
4039 n_expr
: nullable AExpr,
4040 n_expr2
: nullable AExpr
4044 _n_expr
= n_expr
.as(not null)
4045 n_expr
.parent
= self
4046 _n_expr2
= n_expr2
.as(not null)
4047 n_expr2
.parent
= self
4050 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4052 if _n_expr
== old_child
then
4053 if new_child
!= null then
4054 new_child
.parent
= self
4055 assert new_child
isa AExpr
4062 if _n_expr2
== old_child
then
4063 if new_child
!= null then
4064 new_child
.parent
= self
4065 assert new_child
isa AExpr
4066 _n_expr2
= new_child
4074 redef fun visit_all
(v
: Visitor)
4076 v
.enter_visit
(_n_expr
)
4077 v
.enter_visit
(_n_expr2
)
4081 private init empty_init
do end
4084 n_expr
: nullable AExpr,
4085 n_expr2
: nullable AExpr
4089 _n_expr
= n_expr
.as(not null)
4090 n_expr
.parent
= self
4091 _n_expr2
= n_expr2
.as(not null)
4092 n_expr2
.parent
= self
4095 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4097 if _n_expr
== old_child
then
4098 if new_child
!= null then
4099 new_child
.parent
= self
4100 assert new_child
isa AExpr
4107 if _n_expr2
== old_child
then
4108 if new_child
!= null then
4109 new_child
.parent
= self
4110 assert new_child
isa AExpr
4111 _n_expr2
= new_child
4119 redef fun visit_all
(v
: Visitor)
4121 v
.enter_visit
(_n_expr
)
4122 v
.enter_visit
(_n_expr2
)
4125 redef class AAndExpr
4126 private init empty_init
do end
4128 init init_aandexpr
(
4129 n_expr
: nullable AExpr,
4130 n_expr2
: nullable AExpr
4134 _n_expr
= n_expr
.as(not null)
4135 n_expr
.parent
= self
4136 _n_expr2
= n_expr2
.as(not null)
4137 n_expr2
.parent
= self
4140 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4142 if _n_expr
== old_child
then
4143 if new_child
!= null then
4144 new_child
.parent
= self
4145 assert new_child
isa AExpr
4152 if _n_expr2
== old_child
then
4153 if new_child
!= null then
4154 new_child
.parent
= self
4155 assert new_child
isa AExpr
4156 _n_expr2
= new_child
4164 redef fun visit_all
(v
: Visitor)
4166 v
.enter_visit
(_n_expr
)
4167 v
.enter_visit
(_n_expr2
)
4170 redef class AOrElseExpr
4171 private init empty_init
do end
4173 init init_aorelseexpr
(
4174 n_expr
: nullable AExpr,
4175 n_expr2
: nullable AExpr
4179 _n_expr
= n_expr
.as(not null)
4180 n_expr
.parent
= self
4181 _n_expr2
= n_expr2
.as(not null)
4182 n_expr2
.parent
= self
4185 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4187 if _n_expr
== old_child
then
4188 if new_child
!= null then
4189 new_child
.parent
= self
4190 assert new_child
isa AExpr
4197 if _n_expr2
== old_child
then
4198 if new_child
!= null then
4199 new_child
.parent
= self
4200 assert new_child
isa AExpr
4201 _n_expr2
= new_child
4209 redef fun visit_all
(v
: Visitor)
4211 v
.enter_visit
(_n_expr
)
4212 v
.enter_visit
(_n_expr2
)
4215 redef class ANotExpr
4216 private init empty_init
do end
4218 init init_anotexpr
(
4219 n_kwnot
: nullable TKwnot,
4220 n_expr
: nullable AExpr
4224 _n_kwnot
= n_kwnot
.as(not null)
4225 n_kwnot
.parent
= self
4226 _n_expr
= n_expr
.as(not null)
4227 n_expr
.parent
= self
4230 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4232 if _n_kwnot
== old_child
then
4233 if new_child
!= null then
4234 new_child
.parent
= self
4235 assert new_child
isa TKwnot
4236 _n_kwnot
= new_child
4242 if _n_expr
== old_child
then
4243 if new_child
!= null then
4244 new_child
.parent
= self
4245 assert new_child
isa AExpr
4254 redef fun visit_all
(v
: Visitor)
4256 v
.enter_visit
(_n_kwnot
)
4257 v
.enter_visit
(_n_expr
)
4261 private init empty_init
do end
4264 n_expr
: nullable AExpr,
4265 n_expr2
: nullable AExpr
4269 _n_expr
= n_expr
.as(not null)
4270 n_expr
.parent
= self
4271 _n_expr2
= n_expr2
.as(not null)
4272 n_expr2
.parent
= self
4275 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4277 if _n_expr
== old_child
then
4278 if new_child
!= null then
4279 new_child
.parent
= self
4280 assert new_child
isa AExpr
4287 if _n_expr2
== old_child
then
4288 if new_child
!= null then
4289 new_child
.parent
= self
4290 assert new_child
isa AExpr
4291 _n_expr2
= new_child
4299 redef fun visit_all
(v
: Visitor)
4301 v
.enter_visit
(_n_expr
)
4302 v
.enter_visit
(_n_expr2
)
4306 private init empty_init
do end
4309 n_expr
: nullable AExpr,
4310 n_expr2
: nullable AExpr
4314 _n_expr
= n_expr
.as(not null)
4315 n_expr
.parent
= self
4316 _n_expr2
= n_expr2
.as(not null)
4317 n_expr2
.parent
= self
4320 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4322 if _n_expr
== old_child
then
4323 if new_child
!= null then
4324 new_child
.parent
= self
4325 assert new_child
isa AExpr
4332 if _n_expr2
== old_child
then
4333 if new_child
!= null then
4334 new_child
.parent
= self
4335 assert new_child
isa AExpr
4336 _n_expr2
= new_child
4344 redef fun visit_all
(v
: Visitor)
4346 v
.enter_visit
(_n_expr
)
4347 v
.enter_visit
(_n_expr2
)
4351 private init empty_init
do end
4354 n_expr
: nullable AExpr,
4355 n_expr2
: nullable AExpr
4359 _n_expr
= n_expr
.as(not null)
4360 n_expr
.parent
= self
4361 _n_expr2
= n_expr2
.as(not null)
4362 n_expr2
.parent
= self
4365 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4367 if _n_expr
== old_child
then
4368 if new_child
!= null then
4369 new_child
.parent
= self
4370 assert new_child
isa AExpr
4377 if _n_expr2
== old_child
then
4378 if new_child
!= null then
4379 new_child
.parent
= self
4380 assert new_child
isa AExpr
4381 _n_expr2
= new_child
4389 redef fun visit_all
(v
: Visitor)
4391 v
.enter_visit
(_n_expr
)
4392 v
.enter_visit
(_n_expr2
)
4396 private init empty_init
do end
4399 n_expr
: nullable AExpr,
4400 n_expr2
: nullable AExpr
4404 _n_expr
= n_expr
.as(not null)
4405 n_expr
.parent
= self
4406 _n_expr2
= n_expr2
.as(not null)
4407 n_expr2
.parent
= self
4410 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4412 if _n_expr
== old_child
then
4413 if new_child
!= null then
4414 new_child
.parent
= self
4415 assert new_child
isa AExpr
4422 if _n_expr2
== old_child
then
4423 if new_child
!= null then
4424 new_child
.parent
= self
4425 assert new_child
isa AExpr
4426 _n_expr2
= new_child
4434 redef fun visit_all
(v
: Visitor)
4436 v
.enter_visit
(_n_expr
)
4437 v
.enter_visit
(_n_expr2
)
4441 private init empty_init
do end
4444 n_expr
: nullable AExpr,
4445 n_expr2
: nullable AExpr
4449 _n_expr
= n_expr
.as(not null)
4450 n_expr
.parent
= self
4451 _n_expr2
= n_expr2
.as(not null)
4452 n_expr2
.parent
= self
4455 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4457 if _n_expr
== old_child
then
4458 if new_child
!= null then
4459 new_child
.parent
= self
4460 assert new_child
isa AExpr
4467 if _n_expr2
== old_child
then
4468 if new_child
!= null then
4469 new_child
.parent
= self
4470 assert new_child
isa AExpr
4471 _n_expr2
= new_child
4479 redef fun visit_all
(v
: Visitor)
4481 v
.enter_visit
(_n_expr
)
4482 v
.enter_visit
(_n_expr2
)
4486 private init empty_init
do end
4489 n_expr
: nullable AExpr,
4490 n_expr2
: nullable AExpr
4494 _n_expr
= n_expr
.as(not null)
4495 n_expr
.parent
= self
4496 _n_expr2
= n_expr2
.as(not null)
4497 n_expr2
.parent
= self
4500 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4502 if _n_expr
== old_child
then
4503 if new_child
!= null then
4504 new_child
.parent
= self
4505 assert new_child
isa AExpr
4512 if _n_expr2
== old_child
then
4513 if new_child
!= null then
4514 new_child
.parent
= self
4515 assert new_child
isa AExpr
4516 _n_expr2
= new_child
4524 redef fun visit_all
(v
: Visitor)
4526 v
.enter_visit
(_n_expr
)
4527 v
.enter_visit
(_n_expr2
)
4531 private init empty_init
do end
4534 n_expr
: nullable AExpr,
4535 n_expr2
: nullable AExpr
4539 _n_expr
= n_expr
.as(not null)
4540 n_expr
.parent
= self
4541 _n_expr2
= n_expr2
.as(not null)
4542 n_expr2
.parent
= self
4545 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4547 if _n_expr
== old_child
then
4548 if new_child
!= null then
4549 new_child
.parent
= self
4550 assert new_child
isa AExpr
4557 if _n_expr2
== old_child
then
4558 if new_child
!= null then
4559 new_child
.parent
= self
4560 assert new_child
isa AExpr
4561 _n_expr2
= new_child
4569 redef fun visit_all
(v
: Visitor)
4571 v
.enter_visit
(_n_expr
)
4572 v
.enter_visit
(_n_expr2
)
4575 redef class AIsaExpr
4576 private init empty_init
do end
4578 init init_aisaexpr
(
4579 n_expr
: nullable AExpr,
4580 n_type
: nullable AType
4584 _n_expr
= n_expr
.as(not null)
4585 n_expr
.parent
= self
4586 _n_type
= n_type
.as(not null)
4587 n_type
.parent
= self
4590 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4592 if _n_expr
== old_child
then
4593 if new_child
!= null then
4594 new_child
.parent
= self
4595 assert new_child
isa AExpr
4602 if _n_type
== old_child
then
4603 if new_child
!= null then
4604 new_child
.parent
= self
4605 assert new_child
isa AType
4614 redef fun visit_all
(v
: Visitor)
4616 v
.enter_visit
(_n_expr
)
4617 v
.enter_visit
(_n_type
)
4620 redef class APlusExpr
4621 private init empty_init
do end
4623 init init_aplusexpr
(
4624 n_expr
: nullable AExpr,
4625 n_expr2
: nullable AExpr
4629 _n_expr
= n_expr
.as(not null)
4630 n_expr
.parent
= self
4631 _n_expr2
= n_expr2
.as(not null)
4632 n_expr2
.parent
= self
4635 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4637 if _n_expr
== old_child
then
4638 if new_child
!= null then
4639 new_child
.parent
= self
4640 assert new_child
isa AExpr
4647 if _n_expr2
== old_child
then
4648 if new_child
!= null then
4649 new_child
.parent
= self
4650 assert new_child
isa AExpr
4651 _n_expr2
= new_child
4659 redef fun visit_all
(v
: Visitor)
4661 v
.enter_visit
(_n_expr
)
4662 v
.enter_visit
(_n_expr2
)
4665 redef class AMinusExpr
4666 private init empty_init
do end
4668 init init_aminusexpr
(
4669 n_expr
: nullable AExpr,
4670 n_expr2
: nullable AExpr
4674 _n_expr
= n_expr
.as(not null)
4675 n_expr
.parent
= self
4676 _n_expr2
= n_expr2
.as(not null)
4677 n_expr2
.parent
= self
4680 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4682 if _n_expr
== old_child
then
4683 if new_child
!= null then
4684 new_child
.parent
= self
4685 assert new_child
isa AExpr
4692 if _n_expr2
== old_child
then
4693 if new_child
!= null then
4694 new_child
.parent
= self
4695 assert new_child
isa AExpr
4696 _n_expr2
= new_child
4704 redef fun visit_all
(v
: Visitor)
4706 v
.enter_visit
(_n_expr
)
4707 v
.enter_visit
(_n_expr2
)
4710 redef class AStarshipExpr
4711 private init empty_init
do end
4713 init init_astarshipexpr
(
4714 n_expr
: nullable AExpr,
4715 n_expr2
: nullable AExpr
4719 _n_expr
= n_expr
.as(not null)
4720 n_expr
.parent
= self
4721 _n_expr2
= n_expr2
.as(not null)
4722 n_expr2
.parent
= self
4725 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4727 if _n_expr
== old_child
then
4728 if new_child
!= null then
4729 new_child
.parent
= self
4730 assert new_child
isa AExpr
4737 if _n_expr2
== old_child
then
4738 if new_child
!= null then
4739 new_child
.parent
= self
4740 assert new_child
isa AExpr
4741 _n_expr2
= new_child
4749 redef fun visit_all
(v
: Visitor)
4751 v
.enter_visit
(_n_expr
)
4752 v
.enter_visit
(_n_expr2
)
4755 redef class AStarExpr
4756 private init empty_init
do end
4758 init init_astarexpr
(
4759 n_expr
: nullable AExpr,
4760 n_expr2
: nullable AExpr
4764 _n_expr
= n_expr
.as(not null)
4765 n_expr
.parent
= self
4766 _n_expr2
= n_expr2
.as(not null)
4767 n_expr2
.parent
= self
4770 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4772 if _n_expr
== old_child
then
4773 if new_child
!= null then
4774 new_child
.parent
= self
4775 assert new_child
isa AExpr
4782 if _n_expr2
== old_child
then
4783 if new_child
!= null then
4784 new_child
.parent
= self
4785 assert new_child
isa AExpr
4786 _n_expr2
= new_child
4794 redef fun visit_all
(v
: Visitor)
4796 v
.enter_visit
(_n_expr
)
4797 v
.enter_visit
(_n_expr2
)
4800 redef class ASlashExpr
4801 private init empty_init
do end
4803 init init_aslashexpr
(
4804 n_expr
: nullable AExpr,
4805 n_expr2
: nullable AExpr
4809 _n_expr
= n_expr
.as(not null)
4810 n_expr
.parent
= self
4811 _n_expr2
= n_expr2
.as(not null)
4812 n_expr2
.parent
= self
4815 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4817 if _n_expr
== old_child
then
4818 if new_child
!= null then
4819 new_child
.parent
= self
4820 assert new_child
isa AExpr
4827 if _n_expr2
== old_child
then
4828 if new_child
!= null then
4829 new_child
.parent
= self
4830 assert new_child
isa AExpr
4831 _n_expr2
= new_child
4839 redef fun visit_all
(v
: Visitor)
4841 v
.enter_visit
(_n_expr
)
4842 v
.enter_visit
(_n_expr2
)
4845 redef class APercentExpr
4846 private init empty_init
do end
4848 init init_apercentexpr
(
4849 n_expr
: nullable AExpr,
4850 n_expr2
: nullable AExpr
4854 _n_expr
= n_expr
.as(not null)
4855 n_expr
.parent
= self
4856 _n_expr2
= n_expr2
.as(not null)
4857 n_expr2
.parent
= self
4860 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4862 if _n_expr
== old_child
then
4863 if new_child
!= null then
4864 new_child
.parent
= self
4865 assert new_child
isa AExpr
4872 if _n_expr2
== old_child
then
4873 if new_child
!= null then
4874 new_child
.parent
= self
4875 assert new_child
isa AExpr
4876 _n_expr2
= new_child
4884 redef fun visit_all
(v
: Visitor)
4886 v
.enter_visit
(_n_expr
)
4887 v
.enter_visit
(_n_expr2
)
4890 redef class AUminusExpr
4891 private init empty_init
do end
4893 init init_auminusexpr
(
4894 n_minus
: nullable TMinus,
4895 n_expr
: nullable AExpr
4899 _n_minus
= n_minus
.as(not null)
4900 n_minus
.parent
= self
4901 _n_expr
= n_expr
.as(not null)
4902 n_expr
.parent
= self
4905 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4907 if _n_minus
== old_child
then
4908 if new_child
!= null then
4909 new_child
.parent
= self
4910 assert new_child
isa TMinus
4911 _n_minus
= new_child
4917 if _n_expr
== old_child
then
4918 if new_child
!= null then
4919 new_child
.parent
= self
4920 assert new_child
isa AExpr
4929 redef fun visit_all
(v
: Visitor)
4931 v
.enter_visit
(_n_minus
)
4932 v
.enter_visit
(_n_expr
)
4935 redef class ANewExpr
4936 private init empty_init
do end
4938 init init_anewexpr
(
4939 n_kwnew
: nullable TKwnew,
4940 n_type
: nullable AType,
4942 n_args
: Collection[Object] # Should be Collection[AExpr]
4946 _n_kwnew
= n_kwnew
.as(not null)
4947 n_kwnew
.parent
= self
4948 _n_type
= n_type
.as(not null)
4949 n_type
.parent
= self
4951 if n_id
!= null then
4961 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4963 if _n_kwnew
== old_child
then
4964 if new_child
!= null then
4965 new_child
.parent
= self
4966 assert new_child
isa TKwnew
4967 _n_kwnew
= new_child
4973 if _n_type
== old_child
then
4974 if new_child
!= null then
4975 new_child
.parent
= self
4976 assert new_child
isa AType
4983 if _n_id
== old_child
then
4984 if new_child
!= null then
4985 new_child
.parent
= self
4986 assert new_child
isa TId
4993 for i
in [0.._n_args
.length
[ do
4994 if _n_args
[i
] == old_child
then
4995 if new_child
!= null then
4996 assert new_child
isa AExpr
4997 _n_args
[i
] = new_child
4998 new_child
.parent
= self
5000 _n_args
.remove_at
(i
)
5007 redef fun visit_all
(v
: Visitor)
5009 v
.enter_visit
(_n_kwnew
)
5010 v
.enter_visit
(_n_type
)
5011 if _n_id
!= null then
5012 v
.enter_visit
(_n_id
.as(not null))
5019 redef class AAttrExpr
5020 private init empty_init
do end
5022 init init_aattrexpr
(
5023 n_expr
: nullable AExpr,
5024 n_id
: nullable TAttrid
5028 _n_expr
= n_expr
.as(not null)
5029 n_expr
.parent
= self
5030 _n_id
= n_id
.as(not null)
5034 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5036 if _n_expr
== old_child
then
5037 if new_child
!= null then
5038 new_child
.parent
= self
5039 assert new_child
isa AExpr
5046 if _n_id
== old_child
then
5047 if new_child
!= null then
5048 new_child
.parent
= self
5049 assert new_child
isa TAttrid
5058 redef fun visit_all
(v
: Visitor)
5060 v
.enter_visit
(_n_expr
)
5061 v
.enter_visit
(_n_id
)
5064 redef class AAttrAssignExpr
5065 private init empty_init
do end
5067 init init_aattrassignexpr
(
5068 n_expr
: nullable AExpr,
5069 n_id
: nullable TAttrid,
5070 n_assign
: nullable TAssign,
5071 n_value
: nullable AExpr
5075 _n_expr
= n_expr
.as(not null)
5076 n_expr
.parent
= self
5077 _n_id
= n_id
.as(not null)
5079 _n_assign
= n_assign
.as(not null)
5080 n_assign
.parent
= self
5081 _n_value
= n_value
.as(not null)
5082 n_value
.parent
= self
5085 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5087 if _n_expr
== old_child
then
5088 if new_child
!= null then
5089 new_child
.parent
= self
5090 assert new_child
isa AExpr
5097 if _n_id
== old_child
then
5098 if new_child
!= null then
5099 new_child
.parent
= self
5100 assert new_child
isa TAttrid
5107 if _n_assign
== old_child
then
5108 if new_child
!= null then
5109 new_child
.parent
= self
5110 assert new_child
isa TAssign
5111 _n_assign
= new_child
5117 if _n_value
== old_child
then
5118 if new_child
!= null then
5119 new_child
.parent
= self
5120 assert new_child
isa AExpr
5121 _n_value
= new_child
5129 redef fun visit_all
(v
: Visitor)
5131 v
.enter_visit
(_n_expr
)
5132 v
.enter_visit
(_n_id
)
5133 v
.enter_visit
(_n_assign
)
5134 v
.enter_visit
(_n_value
)
5137 redef class AAttrReassignExpr
5138 private init empty_init
do end
5140 init init_aattrreassignexpr
(
5141 n_expr
: nullable AExpr,
5142 n_id
: nullable TAttrid,
5143 n_assign_op
: nullable AAssignOp,
5144 n_value
: nullable AExpr
5148 _n_expr
= n_expr
.as(not null)
5149 n_expr
.parent
= self
5150 _n_id
= n_id
.as(not null)
5152 _n_assign_op
= n_assign_op
.as(not null)
5153 n_assign_op
.parent
= self
5154 _n_value
= n_value
.as(not null)
5155 n_value
.parent
= self
5158 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5160 if _n_expr
== old_child
then
5161 if new_child
!= null then
5162 new_child
.parent
= self
5163 assert new_child
isa AExpr
5170 if _n_id
== old_child
then
5171 if new_child
!= null then
5172 new_child
.parent
= self
5173 assert new_child
isa TAttrid
5180 if _n_assign_op
== old_child
then
5181 if new_child
!= null then
5182 new_child
.parent
= self
5183 assert new_child
isa AAssignOp
5184 _n_assign_op
= new_child
5190 if _n_value
== old_child
then
5191 if new_child
!= null then
5192 new_child
.parent
= self
5193 assert new_child
isa AExpr
5194 _n_value
= new_child
5202 redef fun visit_all
(v
: Visitor)
5204 v
.enter_visit
(_n_expr
)
5205 v
.enter_visit
(_n_id
)
5206 v
.enter_visit
(_n_assign_op
)
5207 v
.enter_visit
(_n_value
)
5210 redef class ACallExpr
5211 private init empty_init
do end
5213 init init_acallexpr
(
5214 n_expr
: nullable AExpr,
5216 n_args
: Collection[Object], # Should be Collection[AExpr]
5217 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5221 _n_expr
= n_expr
.as(not null)
5222 n_expr
.parent
= self
5223 _n_id
= n_id
.as(not null)
5230 for n
in n_closure_defs
do
5231 assert n
isa AClosureDef
5232 _n_closure_defs
.add
(n
)
5237 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5239 if _n_expr
== old_child
then
5240 if new_child
!= null then
5241 new_child
.parent
= self
5242 assert new_child
isa AExpr
5249 if _n_id
== old_child
then
5250 if new_child
!= null then
5251 new_child
.parent
= self
5252 assert new_child
isa TId
5259 for i
in [0.._n_args
.length
[ do
5260 if _n_args
[i
] == old_child
then
5261 if new_child
!= null then
5262 assert new_child
isa AExpr
5263 _n_args
[i
] = new_child
5264 new_child
.parent
= self
5266 _n_args
.remove_at
(i
)
5271 for i
in [0.._n_closure_defs
.length
[ do
5272 if _n_closure_defs
[i
] == old_child
then
5273 if new_child
!= null then
5274 assert new_child
isa AClosureDef
5275 _n_closure_defs
[i
] = new_child
5276 new_child
.parent
= self
5278 _n_closure_defs
.remove_at
(i
)
5285 redef fun visit_all
(v
: Visitor)
5287 v
.enter_visit
(_n_expr
)
5288 v
.enter_visit
(_n_id
)
5292 for n
in _n_closure_defs
do
5297 redef class ACallAssignExpr
5298 private init empty_init
do end
5300 init init_acallassignexpr
(
5301 n_expr
: nullable AExpr,
5303 n_args
: Collection[Object], # Should be Collection[AExpr]
5304 n_assign
: nullable TAssign,
5305 n_value
: nullable AExpr
5309 _n_expr
= n_expr
.as(not null)
5310 n_expr
.parent
= self
5311 _n_id
= n_id
.as(not null)
5318 _n_assign
= n_assign
.as(not null)
5319 n_assign
.parent
= self
5320 _n_value
= n_value
.as(not null)
5321 n_value
.parent
= self
5324 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5326 if _n_expr
== old_child
then
5327 if new_child
!= null then
5328 new_child
.parent
= self
5329 assert new_child
isa AExpr
5336 if _n_id
== old_child
then
5337 if new_child
!= null then
5338 new_child
.parent
= self
5339 assert new_child
isa TId
5346 for i
in [0.._n_args
.length
[ do
5347 if _n_args
[i
] == old_child
then
5348 if new_child
!= null then
5349 assert new_child
isa AExpr
5350 _n_args
[i
] = new_child
5351 new_child
.parent
= self
5353 _n_args
.remove_at
(i
)
5358 if _n_assign
== old_child
then
5359 if new_child
!= null then
5360 new_child
.parent
= self
5361 assert new_child
isa TAssign
5362 _n_assign
= new_child
5368 if _n_value
== old_child
then
5369 if new_child
!= null then
5370 new_child
.parent
= self
5371 assert new_child
isa AExpr
5372 _n_value
= new_child
5380 redef fun visit_all
(v
: Visitor)
5382 v
.enter_visit
(_n_expr
)
5383 v
.enter_visit
(_n_id
)
5387 v
.enter_visit
(_n_assign
)
5388 v
.enter_visit
(_n_value
)
5391 redef class ACallReassignExpr
5392 private init empty_init
do end
5394 init init_acallreassignexpr
(
5395 n_expr
: nullable AExpr,
5397 n_args
: Collection[Object], # Should be Collection[AExpr]
5398 n_assign_op
: nullable AAssignOp,
5399 n_value
: nullable AExpr
5403 _n_expr
= n_expr
.as(not null)
5404 n_expr
.parent
= self
5405 _n_id
= n_id
.as(not null)
5412 _n_assign_op
= n_assign_op
.as(not null)
5413 n_assign_op
.parent
= self
5414 _n_value
= n_value
.as(not null)
5415 n_value
.parent
= self
5418 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5420 if _n_expr
== old_child
then
5421 if new_child
!= null then
5422 new_child
.parent
= self
5423 assert new_child
isa AExpr
5430 if _n_id
== old_child
then
5431 if new_child
!= null then
5432 new_child
.parent
= self
5433 assert new_child
isa TId
5440 for i
in [0.._n_args
.length
[ do
5441 if _n_args
[i
] == old_child
then
5442 if new_child
!= null then
5443 assert new_child
isa AExpr
5444 _n_args
[i
] = new_child
5445 new_child
.parent
= self
5447 _n_args
.remove_at
(i
)
5452 if _n_assign_op
== old_child
then
5453 if new_child
!= null then
5454 new_child
.parent
= self
5455 assert new_child
isa AAssignOp
5456 _n_assign_op
= new_child
5462 if _n_value
== old_child
then
5463 if new_child
!= null then
5464 new_child
.parent
= self
5465 assert new_child
isa AExpr
5466 _n_value
= new_child
5474 redef fun visit_all
(v
: Visitor)
5476 v
.enter_visit
(_n_expr
)
5477 v
.enter_visit
(_n_id
)
5481 v
.enter_visit
(_n_assign_op
)
5482 v
.enter_visit
(_n_value
)
5485 redef class ASuperExpr
5486 private init empty_init
do end
5488 init init_asuperexpr
(
5489 n_qualified
: nullable AQualified,
5490 n_kwsuper
: nullable TKwsuper,
5491 n_args
: Collection[Object] # Should be Collection[AExpr]
5495 _n_qualified
= n_qualified
5496 if n_qualified
!= null then
5497 n_qualified
.parent
= self
5499 _n_kwsuper
= n_kwsuper
.as(not null)
5500 n_kwsuper
.parent
= self
5508 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5510 if _n_qualified
== old_child
then
5511 if new_child
!= null then
5512 new_child
.parent
= self
5513 assert new_child
isa AQualified
5514 _n_qualified
= new_child
5520 if _n_kwsuper
== old_child
then
5521 if new_child
!= null then
5522 new_child
.parent
= self
5523 assert new_child
isa TKwsuper
5524 _n_kwsuper
= new_child
5530 for i
in [0.._n_args
.length
[ do
5531 if _n_args
[i
] == old_child
then
5532 if new_child
!= null then
5533 assert new_child
isa AExpr
5534 _n_args
[i
] = new_child
5535 new_child
.parent
= self
5537 _n_args
.remove_at
(i
)
5544 redef fun visit_all
(v
: Visitor)
5546 if _n_qualified
!= null then
5547 v
.enter_visit
(_n_qualified
.as(not null))
5549 v
.enter_visit
(_n_kwsuper
)
5555 redef class AInitExpr
5556 private init empty_init
do end
5558 init init_ainitexpr
(
5559 n_expr
: nullable AExpr,
5560 n_kwinit
: nullable TKwinit,
5561 n_args
: Collection[Object] # Should be Collection[AExpr]
5565 _n_expr
= n_expr
.as(not null)
5566 n_expr
.parent
= self
5567 _n_kwinit
= n_kwinit
.as(not null)
5568 n_kwinit
.parent
= self
5576 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5578 if _n_expr
== old_child
then
5579 if new_child
!= null then
5580 new_child
.parent
= self
5581 assert new_child
isa AExpr
5588 if _n_kwinit
== old_child
then
5589 if new_child
!= null then
5590 new_child
.parent
= self
5591 assert new_child
isa TKwinit
5592 _n_kwinit
= new_child
5598 for i
in [0.._n_args
.length
[ do
5599 if _n_args
[i
] == old_child
then
5600 if new_child
!= null then
5601 assert new_child
isa AExpr
5602 _n_args
[i
] = new_child
5603 new_child
.parent
= self
5605 _n_args
.remove_at
(i
)
5612 redef fun visit_all
(v
: Visitor)
5614 v
.enter_visit
(_n_expr
)
5615 v
.enter_visit
(_n_kwinit
)
5621 redef class ABraExpr
5622 private init empty_init
do end
5624 init init_abraexpr
(
5625 n_expr
: nullable AExpr,
5626 n_args
: Collection[Object], # Should be Collection[AExpr]
5627 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5631 _n_expr
= n_expr
.as(not null)
5632 n_expr
.parent
= self
5638 for n
in n_closure_defs
do
5639 assert n
isa AClosureDef
5640 _n_closure_defs
.add
(n
)
5645 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5647 if _n_expr
== old_child
then
5648 if new_child
!= null then
5649 new_child
.parent
= self
5650 assert new_child
isa AExpr
5657 for i
in [0.._n_args
.length
[ do
5658 if _n_args
[i
] == old_child
then
5659 if new_child
!= null then
5660 assert new_child
isa AExpr
5661 _n_args
[i
] = new_child
5662 new_child
.parent
= self
5664 _n_args
.remove_at
(i
)
5669 for i
in [0.._n_closure_defs
.length
[ do
5670 if _n_closure_defs
[i
] == old_child
then
5671 if new_child
!= null then
5672 assert new_child
isa AClosureDef
5673 _n_closure_defs
[i
] = new_child
5674 new_child
.parent
= self
5676 _n_closure_defs
.remove_at
(i
)
5683 redef fun visit_all
(v
: Visitor)
5685 v
.enter_visit
(_n_expr
)
5689 for n
in _n_closure_defs
do
5694 redef class ABraAssignExpr
5695 private init empty_init
do end
5697 init init_abraassignexpr
(
5698 n_expr
: nullable AExpr,
5699 n_args
: Collection[Object], # Should be Collection[AExpr]
5700 n_assign
: nullable TAssign,
5701 n_value
: nullable AExpr
5705 _n_expr
= n_expr
.as(not null)
5706 n_expr
.parent
= self
5712 _n_assign
= n_assign
.as(not null)
5713 n_assign
.parent
= self
5714 _n_value
= n_value
.as(not null)
5715 n_value
.parent
= self
5718 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5720 if _n_expr
== old_child
then
5721 if new_child
!= null then
5722 new_child
.parent
= self
5723 assert new_child
isa AExpr
5730 for i
in [0.._n_args
.length
[ do
5731 if _n_args
[i
] == old_child
then
5732 if new_child
!= null then
5733 assert new_child
isa AExpr
5734 _n_args
[i
] = new_child
5735 new_child
.parent
= self
5737 _n_args
.remove_at
(i
)
5742 if _n_assign
== old_child
then
5743 if new_child
!= null then
5744 new_child
.parent
= self
5745 assert new_child
isa TAssign
5746 _n_assign
= new_child
5752 if _n_value
== old_child
then
5753 if new_child
!= null then
5754 new_child
.parent
= self
5755 assert new_child
isa AExpr
5756 _n_value
= new_child
5764 redef fun visit_all
(v
: Visitor)
5766 v
.enter_visit
(_n_expr
)
5770 v
.enter_visit
(_n_assign
)
5771 v
.enter_visit
(_n_value
)
5774 redef class ABraReassignExpr
5775 private init empty_init
do end
5777 init init_abrareassignexpr
(
5778 n_expr
: nullable AExpr,
5779 n_args
: Collection[Object], # Should be Collection[AExpr]
5780 n_assign_op
: nullable AAssignOp,
5781 n_value
: nullable AExpr
5785 _n_expr
= n_expr
.as(not null)
5786 n_expr
.parent
= self
5792 _n_assign_op
= n_assign_op
.as(not null)
5793 n_assign_op
.parent
= self
5794 _n_value
= n_value
.as(not null)
5795 n_value
.parent
= self
5798 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5800 if _n_expr
== old_child
then
5801 if new_child
!= null then
5802 new_child
.parent
= self
5803 assert new_child
isa AExpr
5810 for i
in [0.._n_args
.length
[ do
5811 if _n_args
[i
] == old_child
then
5812 if new_child
!= null then
5813 assert new_child
isa AExpr
5814 _n_args
[i
] = new_child
5815 new_child
.parent
= self
5817 _n_args
.remove_at
(i
)
5822 if _n_assign_op
== old_child
then
5823 if new_child
!= null then
5824 new_child
.parent
= self
5825 assert new_child
isa AAssignOp
5826 _n_assign_op
= new_child
5832 if _n_value
== old_child
then
5833 if new_child
!= null then
5834 new_child
.parent
= self
5835 assert new_child
isa AExpr
5836 _n_value
= new_child
5844 redef fun visit_all
(v
: Visitor)
5846 v
.enter_visit
(_n_expr
)
5850 v
.enter_visit
(_n_assign_op
)
5851 v
.enter_visit
(_n_value
)
5854 redef class AClosureCallExpr
5855 private init empty_init
do end
5857 init init_aclosurecallexpr
(
5859 n_args
: Collection[Object], # Should be Collection[AExpr]
5860 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5864 _n_id
= n_id
.as(not null)
5871 for n
in n_closure_defs
do
5872 assert n
isa AClosureDef
5873 _n_closure_defs
.add
(n
)
5878 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5880 if _n_id
== old_child
then
5881 if new_child
!= null then
5882 new_child
.parent
= self
5883 assert new_child
isa TId
5890 for i
in [0.._n_args
.length
[ do
5891 if _n_args
[i
] == old_child
then
5892 if new_child
!= null then
5893 assert new_child
isa AExpr
5894 _n_args
[i
] = new_child
5895 new_child
.parent
= self
5897 _n_args
.remove_at
(i
)
5902 for i
in [0.._n_closure_defs
.length
[ do
5903 if _n_closure_defs
[i
] == old_child
then
5904 if new_child
!= null then
5905 assert new_child
isa AClosureDef
5906 _n_closure_defs
[i
] = new_child
5907 new_child
.parent
= self
5909 _n_closure_defs
.remove_at
(i
)
5916 redef fun visit_all
(v
: Visitor)
5918 v
.enter_visit
(_n_id
)
5922 for n
in _n_closure_defs
do
5927 redef class AVarExpr
5928 private init empty_init
do end
5930 init init_avarexpr
(
5935 _n_id
= n_id
.as(not null)
5939 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5941 if _n_id
== old_child
then
5942 if new_child
!= null then
5943 new_child
.parent
= self
5944 assert new_child
isa TId
5953 redef fun visit_all
(v
: Visitor)
5955 v
.enter_visit
(_n_id
)
5958 redef class AVarAssignExpr
5959 private init empty_init
do end
5961 init init_avarassignexpr
(
5963 n_assign
: nullable TAssign,
5964 n_value
: nullable AExpr
5968 _n_id
= n_id
.as(not null)
5970 _n_assign
= n_assign
.as(not null)
5971 n_assign
.parent
= self
5972 _n_value
= n_value
.as(not null)
5973 n_value
.parent
= self
5976 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5978 if _n_id
== old_child
then
5979 if new_child
!= null then
5980 new_child
.parent
= self
5981 assert new_child
isa TId
5988 if _n_assign
== old_child
then
5989 if new_child
!= null then
5990 new_child
.parent
= self
5991 assert new_child
isa TAssign
5992 _n_assign
= new_child
5998 if _n_value
== old_child
then
5999 if new_child
!= null then
6000 new_child
.parent
= self
6001 assert new_child
isa AExpr
6002 _n_value
= new_child
6010 redef fun visit_all
(v
: Visitor)
6012 v
.enter_visit
(_n_id
)
6013 v
.enter_visit
(_n_assign
)
6014 v
.enter_visit
(_n_value
)
6017 redef class AVarReassignExpr
6018 private init empty_init
do end
6020 init init_avarreassignexpr
(
6022 n_assign_op
: nullable AAssignOp,
6023 n_value
: nullable AExpr
6027 _n_id
= n_id
.as(not null)
6029 _n_assign_op
= n_assign_op
.as(not null)
6030 n_assign_op
.parent
= self
6031 _n_value
= n_value
.as(not null)
6032 n_value
.parent
= self
6035 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6037 if _n_id
== old_child
then
6038 if new_child
!= null then
6039 new_child
.parent
= self
6040 assert new_child
isa TId
6047 if _n_assign_op
== old_child
then
6048 if new_child
!= null then
6049 new_child
.parent
= self
6050 assert new_child
isa AAssignOp
6051 _n_assign_op
= new_child
6057 if _n_value
== old_child
then
6058 if new_child
!= null then
6059 new_child
.parent
= self
6060 assert new_child
isa AExpr
6061 _n_value
= new_child
6069 redef fun visit_all
(v
: Visitor)
6071 v
.enter_visit
(_n_id
)
6072 v
.enter_visit
(_n_assign_op
)
6073 v
.enter_visit
(_n_value
)
6076 redef class ARangeExpr
6077 private init empty_init
do end
6079 init init_arangeexpr
(
6080 n_expr
: nullable AExpr,
6081 n_expr2
: nullable AExpr
6085 _n_expr
= n_expr
.as(not null)
6086 n_expr
.parent
= self
6087 _n_expr2
= n_expr2
.as(not null)
6088 n_expr2
.parent
= self
6091 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6093 if _n_expr
== old_child
then
6094 if new_child
!= null then
6095 new_child
.parent
= self
6096 assert new_child
isa AExpr
6103 if _n_expr2
== old_child
then
6104 if new_child
!= null then
6105 new_child
.parent
= self
6106 assert new_child
isa AExpr
6107 _n_expr2
= new_child
6115 redef fun visit_all
(v
: Visitor)
6117 v
.enter_visit
(_n_expr
)
6118 v
.enter_visit
(_n_expr2
)
6121 redef class ACrangeExpr
6122 private init empty_init
do end
6124 init init_acrangeexpr
(
6125 n_expr
: nullable AExpr,
6126 n_expr2
: nullable AExpr
6130 _n_expr
= n_expr
.as(not null)
6131 n_expr
.parent
= self
6132 _n_expr2
= n_expr2
.as(not null)
6133 n_expr2
.parent
= self
6136 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6138 if _n_expr
== old_child
then
6139 if new_child
!= null then
6140 new_child
.parent
= self
6141 assert new_child
isa AExpr
6148 if _n_expr2
== old_child
then
6149 if new_child
!= null then
6150 new_child
.parent
= self
6151 assert new_child
isa AExpr
6152 _n_expr2
= new_child
6160 redef fun visit_all
(v
: Visitor)
6162 v
.enter_visit
(_n_expr
)
6163 v
.enter_visit
(_n_expr2
)
6166 redef class AOrangeExpr
6167 private init empty_init
do end
6169 init init_aorangeexpr
(
6170 n_expr
: nullable AExpr,
6171 n_expr2
: nullable AExpr
6175 _n_expr
= n_expr
.as(not null)
6176 n_expr
.parent
= self
6177 _n_expr2
= n_expr2
.as(not null)
6178 n_expr2
.parent
= self
6181 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6183 if _n_expr
== old_child
then
6184 if new_child
!= null then
6185 new_child
.parent
= self
6186 assert new_child
isa AExpr
6193 if _n_expr2
== old_child
then
6194 if new_child
!= null then
6195 new_child
.parent
= self
6196 assert new_child
isa AExpr
6197 _n_expr2
= new_child
6205 redef fun visit_all
(v
: Visitor)
6207 v
.enter_visit
(_n_expr
)
6208 v
.enter_visit
(_n_expr2
)
6211 redef class AArrayExpr
6212 private init empty_init
do end
6214 init init_aarrayexpr
(
6215 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6226 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6228 for i
in [0.._n_exprs
.length
[ do
6229 if _n_exprs
[i
] == old_child
then
6230 if new_child
!= null then
6231 assert new_child
isa AExpr
6232 _n_exprs
[i
] = new_child
6233 new_child
.parent
= self
6235 _n_exprs
.remove_at
(i
)
6242 redef fun visit_all
(v
: Visitor)
6244 for n
in _n_exprs
do
6249 redef class ASelfExpr
6250 private init empty_init
do end
6252 init init_aselfexpr
(
6253 n_kwself
: nullable TKwself
6257 _n_kwself
= n_kwself
.as(not null)
6258 n_kwself
.parent
= self
6261 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6263 if _n_kwself
== old_child
then
6264 if new_child
!= null then
6265 new_child
.parent
= self
6266 assert new_child
isa TKwself
6267 _n_kwself
= new_child
6275 redef fun visit_all
(v
: Visitor)
6277 v
.enter_visit
(_n_kwself
)
6280 redef class AImplicitSelfExpr
6281 private init empty_init
do end
6283 init init_aimplicitselfexpr
6288 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6292 redef fun visit_all
(v
: Visitor)
6296 redef class ATrueExpr
6297 private init empty_init
do end
6299 init init_atrueexpr
(
6300 n_kwtrue
: nullable TKwtrue
6304 _n_kwtrue
= n_kwtrue
.as(not null)
6305 n_kwtrue
.parent
= self
6308 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6310 if _n_kwtrue
== old_child
then
6311 if new_child
!= null then
6312 new_child
.parent
= self
6313 assert new_child
isa TKwtrue
6314 _n_kwtrue
= new_child
6322 redef fun visit_all
(v
: Visitor)
6324 v
.enter_visit
(_n_kwtrue
)
6327 redef class AFalseExpr
6328 private init empty_init
do end
6330 init init_afalseexpr
(
6331 n_kwfalse
: nullable TKwfalse
6335 _n_kwfalse
= n_kwfalse
.as(not null)
6336 n_kwfalse
.parent
= self
6339 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6341 if _n_kwfalse
== old_child
then
6342 if new_child
!= null then
6343 new_child
.parent
= self
6344 assert new_child
isa TKwfalse
6345 _n_kwfalse
= new_child
6353 redef fun visit_all
(v
: Visitor)
6355 v
.enter_visit
(_n_kwfalse
)
6358 redef class ANullExpr
6359 private init empty_init
do end
6361 init init_anullexpr
(
6362 n_kwnull
: nullable TKwnull
6366 _n_kwnull
= n_kwnull
.as(not null)
6367 n_kwnull
.parent
= self
6370 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6372 if _n_kwnull
== old_child
then
6373 if new_child
!= null then
6374 new_child
.parent
= self
6375 assert new_child
isa TKwnull
6376 _n_kwnull
= new_child
6384 redef fun visit_all
(v
: Visitor)
6386 v
.enter_visit
(_n_kwnull
)
6389 redef class AIntExpr
6390 private init empty_init
do end
6392 init init_aintexpr
(
6393 n_number
: nullable TNumber
6397 _n_number
= n_number
.as(not null)
6398 n_number
.parent
= self
6401 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6403 if _n_number
== old_child
then
6404 if new_child
!= null then
6405 new_child
.parent
= self
6406 assert new_child
isa TNumber
6407 _n_number
= new_child
6415 redef fun visit_all
(v
: Visitor)
6417 v
.enter_visit
(_n_number
)
6420 redef class AFloatExpr
6421 private init empty_init
do end
6423 init init_afloatexpr
(
6424 n_float
: nullable TFloat
6428 _n_float
= n_float
.as(not null)
6429 n_float
.parent
= self
6432 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6434 if _n_float
== old_child
then
6435 if new_child
!= null then
6436 new_child
.parent
= self
6437 assert new_child
isa TFloat
6438 _n_float
= new_child
6446 redef fun visit_all
(v
: Visitor)
6448 v
.enter_visit
(_n_float
)
6451 redef class ACharExpr
6452 private init empty_init
do end
6454 init init_acharexpr
(
6455 n_char
: nullable TChar
6459 _n_char
= n_char
.as(not null)
6460 n_char
.parent
= self
6463 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6465 if _n_char
== old_child
then
6466 if new_child
!= null then
6467 new_child
.parent
= self
6468 assert new_child
isa TChar
6477 redef fun visit_all
(v
: Visitor)
6479 v
.enter_visit
(_n_char
)
6482 redef class AStringExpr
6483 private init empty_init
do end
6485 init init_astringexpr
(
6486 n_string
: nullable TString
6490 _n_string
= n_string
.as(not null)
6491 n_string
.parent
= self
6494 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6496 if _n_string
== old_child
then
6497 if new_child
!= null then
6498 new_child
.parent
= self
6499 assert new_child
isa TString
6500 _n_string
= new_child
6508 redef fun visit_all
(v
: Visitor)
6510 v
.enter_visit
(_n_string
)
6513 redef class AStartStringExpr
6514 private init empty_init
do end
6516 init init_astartstringexpr
(
6517 n_string
: nullable TStartString
6521 _n_string
= n_string
.as(not null)
6522 n_string
.parent
= self
6525 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6527 if _n_string
== old_child
then
6528 if new_child
!= null then
6529 new_child
.parent
= self
6530 assert new_child
isa TStartString
6531 _n_string
= new_child
6539 redef fun visit_all
(v
: Visitor)
6541 v
.enter_visit
(_n_string
)
6544 redef class AMidStringExpr
6545 private init empty_init
do end
6547 init init_amidstringexpr
(
6548 n_string
: nullable TMidString
6552 _n_string
= n_string
.as(not null)
6553 n_string
.parent
= self
6556 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6558 if _n_string
== old_child
then
6559 if new_child
!= null then
6560 new_child
.parent
= self
6561 assert new_child
isa TMidString
6562 _n_string
= new_child
6570 redef fun visit_all
(v
: Visitor)
6572 v
.enter_visit
(_n_string
)
6575 redef class AEndStringExpr
6576 private init empty_init
do end
6578 init init_aendstringexpr
(
6579 n_string
: nullable TEndString
6583 _n_string
= n_string
.as(not null)
6584 n_string
.parent
= self
6587 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6589 if _n_string
== old_child
then
6590 if new_child
!= null then
6591 new_child
.parent
= self
6592 assert new_child
isa TEndString
6593 _n_string
= new_child
6601 redef fun visit_all
(v
: Visitor)
6603 v
.enter_visit
(_n_string
)
6606 redef class ASuperstringExpr
6607 private init empty_init
do end
6609 init init_asuperstringexpr
(
6610 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6621 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6623 for i
in [0.._n_exprs
.length
[ do
6624 if _n_exprs
[i
] == old_child
then
6625 if new_child
!= null then
6626 assert new_child
isa AExpr
6627 _n_exprs
[i
] = new_child
6628 new_child
.parent
= self
6630 _n_exprs
.remove_at
(i
)
6637 redef fun visit_all
(v
: Visitor)
6639 for n
in _n_exprs
do
6644 redef class AParExpr
6645 private init empty_init
do end
6647 init init_aparexpr
(
6648 n_expr
: nullable AExpr
6652 _n_expr
= n_expr
.as(not null)
6653 n_expr
.parent
= self
6656 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6658 if _n_expr
== old_child
then
6659 if new_child
!= null then
6660 new_child
.parent
= self
6661 assert new_child
isa AExpr
6670 redef fun visit_all
(v
: Visitor)
6672 v
.enter_visit
(_n_expr
)
6675 redef class AAsCastExpr
6676 private init empty_init
do end
6678 init init_aascastexpr
(
6679 n_expr
: nullable AExpr,
6680 n_kwas
: nullable TKwas,
6681 n_type
: nullable AType
6685 _n_expr
= n_expr
.as(not null)
6686 n_expr
.parent
= self
6687 _n_kwas
= n_kwas
.as(not null)
6688 n_kwas
.parent
= self
6689 _n_type
= n_type
.as(not null)
6690 n_type
.parent
= self
6693 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6695 if _n_expr
== old_child
then
6696 if new_child
!= null then
6697 new_child
.parent
= self
6698 assert new_child
isa AExpr
6705 if _n_kwas
== old_child
then
6706 if new_child
!= null then
6707 new_child
.parent
= self
6708 assert new_child
isa TKwas
6715 if _n_type
== old_child
then
6716 if new_child
!= null then
6717 new_child
.parent
= self
6718 assert new_child
isa AType
6727 redef fun visit_all
(v
: Visitor)
6729 v
.enter_visit
(_n_expr
)
6730 v
.enter_visit
(_n_kwas
)
6731 v
.enter_visit
(_n_type
)
6734 redef class AAsNotnullExpr
6735 private init empty_init
do end
6737 init init_aasnotnullexpr
(
6738 n_expr
: nullable AExpr,
6739 n_kwas
: nullable TKwas,
6740 n_kwnot
: nullable TKwnot,
6741 n_kwnull
: nullable TKwnull
6745 _n_expr
= n_expr
.as(not null)
6746 n_expr
.parent
= self
6747 _n_kwas
= n_kwas
.as(not null)
6748 n_kwas
.parent
= self
6749 _n_kwnot
= n_kwnot
.as(not null)
6750 n_kwnot
.parent
= self
6751 _n_kwnull
= n_kwnull
.as(not null)
6752 n_kwnull
.parent
= self
6755 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6757 if _n_expr
== old_child
then
6758 if new_child
!= null then
6759 new_child
.parent
= self
6760 assert new_child
isa AExpr
6767 if _n_kwas
== old_child
then
6768 if new_child
!= null then
6769 new_child
.parent
= self
6770 assert new_child
isa TKwas
6777 if _n_kwnot
== old_child
then
6778 if new_child
!= null then
6779 new_child
.parent
= self
6780 assert new_child
isa TKwnot
6781 _n_kwnot
= new_child
6787 if _n_kwnull
== old_child
then
6788 if new_child
!= null then
6789 new_child
.parent
= self
6790 assert new_child
isa TKwnull
6791 _n_kwnull
= new_child
6799 redef fun visit_all
(v
: Visitor)
6801 v
.enter_visit
(_n_expr
)
6802 v
.enter_visit
(_n_kwas
)
6803 v
.enter_visit
(_n_kwnot
)
6804 v
.enter_visit
(_n_kwnull
)
6807 redef class AIssetAttrExpr
6808 private init empty_init
do end
6810 init init_aissetattrexpr
(
6811 n_kwisset
: nullable TKwisset,
6812 n_expr
: nullable AExpr,
6813 n_id
: nullable TAttrid
6817 _n_kwisset
= n_kwisset
.as(not null)
6818 n_kwisset
.parent
= self
6819 _n_expr
= n_expr
.as(not null)
6820 n_expr
.parent
= self
6821 _n_id
= n_id
.as(not null)
6825 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6827 if _n_kwisset
== old_child
then
6828 if new_child
!= null then
6829 new_child
.parent
= self
6830 assert new_child
isa TKwisset
6831 _n_kwisset
= new_child
6837 if _n_expr
== old_child
then
6838 if new_child
!= null then
6839 new_child
.parent
= self
6840 assert new_child
isa AExpr
6847 if _n_id
== old_child
then
6848 if new_child
!= null then
6849 new_child
.parent
= self
6850 assert new_child
isa TAttrid
6859 redef fun visit_all
(v
: Visitor)
6861 v
.enter_visit
(_n_kwisset
)
6862 v
.enter_visit
(_n_expr
)
6863 v
.enter_visit
(_n_id
)
6866 redef class APlusAssignOp
6867 private init empty_init
do end
6869 init init_aplusassignop
(
6870 n_pluseq
: nullable TPluseq
6874 _n_pluseq
= n_pluseq
.as(not null)
6875 n_pluseq
.parent
= self
6878 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6880 if _n_pluseq
== old_child
then
6881 if new_child
!= null then
6882 new_child
.parent
= self
6883 assert new_child
isa TPluseq
6884 _n_pluseq
= new_child
6892 redef fun visit_all
(v
: Visitor)
6894 v
.enter_visit
(_n_pluseq
)
6897 redef class AMinusAssignOp
6898 private init empty_init
do end
6900 init init_aminusassignop
(
6901 n_minuseq
: nullable TMinuseq
6905 _n_minuseq
= n_minuseq
.as(not null)
6906 n_minuseq
.parent
= self
6909 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6911 if _n_minuseq
== old_child
then
6912 if new_child
!= null then
6913 new_child
.parent
= self
6914 assert new_child
isa TMinuseq
6915 _n_minuseq
= new_child
6923 redef fun visit_all
(v
: Visitor)
6925 v
.enter_visit
(_n_minuseq
)
6928 redef class AClosureDef
6929 private init empty_init
do end
6931 init init_aclosuredef
(
6932 n_bang
: nullable TBang,
6933 n_id
: nullable AClosureId,
6934 n_ids
: Collection[Object], # Should be Collection[TId]
6935 n_kwdo
: nullable TKwdo,
6936 n_expr
: nullable AExpr,
6937 n_label
: nullable ALabel
6941 _n_bang
= n_bang
.as(not null)
6942 n_bang
.parent
= self
6943 _n_id
= n_id
.as(not null)
6951 if n_kwdo
!= null then
6952 n_kwdo
.parent
= self
6955 if n_expr
!= null then
6956 n_expr
.parent
= self
6959 if n_label
!= null then
6960 n_label
.parent
= self
6964 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6966 if _n_bang
== old_child
then
6967 if new_child
!= null then
6968 new_child
.parent
= self
6969 assert new_child
isa TBang
6976 if _n_id
== old_child
then
6977 if new_child
!= null then
6978 new_child
.parent
= self
6979 assert new_child
isa AClosureId
6986 for i
in [0.._n_ids
.length
[ do
6987 if _n_ids
[i
] == old_child
then
6988 if new_child
!= null then
6989 assert new_child
isa TId
6990 _n_ids
[i
] = new_child
6991 new_child
.parent
= self
6998 if _n_kwdo
== old_child
then
6999 if new_child
!= null then
7000 new_child
.parent
= self
7001 assert new_child
isa TKwdo
7008 if _n_expr
== old_child
then
7009 if new_child
!= null then
7010 new_child
.parent
= self
7011 assert new_child
isa AExpr
7018 if _n_label
== old_child
then
7019 if new_child
!= null then
7020 new_child
.parent
= self
7021 assert new_child
isa ALabel
7022 _n_label
= new_child
7030 redef fun visit_all
(v
: Visitor)
7032 v
.enter_visit
(_n_bang
)
7033 v
.enter_visit
(_n_id
)
7037 if _n_kwdo
!= null then
7038 v
.enter_visit
(_n_kwdo
.as(not null))
7040 if _n_expr
!= null then
7041 v
.enter_visit
(_n_expr
.as(not null))
7043 if _n_label
!= null then
7044 v
.enter_visit
(_n_label
.as(not null))
7048 redef class ASimpleClosureId
7049 private init empty_init
do end
7051 init init_asimpleclosureid
(
7056 _n_id
= n_id
.as(not null)
7060 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7062 if _n_id
== old_child
then
7063 if new_child
!= null then
7064 new_child
.parent
= self
7065 assert new_child
isa TId
7074 redef fun visit_all
(v
: Visitor)
7076 v
.enter_visit
(_n_id
)
7079 redef class ABreakClosureId
7080 private init empty_init
do end
7082 init init_abreakclosureid
(
7083 n_kwbreak
: nullable TKwbreak
7087 _n_kwbreak
= n_kwbreak
.as(not null)
7088 n_kwbreak
.parent
= self
7091 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7093 if _n_kwbreak
== old_child
then
7094 if new_child
!= null then
7095 new_child
.parent
= self
7096 assert new_child
isa TKwbreak
7097 _n_kwbreak
= new_child
7105 redef fun visit_all
(v
: Visitor)
7107 v
.enter_visit
(_n_kwbreak
)
7110 redef class AQualified
7111 private init empty_init
do end
7113 init init_aqualified
(
7114 n_id
: Collection[Object], # Should be Collection[TId]
7115 n_classid
: nullable TClassid
7124 _n_classid
= n_classid
7125 if n_classid
!= null then
7126 n_classid
.parent
= self
7130 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7132 for i
in [0.._n_id
.length
[ do
7133 if _n_id
[i
] == old_child
then
7134 if new_child
!= null then
7135 assert new_child
isa TId
7136 _n_id
[i
] = new_child
7137 new_child
.parent
= self
7144 if _n_classid
== old_child
then
7145 if new_child
!= null then
7146 new_child
.parent
= self
7147 assert new_child
isa TClassid
7148 _n_classid
= new_child
7156 redef fun visit_all
(v
: Visitor)
7161 if _n_classid
!= null then
7162 v
.enter_visit
(_n_classid
.as(not null))
7167 private init empty_init
do end
7170 n_comment
: Collection[Object] # Should be Collection[TComment]
7174 for n
in n_comment
do
7175 assert n
isa TComment
7181 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7183 for i
in [0.._n_comment
.length
[ do
7184 if _n_comment
[i
] == old_child
then
7185 if new_child
!= null then
7186 assert new_child
isa TComment
7187 _n_comment
[i
] = new_child
7188 new_child
.parent
= self
7190 _n_comment
.remove_at
(i
)
7197 redef fun visit_all
(v
: Visitor)
7199 for n
in _n_comment
do
7207 n_base
: nullable AModule,
7214 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7216 if _n_base
== old_child
then
7217 if new_child
== null then
7219 new_child
.parent
= self
7220 assert new_child
isa AModule
7223 old_child
.parent
= null
7228 redef fun visit_all
(v
: Visitor)
7230 if _n_base
!= null then
7231 v
.enter_visit
(_n_base
.as(not null))
7233 v
.enter_visit
(_n_eof
)