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_type
: nullable AType
870 _n_kwspecial
= n_kwspecial
.as(not null)
871 n_kwspecial
.parent
= self
872 _n_type
= n_type
.as(not null)
876 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
878 if _n_kwspecial
== old_child
then
879 if new_child
!= null then
880 new_child
.parent
= self
881 assert new_child
isa TKwspecial
882 _n_kwspecial
= new_child
888 if _n_type
== old_child
then
889 if new_child
!= null then
890 new_child
.parent
= self
891 assert new_child
isa AType
900 redef fun visit_all
(v
: Visitor)
902 v
.enter_visit
(_n_kwspecial
)
903 v
.enter_visit
(_n_type
)
906 redef class AAttrPropdef
907 private init empty_init
do end
909 init init_aattrpropdef
(
910 n_doc
: nullable ADoc,
911 n_readable
: nullable AAble,
912 n_writable
: nullable AAble,
913 n_kwredef
: nullable TKwredef,
914 n_visibility
: nullable AVisibility,
915 n_kwvar
: nullable TKwvar,
916 n_id
: nullable TAttrid,
917 n_type
: nullable AType,
918 n_expr
: nullable AExpr
923 if n_doc
!= null then
926 _n_readable
= n_readable
927 if n_readable
!= null then
928 n_readable
.parent
= self
930 _n_writable
= n_writable
931 if n_writable
!= null then
932 n_writable
.parent
= self
934 _n_kwredef
= n_kwredef
935 if n_kwredef
!= null then
936 n_kwredef
.parent
= self
938 _n_visibility
= n_visibility
.as(not null)
939 n_visibility
.parent
= self
940 _n_kwvar
= n_kwvar
.as(not null)
941 n_kwvar
.parent
= self
942 _n_id
= n_id
.as(not null)
945 if n_type
!= null then
949 if n_expr
!= null then
954 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
956 if _n_doc
== old_child
then
957 if new_child
!= null then
958 new_child
.parent
= self
959 assert new_child
isa ADoc
966 if _n_readable
== old_child
then
967 if new_child
!= null then
968 new_child
.parent
= self
969 assert new_child
isa AAble
970 _n_readable
= new_child
976 if _n_writable
== old_child
then
977 if new_child
!= null then
978 new_child
.parent
= self
979 assert new_child
isa AAble
980 _n_writable
= new_child
986 if _n_kwredef
== old_child
then
987 if new_child
!= null then
988 new_child
.parent
= self
989 assert new_child
isa TKwredef
990 _n_kwredef
= new_child
996 if _n_visibility
== old_child
then
997 if new_child
!= null then
998 new_child
.parent
= self
999 assert new_child
isa AVisibility
1000 _n_visibility
= new_child
1006 if _n_kwvar
== old_child
then
1007 if new_child
!= null then
1008 new_child
.parent
= self
1009 assert new_child
isa TKwvar
1010 _n_kwvar
= new_child
1016 if _n_id
== old_child
then
1017 if new_child
!= null then
1018 new_child
.parent
= self
1019 assert new_child
isa TAttrid
1026 if _n_type
== old_child
then
1027 if new_child
!= null then
1028 new_child
.parent
= self
1029 assert new_child
isa AType
1036 if _n_expr
== old_child
then
1037 if new_child
!= null then
1038 new_child
.parent
= self
1039 assert new_child
isa AExpr
1048 redef fun visit_all
(v
: Visitor)
1050 if _n_doc
!= null then
1051 v
.enter_visit
(_n_doc
.as(not null))
1053 if _n_readable
!= null then
1054 v
.enter_visit
(_n_readable
.as(not null))
1056 if _n_writable
!= null then
1057 v
.enter_visit
(_n_writable
.as(not null))
1059 if _n_kwredef
!= null then
1060 v
.enter_visit
(_n_kwredef
.as(not null))
1062 v
.enter_visit
(_n_visibility
)
1063 v
.enter_visit
(_n_kwvar
)
1064 v
.enter_visit
(_n_id
)
1065 if _n_type
!= null then
1066 v
.enter_visit
(_n_type
.as(not null))
1068 if _n_expr
!= null then
1069 v
.enter_visit
(_n_expr
.as(not null))
1073 redef class AMethPropdef
1074 private init empty_init
do end
1076 init init_amethpropdef
(
1077 n_doc
: nullable ADoc,
1078 n_kwredef
: nullable TKwredef,
1079 n_visibility
: nullable AVisibility,
1080 n_methid
: nullable AMethid,
1081 n_signature
: nullable ASignature
1086 if n_doc
!= null then
1089 _n_kwredef
= n_kwredef
1090 if n_kwredef
!= null then
1091 n_kwredef
.parent
= self
1093 _n_visibility
= n_visibility
.as(not null)
1094 n_visibility
.parent
= self
1095 _n_methid
= n_methid
.as(not null)
1096 n_methid
.parent
= self
1097 _n_signature
= n_signature
.as(not null)
1098 n_signature
.parent
= self
1101 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1103 if _n_doc
== old_child
then
1104 if new_child
!= null then
1105 new_child
.parent
= self
1106 assert new_child
isa ADoc
1113 if _n_kwredef
== old_child
then
1114 if new_child
!= null then
1115 new_child
.parent
= self
1116 assert new_child
isa TKwredef
1117 _n_kwredef
= new_child
1123 if _n_visibility
== old_child
then
1124 if new_child
!= null then
1125 new_child
.parent
= self
1126 assert new_child
isa AVisibility
1127 _n_visibility
= new_child
1133 if _n_methid
== old_child
then
1134 if new_child
!= null then
1135 new_child
.parent
= self
1136 assert new_child
isa AMethid
1137 _n_methid
= new_child
1143 if _n_signature
== old_child
then
1144 if new_child
!= null then
1145 new_child
.parent
= self
1146 assert new_child
isa ASignature
1147 _n_signature
= new_child
1155 redef fun visit_all
(v
: Visitor)
1157 if _n_doc
!= null then
1158 v
.enter_visit
(_n_doc
.as(not null))
1160 if _n_kwredef
!= null then
1161 v
.enter_visit
(_n_kwredef
.as(not null))
1163 v
.enter_visit
(_n_visibility
)
1164 v
.enter_visit
(_n_methid
)
1165 v
.enter_visit
(_n_signature
)
1168 redef class ADeferredMethPropdef
1169 private init empty_init
do end
1171 init init_adeferredmethpropdef
(
1172 n_doc
: nullable ADoc,
1173 n_kwredef
: nullable TKwredef,
1174 n_visibility
: nullable AVisibility,
1175 n_kwmeth
: nullable TKwmeth,
1176 n_methid
: nullable AMethid,
1177 n_signature
: nullable ASignature
1182 if n_doc
!= null then
1185 _n_kwredef
= n_kwredef
1186 if n_kwredef
!= null then
1187 n_kwredef
.parent
= self
1189 _n_visibility
= n_visibility
.as(not null)
1190 n_visibility
.parent
= self
1191 _n_kwmeth
= n_kwmeth
.as(not null)
1192 n_kwmeth
.parent
= self
1193 _n_methid
= n_methid
.as(not null)
1194 n_methid
.parent
= self
1195 _n_signature
= n_signature
.as(not null)
1196 n_signature
.parent
= self
1199 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1201 if _n_doc
== old_child
then
1202 if new_child
!= null then
1203 new_child
.parent
= self
1204 assert new_child
isa ADoc
1211 if _n_kwredef
== old_child
then
1212 if new_child
!= null then
1213 new_child
.parent
= self
1214 assert new_child
isa TKwredef
1215 _n_kwredef
= new_child
1221 if _n_visibility
== old_child
then
1222 if new_child
!= null then
1223 new_child
.parent
= self
1224 assert new_child
isa AVisibility
1225 _n_visibility
= new_child
1231 if _n_kwmeth
== old_child
then
1232 if new_child
!= null then
1233 new_child
.parent
= self
1234 assert new_child
isa TKwmeth
1235 _n_kwmeth
= new_child
1241 if _n_methid
== old_child
then
1242 if new_child
!= null then
1243 new_child
.parent
= self
1244 assert new_child
isa AMethid
1245 _n_methid
= new_child
1251 if _n_signature
== old_child
then
1252 if new_child
!= null then
1253 new_child
.parent
= self
1254 assert new_child
isa ASignature
1255 _n_signature
= new_child
1263 redef fun visit_all
(v
: Visitor)
1265 if _n_doc
!= null then
1266 v
.enter_visit
(_n_doc
.as(not null))
1268 if _n_kwredef
!= null then
1269 v
.enter_visit
(_n_kwredef
.as(not null))
1271 v
.enter_visit
(_n_visibility
)
1272 v
.enter_visit
(_n_kwmeth
)
1273 v
.enter_visit
(_n_methid
)
1274 v
.enter_visit
(_n_signature
)
1277 redef class AInternMethPropdef
1278 private init empty_init
do end
1280 init init_ainternmethpropdef
(
1281 n_doc
: nullable ADoc,
1282 n_kwredef
: nullable TKwredef,
1283 n_visibility
: nullable AVisibility,
1284 n_kwmeth
: nullable TKwmeth,
1285 n_methid
: nullable AMethid,
1286 n_signature
: nullable ASignature
1291 if n_doc
!= null then
1294 _n_kwredef
= n_kwredef
1295 if n_kwredef
!= null then
1296 n_kwredef
.parent
= self
1298 _n_visibility
= n_visibility
.as(not null)
1299 n_visibility
.parent
= self
1300 _n_kwmeth
= n_kwmeth
.as(not null)
1301 n_kwmeth
.parent
= self
1302 _n_methid
= n_methid
.as(not null)
1303 n_methid
.parent
= self
1304 _n_signature
= n_signature
.as(not null)
1305 n_signature
.parent
= self
1308 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1310 if _n_doc
== old_child
then
1311 if new_child
!= null then
1312 new_child
.parent
= self
1313 assert new_child
isa ADoc
1320 if _n_kwredef
== old_child
then
1321 if new_child
!= null then
1322 new_child
.parent
= self
1323 assert new_child
isa TKwredef
1324 _n_kwredef
= new_child
1330 if _n_visibility
== old_child
then
1331 if new_child
!= null then
1332 new_child
.parent
= self
1333 assert new_child
isa AVisibility
1334 _n_visibility
= new_child
1340 if _n_kwmeth
== old_child
then
1341 if new_child
!= null then
1342 new_child
.parent
= self
1343 assert new_child
isa TKwmeth
1344 _n_kwmeth
= new_child
1350 if _n_methid
== old_child
then
1351 if new_child
!= null then
1352 new_child
.parent
= self
1353 assert new_child
isa AMethid
1354 _n_methid
= new_child
1360 if _n_signature
== old_child
then
1361 if new_child
!= null then
1362 new_child
.parent
= self
1363 assert new_child
isa ASignature
1364 _n_signature
= new_child
1372 redef fun visit_all
(v
: Visitor)
1374 if _n_doc
!= null then
1375 v
.enter_visit
(_n_doc
.as(not null))
1377 if _n_kwredef
!= null then
1378 v
.enter_visit
(_n_kwredef
.as(not null))
1380 v
.enter_visit
(_n_visibility
)
1381 v
.enter_visit
(_n_kwmeth
)
1382 v
.enter_visit
(_n_methid
)
1383 v
.enter_visit
(_n_signature
)
1386 redef class AExternMethPropdef
1387 private init empty_init
do end
1389 init init_aexternmethpropdef
(
1390 n_doc
: nullable ADoc,
1391 n_kwredef
: nullable TKwredef,
1392 n_visibility
: nullable AVisibility,
1393 n_kwmeth
: nullable TKwmeth,
1394 n_methid
: nullable AMethid,
1395 n_signature
: nullable ASignature,
1396 n_extern
: nullable TString
1401 if n_doc
!= null then
1404 _n_kwredef
= n_kwredef
1405 if n_kwredef
!= null then
1406 n_kwredef
.parent
= self
1408 _n_visibility
= n_visibility
.as(not null)
1409 n_visibility
.parent
= self
1410 _n_kwmeth
= n_kwmeth
.as(not null)
1411 n_kwmeth
.parent
= self
1412 _n_methid
= n_methid
.as(not null)
1413 n_methid
.parent
= self
1414 _n_signature
= n_signature
.as(not null)
1415 n_signature
.parent
= self
1416 _n_extern
= n_extern
1417 if n_extern
!= null then
1418 n_extern
.parent
= self
1422 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1424 if _n_doc
== old_child
then
1425 if new_child
!= null then
1426 new_child
.parent
= self
1427 assert new_child
isa ADoc
1434 if _n_kwredef
== old_child
then
1435 if new_child
!= null then
1436 new_child
.parent
= self
1437 assert new_child
isa TKwredef
1438 _n_kwredef
= new_child
1444 if _n_visibility
== old_child
then
1445 if new_child
!= null then
1446 new_child
.parent
= self
1447 assert new_child
isa AVisibility
1448 _n_visibility
= new_child
1454 if _n_kwmeth
== old_child
then
1455 if new_child
!= null then
1456 new_child
.parent
= self
1457 assert new_child
isa TKwmeth
1458 _n_kwmeth
= new_child
1464 if _n_methid
== old_child
then
1465 if new_child
!= null then
1466 new_child
.parent
= self
1467 assert new_child
isa AMethid
1468 _n_methid
= new_child
1474 if _n_signature
== old_child
then
1475 if new_child
!= null then
1476 new_child
.parent
= self
1477 assert new_child
isa ASignature
1478 _n_signature
= new_child
1484 if _n_extern
== old_child
then
1485 if new_child
!= null then
1486 new_child
.parent
= self
1487 assert new_child
isa TString
1488 _n_extern
= new_child
1496 redef fun visit_all
(v
: Visitor)
1498 if _n_doc
!= null then
1499 v
.enter_visit
(_n_doc
.as(not null))
1501 if _n_kwredef
!= null then
1502 v
.enter_visit
(_n_kwredef
.as(not null))
1504 v
.enter_visit
(_n_visibility
)
1505 v
.enter_visit
(_n_kwmeth
)
1506 v
.enter_visit
(_n_methid
)
1507 v
.enter_visit
(_n_signature
)
1508 if _n_extern
!= null then
1509 v
.enter_visit
(_n_extern
.as(not null))
1513 redef class AConcreteMethPropdef
1514 private init empty_init
do end
1516 init init_aconcretemethpropdef
(
1517 n_doc
: nullable ADoc,
1518 n_kwredef
: nullable TKwredef,
1519 n_visibility
: nullable AVisibility,
1520 n_kwmeth
: nullable TKwmeth,
1521 n_methid
: nullable AMethid,
1522 n_signature
: nullable ASignature,
1523 n_block
: nullable AExpr
1528 if n_doc
!= null then
1531 _n_kwredef
= n_kwredef
1532 if n_kwredef
!= null then
1533 n_kwredef
.parent
= self
1535 _n_visibility
= n_visibility
.as(not null)
1536 n_visibility
.parent
= self
1537 _n_kwmeth
= n_kwmeth
.as(not null)
1538 n_kwmeth
.parent
= self
1539 _n_methid
= n_methid
.as(not null)
1540 n_methid
.parent
= self
1541 _n_signature
= n_signature
.as(not null)
1542 n_signature
.parent
= self
1544 if n_block
!= null then
1545 n_block
.parent
= self
1549 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1551 if _n_doc
== old_child
then
1552 if new_child
!= null then
1553 new_child
.parent
= self
1554 assert new_child
isa ADoc
1561 if _n_kwredef
== old_child
then
1562 if new_child
!= null then
1563 new_child
.parent
= self
1564 assert new_child
isa TKwredef
1565 _n_kwredef
= new_child
1571 if _n_visibility
== old_child
then
1572 if new_child
!= null then
1573 new_child
.parent
= self
1574 assert new_child
isa AVisibility
1575 _n_visibility
= new_child
1581 if _n_kwmeth
== old_child
then
1582 if new_child
!= null then
1583 new_child
.parent
= self
1584 assert new_child
isa TKwmeth
1585 _n_kwmeth
= new_child
1591 if _n_methid
== old_child
then
1592 if new_child
!= null then
1593 new_child
.parent
= self
1594 assert new_child
isa AMethid
1595 _n_methid
= new_child
1601 if _n_signature
== old_child
then
1602 if new_child
!= null then
1603 new_child
.parent
= self
1604 assert new_child
isa ASignature
1605 _n_signature
= new_child
1611 if _n_block
== old_child
then
1612 if new_child
!= null then
1613 new_child
.parent
= self
1614 assert new_child
isa AExpr
1615 _n_block
= new_child
1623 redef fun visit_all
(v
: Visitor)
1625 if _n_doc
!= null then
1626 v
.enter_visit
(_n_doc
.as(not null))
1628 if _n_kwredef
!= null then
1629 v
.enter_visit
(_n_kwredef
.as(not null))
1631 v
.enter_visit
(_n_visibility
)
1632 v
.enter_visit
(_n_kwmeth
)
1633 v
.enter_visit
(_n_methid
)
1634 v
.enter_visit
(_n_signature
)
1635 if _n_block
!= null then
1636 v
.enter_visit
(_n_block
.as(not null))
1640 redef class AConcreteInitPropdef
1641 private init empty_init
do end
1643 init init_aconcreteinitpropdef
(
1644 n_doc
: nullable ADoc,
1645 n_kwredef
: nullable TKwredef,
1646 n_visibility
: nullable AVisibility,
1647 n_kwinit
: nullable TKwinit,
1648 n_methid
: nullable AMethid,
1649 n_signature
: nullable ASignature,
1650 n_block
: nullable AExpr
1655 if n_doc
!= null then
1658 _n_kwredef
= n_kwredef
1659 if n_kwredef
!= null then
1660 n_kwredef
.parent
= self
1662 _n_visibility
= n_visibility
.as(not null)
1663 n_visibility
.parent
= self
1664 _n_kwinit
= n_kwinit
.as(not null)
1665 n_kwinit
.parent
= self
1666 _n_methid
= n_methid
1667 if n_methid
!= null then
1668 n_methid
.parent
= self
1670 _n_signature
= n_signature
.as(not null)
1671 n_signature
.parent
= self
1673 if n_block
!= null then
1674 n_block
.parent
= self
1678 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1680 if _n_doc
== old_child
then
1681 if new_child
!= null then
1682 new_child
.parent
= self
1683 assert new_child
isa ADoc
1690 if _n_kwredef
== old_child
then
1691 if new_child
!= null then
1692 new_child
.parent
= self
1693 assert new_child
isa TKwredef
1694 _n_kwredef
= new_child
1700 if _n_visibility
== old_child
then
1701 if new_child
!= null then
1702 new_child
.parent
= self
1703 assert new_child
isa AVisibility
1704 _n_visibility
= new_child
1710 if _n_kwinit
== old_child
then
1711 if new_child
!= null then
1712 new_child
.parent
= self
1713 assert new_child
isa TKwinit
1714 _n_kwinit
= new_child
1720 if _n_methid
== old_child
then
1721 if new_child
!= null then
1722 new_child
.parent
= self
1723 assert new_child
isa AMethid
1724 _n_methid
= new_child
1730 if _n_signature
== old_child
then
1731 if new_child
!= null then
1732 new_child
.parent
= self
1733 assert new_child
isa ASignature
1734 _n_signature
= new_child
1740 if _n_block
== old_child
then
1741 if new_child
!= null then
1742 new_child
.parent
= self
1743 assert new_child
isa AExpr
1744 _n_block
= new_child
1752 redef fun visit_all
(v
: Visitor)
1754 if _n_doc
!= null then
1755 v
.enter_visit
(_n_doc
.as(not null))
1757 if _n_kwredef
!= null then
1758 v
.enter_visit
(_n_kwredef
.as(not null))
1760 v
.enter_visit
(_n_visibility
)
1761 v
.enter_visit
(_n_kwinit
)
1762 if _n_methid
!= null then
1763 v
.enter_visit
(_n_methid
.as(not null))
1765 v
.enter_visit
(_n_signature
)
1766 if _n_block
!= null then
1767 v
.enter_visit
(_n_block
.as(not null))
1771 redef class AMainMethPropdef
1772 private init empty_init
do end
1774 init init_amainmethpropdef
(
1775 n_kwredef
: nullable TKwredef,
1776 n_block
: nullable AExpr
1780 _n_kwredef
= n_kwredef
1781 if n_kwredef
!= null then
1782 n_kwredef
.parent
= self
1785 if n_block
!= null then
1786 n_block
.parent
= self
1790 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1792 if _n_kwredef
== old_child
then
1793 if new_child
!= null then
1794 new_child
.parent
= self
1795 assert new_child
isa TKwredef
1796 _n_kwredef
= new_child
1802 if _n_block
== old_child
then
1803 if new_child
!= null then
1804 new_child
.parent
= self
1805 assert new_child
isa AExpr
1806 _n_block
= new_child
1814 redef fun visit_all
(v
: Visitor)
1816 if _n_kwredef
!= null then
1817 v
.enter_visit
(_n_kwredef
.as(not null))
1819 if _n_block
!= null then
1820 v
.enter_visit
(_n_block
.as(not null))
1824 redef class ATypePropdef
1825 private init empty_init
do end
1827 init init_atypepropdef
(
1828 n_doc
: nullable ADoc,
1829 n_kwredef
: nullable TKwredef,
1830 n_visibility
: nullable AVisibility,
1831 n_kwtype
: nullable TKwtype,
1832 n_id
: nullable TClassid,
1833 n_type
: nullable AType
1838 if n_doc
!= null then
1841 _n_kwredef
= n_kwredef
1842 if n_kwredef
!= null then
1843 n_kwredef
.parent
= self
1845 _n_visibility
= n_visibility
.as(not null)
1846 n_visibility
.parent
= self
1847 _n_kwtype
= n_kwtype
.as(not null)
1848 n_kwtype
.parent
= self
1849 _n_id
= n_id
.as(not null)
1851 _n_type
= n_type
.as(not null)
1852 n_type
.parent
= self
1855 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1857 if _n_doc
== old_child
then
1858 if new_child
!= null then
1859 new_child
.parent
= self
1860 assert new_child
isa ADoc
1867 if _n_kwredef
== old_child
then
1868 if new_child
!= null then
1869 new_child
.parent
= self
1870 assert new_child
isa TKwredef
1871 _n_kwredef
= new_child
1877 if _n_visibility
== old_child
then
1878 if new_child
!= null then
1879 new_child
.parent
= self
1880 assert new_child
isa AVisibility
1881 _n_visibility
= new_child
1887 if _n_kwtype
== old_child
then
1888 if new_child
!= null then
1889 new_child
.parent
= self
1890 assert new_child
isa TKwtype
1891 _n_kwtype
= new_child
1897 if _n_id
== old_child
then
1898 if new_child
!= null then
1899 new_child
.parent
= self
1900 assert new_child
isa TClassid
1907 if _n_type
== old_child
then
1908 if new_child
!= null then
1909 new_child
.parent
= self
1910 assert new_child
isa AType
1919 redef fun visit_all
(v
: Visitor)
1921 if _n_doc
!= null then
1922 v
.enter_visit
(_n_doc
.as(not null))
1924 if _n_kwredef
!= null then
1925 v
.enter_visit
(_n_kwredef
.as(not null))
1927 v
.enter_visit
(_n_visibility
)
1928 v
.enter_visit
(_n_kwtype
)
1929 v
.enter_visit
(_n_id
)
1930 v
.enter_visit
(_n_type
)
1933 redef class AReadAble
1934 private init empty_init
do end
1936 init init_areadable
(
1937 n_kwredef
: nullable TKwredef,
1938 n_kwreadable
: nullable TKwreadable
1942 _n_kwredef
= n_kwredef
1943 if n_kwredef
!= null then
1944 n_kwredef
.parent
= self
1946 _n_kwreadable
= n_kwreadable
.as(not null)
1947 n_kwreadable
.parent
= self
1950 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1952 if _n_kwredef
== old_child
then
1953 if new_child
!= null then
1954 new_child
.parent
= self
1955 assert new_child
isa TKwredef
1956 _n_kwredef
= new_child
1962 if _n_kwreadable
== old_child
then
1963 if new_child
!= null then
1964 new_child
.parent
= self
1965 assert new_child
isa TKwreadable
1966 _n_kwreadable
= new_child
1974 redef fun visit_all
(v
: Visitor)
1976 if _n_kwredef
!= null then
1977 v
.enter_visit
(_n_kwredef
.as(not null))
1979 v
.enter_visit
(_n_kwreadable
)
1982 redef class AWriteAble
1983 private init empty_init
do end
1985 init init_awriteable
(
1986 n_kwredef
: nullable TKwredef,
1987 n_kwwritable
: nullable TKwwritable
1991 _n_kwredef
= n_kwredef
1992 if n_kwredef
!= null then
1993 n_kwredef
.parent
= self
1995 _n_kwwritable
= n_kwwritable
.as(not null)
1996 n_kwwritable
.parent
= self
1999 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2001 if _n_kwredef
== old_child
then
2002 if new_child
!= null then
2003 new_child
.parent
= self
2004 assert new_child
isa TKwredef
2005 _n_kwredef
= new_child
2011 if _n_kwwritable
== old_child
then
2012 if new_child
!= null then
2013 new_child
.parent
= self
2014 assert new_child
isa TKwwritable
2015 _n_kwwritable
= new_child
2023 redef fun visit_all
(v
: Visitor)
2025 if _n_kwredef
!= null then
2026 v
.enter_visit
(_n_kwredef
.as(not null))
2028 v
.enter_visit
(_n_kwwritable
)
2031 redef class AIdMethid
2032 private init empty_init
do end
2034 init init_aidmethid
(
2039 _n_id
= n_id
.as(not null)
2043 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2045 if _n_id
== old_child
then
2046 if new_child
!= null then
2047 new_child
.parent
= self
2048 assert new_child
isa TId
2057 redef fun visit_all
(v
: Visitor)
2059 v
.enter_visit
(_n_id
)
2062 redef class APlusMethid
2063 private init empty_init
do end
2065 init init_aplusmethid
(
2066 n_plus
: nullable TPlus
2070 _n_plus
= n_plus
.as(not null)
2071 n_plus
.parent
= self
2074 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2076 if _n_plus
== old_child
then
2077 if new_child
!= null then
2078 new_child
.parent
= self
2079 assert new_child
isa TPlus
2088 redef fun visit_all
(v
: Visitor)
2090 v
.enter_visit
(_n_plus
)
2093 redef class AMinusMethid
2094 private init empty_init
do end
2096 init init_aminusmethid
(
2097 n_minus
: nullable TMinus
2101 _n_minus
= n_minus
.as(not null)
2102 n_minus
.parent
= self
2105 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2107 if _n_minus
== old_child
then
2108 if new_child
!= null then
2109 new_child
.parent
= self
2110 assert new_child
isa TMinus
2111 _n_minus
= new_child
2119 redef fun visit_all
(v
: Visitor)
2121 v
.enter_visit
(_n_minus
)
2124 redef class AStarMethid
2125 private init empty_init
do end
2127 init init_astarmethid
(
2128 n_star
: nullable TStar
2132 _n_star
= n_star
.as(not null)
2133 n_star
.parent
= self
2136 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2138 if _n_star
== old_child
then
2139 if new_child
!= null then
2140 new_child
.parent
= self
2141 assert new_child
isa TStar
2150 redef fun visit_all
(v
: Visitor)
2152 v
.enter_visit
(_n_star
)
2155 redef class ASlashMethid
2156 private init empty_init
do end
2158 init init_aslashmethid
(
2159 n_slash
: nullable TSlash
2163 _n_slash
= n_slash
.as(not null)
2164 n_slash
.parent
= self
2167 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2169 if _n_slash
== old_child
then
2170 if new_child
!= null then
2171 new_child
.parent
= self
2172 assert new_child
isa TSlash
2173 _n_slash
= new_child
2181 redef fun visit_all
(v
: Visitor)
2183 v
.enter_visit
(_n_slash
)
2186 redef class APercentMethid
2187 private init empty_init
do end
2189 init init_apercentmethid
(
2190 n_percent
: nullable TPercent
2194 _n_percent
= n_percent
.as(not null)
2195 n_percent
.parent
= self
2198 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2200 if _n_percent
== old_child
then
2201 if new_child
!= null then
2202 new_child
.parent
= self
2203 assert new_child
isa TPercent
2204 _n_percent
= new_child
2212 redef fun visit_all
(v
: Visitor)
2214 v
.enter_visit
(_n_percent
)
2217 redef class AEqMethid
2218 private init empty_init
do end
2220 init init_aeqmethid
(
2225 _n_eq
= n_eq
.as(not null)
2229 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2231 if _n_eq
== old_child
then
2232 if new_child
!= null then
2233 new_child
.parent
= self
2234 assert new_child
isa TEq
2243 redef fun visit_all
(v
: Visitor)
2245 v
.enter_visit
(_n_eq
)
2248 redef class ANeMethid
2249 private init empty_init
do end
2251 init init_anemethid
(
2256 _n_ne
= n_ne
.as(not null)
2260 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2262 if _n_ne
== old_child
then
2263 if new_child
!= null then
2264 new_child
.parent
= self
2265 assert new_child
isa TNe
2274 redef fun visit_all
(v
: Visitor)
2276 v
.enter_visit
(_n_ne
)
2279 redef class ALeMethid
2280 private init empty_init
do end
2282 init init_alemethid
(
2287 _n_le
= n_le
.as(not null)
2291 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2293 if _n_le
== old_child
then
2294 if new_child
!= null then
2295 new_child
.parent
= self
2296 assert new_child
isa TLe
2305 redef fun visit_all
(v
: Visitor)
2307 v
.enter_visit
(_n_le
)
2310 redef class AGeMethid
2311 private init empty_init
do end
2313 init init_agemethid
(
2318 _n_ge
= n_ge
.as(not null)
2322 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2324 if _n_ge
== old_child
then
2325 if new_child
!= null then
2326 new_child
.parent
= self
2327 assert new_child
isa TGe
2336 redef fun visit_all
(v
: Visitor)
2338 v
.enter_visit
(_n_ge
)
2341 redef class ALtMethid
2342 private init empty_init
do end
2344 init init_altmethid
(
2349 _n_lt
= n_lt
.as(not null)
2353 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2355 if _n_lt
== old_child
then
2356 if new_child
!= null then
2357 new_child
.parent
= self
2358 assert new_child
isa TLt
2367 redef fun visit_all
(v
: Visitor)
2369 v
.enter_visit
(_n_lt
)
2372 redef class AGtMethid
2373 private init empty_init
do end
2375 init init_agtmethid
(
2380 _n_gt
= n_gt
.as(not null)
2384 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2386 if _n_gt
== old_child
then
2387 if new_child
!= null then
2388 new_child
.parent
= self
2389 assert new_child
isa TGt
2398 redef fun visit_all
(v
: Visitor)
2400 v
.enter_visit
(_n_gt
)
2403 redef class ABraMethid
2404 private init empty_init
do end
2406 init init_abramethid
(
2407 n_obra
: nullable TObra,
2408 n_cbra
: nullable TCbra
2412 _n_obra
= n_obra
.as(not null)
2413 n_obra
.parent
= self
2414 _n_cbra
= n_cbra
.as(not null)
2415 n_cbra
.parent
= self
2418 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2420 if _n_obra
== old_child
then
2421 if new_child
!= null then
2422 new_child
.parent
= self
2423 assert new_child
isa TObra
2430 if _n_cbra
== old_child
then
2431 if new_child
!= null then
2432 new_child
.parent
= self
2433 assert new_child
isa TCbra
2442 redef fun visit_all
(v
: Visitor)
2444 v
.enter_visit
(_n_obra
)
2445 v
.enter_visit
(_n_cbra
)
2448 redef class AStarshipMethid
2449 private init empty_init
do end
2451 init init_astarshipmethid
(
2452 n_starship
: nullable TStarship
2456 _n_starship
= n_starship
.as(not null)
2457 n_starship
.parent
= self
2460 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2462 if _n_starship
== old_child
then
2463 if new_child
!= null then
2464 new_child
.parent
= self
2465 assert new_child
isa TStarship
2466 _n_starship
= new_child
2474 redef fun visit_all
(v
: Visitor)
2476 v
.enter_visit
(_n_starship
)
2479 redef class AAssignMethid
2480 private init empty_init
do end
2482 init init_aassignmethid
(
2484 n_assign
: nullable TAssign
2488 _n_id
= n_id
.as(not null)
2490 _n_assign
= n_assign
.as(not null)
2491 n_assign
.parent
= self
2494 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2496 if _n_id
== old_child
then
2497 if new_child
!= null then
2498 new_child
.parent
= self
2499 assert new_child
isa TId
2506 if _n_assign
== old_child
then
2507 if new_child
!= null then
2508 new_child
.parent
= self
2509 assert new_child
isa TAssign
2510 _n_assign
= new_child
2518 redef fun visit_all
(v
: Visitor)
2520 v
.enter_visit
(_n_id
)
2521 v
.enter_visit
(_n_assign
)
2524 redef class ABraassignMethid
2525 private init empty_init
do end
2527 init init_abraassignmethid
(
2528 n_obra
: nullable TObra,
2529 n_cbra
: nullable TCbra,
2530 n_assign
: nullable TAssign
2534 _n_obra
= n_obra
.as(not null)
2535 n_obra
.parent
= self
2536 _n_cbra
= n_cbra
.as(not null)
2537 n_cbra
.parent
= self
2538 _n_assign
= n_assign
.as(not null)
2539 n_assign
.parent
= self
2542 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2544 if _n_obra
== old_child
then
2545 if new_child
!= null then
2546 new_child
.parent
= self
2547 assert new_child
isa TObra
2554 if _n_cbra
== old_child
then
2555 if new_child
!= null then
2556 new_child
.parent
= self
2557 assert new_child
isa TCbra
2564 if _n_assign
== old_child
then
2565 if new_child
!= null then
2566 new_child
.parent
= self
2567 assert new_child
isa TAssign
2568 _n_assign
= new_child
2576 redef fun visit_all
(v
: Visitor)
2578 v
.enter_visit
(_n_obra
)
2579 v
.enter_visit
(_n_cbra
)
2580 v
.enter_visit
(_n_assign
)
2583 redef class ASignature
2584 private init empty_init
do end
2586 init init_asignature
(
2587 n_params
: Collection[Object], # Should be Collection[AParam]
2588 n_type
: nullable AType,
2589 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2593 for n
in n_params
do
2599 if n_type
!= null then
2600 n_type
.parent
= self
2602 for n
in n_closure_decls
do
2603 assert n
isa AClosureDecl
2604 _n_closure_decls
.add
(n
)
2609 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2611 for i
in [0.._n_params
.length
[ do
2612 if _n_params
[i
] == old_child
then
2613 if new_child
!= null then
2614 assert new_child
isa AParam
2615 _n_params
[i
] = new_child
2616 new_child
.parent
= self
2618 _n_params
.remove_at
(i
)
2623 if _n_type
== old_child
then
2624 if new_child
!= null then
2625 new_child
.parent
= self
2626 assert new_child
isa AType
2633 for i
in [0.._n_closure_decls
.length
[ do
2634 if _n_closure_decls
[i
] == old_child
then
2635 if new_child
!= null then
2636 assert new_child
isa AClosureDecl
2637 _n_closure_decls
[i
] = new_child
2638 new_child
.parent
= self
2640 _n_closure_decls
.remove_at
(i
)
2647 redef fun visit_all
(v
: Visitor)
2649 for n
in _n_params
do
2652 if _n_type
!= null then
2653 v
.enter_visit
(_n_type
.as(not null))
2655 for n
in _n_closure_decls
do
2661 private init empty_init
do end
2665 n_type
: nullable AType,
2666 n_dotdotdot
: nullable TDotdotdot
2670 _n_id
= n_id
.as(not null)
2673 if n_type
!= null then
2674 n_type
.parent
= self
2676 _n_dotdotdot
= n_dotdotdot
2677 if n_dotdotdot
!= null then
2678 n_dotdotdot
.parent
= self
2682 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2684 if _n_id
== old_child
then
2685 if new_child
!= null then
2686 new_child
.parent
= self
2687 assert new_child
isa TId
2694 if _n_type
== old_child
then
2695 if new_child
!= null then
2696 new_child
.parent
= self
2697 assert new_child
isa AType
2704 if _n_dotdotdot
== old_child
then
2705 if new_child
!= null then
2706 new_child
.parent
= self
2707 assert new_child
isa TDotdotdot
2708 _n_dotdotdot
= new_child
2716 redef fun visit_all
(v
: Visitor)
2718 v
.enter_visit
(_n_id
)
2719 if _n_type
!= null then
2720 v
.enter_visit
(_n_type
.as(not null))
2722 if _n_dotdotdot
!= null then
2723 v
.enter_visit
(_n_dotdotdot
.as(not null))
2727 redef class AClosureDecl
2728 private init empty_init
do end
2730 init init_aclosuredecl
(
2731 n_kwbreak
: nullable TKwbreak,
2732 n_bang
: nullable TBang,
2734 n_signature
: nullable ASignature,
2735 n_expr
: nullable AExpr
2739 _n_kwbreak
= n_kwbreak
2740 if n_kwbreak
!= null then
2741 n_kwbreak
.parent
= self
2743 _n_bang
= n_bang
.as(not null)
2744 n_bang
.parent
= self
2745 _n_id
= n_id
.as(not null)
2747 _n_signature
= n_signature
.as(not null)
2748 n_signature
.parent
= self
2750 if n_expr
!= null then
2751 n_expr
.parent
= self
2755 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2757 if _n_kwbreak
== old_child
then
2758 if new_child
!= null then
2759 new_child
.parent
= self
2760 assert new_child
isa TKwbreak
2761 _n_kwbreak
= new_child
2767 if _n_bang
== old_child
then
2768 if new_child
!= null then
2769 new_child
.parent
= self
2770 assert new_child
isa TBang
2777 if _n_id
== old_child
then
2778 if new_child
!= null then
2779 new_child
.parent
= self
2780 assert new_child
isa TId
2787 if _n_signature
== old_child
then
2788 if new_child
!= null then
2789 new_child
.parent
= self
2790 assert new_child
isa ASignature
2791 _n_signature
= new_child
2797 if _n_expr
== old_child
then
2798 if new_child
!= null then
2799 new_child
.parent
= self
2800 assert new_child
isa AExpr
2809 redef fun visit_all
(v
: Visitor)
2811 if _n_kwbreak
!= null then
2812 v
.enter_visit
(_n_kwbreak
.as(not null))
2814 v
.enter_visit
(_n_bang
)
2815 v
.enter_visit
(_n_id
)
2816 v
.enter_visit
(_n_signature
)
2817 if _n_expr
!= null then
2818 v
.enter_visit
(_n_expr
.as(not null))
2823 private init empty_init
do end
2826 n_kwnullable
: nullable TKwnullable,
2827 n_id
: nullable TClassid,
2828 n_types
: Collection[Object] # Should be Collection[AType]
2832 _n_kwnullable
= n_kwnullable
2833 if n_kwnullable
!= null then
2834 n_kwnullable
.parent
= self
2836 _n_id
= n_id
.as(not null)
2845 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2847 if _n_kwnullable
== old_child
then
2848 if new_child
!= null then
2849 new_child
.parent
= self
2850 assert new_child
isa TKwnullable
2851 _n_kwnullable
= new_child
2853 _n_kwnullable
= null
2857 if _n_id
== old_child
then
2858 if new_child
!= null then
2859 new_child
.parent
= self
2860 assert new_child
isa TClassid
2867 for i
in [0.._n_types
.length
[ do
2868 if _n_types
[i
] == old_child
then
2869 if new_child
!= null then
2870 assert new_child
isa AType
2871 _n_types
[i
] = new_child
2872 new_child
.parent
= self
2874 _n_types
.remove_at
(i
)
2881 redef fun visit_all
(v
: Visitor)
2883 if _n_kwnullable
!= null then
2884 v
.enter_visit
(_n_kwnullable
.as(not null))
2886 v
.enter_visit
(_n_id
)
2887 for n
in _n_types
do
2893 private init empty_init
do end
2896 n_kwlabel
: nullable TKwlabel,
2901 _n_kwlabel
= n_kwlabel
.as(not null)
2902 n_kwlabel
.parent
= self
2903 _n_id
= n_id
.as(not null)
2907 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2909 if _n_kwlabel
== old_child
then
2910 if new_child
!= null then
2911 new_child
.parent
= self
2912 assert new_child
isa TKwlabel
2913 _n_kwlabel
= new_child
2919 if _n_id
== old_child
then
2920 if new_child
!= null then
2921 new_child
.parent
= self
2922 assert new_child
isa TId
2931 redef fun visit_all
(v
: Visitor)
2933 v
.enter_visit
(_n_kwlabel
)
2934 v
.enter_visit
(_n_id
)
2937 redef class ABlockExpr
2938 private init empty_init
do end
2940 init init_ablockexpr
(
2941 n_expr
: Collection[Object] # Should be Collection[AExpr]
2952 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2954 for i
in [0.._n_expr
.length
[ do
2955 if _n_expr
[i
] == old_child
then
2956 if new_child
!= null then
2957 assert new_child
isa AExpr
2958 _n_expr
[i
] = new_child
2959 new_child
.parent
= self
2961 _n_expr
.remove_at
(i
)
2968 redef fun visit_all
(v
: Visitor)
2975 redef class AVardeclExpr
2976 private init empty_init
do end
2978 init init_avardeclexpr
(
2979 n_kwvar
: nullable TKwvar,
2981 n_type
: nullable AType,
2982 n_assign
: nullable TAssign,
2983 n_expr
: nullable AExpr
2987 _n_kwvar
= n_kwvar
.as(not null)
2988 n_kwvar
.parent
= self
2989 _n_id
= n_id
.as(not null)
2992 if n_type
!= null then
2993 n_type
.parent
= self
2995 _n_assign
= n_assign
2996 if n_assign
!= null then
2997 n_assign
.parent
= self
3000 if n_expr
!= null then
3001 n_expr
.parent
= self
3005 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3007 if _n_kwvar
== old_child
then
3008 if new_child
!= null then
3009 new_child
.parent
= self
3010 assert new_child
isa TKwvar
3011 _n_kwvar
= new_child
3017 if _n_id
== old_child
then
3018 if new_child
!= null then
3019 new_child
.parent
= self
3020 assert new_child
isa TId
3027 if _n_type
== old_child
then
3028 if new_child
!= null then
3029 new_child
.parent
= self
3030 assert new_child
isa AType
3037 if _n_assign
== old_child
then
3038 if new_child
!= null then
3039 new_child
.parent
= self
3040 assert new_child
isa TAssign
3041 _n_assign
= new_child
3047 if _n_expr
== old_child
then
3048 if new_child
!= null then
3049 new_child
.parent
= self
3050 assert new_child
isa AExpr
3059 redef fun visit_all
(v
: Visitor)
3061 v
.enter_visit
(_n_kwvar
)
3062 v
.enter_visit
(_n_id
)
3063 if _n_type
!= null then
3064 v
.enter_visit
(_n_type
.as(not null))
3066 if _n_assign
!= null then
3067 v
.enter_visit
(_n_assign
.as(not null))
3069 if _n_expr
!= null then
3070 v
.enter_visit
(_n_expr
.as(not null))
3074 redef class AReturnExpr
3075 private init empty_init
do end
3077 init init_areturnexpr
(
3078 n_kwreturn
: nullable TKwreturn,
3079 n_expr
: nullable AExpr
3083 _n_kwreturn
= n_kwreturn
3084 if n_kwreturn
!= null then
3085 n_kwreturn
.parent
= self
3088 if n_expr
!= null then
3089 n_expr
.parent
= self
3093 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3095 if _n_kwreturn
== old_child
then
3096 if new_child
!= null then
3097 new_child
.parent
= self
3098 assert new_child
isa TKwreturn
3099 _n_kwreturn
= new_child
3105 if _n_expr
== old_child
then
3106 if new_child
!= null then
3107 new_child
.parent
= self
3108 assert new_child
isa AExpr
3117 redef fun visit_all
(v
: Visitor)
3119 if _n_kwreturn
!= null then
3120 v
.enter_visit
(_n_kwreturn
.as(not null))
3122 if _n_expr
!= null then
3123 v
.enter_visit
(_n_expr
.as(not null))
3127 redef class ABreakExpr
3128 private init empty_init
do end
3130 init init_abreakexpr
(
3131 n_kwbreak
: nullable TKwbreak,
3132 n_label
: nullable ALabel,
3133 n_expr
: nullable AExpr
3137 _n_kwbreak
= n_kwbreak
.as(not null)
3138 n_kwbreak
.parent
= self
3140 if n_label
!= null then
3141 n_label
.parent
= self
3144 if n_expr
!= null then
3145 n_expr
.parent
= self
3149 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3151 if _n_kwbreak
== old_child
then
3152 if new_child
!= null then
3153 new_child
.parent
= self
3154 assert new_child
isa TKwbreak
3155 _n_kwbreak
= new_child
3161 if _n_label
== old_child
then
3162 if new_child
!= null then
3163 new_child
.parent
= self
3164 assert new_child
isa ALabel
3165 _n_label
= new_child
3171 if _n_expr
== old_child
then
3172 if new_child
!= null then
3173 new_child
.parent
= self
3174 assert new_child
isa AExpr
3183 redef fun visit_all
(v
: Visitor)
3185 v
.enter_visit
(_n_kwbreak
)
3186 if _n_label
!= null then
3187 v
.enter_visit
(_n_label
.as(not null))
3189 if _n_expr
!= null then
3190 v
.enter_visit
(_n_expr
.as(not null))
3194 redef class AAbortExpr
3195 private init empty_init
do end
3197 init init_aabortexpr
(
3198 n_kwabort
: nullable TKwabort
3202 _n_kwabort
= n_kwabort
.as(not null)
3203 n_kwabort
.parent
= self
3206 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3208 if _n_kwabort
== old_child
then
3209 if new_child
!= null then
3210 new_child
.parent
= self
3211 assert new_child
isa TKwabort
3212 _n_kwabort
= new_child
3220 redef fun visit_all
(v
: Visitor)
3222 v
.enter_visit
(_n_kwabort
)
3225 redef class AContinueExpr
3226 private init empty_init
do end
3228 init init_acontinueexpr
(
3229 n_kwcontinue
: nullable TKwcontinue,
3230 n_label
: nullable ALabel,
3231 n_expr
: nullable AExpr
3235 _n_kwcontinue
= n_kwcontinue
3236 if n_kwcontinue
!= null then
3237 n_kwcontinue
.parent
= self
3240 if n_label
!= null then
3241 n_label
.parent
= self
3244 if n_expr
!= null then
3245 n_expr
.parent
= self
3249 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3251 if _n_kwcontinue
== old_child
then
3252 if new_child
!= null then
3253 new_child
.parent
= self
3254 assert new_child
isa TKwcontinue
3255 _n_kwcontinue
= new_child
3257 _n_kwcontinue
= null
3261 if _n_label
== old_child
then
3262 if new_child
!= null then
3263 new_child
.parent
= self
3264 assert new_child
isa ALabel
3265 _n_label
= new_child
3271 if _n_expr
== old_child
then
3272 if new_child
!= null then
3273 new_child
.parent
= self
3274 assert new_child
isa AExpr
3283 redef fun visit_all
(v
: Visitor)
3285 if _n_kwcontinue
!= null then
3286 v
.enter_visit
(_n_kwcontinue
.as(not null))
3288 if _n_label
!= null then
3289 v
.enter_visit
(_n_label
.as(not null))
3291 if _n_expr
!= null then
3292 v
.enter_visit
(_n_expr
.as(not null))
3297 private init empty_init
do end
3300 n_kwdo
: nullable TKwdo,
3301 n_block
: nullable AExpr,
3302 n_label
: nullable ALabel
3306 _n_kwdo
= n_kwdo
.as(not null)
3307 n_kwdo
.parent
= self
3309 if n_block
!= null then
3310 n_block
.parent
= self
3313 if n_label
!= null then
3314 n_label
.parent
= self
3318 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3320 if _n_kwdo
== old_child
then
3321 if new_child
!= null then
3322 new_child
.parent
= self
3323 assert new_child
isa TKwdo
3330 if _n_block
== old_child
then
3331 if new_child
!= null then
3332 new_child
.parent
= self
3333 assert new_child
isa AExpr
3334 _n_block
= new_child
3340 if _n_label
== old_child
then
3341 if new_child
!= null then
3342 new_child
.parent
= self
3343 assert new_child
isa ALabel
3344 _n_label
= new_child
3352 redef fun visit_all
(v
: Visitor)
3354 v
.enter_visit
(_n_kwdo
)
3355 if _n_block
!= null then
3356 v
.enter_visit
(_n_block
.as(not null))
3358 if _n_label
!= null then
3359 v
.enter_visit
(_n_label
.as(not null))
3364 private init empty_init
do end
3367 n_kwif
: nullable TKwif,
3368 n_expr
: nullable AExpr,
3369 n_then
: nullable AExpr,
3370 n_else
: nullable AExpr
3374 _n_kwif
= n_kwif
.as(not null)
3375 n_kwif
.parent
= self
3376 _n_expr
= n_expr
.as(not null)
3377 n_expr
.parent
= self
3379 if n_then
!= null then
3380 n_then
.parent
= self
3383 if n_else
!= null then
3384 n_else
.parent
= self
3388 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3390 if _n_kwif
== old_child
then
3391 if new_child
!= null then
3392 new_child
.parent
= self
3393 assert new_child
isa TKwif
3400 if _n_expr
== old_child
then
3401 if new_child
!= null then
3402 new_child
.parent
= self
3403 assert new_child
isa AExpr
3410 if _n_then
== old_child
then
3411 if new_child
!= null then
3412 new_child
.parent
= self
3413 assert new_child
isa AExpr
3420 if _n_else
== old_child
then
3421 if new_child
!= null then
3422 new_child
.parent
= self
3423 assert new_child
isa AExpr
3432 redef fun visit_all
(v
: Visitor)
3434 v
.enter_visit
(_n_kwif
)
3435 v
.enter_visit
(_n_expr
)
3436 if _n_then
!= null then
3437 v
.enter_visit
(_n_then
.as(not null))
3439 if _n_else
!= null then
3440 v
.enter_visit
(_n_else
.as(not null))
3444 redef class AIfexprExpr
3445 private init empty_init
do end
3447 init init_aifexprexpr
(
3448 n_kwif
: nullable TKwif,
3449 n_expr
: nullable AExpr,
3450 n_kwthen
: nullable TKwthen,
3451 n_then
: nullable AExpr,
3452 n_kwelse
: nullable TKwelse,
3453 n_else
: nullable AExpr
3457 _n_kwif
= n_kwif
.as(not null)
3458 n_kwif
.parent
= self
3459 _n_expr
= n_expr
.as(not null)
3460 n_expr
.parent
= self
3461 _n_kwthen
= n_kwthen
.as(not null)
3462 n_kwthen
.parent
= self
3463 _n_then
= n_then
.as(not null)
3464 n_then
.parent
= self
3465 _n_kwelse
= n_kwelse
.as(not null)
3466 n_kwelse
.parent
= self
3467 _n_else
= n_else
.as(not null)
3468 n_else
.parent
= self
3471 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3473 if _n_kwif
== old_child
then
3474 if new_child
!= null then
3475 new_child
.parent
= self
3476 assert new_child
isa TKwif
3483 if _n_expr
== old_child
then
3484 if new_child
!= null then
3485 new_child
.parent
= self
3486 assert new_child
isa AExpr
3493 if _n_kwthen
== old_child
then
3494 if new_child
!= null then
3495 new_child
.parent
= self
3496 assert new_child
isa TKwthen
3497 _n_kwthen
= new_child
3503 if _n_then
== old_child
then
3504 if new_child
!= null then
3505 new_child
.parent
= self
3506 assert new_child
isa AExpr
3513 if _n_kwelse
== old_child
then
3514 if new_child
!= null then
3515 new_child
.parent
= self
3516 assert new_child
isa TKwelse
3517 _n_kwelse
= new_child
3523 if _n_else
== old_child
then
3524 if new_child
!= null then
3525 new_child
.parent
= self
3526 assert new_child
isa AExpr
3535 redef fun visit_all
(v
: Visitor)
3537 v
.enter_visit
(_n_kwif
)
3538 v
.enter_visit
(_n_expr
)
3539 v
.enter_visit
(_n_kwthen
)
3540 v
.enter_visit
(_n_then
)
3541 v
.enter_visit
(_n_kwelse
)
3542 v
.enter_visit
(_n_else
)
3545 redef class AWhileExpr
3546 private init empty_init
do end
3548 init init_awhileexpr
(
3549 n_kwwhile
: nullable TKwwhile,
3550 n_expr
: nullable AExpr,
3551 n_kwdo
: nullable TKwdo,
3552 n_block
: nullable AExpr,
3553 n_label
: nullable ALabel
3557 _n_kwwhile
= n_kwwhile
.as(not null)
3558 n_kwwhile
.parent
= self
3559 _n_expr
= n_expr
.as(not null)
3560 n_expr
.parent
= self
3561 _n_kwdo
= n_kwdo
.as(not null)
3562 n_kwdo
.parent
= self
3564 if n_block
!= null then
3565 n_block
.parent
= self
3568 if n_label
!= null then
3569 n_label
.parent
= self
3573 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3575 if _n_kwwhile
== old_child
then
3576 if new_child
!= null then
3577 new_child
.parent
= self
3578 assert new_child
isa TKwwhile
3579 _n_kwwhile
= new_child
3585 if _n_expr
== old_child
then
3586 if new_child
!= null then
3587 new_child
.parent
= self
3588 assert new_child
isa AExpr
3595 if _n_kwdo
== old_child
then
3596 if new_child
!= null then
3597 new_child
.parent
= self
3598 assert new_child
isa TKwdo
3605 if _n_block
== old_child
then
3606 if new_child
!= null then
3607 new_child
.parent
= self
3608 assert new_child
isa AExpr
3609 _n_block
= new_child
3615 if _n_label
== old_child
then
3616 if new_child
!= null then
3617 new_child
.parent
= self
3618 assert new_child
isa ALabel
3619 _n_label
= new_child
3627 redef fun visit_all
(v
: Visitor)
3629 v
.enter_visit
(_n_kwwhile
)
3630 v
.enter_visit
(_n_expr
)
3631 v
.enter_visit
(_n_kwdo
)
3632 if _n_block
!= null then
3633 v
.enter_visit
(_n_block
.as(not null))
3635 if _n_label
!= null then
3636 v
.enter_visit
(_n_label
.as(not null))
3640 redef class ALoopExpr
3641 private init empty_init
do end
3643 init init_aloopexpr
(
3644 n_kwloop
: nullable TKwloop,
3645 n_block
: nullable AExpr,
3646 n_label
: nullable ALabel
3650 _n_kwloop
= n_kwloop
.as(not null)
3651 n_kwloop
.parent
= self
3653 if n_block
!= null then
3654 n_block
.parent
= self
3657 if n_label
!= null then
3658 n_label
.parent
= self
3662 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3664 if _n_kwloop
== old_child
then
3665 if new_child
!= null then
3666 new_child
.parent
= self
3667 assert new_child
isa TKwloop
3668 _n_kwloop
= new_child
3674 if _n_block
== old_child
then
3675 if new_child
!= null then
3676 new_child
.parent
= self
3677 assert new_child
isa AExpr
3678 _n_block
= new_child
3684 if _n_label
== old_child
then
3685 if new_child
!= null then
3686 new_child
.parent
= self
3687 assert new_child
isa ALabel
3688 _n_label
= new_child
3696 redef fun visit_all
(v
: Visitor)
3698 v
.enter_visit
(_n_kwloop
)
3699 if _n_block
!= null then
3700 v
.enter_visit
(_n_block
.as(not null))
3702 if _n_label
!= null then
3703 v
.enter_visit
(_n_label
.as(not null))
3707 redef class AForExpr
3708 private init empty_init
do end
3710 init init_aforexpr
(
3711 n_kwfor
: nullable TKwfor,
3713 n_expr
: nullable AExpr,
3714 n_kwdo
: nullable TKwdo,
3715 n_block
: nullable AExpr,
3716 n_label
: nullable ALabel
3720 _n_kwfor
= n_kwfor
.as(not null)
3721 n_kwfor
.parent
= self
3722 _n_id
= n_id
.as(not null)
3724 _n_expr
= n_expr
.as(not null)
3725 n_expr
.parent
= self
3726 _n_kwdo
= n_kwdo
.as(not null)
3727 n_kwdo
.parent
= self
3729 if n_block
!= null then
3730 n_block
.parent
= self
3733 if n_label
!= null then
3734 n_label
.parent
= self
3738 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3740 if _n_kwfor
== old_child
then
3741 if new_child
!= null then
3742 new_child
.parent
= self
3743 assert new_child
isa TKwfor
3744 _n_kwfor
= new_child
3750 if _n_id
== old_child
then
3751 if new_child
!= null then
3752 new_child
.parent
= self
3753 assert new_child
isa TId
3760 if _n_expr
== old_child
then
3761 if new_child
!= null then
3762 new_child
.parent
= self
3763 assert new_child
isa AExpr
3770 if _n_kwdo
== old_child
then
3771 if new_child
!= null then
3772 new_child
.parent
= self
3773 assert new_child
isa TKwdo
3780 if _n_block
== old_child
then
3781 if new_child
!= null then
3782 new_child
.parent
= self
3783 assert new_child
isa AExpr
3784 _n_block
= new_child
3790 if _n_label
== old_child
then
3791 if new_child
!= null then
3792 new_child
.parent
= self
3793 assert new_child
isa ALabel
3794 _n_label
= new_child
3802 redef fun visit_all
(v
: Visitor)
3804 v
.enter_visit
(_n_kwfor
)
3805 v
.enter_visit
(_n_id
)
3806 v
.enter_visit
(_n_expr
)
3807 v
.enter_visit
(_n_kwdo
)
3808 if _n_block
!= null then
3809 v
.enter_visit
(_n_block
.as(not null))
3811 if _n_label
!= null then
3812 v
.enter_visit
(_n_label
.as(not null))
3816 redef class AAssertExpr
3817 private init empty_init
do end
3819 init init_aassertexpr
(
3820 n_kwassert
: nullable TKwassert,
3822 n_expr
: nullable AExpr,
3823 n_else
: nullable AExpr
3827 _n_kwassert
= n_kwassert
.as(not null)
3828 n_kwassert
.parent
= self
3830 if n_id
!= null then
3833 _n_expr
= n_expr
.as(not null)
3834 n_expr
.parent
= self
3836 if n_else
!= null then
3837 n_else
.parent
= self
3841 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3843 if _n_kwassert
== old_child
then
3844 if new_child
!= null then
3845 new_child
.parent
= self
3846 assert new_child
isa TKwassert
3847 _n_kwassert
= new_child
3853 if _n_id
== old_child
then
3854 if new_child
!= null then
3855 new_child
.parent
= self
3856 assert new_child
isa TId
3863 if _n_expr
== old_child
then
3864 if new_child
!= null then
3865 new_child
.parent
= self
3866 assert new_child
isa AExpr
3873 if _n_else
== old_child
then
3874 if new_child
!= null then
3875 new_child
.parent
= self
3876 assert new_child
isa AExpr
3885 redef fun visit_all
(v
: Visitor)
3887 v
.enter_visit
(_n_kwassert
)
3888 if _n_id
!= null then
3889 v
.enter_visit
(_n_id
.as(not null))
3891 v
.enter_visit
(_n_expr
)
3892 if _n_else
!= null then
3893 v
.enter_visit
(_n_else
.as(not null))
3897 redef class AOnceExpr
3898 private init empty_init
do end
3900 init init_aonceexpr
(
3901 n_kwonce
: nullable TKwonce,
3902 n_expr
: nullable AExpr
3906 _n_kwonce
= n_kwonce
.as(not null)
3907 n_kwonce
.parent
= self
3908 _n_expr
= n_expr
.as(not null)
3909 n_expr
.parent
= self
3912 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3914 if _n_kwonce
== old_child
then
3915 if new_child
!= null then
3916 new_child
.parent
= self
3917 assert new_child
isa TKwonce
3918 _n_kwonce
= new_child
3924 if _n_expr
== old_child
then
3925 if new_child
!= null then
3926 new_child
.parent
= self
3927 assert new_child
isa AExpr
3936 redef fun visit_all
(v
: Visitor)
3938 v
.enter_visit
(_n_kwonce
)
3939 v
.enter_visit
(_n_expr
)
3942 redef class ASendExpr
3943 private init empty_init
do end
3945 init init_asendexpr
(
3946 n_expr
: nullable AExpr
3950 _n_expr
= n_expr
.as(not null)
3951 n_expr
.parent
= self
3954 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3956 if _n_expr
== old_child
then
3957 if new_child
!= null then
3958 new_child
.parent
= self
3959 assert new_child
isa AExpr
3968 redef fun visit_all
(v
: Visitor)
3970 v
.enter_visit
(_n_expr
)
3973 redef class ABinopExpr
3974 private init empty_init
do end
3976 init init_abinopexpr
(
3977 n_expr
: nullable AExpr,
3978 n_expr2
: nullable AExpr
3982 _n_expr
= n_expr
.as(not null)
3983 n_expr
.parent
= self
3984 _n_expr2
= n_expr2
.as(not null)
3985 n_expr2
.parent
= self
3988 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3990 if _n_expr
== old_child
then
3991 if new_child
!= null then
3992 new_child
.parent
= self
3993 assert new_child
isa AExpr
4000 if _n_expr2
== old_child
then
4001 if new_child
!= null then
4002 new_child
.parent
= self
4003 assert new_child
isa AExpr
4004 _n_expr2
= new_child
4012 redef fun visit_all
(v
: Visitor)
4014 v
.enter_visit
(_n_expr
)
4015 v
.enter_visit
(_n_expr2
)
4019 private init empty_init
do end
4022 n_expr
: nullable AExpr,
4023 n_expr2
: nullable AExpr
4027 _n_expr
= n_expr
.as(not null)
4028 n_expr
.parent
= self
4029 _n_expr2
= n_expr2
.as(not null)
4030 n_expr2
.parent
= self
4033 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4035 if _n_expr
== old_child
then
4036 if new_child
!= null then
4037 new_child
.parent
= self
4038 assert new_child
isa AExpr
4045 if _n_expr2
== old_child
then
4046 if new_child
!= null then
4047 new_child
.parent
= self
4048 assert new_child
isa AExpr
4049 _n_expr2
= new_child
4057 redef fun visit_all
(v
: Visitor)
4059 v
.enter_visit
(_n_expr
)
4060 v
.enter_visit
(_n_expr2
)
4063 redef class AAndExpr
4064 private init empty_init
do end
4066 init init_aandexpr
(
4067 n_expr
: nullable AExpr,
4068 n_expr2
: nullable AExpr
4072 _n_expr
= n_expr
.as(not null)
4073 n_expr
.parent
= self
4074 _n_expr2
= n_expr2
.as(not null)
4075 n_expr2
.parent
= self
4078 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4080 if _n_expr
== old_child
then
4081 if new_child
!= null then
4082 new_child
.parent
= self
4083 assert new_child
isa AExpr
4090 if _n_expr2
== old_child
then
4091 if new_child
!= null then
4092 new_child
.parent
= self
4093 assert new_child
isa AExpr
4094 _n_expr2
= new_child
4102 redef fun visit_all
(v
: Visitor)
4104 v
.enter_visit
(_n_expr
)
4105 v
.enter_visit
(_n_expr2
)
4108 redef class ANotExpr
4109 private init empty_init
do end
4111 init init_anotexpr
(
4112 n_kwnot
: nullable TKwnot,
4113 n_expr
: nullable AExpr
4117 _n_kwnot
= n_kwnot
.as(not null)
4118 n_kwnot
.parent
= self
4119 _n_expr
= n_expr
.as(not null)
4120 n_expr
.parent
= self
4123 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4125 if _n_kwnot
== old_child
then
4126 if new_child
!= null then
4127 new_child
.parent
= self
4128 assert new_child
isa TKwnot
4129 _n_kwnot
= new_child
4135 if _n_expr
== old_child
then
4136 if new_child
!= null then
4137 new_child
.parent
= self
4138 assert new_child
isa AExpr
4147 redef fun visit_all
(v
: Visitor)
4149 v
.enter_visit
(_n_kwnot
)
4150 v
.enter_visit
(_n_expr
)
4154 private init empty_init
do end
4157 n_expr
: nullable AExpr,
4158 n_expr2
: nullable AExpr
4162 _n_expr
= n_expr
.as(not null)
4163 n_expr
.parent
= self
4164 _n_expr2
= n_expr2
.as(not null)
4165 n_expr2
.parent
= self
4168 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4170 if _n_expr
== old_child
then
4171 if new_child
!= null then
4172 new_child
.parent
= self
4173 assert new_child
isa AExpr
4180 if _n_expr2
== old_child
then
4181 if new_child
!= null then
4182 new_child
.parent
= self
4183 assert new_child
isa AExpr
4184 _n_expr2
= new_child
4192 redef fun visit_all
(v
: Visitor)
4194 v
.enter_visit
(_n_expr
)
4195 v
.enter_visit
(_n_expr2
)
4199 private init empty_init
do end
4202 n_expr
: nullable AExpr,
4203 n_expr2
: nullable AExpr
4207 _n_expr
= n_expr
.as(not null)
4208 n_expr
.parent
= self
4209 _n_expr2
= n_expr2
.as(not null)
4210 n_expr2
.parent
= self
4213 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4215 if _n_expr
== old_child
then
4216 if new_child
!= null then
4217 new_child
.parent
= self
4218 assert new_child
isa AExpr
4225 if _n_expr2
== old_child
then
4226 if new_child
!= null then
4227 new_child
.parent
= self
4228 assert new_child
isa AExpr
4229 _n_expr2
= new_child
4237 redef fun visit_all
(v
: Visitor)
4239 v
.enter_visit
(_n_expr
)
4240 v
.enter_visit
(_n_expr2
)
4244 private init empty_init
do end
4247 n_expr
: nullable AExpr,
4248 n_expr2
: nullable AExpr
4252 _n_expr
= n_expr
.as(not null)
4253 n_expr
.parent
= self
4254 _n_expr2
= n_expr2
.as(not null)
4255 n_expr2
.parent
= self
4258 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4260 if _n_expr
== old_child
then
4261 if new_child
!= null then
4262 new_child
.parent
= self
4263 assert new_child
isa AExpr
4270 if _n_expr2
== old_child
then
4271 if new_child
!= null then
4272 new_child
.parent
= self
4273 assert new_child
isa AExpr
4274 _n_expr2
= new_child
4282 redef fun visit_all
(v
: Visitor)
4284 v
.enter_visit
(_n_expr
)
4285 v
.enter_visit
(_n_expr2
)
4289 private init empty_init
do end
4292 n_expr
: nullable AExpr,
4293 n_expr2
: nullable AExpr
4297 _n_expr
= n_expr
.as(not null)
4298 n_expr
.parent
= self
4299 _n_expr2
= n_expr2
.as(not null)
4300 n_expr2
.parent
= self
4303 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4305 if _n_expr
== old_child
then
4306 if new_child
!= null then
4307 new_child
.parent
= self
4308 assert new_child
isa AExpr
4315 if _n_expr2
== old_child
then
4316 if new_child
!= null then
4317 new_child
.parent
= self
4318 assert new_child
isa AExpr
4319 _n_expr2
= new_child
4327 redef fun visit_all
(v
: Visitor)
4329 v
.enter_visit
(_n_expr
)
4330 v
.enter_visit
(_n_expr2
)
4334 private init empty_init
do end
4337 n_expr
: nullable AExpr,
4338 n_expr2
: nullable AExpr
4342 _n_expr
= n_expr
.as(not null)
4343 n_expr
.parent
= self
4344 _n_expr2
= n_expr2
.as(not null)
4345 n_expr2
.parent
= self
4348 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4350 if _n_expr
== old_child
then
4351 if new_child
!= null then
4352 new_child
.parent
= self
4353 assert new_child
isa AExpr
4360 if _n_expr2
== old_child
then
4361 if new_child
!= null then
4362 new_child
.parent
= self
4363 assert new_child
isa AExpr
4364 _n_expr2
= new_child
4372 redef fun visit_all
(v
: Visitor)
4374 v
.enter_visit
(_n_expr
)
4375 v
.enter_visit
(_n_expr2
)
4379 private init empty_init
do end
4382 n_expr
: nullable AExpr,
4383 n_expr2
: nullable AExpr
4387 _n_expr
= n_expr
.as(not null)
4388 n_expr
.parent
= self
4389 _n_expr2
= n_expr2
.as(not null)
4390 n_expr2
.parent
= self
4393 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4395 if _n_expr
== old_child
then
4396 if new_child
!= null then
4397 new_child
.parent
= self
4398 assert new_child
isa AExpr
4405 if _n_expr2
== old_child
then
4406 if new_child
!= null then
4407 new_child
.parent
= self
4408 assert new_child
isa AExpr
4409 _n_expr2
= new_child
4417 redef fun visit_all
(v
: Visitor)
4419 v
.enter_visit
(_n_expr
)
4420 v
.enter_visit
(_n_expr2
)
4424 private init empty_init
do end
4427 n_expr
: nullable AExpr,
4428 n_expr2
: nullable AExpr
4432 _n_expr
= n_expr
.as(not null)
4433 n_expr
.parent
= self
4434 _n_expr2
= n_expr2
.as(not null)
4435 n_expr2
.parent
= self
4438 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4440 if _n_expr
== old_child
then
4441 if new_child
!= null then
4442 new_child
.parent
= self
4443 assert new_child
isa AExpr
4450 if _n_expr2
== old_child
then
4451 if new_child
!= null then
4452 new_child
.parent
= self
4453 assert new_child
isa AExpr
4454 _n_expr2
= new_child
4462 redef fun visit_all
(v
: Visitor)
4464 v
.enter_visit
(_n_expr
)
4465 v
.enter_visit
(_n_expr2
)
4468 redef class AIsaExpr
4469 private init empty_init
do end
4471 init init_aisaexpr
(
4472 n_expr
: nullable AExpr,
4473 n_type
: nullable AType
4477 _n_expr
= n_expr
.as(not null)
4478 n_expr
.parent
= self
4479 _n_type
= n_type
.as(not null)
4480 n_type
.parent
= self
4483 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4485 if _n_expr
== old_child
then
4486 if new_child
!= null then
4487 new_child
.parent
= self
4488 assert new_child
isa AExpr
4495 if _n_type
== old_child
then
4496 if new_child
!= null then
4497 new_child
.parent
= self
4498 assert new_child
isa AType
4507 redef fun visit_all
(v
: Visitor)
4509 v
.enter_visit
(_n_expr
)
4510 v
.enter_visit
(_n_type
)
4513 redef class APlusExpr
4514 private init empty_init
do end
4516 init init_aplusexpr
(
4517 n_expr
: nullable AExpr,
4518 n_expr2
: nullable AExpr
4522 _n_expr
= n_expr
.as(not null)
4523 n_expr
.parent
= self
4524 _n_expr2
= n_expr2
.as(not null)
4525 n_expr2
.parent
= self
4528 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4530 if _n_expr
== old_child
then
4531 if new_child
!= null then
4532 new_child
.parent
= self
4533 assert new_child
isa AExpr
4540 if _n_expr2
== old_child
then
4541 if new_child
!= null then
4542 new_child
.parent
= self
4543 assert new_child
isa AExpr
4544 _n_expr2
= new_child
4552 redef fun visit_all
(v
: Visitor)
4554 v
.enter_visit
(_n_expr
)
4555 v
.enter_visit
(_n_expr2
)
4558 redef class AMinusExpr
4559 private init empty_init
do end
4561 init init_aminusexpr
(
4562 n_expr
: nullable AExpr,
4563 n_expr2
: nullable AExpr
4567 _n_expr
= n_expr
.as(not null)
4568 n_expr
.parent
= self
4569 _n_expr2
= n_expr2
.as(not null)
4570 n_expr2
.parent
= self
4573 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4575 if _n_expr
== old_child
then
4576 if new_child
!= null then
4577 new_child
.parent
= self
4578 assert new_child
isa AExpr
4585 if _n_expr2
== old_child
then
4586 if new_child
!= null then
4587 new_child
.parent
= self
4588 assert new_child
isa AExpr
4589 _n_expr2
= new_child
4597 redef fun visit_all
(v
: Visitor)
4599 v
.enter_visit
(_n_expr
)
4600 v
.enter_visit
(_n_expr2
)
4603 redef class AStarshipExpr
4604 private init empty_init
do end
4606 init init_astarshipexpr
(
4607 n_expr
: nullable AExpr,
4608 n_expr2
: nullable AExpr
4612 _n_expr
= n_expr
.as(not null)
4613 n_expr
.parent
= self
4614 _n_expr2
= n_expr2
.as(not null)
4615 n_expr2
.parent
= self
4618 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4620 if _n_expr
== old_child
then
4621 if new_child
!= null then
4622 new_child
.parent
= self
4623 assert new_child
isa AExpr
4630 if _n_expr2
== old_child
then
4631 if new_child
!= null then
4632 new_child
.parent
= self
4633 assert new_child
isa AExpr
4634 _n_expr2
= new_child
4642 redef fun visit_all
(v
: Visitor)
4644 v
.enter_visit
(_n_expr
)
4645 v
.enter_visit
(_n_expr2
)
4648 redef class AStarExpr
4649 private init empty_init
do end
4651 init init_astarexpr
(
4652 n_expr
: nullable AExpr,
4653 n_expr2
: nullable AExpr
4657 _n_expr
= n_expr
.as(not null)
4658 n_expr
.parent
= self
4659 _n_expr2
= n_expr2
.as(not null)
4660 n_expr2
.parent
= self
4663 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4665 if _n_expr
== old_child
then
4666 if new_child
!= null then
4667 new_child
.parent
= self
4668 assert new_child
isa AExpr
4675 if _n_expr2
== old_child
then
4676 if new_child
!= null then
4677 new_child
.parent
= self
4678 assert new_child
isa AExpr
4679 _n_expr2
= new_child
4687 redef fun visit_all
(v
: Visitor)
4689 v
.enter_visit
(_n_expr
)
4690 v
.enter_visit
(_n_expr2
)
4693 redef class ASlashExpr
4694 private init empty_init
do end
4696 init init_aslashexpr
(
4697 n_expr
: nullable AExpr,
4698 n_expr2
: nullable AExpr
4702 _n_expr
= n_expr
.as(not null)
4703 n_expr
.parent
= self
4704 _n_expr2
= n_expr2
.as(not null)
4705 n_expr2
.parent
= self
4708 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4710 if _n_expr
== old_child
then
4711 if new_child
!= null then
4712 new_child
.parent
= self
4713 assert new_child
isa AExpr
4720 if _n_expr2
== old_child
then
4721 if new_child
!= null then
4722 new_child
.parent
= self
4723 assert new_child
isa AExpr
4724 _n_expr2
= new_child
4732 redef fun visit_all
(v
: Visitor)
4734 v
.enter_visit
(_n_expr
)
4735 v
.enter_visit
(_n_expr2
)
4738 redef class APercentExpr
4739 private init empty_init
do end
4741 init init_apercentexpr
(
4742 n_expr
: nullable AExpr,
4743 n_expr2
: nullable AExpr
4747 _n_expr
= n_expr
.as(not null)
4748 n_expr
.parent
= self
4749 _n_expr2
= n_expr2
.as(not null)
4750 n_expr2
.parent
= self
4753 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4755 if _n_expr
== old_child
then
4756 if new_child
!= null then
4757 new_child
.parent
= self
4758 assert new_child
isa AExpr
4765 if _n_expr2
== old_child
then
4766 if new_child
!= null then
4767 new_child
.parent
= self
4768 assert new_child
isa AExpr
4769 _n_expr2
= new_child
4777 redef fun visit_all
(v
: Visitor)
4779 v
.enter_visit
(_n_expr
)
4780 v
.enter_visit
(_n_expr2
)
4783 redef class AUminusExpr
4784 private init empty_init
do end
4786 init init_auminusexpr
(
4787 n_minus
: nullable TMinus,
4788 n_expr
: nullable AExpr
4792 _n_minus
= n_minus
.as(not null)
4793 n_minus
.parent
= self
4794 _n_expr
= n_expr
.as(not null)
4795 n_expr
.parent
= self
4798 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4800 if _n_minus
== old_child
then
4801 if new_child
!= null then
4802 new_child
.parent
= self
4803 assert new_child
isa TMinus
4804 _n_minus
= new_child
4810 if _n_expr
== old_child
then
4811 if new_child
!= null then
4812 new_child
.parent
= self
4813 assert new_child
isa AExpr
4822 redef fun visit_all
(v
: Visitor)
4824 v
.enter_visit
(_n_minus
)
4825 v
.enter_visit
(_n_expr
)
4828 redef class ANewExpr
4829 private init empty_init
do end
4831 init init_anewexpr
(
4832 n_kwnew
: nullable TKwnew,
4833 n_type
: nullable AType,
4835 n_args
: Collection[Object] # Should be Collection[AExpr]
4839 _n_kwnew
= n_kwnew
.as(not null)
4840 n_kwnew
.parent
= self
4841 _n_type
= n_type
.as(not null)
4842 n_type
.parent
= self
4844 if n_id
!= null then
4854 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4856 if _n_kwnew
== old_child
then
4857 if new_child
!= null then
4858 new_child
.parent
= self
4859 assert new_child
isa TKwnew
4860 _n_kwnew
= new_child
4866 if _n_type
== old_child
then
4867 if new_child
!= null then
4868 new_child
.parent
= self
4869 assert new_child
isa AType
4876 if _n_id
== old_child
then
4877 if new_child
!= null then
4878 new_child
.parent
= self
4879 assert new_child
isa TId
4886 for i
in [0.._n_args
.length
[ do
4887 if _n_args
[i
] == old_child
then
4888 if new_child
!= null then
4889 assert new_child
isa AExpr
4890 _n_args
[i
] = new_child
4891 new_child
.parent
= self
4893 _n_args
.remove_at
(i
)
4900 redef fun visit_all
(v
: Visitor)
4902 v
.enter_visit
(_n_kwnew
)
4903 v
.enter_visit
(_n_type
)
4904 if _n_id
!= null then
4905 v
.enter_visit
(_n_id
.as(not null))
4912 redef class AAttrExpr
4913 private init empty_init
do end
4915 init init_aattrexpr
(
4916 n_expr
: nullable AExpr,
4917 n_id
: nullable TAttrid
4921 _n_expr
= n_expr
.as(not null)
4922 n_expr
.parent
= self
4923 _n_id
= n_id
.as(not null)
4927 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4929 if _n_expr
== old_child
then
4930 if new_child
!= null then
4931 new_child
.parent
= self
4932 assert new_child
isa AExpr
4939 if _n_id
== old_child
then
4940 if new_child
!= null then
4941 new_child
.parent
= self
4942 assert new_child
isa TAttrid
4951 redef fun visit_all
(v
: Visitor)
4953 v
.enter_visit
(_n_expr
)
4954 v
.enter_visit
(_n_id
)
4957 redef class AAttrAssignExpr
4958 private init empty_init
do end
4960 init init_aattrassignexpr
(
4961 n_expr
: nullable AExpr,
4962 n_id
: nullable TAttrid,
4963 n_assign
: nullable TAssign,
4964 n_value
: nullable AExpr
4968 _n_expr
= n_expr
.as(not null)
4969 n_expr
.parent
= self
4970 _n_id
= n_id
.as(not null)
4972 _n_assign
= n_assign
.as(not null)
4973 n_assign
.parent
= self
4974 _n_value
= n_value
.as(not null)
4975 n_value
.parent
= self
4978 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4980 if _n_expr
== old_child
then
4981 if new_child
!= null then
4982 new_child
.parent
= self
4983 assert new_child
isa AExpr
4990 if _n_id
== old_child
then
4991 if new_child
!= null then
4992 new_child
.parent
= self
4993 assert new_child
isa TAttrid
5000 if _n_assign
== old_child
then
5001 if new_child
!= null then
5002 new_child
.parent
= self
5003 assert new_child
isa TAssign
5004 _n_assign
= new_child
5010 if _n_value
== old_child
then
5011 if new_child
!= null then
5012 new_child
.parent
= self
5013 assert new_child
isa AExpr
5014 _n_value
= new_child
5022 redef fun visit_all
(v
: Visitor)
5024 v
.enter_visit
(_n_expr
)
5025 v
.enter_visit
(_n_id
)
5026 v
.enter_visit
(_n_assign
)
5027 v
.enter_visit
(_n_value
)
5030 redef class AAttrReassignExpr
5031 private init empty_init
do end
5033 init init_aattrreassignexpr
(
5034 n_expr
: nullable AExpr,
5035 n_id
: nullable TAttrid,
5036 n_assign_op
: nullable AAssignOp,
5037 n_value
: nullable AExpr
5041 _n_expr
= n_expr
.as(not null)
5042 n_expr
.parent
= self
5043 _n_id
= n_id
.as(not null)
5045 _n_assign_op
= n_assign_op
.as(not null)
5046 n_assign_op
.parent
= self
5047 _n_value
= n_value
.as(not null)
5048 n_value
.parent
= self
5051 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5053 if _n_expr
== old_child
then
5054 if new_child
!= null then
5055 new_child
.parent
= self
5056 assert new_child
isa AExpr
5063 if _n_id
== old_child
then
5064 if new_child
!= null then
5065 new_child
.parent
= self
5066 assert new_child
isa TAttrid
5073 if _n_assign_op
== old_child
then
5074 if new_child
!= null then
5075 new_child
.parent
= self
5076 assert new_child
isa AAssignOp
5077 _n_assign_op
= new_child
5083 if _n_value
== old_child
then
5084 if new_child
!= null then
5085 new_child
.parent
= self
5086 assert new_child
isa AExpr
5087 _n_value
= new_child
5095 redef fun visit_all
(v
: Visitor)
5097 v
.enter_visit
(_n_expr
)
5098 v
.enter_visit
(_n_id
)
5099 v
.enter_visit
(_n_assign_op
)
5100 v
.enter_visit
(_n_value
)
5103 redef class ACallExpr
5104 private init empty_init
do end
5106 init init_acallexpr
(
5107 n_expr
: nullable AExpr,
5109 n_args
: Collection[Object], # Should be Collection[AExpr]
5110 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5114 _n_expr
= n_expr
.as(not null)
5115 n_expr
.parent
= self
5116 _n_id
= n_id
.as(not null)
5123 for n
in n_closure_defs
do
5124 assert n
isa AClosureDef
5125 _n_closure_defs
.add
(n
)
5130 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5132 if _n_expr
== old_child
then
5133 if new_child
!= null then
5134 new_child
.parent
= self
5135 assert new_child
isa AExpr
5142 if _n_id
== old_child
then
5143 if new_child
!= null then
5144 new_child
.parent
= self
5145 assert new_child
isa TId
5152 for i
in [0.._n_args
.length
[ do
5153 if _n_args
[i
] == old_child
then
5154 if new_child
!= null then
5155 assert new_child
isa AExpr
5156 _n_args
[i
] = new_child
5157 new_child
.parent
= self
5159 _n_args
.remove_at
(i
)
5164 for i
in [0.._n_closure_defs
.length
[ do
5165 if _n_closure_defs
[i
] == old_child
then
5166 if new_child
!= null then
5167 assert new_child
isa AClosureDef
5168 _n_closure_defs
[i
] = new_child
5169 new_child
.parent
= self
5171 _n_closure_defs
.remove_at
(i
)
5178 redef fun visit_all
(v
: Visitor)
5180 v
.enter_visit
(_n_expr
)
5181 v
.enter_visit
(_n_id
)
5185 for n
in _n_closure_defs
do
5190 redef class ACallAssignExpr
5191 private init empty_init
do end
5193 init init_acallassignexpr
(
5194 n_expr
: nullable AExpr,
5196 n_args
: Collection[Object], # Should be Collection[AExpr]
5197 n_assign
: nullable TAssign,
5198 n_value
: nullable AExpr
5202 _n_expr
= n_expr
.as(not null)
5203 n_expr
.parent
= self
5204 _n_id
= n_id
.as(not null)
5211 _n_assign
= n_assign
.as(not null)
5212 n_assign
.parent
= self
5213 _n_value
= n_value
.as(not null)
5214 n_value
.parent
= self
5217 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5219 if _n_expr
== old_child
then
5220 if new_child
!= null then
5221 new_child
.parent
= self
5222 assert new_child
isa AExpr
5229 if _n_id
== old_child
then
5230 if new_child
!= null then
5231 new_child
.parent
= self
5232 assert new_child
isa TId
5239 for i
in [0.._n_args
.length
[ do
5240 if _n_args
[i
] == old_child
then
5241 if new_child
!= null then
5242 assert new_child
isa AExpr
5243 _n_args
[i
] = new_child
5244 new_child
.parent
= self
5246 _n_args
.remove_at
(i
)
5251 if _n_assign
== old_child
then
5252 if new_child
!= null then
5253 new_child
.parent
= self
5254 assert new_child
isa TAssign
5255 _n_assign
= new_child
5261 if _n_value
== old_child
then
5262 if new_child
!= null then
5263 new_child
.parent
= self
5264 assert new_child
isa AExpr
5265 _n_value
= new_child
5273 redef fun visit_all
(v
: Visitor)
5275 v
.enter_visit
(_n_expr
)
5276 v
.enter_visit
(_n_id
)
5280 v
.enter_visit
(_n_assign
)
5281 v
.enter_visit
(_n_value
)
5284 redef class ACallReassignExpr
5285 private init empty_init
do end
5287 init init_acallreassignexpr
(
5288 n_expr
: nullable AExpr,
5290 n_args
: Collection[Object], # Should be Collection[AExpr]
5291 n_assign_op
: nullable AAssignOp,
5292 n_value
: nullable AExpr
5296 _n_expr
= n_expr
.as(not null)
5297 n_expr
.parent
= self
5298 _n_id
= n_id
.as(not null)
5305 _n_assign_op
= n_assign_op
.as(not null)
5306 n_assign_op
.parent
= self
5307 _n_value
= n_value
.as(not null)
5308 n_value
.parent
= self
5311 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5313 if _n_expr
== old_child
then
5314 if new_child
!= null then
5315 new_child
.parent
= self
5316 assert new_child
isa AExpr
5323 if _n_id
== old_child
then
5324 if new_child
!= null then
5325 new_child
.parent
= self
5326 assert new_child
isa TId
5333 for i
in [0.._n_args
.length
[ do
5334 if _n_args
[i
] == old_child
then
5335 if new_child
!= null then
5336 assert new_child
isa AExpr
5337 _n_args
[i
] = new_child
5338 new_child
.parent
= self
5340 _n_args
.remove_at
(i
)
5345 if _n_assign_op
== old_child
then
5346 if new_child
!= null then
5347 new_child
.parent
= self
5348 assert new_child
isa AAssignOp
5349 _n_assign_op
= new_child
5355 if _n_value
== old_child
then
5356 if new_child
!= null then
5357 new_child
.parent
= self
5358 assert new_child
isa AExpr
5359 _n_value
= new_child
5367 redef fun visit_all
(v
: Visitor)
5369 v
.enter_visit
(_n_expr
)
5370 v
.enter_visit
(_n_id
)
5374 v
.enter_visit
(_n_assign_op
)
5375 v
.enter_visit
(_n_value
)
5378 redef class ASuperExpr
5379 private init empty_init
do end
5381 init init_asuperexpr
(
5382 n_qualified
: nullable AQualified,
5383 n_kwsuper
: nullable TKwsuper,
5384 n_args
: Collection[Object] # Should be Collection[AExpr]
5388 _n_qualified
= n_qualified
5389 if n_qualified
!= null then
5390 n_qualified
.parent
= self
5392 _n_kwsuper
= n_kwsuper
.as(not null)
5393 n_kwsuper
.parent
= self
5401 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5403 if _n_qualified
== old_child
then
5404 if new_child
!= null then
5405 new_child
.parent
= self
5406 assert new_child
isa AQualified
5407 _n_qualified
= new_child
5413 if _n_kwsuper
== old_child
then
5414 if new_child
!= null then
5415 new_child
.parent
= self
5416 assert new_child
isa TKwsuper
5417 _n_kwsuper
= new_child
5423 for i
in [0.._n_args
.length
[ do
5424 if _n_args
[i
] == old_child
then
5425 if new_child
!= null then
5426 assert new_child
isa AExpr
5427 _n_args
[i
] = new_child
5428 new_child
.parent
= self
5430 _n_args
.remove_at
(i
)
5437 redef fun visit_all
(v
: Visitor)
5439 if _n_qualified
!= null then
5440 v
.enter_visit
(_n_qualified
.as(not null))
5442 v
.enter_visit
(_n_kwsuper
)
5448 redef class AInitExpr
5449 private init empty_init
do end
5451 init init_ainitexpr
(
5452 n_expr
: nullable AExpr,
5453 n_kwinit
: nullable TKwinit,
5454 n_args
: Collection[Object] # Should be Collection[AExpr]
5458 _n_expr
= n_expr
.as(not null)
5459 n_expr
.parent
= self
5460 _n_kwinit
= n_kwinit
.as(not null)
5461 n_kwinit
.parent
= self
5469 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5471 if _n_expr
== old_child
then
5472 if new_child
!= null then
5473 new_child
.parent
= self
5474 assert new_child
isa AExpr
5481 if _n_kwinit
== old_child
then
5482 if new_child
!= null then
5483 new_child
.parent
= self
5484 assert new_child
isa TKwinit
5485 _n_kwinit
= new_child
5491 for i
in [0.._n_args
.length
[ do
5492 if _n_args
[i
] == old_child
then
5493 if new_child
!= null then
5494 assert new_child
isa AExpr
5495 _n_args
[i
] = new_child
5496 new_child
.parent
= self
5498 _n_args
.remove_at
(i
)
5505 redef fun visit_all
(v
: Visitor)
5507 v
.enter_visit
(_n_expr
)
5508 v
.enter_visit
(_n_kwinit
)
5514 redef class ABraExpr
5515 private init empty_init
do end
5517 init init_abraexpr
(
5518 n_expr
: nullable AExpr,
5519 n_args
: Collection[Object], # Should be Collection[AExpr]
5520 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5524 _n_expr
= n_expr
.as(not null)
5525 n_expr
.parent
= self
5531 for n
in n_closure_defs
do
5532 assert n
isa AClosureDef
5533 _n_closure_defs
.add
(n
)
5538 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5540 if _n_expr
== old_child
then
5541 if new_child
!= null then
5542 new_child
.parent
= self
5543 assert new_child
isa AExpr
5550 for i
in [0.._n_args
.length
[ do
5551 if _n_args
[i
] == old_child
then
5552 if new_child
!= null then
5553 assert new_child
isa AExpr
5554 _n_args
[i
] = new_child
5555 new_child
.parent
= self
5557 _n_args
.remove_at
(i
)
5562 for i
in [0.._n_closure_defs
.length
[ do
5563 if _n_closure_defs
[i
] == old_child
then
5564 if new_child
!= null then
5565 assert new_child
isa AClosureDef
5566 _n_closure_defs
[i
] = new_child
5567 new_child
.parent
= self
5569 _n_closure_defs
.remove_at
(i
)
5576 redef fun visit_all
(v
: Visitor)
5578 v
.enter_visit
(_n_expr
)
5582 for n
in _n_closure_defs
do
5587 redef class ABraAssignExpr
5588 private init empty_init
do end
5590 init init_abraassignexpr
(
5591 n_expr
: nullable AExpr,
5592 n_args
: Collection[Object], # Should be Collection[AExpr]
5593 n_assign
: nullable TAssign,
5594 n_value
: nullable AExpr
5598 _n_expr
= n_expr
.as(not null)
5599 n_expr
.parent
= self
5605 _n_assign
= n_assign
.as(not null)
5606 n_assign
.parent
= self
5607 _n_value
= n_value
.as(not null)
5608 n_value
.parent
= self
5611 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5613 if _n_expr
== old_child
then
5614 if new_child
!= null then
5615 new_child
.parent
= self
5616 assert new_child
isa AExpr
5623 for i
in [0.._n_args
.length
[ do
5624 if _n_args
[i
] == old_child
then
5625 if new_child
!= null then
5626 assert new_child
isa AExpr
5627 _n_args
[i
] = new_child
5628 new_child
.parent
= self
5630 _n_args
.remove_at
(i
)
5635 if _n_assign
== old_child
then
5636 if new_child
!= null then
5637 new_child
.parent
= self
5638 assert new_child
isa TAssign
5639 _n_assign
= new_child
5645 if _n_value
== old_child
then
5646 if new_child
!= null then
5647 new_child
.parent
= self
5648 assert new_child
isa AExpr
5649 _n_value
= new_child
5657 redef fun visit_all
(v
: Visitor)
5659 v
.enter_visit
(_n_expr
)
5663 v
.enter_visit
(_n_assign
)
5664 v
.enter_visit
(_n_value
)
5667 redef class ABraReassignExpr
5668 private init empty_init
do end
5670 init init_abrareassignexpr
(
5671 n_expr
: nullable AExpr,
5672 n_args
: Collection[Object], # Should be Collection[AExpr]
5673 n_assign_op
: nullable AAssignOp,
5674 n_value
: nullable AExpr
5678 _n_expr
= n_expr
.as(not null)
5679 n_expr
.parent
= self
5685 _n_assign_op
= n_assign_op
.as(not null)
5686 n_assign_op
.parent
= self
5687 _n_value
= n_value
.as(not null)
5688 n_value
.parent
= self
5691 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5693 if _n_expr
== old_child
then
5694 if new_child
!= null then
5695 new_child
.parent
= self
5696 assert new_child
isa AExpr
5703 for i
in [0.._n_args
.length
[ do
5704 if _n_args
[i
] == old_child
then
5705 if new_child
!= null then
5706 assert new_child
isa AExpr
5707 _n_args
[i
] = new_child
5708 new_child
.parent
= self
5710 _n_args
.remove_at
(i
)
5715 if _n_assign_op
== old_child
then
5716 if new_child
!= null then
5717 new_child
.parent
= self
5718 assert new_child
isa AAssignOp
5719 _n_assign_op
= new_child
5725 if _n_value
== old_child
then
5726 if new_child
!= null then
5727 new_child
.parent
= self
5728 assert new_child
isa AExpr
5729 _n_value
= new_child
5737 redef fun visit_all
(v
: Visitor)
5739 v
.enter_visit
(_n_expr
)
5743 v
.enter_visit
(_n_assign_op
)
5744 v
.enter_visit
(_n_value
)
5747 redef class AClosureCallExpr
5748 private init empty_init
do end
5750 init init_aclosurecallexpr
(
5752 n_args
: Collection[Object], # Should be Collection[AExpr]
5753 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5757 _n_id
= n_id
.as(not null)
5764 for n
in n_closure_defs
do
5765 assert n
isa AClosureDef
5766 _n_closure_defs
.add
(n
)
5771 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5773 if _n_id
== old_child
then
5774 if new_child
!= null then
5775 new_child
.parent
= self
5776 assert new_child
isa TId
5783 for i
in [0.._n_args
.length
[ do
5784 if _n_args
[i
] == old_child
then
5785 if new_child
!= null then
5786 assert new_child
isa AExpr
5787 _n_args
[i
] = new_child
5788 new_child
.parent
= self
5790 _n_args
.remove_at
(i
)
5795 for i
in [0.._n_closure_defs
.length
[ do
5796 if _n_closure_defs
[i
] == old_child
then
5797 if new_child
!= null then
5798 assert new_child
isa AClosureDef
5799 _n_closure_defs
[i
] = new_child
5800 new_child
.parent
= self
5802 _n_closure_defs
.remove_at
(i
)
5809 redef fun visit_all
(v
: Visitor)
5811 v
.enter_visit
(_n_id
)
5815 for n
in _n_closure_defs
do
5820 redef class AVarExpr
5821 private init empty_init
do end
5823 init init_avarexpr
(
5828 _n_id
= n_id
.as(not null)
5832 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5834 if _n_id
== old_child
then
5835 if new_child
!= null then
5836 new_child
.parent
= self
5837 assert new_child
isa TId
5846 redef fun visit_all
(v
: Visitor)
5848 v
.enter_visit
(_n_id
)
5851 redef class AVarAssignExpr
5852 private init empty_init
do end
5854 init init_avarassignexpr
(
5856 n_assign
: nullable TAssign,
5857 n_value
: nullable AExpr
5861 _n_id
= n_id
.as(not null)
5863 _n_assign
= n_assign
.as(not null)
5864 n_assign
.parent
= self
5865 _n_value
= n_value
.as(not null)
5866 n_value
.parent
= self
5869 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5871 if _n_id
== old_child
then
5872 if new_child
!= null then
5873 new_child
.parent
= self
5874 assert new_child
isa TId
5881 if _n_assign
== old_child
then
5882 if new_child
!= null then
5883 new_child
.parent
= self
5884 assert new_child
isa TAssign
5885 _n_assign
= new_child
5891 if _n_value
== old_child
then
5892 if new_child
!= null then
5893 new_child
.parent
= self
5894 assert new_child
isa AExpr
5895 _n_value
= new_child
5903 redef fun visit_all
(v
: Visitor)
5905 v
.enter_visit
(_n_id
)
5906 v
.enter_visit
(_n_assign
)
5907 v
.enter_visit
(_n_value
)
5910 redef class AVarReassignExpr
5911 private init empty_init
do end
5913 init init_avarreassignexpr
(
5915 n_assign_op
: nullable AAssignOp,
5916 n_value
: nullable AExpr
5920 _n_id
= n_id
.as(not null)
5922 _n_assign_op
= n_assign_op
.as(not null)
5923 n_assign_op
.parent
= self
5924 _n_value
= n_value
.as(not null)
5925 n_value
.parent
= self
5928 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5930 if _n_id
== old_child
then
5931 if new_child
!= null then
5932 new_child
.parent
= self
5933 assert new_child
isa TId
5940 if _n_assign_op
== old_child
then
5941 if new_child
!= null then
5942 new_child
.parent
= self
5943 assert new_child
isa AAssignOp
5944 _n_assign_op
= new_child
5950 if _n_value
== old_child
then
5951 if new_child
!= null then
5952 new_child
.parent
= self
5953 assert new_child
isa AExpr
5954 _n_value
= new_child
5962 redef fun visit_all
(v
: Visitor)
5964 v
.enter_visit
(_n_id
)
5965 v
.enter_visit
(_n_assign_op
)
5966 v
.enter_visit
(_n_value
)
5969 redef class ARangeExpr
5970 private init empty_init
do end
5972 init init_arangeexpr
(
5973 n_expr
: nullable AExpr,
5974 n_expr2
: nullable AExpr
5978 _n_expr
= n_expr
.as(not null)
5979 n_expr
.parent
= self
5980 _n_expr2
= n_expr2
.as(not null)
5981 n_expr2
.parent
= self
5984 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5986 if _n_expr
== old_child
then
5987 if new_child
!= null then
5988 new_child
.parent
= self
5989 assert new_child
isa AExpr
5996 if _n_expr2
== old_child
then
5997 if new_child
!= null then
5998 new_child
.parent
= self
5999 assert new_child
isa AExpr
6000 _n_expr2
= new_child
6008 redef fun visit_all
(v
: Visitor)
6010 v
.enter_visit
(_n_expr
)
6011 v
.enter_visit
(_n_expr2
)
6014 redef class ACrangeExpr
6015 private init empty_init
do end
6017 init init_acrangeexpr
(
6018 n_expr
: nullable AExpr,
6019 n_expr2
: nullable AExpr
6023 _n_expr
= n_expr
.as(not null)
6024 n_expr
.parent
= self
6025 _n_expr2
= n_expr2
.as(not null)
6026 n_expr2
.parent
= self
6029 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6031 if _n_expr
== old_child
then
6032 if new_child
!= null then
6033 new_child
.parent
= self
6034 assert new_child
isa AExpr
6041 if _n_expr2
== old_child
then
6042 if new_child
!= null then
6043 new_child
.parent
= self
6044 assert new_child
isa AExpr
6045 _n_expr2
= new_child
6053 redef fun visit_all
(v
: Visitor)
6055 v
.enter_visit
(_n_expr
)
6056 v
.enter_visit
(_n_expr2
)
6059 redef class AOrangeExpr
6060 private init empty_init
do end
6062 init init_aorangeexpr
(
6063 n_expr
: nullable AExpr,
6064 n_expr2
: nullable AExpr
6068 _n_expr
= n_expr
.as(not null)
6069 n_expr
.parent
= self
6070 _n_expr2
= n_expr2
.as(not null)
6071 n_expr2
.parent
= self
6074 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6076 if _n_expr
== old_child
then
6077 if new_child
!= null then
6078 new_child
.parent
= self
6079 assert new_child
isa AExpr
6086 if _n_expr2
== old_child
then
6087 if new_child
!= null then
6088 new_child
.parent
= self
6089 assert new_child
isa AExpr
6090 _n_expr2
= new_child
6098 redef fun visit_all
(v
: Visitor)
6100 v
.enter_visit
(_n_expr
)
6101 v
.enter_visit
(_n_expr2
)
6104 redef class AArrayExpr
6105 private init empty_init
do end
6107 init init_aarrayexpr
(
6108 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6119 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6121 for i
in [0.._n_exprs
.length
[ do
6122 if _n_exprs
[i
] == old_child
then
6123 if new_child
!= null then
6124 assert new_child
isa AExpr
6125 _n_exprs
[i
] = new_child
6126 new_child
.parent
= self
6128 _n_exprs
.remove_at
(i
)
6135 redef fun visit_all
(v
: Visitor)
6137 for n
in _n_exprs
do
6142 redef class ASelfExpr
6143 private init empty_init
do end
6145 init init_aselfexpr
(
6146 n_kwself
: nullable TKwself
6150 _n_kwself
= n_kwself
.as(not null)
6151 n_kwself
.parent
= self
6154 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6156 if _n_kwself
== old_child
then
6157 if new_child
!= null then
6158 new_child
.parent
= self
6159 assert new_child
isa TKwself
6160 _n_kwself
= new_child
6168 redef fun visit_all
(v
: Visitor)
6170 v
.enter_visit
(_n_kwself
)
6173 redef class AImplicitSelfExpr
6174 private init empty_init
do end
6176 init init_aimplicitselfexpr
6181 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6185 redef fun visit_all
(v
: Visitor)
6189 redef class ATrueExpr
6190 private init empty_init
do end
6192 init init_atrueexpr
(
6193 n_kwtrue
: nullable TKwtrue
6197 _n_kwtrue
= n_kwtrue
.as(not null)
6198 n_kwtrue
.parent
= self
6201 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6203 if _n_kwtrue
== old_child
then
6204 if new_child
!= null then
6205 new_child
.parent
= self
6206 assert new_child
isa TKwtrue
6207 _n_kwtrue
= new_child
6215 redef fun visit_all
(v
: Visitor)
6217 v
.enter_visit
(_n_kwtrue
)
6220 redef class AFalseExpr
6221 private init empty_init
do end
6223 init init_afalseexpr
(
6224 n_kwfalse
: nullable TKwfalse
6228 _n_kwfalse
= n_kwfalse
.as(not null)
6229 n_kwfalse
.parent
= self
6232 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6234 if _n_kwfalse
== old_child
then
6235 if new_child
!= null then
6236 new_child
.parent
= self
6237 assert new_child
isa TKwfalse
6238 _n_kwfalse
= new_child
6246 redef fun visit_all
(v
: Visitor)
6248 v
.enter_visit
(_n_kwfalse
)
6251 redef class ANullExpr
6252 private init empty_init
do end
6254 init init_anullexpr
(
6255 n_kwnull
: nullable TKwnull
6259 _n_kwnull
= n_kwnull
.as(not null)
6260 n_kwnull
.parent
= self
6263 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6265 if _n_kwnull
== old_child
then
6266 if new_child
!= null then
6267 new_child
.parent
= self
6268 assert new_child
isa TKwnull
6269 _n_kwnull
= new_child
6277 redef fun visit_all
(v
: Visitor)
6279 v
.enter_visit
(_n_kwnull
)
6282 redef class AIntExpr
6283 private init empty_init
do end
6285 init init_aintexpr
(
6286 n_number
: nullable TNumber
6290 _n_number
= n_number
.as(not null)
6291 n_number
.parent
= self
6294 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6296 if _n_number
== old_child
then
6297 if new_child
!= null then
6298 new_child
.parent
= self
6299 assert new_child
isa TNumber
6300 _n_number
= new_child
6308 redef fun visit_all
(v
: Visitor)
6310 v
.enter_visit
(_n_number
)
6313 redef class AFloatExpr
6314 private init empty_init
do end
6316 init init_afloatexpr
(
6317 n_float
: nullable TFloat
6321 _n_float
= n_float
.as(not null)
6322 n_float
.parent
= self
6325 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6327 if _n_float
== old_child
then
6328 if new_child
!= null then
6329 new_child
.parent
= self
6330 assert new_child
isa TFloat
6331 _n_float
= new_child
6339 redef fun visit_all
(v
: Visitor)
6341 v
.enter_visit
(_n_float
)
6344 redef class ACharExpr
6345 private init empty_init
do end
6347 init init_acharexpr
(
6348 n_char
: nullable TChar
6352 _n_char
= n_char
.as(not null)
6353 n_char
.parent
= self
6356 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6358 if _n_char
== old_child
then
6359 if new_child
!= null then
6360 new_child
.parent
= self
6361 assert new_child
isa TChar
6370 redef fun visit_all
(v
: Visitor)
6372 v
.enter_visit
(_n_char
)
6375 redef class AStringExpr
6376 private init empty_init
do end
6378 init init_astringexpr
(
6379 n_string
: nullable TString
6383 _n_string
= n_string
.as(not null)
6384 n_string
.parent
= self
6387 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6389 if _n_string
== old_child
then
6390 if new_child
!= null then
6391 new_child
.parent
= self
6392 assert new_child
isa TString
6393 _n_string
= new_child
6401 redef fun visit_all
(v
: Visitor)
6403 v
.enter_visit
(_n_string
)
6406 redef class AStartStringExpr
6407 private init empty_init
do end
6409 init init_astartstringexpr
(
6410 n_string
: nullable TStartString
6414 _n_string
= n_string
.as(not null)
6415 n_string
.parent
= self
6418 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6420 if _n_string
== old_child
then
6421 if new_child
!= null then
6422 new_child
.parent
= self
6423 assert new_child
isa TStartString
6424 _n_string
= new_child
6432 redef fun visit_all
(v
: Visitor)
6434 v
.enter_visit
(_n_string
)
6437 redef class AMidStringExpr
6438 private init empty_init
do end
6440 init init_amidstringexpr
(
6441 n_string
: nullable TMidString
6445 _n_string
= n_string
.as(not null)
6446 n_string
.parent
= self
6449 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6451 if _n_string
== old_child
then
6452 if new_child
!= null then
6453 new_child
.parent
= self
6454 assert new_child
isa TMidString
6455 _n_string
= new_child
6463 redef fun visit_all
(v
: Visitor)
6465 v
.enter_visit
(_n_string
)
6468 redef class AEndStringExpr
6469 private init empty_init
do end
6471 init init_aendstringexpr
(
6472 n_string
: nullable TEndString
6476 _n_string
= n_string
.as(not null)
6477 n_string
.parent
= self
6480 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6482 if _n_string
== old_child
then
6483 if new_child
!= null then
6484 new_child
.parent
= self
6485 assert new_child
isa TEndString
6486 _n_string
= new_child
6494 redef fun visit_all
(v
: Visitor)
6496 v
.enter_visit
(_n_string
)
6499 redef class ASuperstringExpr
6500 private init empty_init
do end
6502 init init_asuperstringexpr
(
6503 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6514 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6516 for i
in [0.._n_exprs
.length
[ do
6517 if _n_exprs
[i
] == old_child
then
6518 if new_child
!= null then
6519 assert new_child
isa AExpr
6520 _n_exprs
[i
] = new_child
6521 new_child
.parent
= self
6523 _n_exprs
.remove_at
(i
)
6530 redef fun visit_all
(v
: Visitor)
6532 for n
in _n_exprs
do
6537 redef class AParExpr
6538 private init empty_init
do end
6540 init init_aparexpr
(
6541 n_expr
: nullable AExpr
6545 _n_expr
= n_expr
.as(not null)
6546 n_expr
.parent
= self
6549 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6551 if _n_expr
== old_child
then
6552 if new_child
!= null then
6553 new_child
.parent
= self
6554 assert new_child
isa AExpr
6563 redef fun visit_all
(v
: Visitor)
6565 v
.enter_visit
(_n_expr
)
6568 redef class AAsCastExpr
6569 private init empty_init
do end
6571 init init_aascastexpr
(
6572 n_expr
: nullable AExpr,
6573 n_kwas
: nullable TKwas,
6574 n_type
: nullable AType
6578 _n_expr
= n_expr
.as(not null)
6579 n_expr
.parent
= self
6580 _n_kwas
= n_kwas
.as(not null)
6581 n_kwas
.parent
= self
6582 _n_type
= n_type
.as(not null)
6583 n_type
.parent
= self
6586 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6588 if _n_expr
== old_child
then
6589 if new_child
!= null then
6590 new_child
.parent
= self
6591 assert new_child
isa AExpr
6598 if _n_kwas
== old_child
then
6599 if new_child
!= null then
6600 new_child
.parent
= self
6601 assert new_child
isa TKwas
6608 if _n_type
== old_child
then
6609 if new_child
!= null then
6610 new_child
.parent
= self
6611 assert new_child
isa AType
6620 redef fun visit_all
(v
: Visitor)
6622 v
.enter_visit
(_n_expr
)
6623 v
.enter_visit
(_n_kwas
)
6624 v
.enter_visit
(_n_type
)
6627 redef class AAsNotnullExpr
6628 private init empty_init
do end
6630 init init_aasnotnullexpr
(
6631 n_expr
: nullable AExpr,
6632 n_kwas
: nullable TKwas,
6633 n_kwnot
: nullable TKwnot,
6634 n_kwnull
: nullable TKwnull
6638 _n_expr
= n_expr
.as(not null)
6639 n_expr
.parent
= self
6640 _n_kwas
= n_kwas
.as(not null)
6641 n_kwas
.parent
= self
6642 _n_kwnot
= n_kwnot
.as(not null)
6643 n_kwnot
.parent
= self
6644 _n_kwnull
= n_kwnull
.as(not null)
6645 n_kwnull
.parent
= self
6648 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6650 if _n_expr
== old_child
then
6651 if new_child
!= null then
6652 new_child
.parent
= self
6653 assert new_child
isa AExpr
6660 if _n_kwas
== old_child
then
6661 if new_child
!= null then
6662 new_child
.parent
= self
6663 assert new_child
isa TKwas
6670 if _n_kwnot
== old_child
then
6671 if new_child
!= null then
6672 new_child
.parent
= self
6673 assert new_child
isa TKwnot
6674 _n_kwnot
= new_child
6680 if _n_kwnull
== old_child
then
6681 if new_child
!= null then
6682 new_child
.parent
= self
6683 assert new_child
isa TKwnull
6684 _n_kwnull
= new_child
6692 redef fun visit_all
(v
: Visitor)
6694 v
.enter_visit
(_n_expr
)
6695 v
.enter_visit
(_n_kwas
)
6696 v
.enter_visit
(_n_kwnot
)
6697 v
.enter_visit
(_n_kwnull
)
6700 redef class AIssetAttrExpr
6701 private init empty_init
do end
6703 init init_aissetattrexpr
(
6704 n_kwisset
: nullable TKwisset,
6705 n_expr
: nullable AExpr,
6706 n_id
: nullable TAttrid
6710 _n_kwisset
= n_kwisset
.as(not null)
6711 n_kwisset
.parent
= self
6712 _n_expr
= n_expr
.as(not null)
6713 n_expr
.parent
= self
6714 _n_id
= n_id
.as(not null)
6718 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6720 if _n_kwisset
== old_child
then
6721 if new_child
!= null then
6722 new_child
.parent
= self
6723 assert new_child
isa TKwisset
6724 _n_kwisset
= new_child
6730 if _n_expr
== old_child
then
6731 if new_child
!= null then
6732 new_child
.parent
= self
6733 assert new_child
isa AExpr
6740 if _n_id
== old_child
then
6741 if new_child
!= null then
6742 new_child
.parent
= self
6743 assert new_child
isa TAttrid
6752 redef fun visit_all
(v
: Visitor)
6754 v
.enter_visit
(_n_kwisset
)
6755 v
.enter_visit
(_n_expr
)
6756 v
.enter_visit
(_n_id
)
6759 redef class APlusAssignOp
6760 private init empty_init
do end
6762 init init_aplusassignop
(
6763 n_pluseq
: nullable TPluseq
6767 _n_pluseq
= n_pluseq
.as(not null)
6768 n_pluseq
.parent
= self
6771 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6773 if _n_pluseq
== old_child
then
6774 if new_child
!= null then
6775 new_child
.parent
= self
6776 assert new_child
isa TPluseq
6777 _n_pluseq
= new_child
6785 redef fun visit_all
(v
: Visitor)
6787 v
.enter_visit
(_n_pluseq
)
6790 redef class AMinusAssignOp
6791 private init empty_init
do end
6793 init init_aminusassignop
(
6794 n_minuseq
: nullable TMinuseq
6798 _n_minuseq
= n_minuseq
.as(not null)
6799 n_minuseq
.parent
= self
6802 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6804 if _n_minuseq
== old_child
then
6805 if new_child
!= null then
6806 new_child
.parent
= self
6807 assert new_child
isa TMinuseq
6808 _n_minuseq
= new_child
6816 redef fun visit_all
(v
: Visitor)
6818 v
.enter_visit
(_n_minuseq
)
6821 redef class AClosureDef
6822 private init empty_init
do end
6824 init init_aclosuredef
(
6825 n_bang
: nullable TBang,
6826 n_id
: nullable AClosureId,
6827 n_ids
: Collection[Object], # Should be Collection[TId]
6828 n_kwdo
: nullable TKwdo,
6829 n_expr
: nullable AExpr,
6830 n_label
: nullable ALabel
6834 _n_bang
= n_bang
.as(not null)
6835 n_bang
.parent
= self
6836 _n_id
= n_id
.as(not null)
6844 if n_kwdo
!= null then
6845 n_kwdo
.parent
= self
6848 if n_expr
!= null then
6849 n_expr
.parent
= self
6852 if n_label
!= null then
6853 n_label
.parent
= self
6857 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6859 if _n_bang
== old_child
then
6860 if new_child
!= null then
6861 new_child
.parent
= self
6862 assert new_child
isa TBang
6869 if _n_id
== old_child
then
6870 if new_child
!= null then
6871 new_child
.parent
= self
6872 assert new_child
isa AClosureId
6879 for i
in [0.._n_ids
.length
[ do
6880 if _n_ids
[i
] == old_child
then
6881 if new_child
!= null then
6882 assert new_child
isa TId
6883 _n_ids
[i
] = new_child
6884 new_child
.parent
= self
6891 if _n_kwdo
== old_child
then
6892 if new_child
!= null then
6893 new_child
.parent
= self
6894 assert new_child
isa TKwdo
6901 if _n_expr
== old_child
then
6902 if new_child
!= null then
6903 new_child
.parent
= self
6904 assert new_child
isa AExpr
6911 if _n_label
== old_child
then
6912 if new_child
!= null then
6913 new_child
.parent
= self
6914 assert new_child
isa ALabel
6915 _n_label
= new_child
6923 redef fun visit_all
(v
: Visitor)
6925 v
.enter_visit
(_n_bang
)
6926 v
.enter_visit
(_n_id
)
6930 if _n_kwdo
!= null then
6931 v
.enter_visit
(_n_kwdo
.as(not null))
6933 if _n_expr
!= null then
6934 v
.enter_visit
(_n_expr
.as(not null))
6936 if _n_label
!= null then
6937 v
.enter_visit
(_n_label
.as(not null))
6941 redef class ASimpleClosureId
6942 private init empty_init
do end
6944 init init_asimpleclosureid
(
6949 _n_id
= n_id
.as(not null)
6953 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6955 if _n_id
== old_child
then
6956 if new_child
!= null then
6957 new_child
.parent
= self
6958 assert new_child
isa TId
6967 redef fun visit_all
(v
: Visitor)
6969 v
.enter_visit
(_n_id
)
6972 redef class ABreakClosureId
6973 private init empty_init
do end
6975 init init_abreakclosureid
(
6976 n_kwbreak
: nullable TKwbreak
6980 _n_kwbreak
= n_kwbreak
.as(not null)
6981 n_kwbreak
.parent
= self
6984 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6986 if _n_kwbreak
== old_child
then
6987 if new_child
!= null then
6988 new_child
.parent
= self
6989 assert new_child
isa TKwbreak
6990 _n_kwbreak
= new_child
6998 redef fun visit_all
(v
: Visitor)
7000 v
.enter_visit
(_n_kwbreak
)
7003 redef class AQualified
7004 private init empty_init
do end
7006 init init_aqualified
(
7007 n_id
: Collection[Object], # Should be Collection[TId]
7008 n_classid
: nullable TClassid
7017 _n_classid
= n_classid
7018 if n_classid
!= null then
7019 n_classid
.parent
= self
7023 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7025 for i
in [0.._n_id
.length
[ do
7026 if _n_id
[i
] == old_child
then
7027 if new_child
!= null then
7028 assert new_child
isa TId
7029 _n_id
[i
] = new_child
7030 new_child
.parent
= self
7037 if _n_classid
== old_child
then
7038 if new_child
!= null then
7039 new_child
.parent
= self
7040 assert new_child
isa TClassid
7041 _n_classid
= new_child
7049 redef fun visit_all
(v
: Visitor)
7054 if _n_classid
!= null then
7055 v
.enter_visit
(_n_classid
.as(not null))
7060 private init empty_init
do end
7063 n_comment
: Collection[Object] # Should be Collection[TComment]
7067 for n
in n_comment
do
7068 assert n
isa TComment
7074 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7076 for i
in [0.._n_comment
.length
[ do
7077 if _n_comment
[i
] == old_child
then
7078 if new_child
!= null then
7079 assert new_child
isa TComment
7080 _n_comment
[i
] = new_child
7081 new_child
.parent
= self
7083 _n_comment
.remove_at
(i
)
7090 redef fun visit_all
(v
: Visitor)
7092 for n
in _n_comment
do
7100 n_base
: nullable AModule,
7107 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7109 if _n_base
== old_child
then
7110 if new_child
== null then
7112 new_child
.parent
= self
7113 assert new_child
isa AModule
7116 old_child
.parent
= null
7121 redef fun visit_all
(v
: Visitor)
7123 if _n_base
!= null then
7124 v
.enter_visit
(_n_base
.as(not null))
7126 v
.enter_visit
(_n_eof
)