1 # Production AST nodes full definition.
2 # This file was generated by SableCC (http://www.sablecc.org/).
6 intrude import parser_nodes
10 # Parent of the node in the AST
11 readable writable var _parent
: nullable ANode
13 # Remove a child from the AST
14 fun remove_child
(child
: ANode)
16 replace_child
(child
, null)
19 # Replace a child with an other node in the AST
20 fun replace_child
(old_child
: ANode, new_child
: nullable ANode) is abstract
22 # Replace itself with an other node in the AST
23 fun replace_with
(node
: ANode)
25 if (_parent
!= null) then
26 _parent
.replace_child
(self, node
)
30 # Visit all nodes in order.
31 # Thus, call "v.visit(e)" for each node e
32 fun visit_all
(v
: Visitor) is abstract
36 redef fun visit_all
(v
: Visitor) do end
37 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode) do end
41 redef fun replace_with
(n
: ANode)
49 # Abstract standard visitor
51 # What the visitor do when a node is visited
52 # Concrete visitors should redefine this method.
53 protected fun visit
(e
: nullable ANode) is abstract
55 # Ask the visitor to visit a given node.
56 # Usually automatically called by visit_all* methods.
57 # This methos should not be redefined
58 fun enter_visit
(e
: nullable ANode)
60 var old
= _current_node
66 # The current visited node
67 readable var _current_node
: nullable ANode = null
71 private init empty_init
do end
74 n_packagedecl
: nullable APackagedecl,
75 n_imports
: Collection[Object], # Should be Collection[AImport]
76 n_classdefs
: Collection[Object] # Should be Collection[AClassdef]
80 _n_packagedecl
= n_packagedecl
81 if n_packagedecl
!= null then
82 n_packagedecl
.parent
= self
89 for n
in n_classdefs
do
90 assert n
isa AClassdef
96 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
98 if _n_packagedecl
== old_child
then
99 if new_child
!= null then
100 new_child
.parent
= self
101 assert new_child
isa APackagedecl
102 _n_packagedecl
= new_child
104 _n_packagedecl
= null
108 for i
in [0.._n_imports
.length
[ do
109 if _n_imports
[i
] == old_child
then
110 if new_child
!= null then
111 assert new_child
isa AImport
112 _n_imports
[i
] = new_child
113 new_child
.parent
= self
115 _n_imports
.remove_at
(i
)
120 for i
in [0.._n_classdefs
.length
[ do
121 if _n_classdefs
[i
] == old_child
then
122 if new_child
!= null then
123 assert new_child
isa AClassdef
124 _n_classdefs
[i
] = new_child
125 new_child
.parent
= self
127 _n_classdefs
.remove_at
(i
)
134 redef fun visit_all
(v
: Visitor)
136 if _n_packagedecl
!= null then
137 v
.enter_visit
(_n_packagedecl
.as(not null))
139 for n
in _n_imports
do
142 for n
in _n_classdefs
do
147 redef class APackagedecl
148 private init empty_init
do end
150 init init_apackagedecl
(
151 n_doc
: nullable ADoc,
152 n_kwpackage
: nullable TKwpackage,
158 if n_doc
!= null then
161 _n_kwpackage
= n_kwpackage
.as(not null)
162 n_kwpackage
.parent
= self
163 _n_id
= n_id
.as(not null)
167 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
169 if _n_doc
== old_child
then
170 if new_child
!= null then
171 new_child
.parent
= self
172 assert new_child
isa ADoc
179 if _n_kwpackage
== old_child
then
180 if new_child
!= null then
181 new_child
.parent
= self
182 assert new_child
isa TKwpackage
183 _n_kwpackage
= new_child
189 if _n_id
== old_child
then
190 if new_child
!= null then
191 new_child
.parent
= self
192 assert new_child
isa TId
201 redef fun visit_all
(v
: Visitor)
203 if _n_doc
!= null then
204 v
.enter_visit
(_n_doc
.as(not null))
206 v
.enter_visit
(_n_kwpackage
)
210 redef class AStdImport
211 private init empty_init
do end
213 init init_astdimport
(
214 n_visibility
: nullable AVisibility,
215 n_kwimport
: nullable TKwimport,
220 _n_visibility
= n_visibility
.as(not null)
221 n_visibility
.parent
= self
222 _n_kwimport
= n_kwimport
.as(not null)
223 n_kwimport
.parent
= self
224 _n_id
= n_id
.as(not null)
228 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
230 if _n_visibility
== old_child
then
231 if new_child
!= null then
232 new_child
.parent
= self
233 assert new_child
isa AVisibility
234 _n_visibility
= new_child
240 if _n_kwimport
== old_child
then
241 if new_child
!= null then
242 new_child
.parent
= self
243 assert new_child
isa TKwimport
244 _n_kwimport
= new_child
250 if _n_id
== old_child
then
251 if new_child
!= null then
252 new_child
.parent
= self
253 assert new_child
isa TId
262 redef fun visit_all
(v
: Visitor)
264 v
.enter_visit
(_n_visibility
)
265 v
.enter_visit
(_n_kwimport
)
269 redef class ANoImport
270 private init empty_init
do end
272 init init_anoimport
(
273 n_visibility
: nullable AVisibility,
274 n_kwimport
: nullable TKwimport,
275 n_kwend
: nullable TKwend
279 _n_visibility
= n_visibility
.as(not null)
280 n_visibility
.parent
= self
281 _n_kwimport
= n_kwimport
.as(not null)
282 n_kwimport
.parent
= self
283 _n_kwend
= n_kwend
.as(not null)
284 n_kwend
.parent
= self
287 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
289 if _n_visibility
== old_child
then
290 if new_child
!= null then
291 new_child
.parent
= self
292 assert new_child
isa AVisibility
293 _n_visibility
= new_child
299 if _n_kwimport
== old_child
then
300 if new_child
!= null then
301 new_child
.parent
= self
302 assert new_child
isa TKwimport
303 _n_kwimport
= new_child
309 if _n_kwend
== old_child
then
310 if new_child
!= null then
311 new_child
.parent
= self
312 assert new_child
isa TKwend
321 redef fun visit_all
(v
: Visitor)
323 v
.enter_visit
(_n_visibility
)
324 v
.enter_visit
(_n_kwimport
)
325 v
.enter_visit
(_n_kwend
)
328 redef class APublicVisibility
329 private init empty_init
do end
331 init init_apublicvisibility
336 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
340 redef fun visit_all
(v
: Visitor)
344 redef class APrivateVisibility
345 private init empty_init
do end
347 init init_aprivatevisibility
(
348 n_kwprivate
: nullable TKwprivate
352 _n_kwprivate
= n_kwprivate
.as(not null)
353 n_kwprivate
.parent
= self
356 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
358 if _n_kwprivate
== old_child
then
359 if new_child
!= null then
360 new_child
.parent
= self
361 assert new_child
isa TKwprivate
362 _n_kwprivate
= new_child
370 redef fun visit_all
(v
: Visitor)
372 v
.enter_visit
(_n_kwprivate
)
375 redef class AProtectedVisibility
376 private init empty_init
do end
378 init init_aprotectedvisibility
(
379 n_kwprotected
: nullable TKwprotected
383 _n_kwprotected
= n_kwprotected
.as(not null)
384 n_kwprotected
.parent
= self
387 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
389 if _n_kwprotected
== old_child
then
390 if new_child
!= null then
391 new_child
.parent
= self
392 assert new_child
isa TKwprotected
393 _n_kwprotected
= new_child
401 redef fun visit_all
(v
: Visitor)
403 v
.enter_visit
(_n_kwprotected
)
406 redef class AIntrudeVisibility
407 private init empty_init
do end
409 init init_aintrudevisibility
(
410 n_kwintrude
: nullable TKwintrude
414 _n_kwintrude
= n_kwintrude
.as(not null)
415 n_kwintrude
.parent
= self
418 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
420 if _n_kwintrude
== old_child
then
421 if new_child
!= null then
422 new_child
.parent
= self
423 assert new_child
isa TKwintrude
424 _n_kwintrude
= new_child
432 redef fun visit_all
(v
: Visitor)
434 v
.enter_visit
(_n_kwintrude
)
437 redef class AStdClassdef
438 private init empty_init
do end
440 init init_astdclassdef
(
441 n_doc
: nullable ADoc,
442 n_kwredef
: nullable TKwredef,
443 n_visibility
: nullable AVisibility,
444 n_classkind
: nullable AClasskind,
445 n_id
: nullable TClassid,
446 n_formaldefs
: Collection[Object], # Should be Collection[AFormaldef]
447 n_superclasses
: Collection[Object], # Should be Collection[ASuperclass]
448 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
453 if n_doc
!= null then
456 _n_kwredef
= n_kwredef
457 if n_kwredef
!= null then
458 n_kwredef
.parent
= self
460 _n_visibility
= n_visibility
.as(not null)
461 n_visibility
.parent
= self
462 _n_classkind
= n_classkind
.as(not null)
463 n_classkind
.parent
= self
468 for n
in n_formaldefs
do
469 assert n
isa AFormaldef
473 for n
in n_superclasses
do
474 assert n
isa ASuperclass
475 _n_superclasses
.add
(n
)
478 for n
in n_propdefs
do
479 assert n
isa APropdef
485 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
487 if _n_doc
== old_child
then
488 if new_child
!= null then
489 new_child
.parent
= self
490 assert new_child
isa ADoc
497 if _n_kwredef
== old_child
then
498 if new_child
!= null then
499 new_child
.parent
= self
500 assert new_child
isa TKwredef
501 _n_kwredef
= new_child
507 if _n_visibility
== old_child
then
508 if new_child
!= null then
509 new_child
.parent
= self
510 assert new_child
isa AVisibility
511 _n_visibility
= new_child
517 if _n_classkind
== old_child
then
518 if new_child
!= null then
519 new_child
.parent
= self
520 assert new_child
isa AClasskind
521 _n_classkind
= new_child
527 if _n_id
== old_child
then
528 if new_child
!= null then
529 new_child
.parent
= self
530 assert new_child
isa TClassid
537 for i
in [0.._n_formaldefs
.length
[ do
538 if _n_formaldefs
[i
] == old_child
then
539 if new_child
!= null then
540 assert new_child
isa AFormaldef
541 _n_formaldefs
[i
] = new_child
542 new_child
.parent
= self
544 _n_formaldefs
.remove_at
(i
)
549 for i
in [0.._n_superclasses
.length
[ do
550 if _n_superclasses
[i
] == old_child
then
551 if new_child
!= null then
552 assert new_child
isa ASuperclass
553 _n_superclasses
[i
] = new_child
554 new_child
.parent
= self
556 _n_superclasses
.remove_at
(i
)
561 for i
in [0.._n_propdefs
.length
[ do
562 if _n_propdefs
[i
] == old_child
then
563 if new_child
!= null then
564 assert new_child
isa APropdef
565 _n_propdefs
[i
] = new_child
566 new_child
.parent
= self
568 _n_propdefs
.remove_at
(i
)
575 redef fun visit_all
(v
: Visitor)
577 if _n_doc
!= null then
578 v
.enter_visit
(_n_doc
.as(not null))
580 if _n_kwredef
!= null then
581 v
.enter_visit
(_n_kwredef
.as(not null))
583 v
.enter_visit
(_n_visibility
)
584 v
.enter_visit
(_n_classkind
)
585 if _n_id
!= null then
586 v
.enter_visit
(_n_id
.as(not null))
588 for n
in _n_formaldefs
do
591 for n
in _n_superclasses
do
594 for n
in _n_propdefs
do
599 redef class ATopClassdef
600 private init empty_init
do end
602 init init_atopclassdef
(
603 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
607 for n
in n_propdefs
do
608 assert n
isa APropdef
614 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
616 for i
in [0.._n_propdefs
.length
[ do
617 if _n_propdefs
[i
] == old_child
then
618 if new_child
!= null then
619 assert new_child
isa APropdef
620 _n_propdefs
[i
] = new_child
621 new_child
.parent
= self
623 _n_propdefs
.remove_at
(i
)
630 redef fun visit_all
(v
: Visitor)
632 for n
in _n_propdefs
do
637 redef class AMainClassdef
638 private init empty_init
do end
640 init init_amainclassdef
(
641 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
645 for n
in n_propdefs
do
646 assert n
isa APropdef
652 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
654 for i
in [0.._n_propdefs
.length
[ do
655 if _n_propdefs
[i
] == old_child
then
656 if new_child
!= null then
657 assert new_child
isa APropdef
658 _n_propdefs
[i
] = new_child
659 new_child
.parent
= self
661 _n_propdefs
.remove_at
(i
)
668 redef fun visit_all
(v
: Visitor)
670 for n
in _n_propdefs
do
675 redef class AConcreteClasskind
676 private init empty_init
do end
678 init init_aconcreteclasskind
(
679 n_kwclass
: nullable TKwclass
683 _n_kwclass
= n_kwclass
.as(not null)
684 n_kwclass
.parent
= self
687 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
689 if _n_kwclass
== old_child
then
690 if new_child
!= null then
691 new_child
.parent
= self
692 assert new_child
isa TKwclass
693 _n_kwclass
= new_child
701 redef fun visit_all
(v
: Visitor)
703 v
.enter_visit
(_n_kwclass
)
706 redef class AAbstractClasskind
707 private init empty_init
do end
709 init init_aabstractclasskind
(
710 n_kwabstract
: nullable TKwabstract,
711 n_kwclass
: nullable TKwclass
715 _n_kwabstract
= n_kwabstract
.as(not null)
716 n_kwabstract
.parent
= self
717 _n_kwclass
= n_kwclass
.as(not null)
718 n_kwclass
.parent
= self
721 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
723 if _n_kwabstract
== old_child
then
724 if new_child
!= null then
725 new_child
.parent
= self
726 assert new_child
isa TKwabstract
727 _n_kwabstract
= new_child
733 if _n_kwclass
== old_child
then
734 if new_child
!= null then
735 new_child
.parent
= self
736 assert new_child
isa TKwclass
737 _n_kwclass
= new_child
745 redef fun visit_all
(v
: Visitor)
747 v
.enter_visit
(_n_kwabstract
)
748 v
.enter_visit
(_n_kwclass
)
751 redef class AInterfaceClasskind
752 private init empty_init
do end
754 init init_ainterfaceclasskind
(
755 n_kwinterface
: nullable TKwinterface
759 _n_kwinterface
= n_kwinterface
.as(not null)
760 n_kwinterface
.parent
= self
763 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
765 if _n_kwinterface
== old_child
then
766 if new_child
!= null then
767 new_child
.parent
= self
768 assert new_child
isa TKwinterface
769 _n_kwinterface
= new_child
777 redef fun visit_all
(v
: Visitor)
779 v
.enter_visit
(_n_kwinterface
)
782 redef class AUniversalClasskind
783 private init empty_init
do end
785 init init_auniversalclasskind
(
786 n_kwuniversal
: nullable TKwuniversal
790 _n_kwuniversal
= n_kwuniversal
.as(not null)
791 n_kwuniversal
.parent
= self
794 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
796 if _n_kwuniversal
== old_child
then
797 if new_child
!= null then
798 new_child
.parent
= self
799 assert new_child
isa TKwuniversal
800 _n_kwuniversal
= new_child
808 redef fun visit_all
(v
: Visitor)
810 v
.enter_visit
(_n_kwuniversal
)
813 redef class AFormaldef
814 private init empty_init
do end
816 init init_aformaldef
(
817 n_id
: nullable TClassid,
818 n_type
: nullable AType
822 _n_id
= n_id
.as(not null)
825 if n_type
!= null then
830 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
832 if _n_id
== old_child
then
833 if new_child
!= null then
834 new_child
.parent
= self
835 assert new_child
isa TClassid
842 if _n_type
== old_child
then
843 if new_child
!= null then
844 new_child
.parent
= self
845 assert new_child
isa AType
854 redef fun visit_all
(v
: Visitor)
857 if _n_type
!= null then
858 v
.enter_visit
(_n_type
.as(not null))
862 redef class ASuperclass
863 private init empty_init
do end
865 init init_asuperclass
(
866 n_kwspecial
: nullable TKwspecial,
867 n_kwsuper
: nullable TKwsuper,
868 n_type
: nullable AType
872 _n_kwspecial
= n_kwspecial
873 if n_kwspecial
!= null then
874 n_kwspecial
.parent
= self
876 _n_kwsuper
= n_kwsuper
877 if n_kwsuper
!= null then
878 n_kwsuper
.parent
= self
880 _n_type
= n_type
.as(not null)
884 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
886 if _n_kwspecial
== old_child
then
887 if new_child
!= null then
888 new_child
.parent
= self
889 assert new_child
isa TKwspecial
890 _n_kwspecial
= new_child
896 if _n_kwsuper
== old_child
then
897 if new_child
!= null then
898 new_child
.parent
= self
899 assert new_child
isa TKwsuper
900 _n_kwsuper
= new_child
906 if _n_type
== old_child
then
907 if new_child
!= null then
908 new_child
.parent
= self
909 assert new_child
isa AType
918 redef fun visit_all
(v
: Visitor)
920 if _n_kwspecial
!= null then
921 v
.enter_visit
(_n_kwspecial
.as(not null))
923 if _n_kwsuper
!= null then
924 v
.enter_visit
(_n_kwsuper
.as(not null))
926 v
.enter_visit
(_n_type
)
929 redef class AAttrPropdef
930 private init empty_init
do end
932 init init_aattrpropdef
(
933 n_doc
: nullable ADoc,
934 n_readable
: nullable AAble,
935 n_writable
: nullable AAble,
936 n_kwredef
: nullable TKwredef,
937 n_visibility
: nullable AVisibility,
938 n_kwvar
: nullable TKwvar,
939 n_id
: nullable TAttrid,
941 n_type
: nullable AType,
942 n_expr
: nullable AExpr
947 if n_doc
!= null then
950 _n_readable
= n_readable
951 if n_readable
!= null then
952 n_readable
.parent
= self
954 _n_writable
= n_writable
955 if n_writable
!= null then
956 n_writable
.parent
= self
958 _n_kwredef
= n_kwredef
959 if n_kwredef
!= null then
960 n_kwredef
.parent
= self
962 _n_visibility
= n_visibility
.as(not null)
963 n_visibility
.parent
= self
964 _n_kwvar
= n_kwvar
.as(not null)
965 n_kwvar
.parent
= self
971 if n_id2
!= null then
975 if n_type
!= null then
979 if n_expr
!= null then
984 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
986 if _n_doc
== old_child
then
987 if new_child
!= null then
988 new_child
.parent
= self
989 assert new_child
isa ADoc
996 if _n_readable
== old_child
then
997 if new_child
!= null then
998 new_child
.parent
= self
999 assert new_child
isa AAble
1000 _n_readable
= new_child
1006 if _n_writable
== old_child
then
1007 if new_child
!= null then
1008 new_child
.parent
= self
1009 assert new_child
isa AAble
1010 _n_writable
= new_child
1016 if _n_kwredef
== old_child
then
1017 if new_child
!= null then
1018 new_child
.parent
= self
1019 assert new_child
isa TKwredef
1020 _n_kwredef
= new_child
1026 if _n_visibility
== old_child
then
1027 if new_child
!= null then
1028 new_child
.parent
= self
1029 assert new_child
isa AVisibility
1030 _n_visibility
= new_child
1036 if _n_kwvar
== old_child
then
1037 if new_child
!= null then
1038 new_child
.parent
= self
1039 assert new_child
isa TKwvar
1040 _n_kwvar
= new_child
1046 if _n_id
== old_child
then
1047 if new_child
!= null then
1048 new_child
.parent
= self
1049 assert new_child
isa TAttrid
1056 if _n_id2
== old_child
then
1057 if new_child
!= null then
1058 new_child
.parent
= self
1059 assert new_child
isa TId
1066 if _n_type
== old_child
then
1067 if new_child
!= null then
1068 new_child
.parent
= self
1069 assert new_child
isa AType
1076 if _n_expr
== old_child
then
1077 if new_child
!= null then
1078 new_child
.parent
= self
1079 assert new_child
isa AExpr
1088 redef fun visit_all
(v
: Visitor)
1090 if _n_doc
!= null then
1091 v
.enter_visit
(_n_doc
.as(not null))
1093 if _n_readable
!= null then
1094 v
.enter_visit
(_n_readable
.as(not null))
1096 if _n_writable
!= null then
1097 v
.enter_visit
(_n_writable
.as(not null))
1099 if _n_kwredef
!= null then
1100 v
.enter_visit
(_n_kwredef
.as(not null))
1102 v
.enter_visit
(_n_visibility
)
1103 v
.enter_visit
(_n_kwvar
)
1104 if _n_id
!= null then
1105 v
.enter_visit
(_n_id
.as(not null))
1107 if _n_id2
!= null then
1108 v
.enter_visit
(_n_id2
.as(not null))
1110 if _n_type
!= null then
1111 v
.enter_visit
(_n_type
.as(not null))
1113 if _n_expr
!= null then
1114 v
.enter_visit
(_n_expr
.as(not null))
1118 redef class AMethPropdef
1119 private init empty_init
do end
1121 init init_amethpropdef
(
1122 n_doc
: nullable ADoc,
1123 n_kwredef
: nullable TKwredef,
1124 n_visibility
: nullable AVisibility,
1125 n_methid
: nullable AMethid,
1126 n_signature
: nullable ASignature
1131 if n_doc
!= null then
1134 _n_kwredef
= n_kwredef
1135 if n_kwredef
!= null then
1136 n_kwredef
.parent
= self
1138 _n_visibility
= n_visibility
.as(not null)
1139 n_visibility
.parent
= self
1140 _n_methid
= n_methid
.as(not null)
1141 n_methid
.parent
= self
1142 _n_signature
= n_signature
.as(not null)
1143 n_signature
.parent
= self
1146 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1148 if _n_doc
== old_child
then
1149 if new_child
!= null then
1150 new_child
.parent
= self
1151 assert new_child
isa ADoc
1158 if _n_kwredef
== old_child
then
1159 if new_child
!= null then
1160 new_child
.parent
= self
1161 assert new_child
isa TKwredef
1162 _n_kwredef
= new_child
1168 if _n_visibility
== old_child
then
1169 if new_child
!= null then
1170 new_child
.parent
= self
1171 assert new_child
isa AVisibility
1172 _n_visibility
= new_child
1178 if _n_methid
== old_child
then
1179 if new_child
!= null then
1180 new_child
.parent
= self
1181 assert new_child
isa AMethid
1182 _n_methid
= new_child
1188 if _n_signature
== old_child
then
1189 if new_child
!= null then
1190 new_child
.parent
= self
1191 assert new_child
isa ASignature
1192 _n_signature
= new_child
1200 redef fun visit_all
(v
: Visitor)
1202 if _n_doc
!= null then
1203 v
.enter_visit
(_n_doc
.as(not null))
1205 if _n_kwredef
!= null then
1206 v
.enter_visit
(_n_kwredef
.as(not null))
1208 v
.enter_visit
(_n_visibility
)
1209 v
.enter_visit
(_n_methid
)
1210 v
.enter_visit
(_n_signature
)
1213 redef class ADeferredMethPropdef
1214 private init empty_init
do end
1216 init init_adeferredmethpropdef
(
1217 n_doc
: nullable ADoc,
1218 n_kwredef
: nullable TKwredef,
1219 n_visibility
: nullable AVisibility,
1220 n_kwmeth
: nullable TKwmeth,
1221 n_methid
: nullable AMethid,
1222 n_signature
: nullable ASignature
1227 if n_doc
!= null then
1230 _n_kwredef
= n_kwredef
1231 if n_kwredef
!= null then
1232 n_kwredef
.parent
= self
1234 _n_visibility
= n_visibility
.as(not null)
1235 n_visibility
.parent
= self
1236 _n_kwmeth
= n_kwmeth
.as(not null)
1237 n_kwmeth
.parent
= self
1238 _n_methid
= n_methid
.as(not null)
1239 n_methid
.parent
= self
1240 _n_signature
= n_signature
.as(not null)
1241 n_signature
.parent
= self
1244 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1246 if _n_doc
== old_child
then
1247 if new_child
!= null then
1248 new_child
.parent
= self
1249 assert new_child
isa ADoc
1256 if _n_kwredef
== old_child
then
1257 if new_child
!= null then
1258 new_child
.parent
= self
1259 assert new_child
isa TKwredef
1260 _n_kwredef
= new_child
1266 if _n_visibility
== old_child
then
1267 if new_child
!= null then
1268 new_child
.parent
= self
1269 assert new_child
isa AVisibility
1270 _n_visibility
= new_child
1276 if _n_kwmeth
== old_child
then
1277 if new_child
!= null then
1278 new_child
.parent
= self
1279 assert new_child
isa TKwmeth
1280 _n_kwmeth
= new_child
1286 if _n_methid
== old_child
then
1287 if new_child
!= null then
1288 new_child
.parent
= self
1289 assert new_child
isa AMethid
1290 _n_methid
= new_child
1296 if _n_signature
== old_child
then
1297 if new_child
!= null then
1298 new_child
.parent
= self
1299 assert new_child
isa ASignature
1300 _n_signature
= new_child
1308 redef fun visit_all
(v
: Visitor)
1310 if _n_doc
!= null then
1311 v
.enter_visit
(_n_doc
.as(not null))
1313 if _n_kwredef
!= null then
1314 v
.enter_visit
(_n_kwredef
.as(not null))
1316 v
.enter_visit
(_n_visibility
)
1317 v
.enter_visit
(_n_kwmeth
)
1318 v
.enter_visit
(_n_methid
)
1319 v
.enter_visit
(_n_signature
)
1322 redef class AInternMethPropdef
1323 private init empty_init
do end
1325 init init_ainternmethpropdef
(
1326 n_doc
: nullable ADoc,
1327 n_kwredef
: nullable TKwredef,
1328 n_visibility
: nullable AVisibility,
1329 n_kwmeth
: nullable TKwmeth,
1330 n_methid
: nullable AMethid,
1331 n_signature
: nullable ASignature
1336 if n_doc
!= null then
1339 _n_kwredef
= n_kwredef
1340 if n_kwredef
!= null then
1341 n_kwredef
.parent
= self
1343 _n_visibility
= n_visibility
.as(not null)
1344 n_visibility
.parent
= self
1345 _n_kwmeth
= n_kwmeth
.as(not null)
1346 n_kwmeth
.parent
= self
1347 _n_methid
= n_methid
.as(not null)
1348 n_methid
.parent
= self
1349 _n_signature
= n_signature
.as(not null)
1350 n_signature
.parent
= self
1353 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1355 if _n_doc
== old_child
then
1356 if new_child
!= null then
1357 new_child
.parent
= self
1358 assert new_child
isa ADoc
1365 if _n_kwredef
== old_child
then
1366 if new_child
!= null then
1367 new_child
.parent
= self
1368 assert new_child
isa TKwredef
1369 _n_kwredef
= new_child
1375 if _n_visibility
== old_child
then
1376 if new_child
!= null then
1377 new_child
.parent
= self
1378 assert new_child
isa AVisibility
1379 _n_visibility
= new_child
1385 if _n_kwmeth
== old_child
then
1386 if new_child
!= null then
1387 new_child
.parent
= self
1388 assert new_child
isa TKwmeth
1389 _n_kwmeth
= new_child
1395 if _n_methid
== old_child
then
1396 if new_child
!= null then
1397 new_child
.parent
= self
1398 assert new_child
isa AMethid
1399 _n_methid
= new_child
1405 if _n_signature
== old_child
then
1406 if new_child
!= null then
1407 new_child
.parent
= self
1408 assert new_child
isa ASignature
1409 _n_signature
= new_child
1417 redef fun visit_all
(v
: Visitor)
1419 if _n_doc
!= null then
1420 v
.enter_visit
(_n_doc
.as(not null))
1422 if _n_kwredef
!= null then
1423 v
.enter_visit
(_n_kwredef
.as(not null))
1425 v
.enter_visit
(_n_visibility
)
1426 v
.enter_visit
(_n_kwmeth
)
1427 v
.enter_visit
(_n_methid
)
1428 v
.enter_visit
(_n_signature
)
1431 redef class AExternMethPropdef
1432 private init empty_init
do end
1434 init init_aexternmethpropdef
(
1435 n_doc
: nullable ADoc,
1436 n_kwredef
: nullable TKwredef,
1437 n_visibility
: nullable AVisibility,
1438 n_kwmeth
: nullable TKwmeth,
1439 n_methid
: nullable AMethid,
1440 n_signature
: nullable ASignature,
1441 n_extern
: nullable TString
1446 if n_doc
!= null then
1449 _n_kwredef
= n_kwredef
1450 if n_kwredef
!= null then
1451 n_kwredef
.parent
= self
1453 _n_visibility
= n_visibility
.as(not null)
1454 n_visibility
.parent
= self
1455 _n_kwmeth
= n_kwmeth
.as(not null)
1456 n_kwmeth
.parent
= self
1457 _n_methid
= n_methid
.as(not null)
1458 n_methid
.parent
= self
1459 _n_signature
= n_signature
.as(not null)
1460 n_signature
.parent
= self
1461 _n_extern
= n_extern
1462 if n_extern
!= null then
1463 n_extern
.parent
= self
1467 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1469 if _n_doc
== old_child
then
1470 if new_child
!= null then
1471 new_child
.parent
= self
1472 assert new_child
isa ADoc
1479 if _n_kwredef
== old_child
then
1480 if new_child
!= null then
1481 new_child
.parent
= self
1482 assert new_child
isa TKwredef
1483 _n_kwredef
= new_child
1489 if _n_visibility
== old_child
then
1490 if new_child
!= null then
1491 new_child
.parent
= self
1492 assert new_child
isa AVisibility
1493 _n_visibility
= new_child
1499 if _n_kwmeth
== old_child
then
1500 if new_child
!= null then
1501 new_child
.parent
= self
1502 assert new_child
isa TKwmeth
1503 _n_kwmeth
= new_child
1509 if _n_methid
== old_child
then
1510 if new_child
!= null then
1511 new_child
.parent
= self
1512 assert new_child
isa AMethid
1513 _n_methid
= new_child
1519 if _n_signature
== old_child
then
1520 if new_child
!= null then
1521 new_child
.parent
= self
1522 assert new_child
isa ASignature
1523 _n_signature
= new_child
1529 if _n_extern
== old_child
then
1530 if new_child
!= null then
1531 new_child
.parent
= self
1532 assert new_child
isa TString
1533 _n_extern
= new_child
1541 redef fun visit_all
(v
: Visitor)
1543 if _n_doc
!= null then
1544 v
.enter_visit
(_n_doc
.as(not null))
1546 if _n_kwredef
!= null then
1547 v
.enter_visit
(_n_kwredef
.as(not null))
1549 v
.enter_visit
(_n_visibility
)
1550 v
.enter_visit
(_n_kwmeth
)
1551 v
.enter_visit
(_n_methid
)
1552 v
.enter_visit
(_n_signature
)
1553 if _n_extern
!= null then
1554 v
.enter_visit
(_n_extern
.as(not null))
1558 redef class AConcreteMethPropdef
1559 private init empty_init
do end
1561 init init_aconcretemethpropdef
(
1562 n_doc
: nullable ADoc,
1563 n_kwredef
: nullable TKwredef,
1564 n_visibility
: nullable AVisibility,
1565 n_kwmeth
: nullable TKwmeth,
1566 n_methid
: nullable AMethid,
1567 n_signature
: nullable ASignature,
1568 n_block
: nullable AExpr
1573 if n_doc
!= null then
1576 _n_kwredef
= n_kwredef
1577 if n_kwredef
!= null then
1578 n_kwredef
.parent
= self
1580 _n_visibility
= n_visibility
.as(not null)
1581 n_visibility
.parent
= self
1582 _n_kwmeth
= n_kwmeth
.as(not null)
1583 n_kwmeth
.parent
= self
1584 _n_methid
= n_methid
.as(not null)
1585 n_methid
.parent
= self
1586 _n_signature
= n_signature
.as(not null)
1587 n_signature
.parent
= self
1589 if n_block
!= null then
1590 n_block
.parent
= self
1594 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1596 if _n_doc
== old_child
then
1597 if new_child
!= null then
1598 new_child
.parent
= self
1599 assert new_child
isa ADoc
1606 if _n_kwredef
== old_child
then
1607 if new_child
!= null then
1608 new_child
.parent
= self
1609 assert new_child
isa TKwredef
1610 _n_kwredef
= new_child
1616 if _n_visibility
== old_child
then
1617 if new_child
!= null then
1618 new_child
.parent
= self
1619 assert new_child
isa AVisibility
1620 _n_visibility
= new_child
1626 if _n_kwmeth
== old_child
then
1627 if new_child
!= null then
1628 new_child
.parent
= self
1629 assert new_child
isa TKwmeth
1630 _n_kwmeth
= new_child
1636 if _n_methid
== old_child
then
1637 if new_child
!= null then
1638 new_child
.parent
= self
1639 assert new_child
isa AMethid
1640 _n_methid
= new_child
1646 if _n_signature
== old_child
then
1647 if new_child
!= null then
1648 new_child
.parent
= self
1649 assert new_child
isa ASignature
1650 _n_signature
= new_child
1656 if _n_block
== old_child
then
1657 if new_child
!= null then
1658 new_child
.parent
= self
1659 assert new_child
isa AExpr
1660 _n_block
= new_child
1668 redef fun visit_all
(v
: Visitor)
1670 if _n_doc
!= null then
1671 v
.enter_visit
(_n_doc
.as(not null))
1673 if _n_kwredef
!= null then
1674 v
.enter_visit
(_n_kwredef
.as(not null))
1676 v
.enter_visit
(_n_visibility
)
1677 v
.enter_visit
(_n_kwmeth
)
1678 v
.enter_visit
(_n_methid
)
1679 v
.enter_visit
(_n_signature
)
1680 if _n_block
!= null then
1681 v
.enter_visit
(_n_block
.as(not null))
1685 redef class AConcreteInitPropdef
1686 private init empty_init
do end
1688 init init_aconcreteinitpropdef
(
1689 n_doc
: nullable ADoc,
1690 n_kwredef
: nullable TKwredef,
1691 n_visibility
: nullable AVisibility,
1692 n_kwinit
: nullable TKwinit,
1693 n_methid
: nullable AMethid,
1694 n_signature
: nullable ASignature,
1695 n_block
: nullable AExpr
1700 if n_doc
!= null then
1703 _n_kwredef
= n_kwredef
1704 if n_kwredef
!= null then
1705 n_kwredef
.parent
= self
1707 _n_visibility
= n_visibility
.as(not null)
1708 n_visibility
.parent
= self
1709 _n_kwinit
= n_kwinit
.as(not null)
1710 n_kwinit
.parent
= self
1711 _n_methid
= n_methid
1712 if n_methid
!= null then
1713 n_methid
.parent
= self
1715 _n_signature
= n_signature
.as(not null)
1716 n_signature
.parent
= self
1718 if n_block
!= null then
1719 n_block
.parent
= self
1723 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1725 if _n_doc
== old_child
then
1726 if new_child
!= null then
1727 new_child
.parent
= self
1728 assert new_child
isa ADoc
1735 if _n_kwredef
== old_child
then
1736 if new_child
!= null then
1737 new_child
.parent
= self
1738 assert new_child
isa TKwredef
1739 _n_kwredef
= new_child
1745 if _n_visibility
== old_child
then
1746 if new_child
!= null then
1747 new_child
.parent
= self
1748 assert new_child
isa AVisibility
1749 _n_visibility
= new_child
1755 if _n_kwinit
== old_child
then
1756 if new_child
!= null then
1757 new_child
.parent
= self
1758 assert new_child
isa TKwinit
1759 _n_kwinit
= new_child
1765 if _n_methid
== old_child
then
1766 if new_child
!= null then
1767 new_child
.parent
= self
1768 assert new_child
isa AMethid
1769 _n_methid
= new_child
1775 if _n_signature
== old_child
then
1776 if new_child
!= null then
1777 new_child
.parent
= self
1778 assert new_child
isa ASignature
1779 _n_signature
= new_child
1785 if _n_block
== old_child
then
1786 if new_child
!= null then
1787 new_child
.parent
= self
1788 assert new_child
isa AExpr
1789 _n_block
= new_child
1797 redef fun visit_all
(v
: Visitor)
1799 if _n_doc
!= null then
1800 v
.enter_visit
(_n_doc
.as(not null))
1802 if _n_kwredef
!= null then
1803 v
.enter_visit
(_n_kwredef
.as(not null))
1805 v
.enter_visit
(_n_visibility
)
1806 v
.enter_visit
(_n_kwinit
)
1807 if _n_methid
!= null then
1808 v
.enter_visit
(_n_methid
.as(not null))
1810 v
.enter_visit
(_n_signature
)
1811 if _n_block
!= null then
1812 v
.enter_visit
(_n_block
.as(not null))
1816 redef class AMainMethPropdef
1817 private init empty_init
do end
1819 init init_amainmethpropdef
(
1820 n_kwredef
: nullable TKwredef,
1821 n_block
: nullable AExpr
1825 _n_kwredef
= n_kwredef
1826 if n_kwredef
!= null then
1827 n_kwredef
.parent
= self
1830 if n_block
!= null then
1831 n_block
.parent
= self
1835 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1837 if _n_kwredef
== old_child
then
1838 if new_child
!= null then
1839 new_child
.parent
= self
1840 assert new_child
isa TKwredef
1841 _n_kwredef
= new_child
1847 if _n_block
== old_child
then
1848 if new_child
!= null then
1849 new_child
.parent
= self
1850 assert new_child
isa AExpr
1851 _n_block
= new_child
1859 redef fun visit_all
(v
: Visitor)
1861 if _n_kwredef
!= null then
1862 v
.enter_visit
(_n_kwredef
.as(not null))
1864 if _n_block
!= null then
1865 v
.enter_visit
(_n_block
.as(not null))
1869 redef class ATypePropdef
1870 private init empty_init
do end
1872 init init_atypepropdef
(
1873 n_doc
: nullable ADoc,
1874 n_kwredef
: nullable TKwredef,
1875 n_visibility
: nullable AVisibility,
1876 n_kwtype
: nullable TKwtype,
1877 n_id
: nullable TClassid,
1878 n_type
: nullable AType
1883 if n_doc
!= null then
1886 _n_kwredef
= n_kwredef
1887 if n_kwredef
!= null then
1888 n_kwredef
.parent
= self
1890 _n_visibility
= n_visibility
.as(not null)
1891 n_visibility
.parent
= self
1892 _n_kwtype
= n_kwtype
.as(not null)
1893 n_kwtype
.parent
= self
1894 _n_id
= n_id
.as(not null)
1896 _n_type
= n_type
.as(not null)
1897 n_type
.parent
= self
1900 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1902 if _n_doc
== old_child
then
1903 if new_child
!= null then
1904 new_child
.parent
= self
1905 assert new_child
isa ADoc
1912 if _n_kwredef
== old_child
then
1913 if new_child
!= null then
1914 new_child
.parent
= self
1915 assert new_child
isa TKwredef
1916 _n_kwredef
= new_child
1922 if _n_visibility
== old_child
then
1923 if new_child
!= null then
1924 new_child
.parent
= self
1925 assert new_child
isa AVisibility
1926 _n_visibility
= new_child
1932 if _n_kwtype
== old_child
then
1933 if new_child
!= null then
1934 new_child
.parent
= self
1935 assert new_child
isa TKwtype
1936 _n_kwtype
= new_child
1942 if _n_id
== old_child
then
1943 if new_child
!= null then
1944 new_child
.parent
= self
1945 assert new_child
isa TClassid
1952 if _n_type
== old_child
then
1953 if new_child
!= null then
1954 new_child
.parent
= self
1955 assert new_child
isa AType
1964 redef fun visit_all
(v
: Visitor)
1966 if _n_doc
!= null then
1967 v
.enter_visit
(_n_doc
.as(not null))
1969 if _n_kwredef
!= null then
1970 v
.enter_visit
(_n_kwredef
.as(not null))
1972 v
.enter_visit
(_n_visibility
)
1973 v
.enter_visit
(_n_kwtype
)
1974 v
.enter_visit
(_n_id
)
1975 v
.enter_visit
(_n_type
)
1978 redef class AReadAble
1979 private init empty_init
do end
1981 init init_areadable
(
1982 n_kwredef
: nullable TKwredef,
1983 n_kwreadable
: nullable TKwreadable
1987 _n_kwredef
= n_kwredef
1988 if n_kwredef
!= null then
1989 n_kwredef
.parent
= self
1991 _n_kwreadable
= n_kwreadable
.as(not null)
1992 n_kwreadable
.parent
= self
1995 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1997 if _n_kwredef
== old_child
then
1998 if new_child
!= null then
1999 new_child
.parent
= self
2000 assert new_child
isa TKwredef
2001 _n_kwredef
= new_child
2007 if _n_kwreadable
== old_child
then
2008 if new_child
!= null then
2009 new_child
.parent
= self
2010 assert new_child
isa TKwreadable
2011 _n_kwreadable
= new_child
2019 redef fun visit_all
(v
: Visitor)
2021 if _n_kwredef
!= null then
2022 v
.enter_visit
(_n_kwredef
.as(not null))
2024 v
.enter_visit
(_n_kwreadable
)
2027 redef class AWriteAble
2028 private init empty_init
do end
2030 init init_awriteable
(
2031 n_kwredef
: nullable TKwredef,
2032 n_visibility
: nullable AVisibility,
2033 n_kwwritable
: nullable TKwwritable
2037 _n_kwredef
= n_kwredef
2038 if n_kwredef
!= null then
2039 n_kwredef
.parent
= self
2041 _n_visibility
= n_visibility
2042 if n_visibility
!= null then
2043 n_visibility
.parent
= self
2045 _n_kwwritable
= n_kwwritable
.as(not null)
2046 n_kwwritable
.parent
= self
2049 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2051 if _n_kwredef
== old_child
then
2052 if new_child
!= null then
2053 new_child
.parent
= self
2054 assert new_child
isa TKwredef
2055 _n_kwredef
= new_child
2061 if _n_visibility
== old_child
then
2062 if new_child
!= null then
2063 new_child
.parent
= self
2064 assert new_child
isa AVisibility
2065 _n_visibility
= new_child
2067 _n_visibility
= null
2071 if _n_kwwritable
== old_child
then
2072 if new_child
!= null then
2073 new_child
.parent
= self
2074 assert new_child
isa TKwwritable
2075 _n_kwwritable
= new_child
2083 redef fun visit_all
(v
: Visitor)
2085 if _n_kwredef
!= null then
2086 v
.enter_visit
(_n_kwredef
.as(not null))
2088 if _n_visibility
!= null then
2089 v
.enter_visit
(_n_visibility
.as(not null))
2091 v
.enter_visit
(_n_kwwritable
)
2094 redef class AIdMethid
2095 private init empty_init
do end
2097 init init_aidmethid
(
2102 _n_id
= n_id
.as(not null)
2106 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2108 if _n_id
== old_child
then
2109 if new_child
!= null then
2110 new_child
.parent
= self
2111 assert new_child
isa TId
2120 redef fun visit_all
(v
: Visitor)
2122 v
.enter_visit
(_n_id
)
2125 redef class APlusMethid
2126 private init empty_init
do end
2128 init init_aplusmethid
(
2129 n_plus
: nullable TPlus
2133 _n_plus
= n_plus
.as(not null)
2134 n_plus
.parent
= self
2137 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2139 if _n_plus
== old_child
then
2140 if new_child
!= null then
2141 new_child
.parent
= self
2142 assert new_child
isa TPlus
2151 redef fun visit_all
(v
: Visitor)
2153 v
.enter_visit
(_n_plus
)
2156 redef class AMinusMethid
2157 private init empty_init
do end
2159 init init_aminusmethid
(
2160 n_minus
: nullable TMinus
2164 _n_minus
= n_minus
.as(not null)
2165 n_minus
.parent
= self
2168 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2170 if _n_minus
== old_child
then
2171 if new_child
!= null then
2172 new_child
.parent
= self
2173 assert new_child
isa TMinus
2174 _n_minus
= new_child
2182 redef fun visit_all
(v
: Visitor)
2184 v
.enter_visit
(_n_minus
)
2187 redef class AStarMethid
2188 private init empty_init
do end
2190 init init_astarmethid
(
2191 n_star
: nullable TStar
2195 _n_star
= n_star
.as(not null)
2196 n_star
.parent
= self
2199 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2201 if _n_star
== old_child
then
2202 if new_child
!= null then
2203 new_child
.parent
= self
2204 assert new_child
isa TStar
2213 redef fun visit_all
(v
: Visitor)
2215 v
.enter_visit
(_n_star
)
2218 redef class ASlashMethid
2219 private init empty_init
do end
2221 init init_aslashmethid
(
2222 n_slash
: nullable TSlash
2226 _n_slash
= n_slash
.as(not null)
2227 n_slash
.parent
= self
2230 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2232 if _n_slash
== old_child
then
2233 if new_child
!= null then
2234 new_child
.parent
= self
2235 assert new_child
isa TSlash
2236 _n_slash
= new_child
2244 redef fun visit_all
(v
: Visitor)
2246 v
.enter_visit
(_n_slash
)
2249 redef class APercentMethid
2250 private init empty_init
do end
2252 init init_apercentmethid
(
2253 n_percent
: nullable TPercent
2257 _n_percent
= n_percent
.as(not null)
2258 n_percent
.parent
= self
2261 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2263 if _n_percent
== old_child
then
2264 if new_child
!= null then
2265 new_child
.parent
= self
2266 assert new_child
isa TPercent
2267 _n_percent
= new_child
2275 redef fun visit_all
(v
: Visitor)
2277 v
.enter_visit
(_n_percent
)
2280 redef class AEqMethid
2281 private init empty_init
do end
2283 init init_aeqmethid
(
2288 _n_eq
= n_eq
.as(not null)
2292 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2294 if _n_eq
== old_child
then
2295 if new_child
!= null then
2296 new_child
.parent
= self
2297 assert new_child
isa TEq
2306 redef fun visit_all
(v
: Visitor)
2308 v
.enter_visit
(_n_eq
)
2311 redef class ANeMethid
2312 private init empty_init
do end
2314 init init_anemethid
(
2319 _n_ne
= n_ne
.as(not null)
2323 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2325 if _n_ne
== old_child
then
2326 if new_child
!= null then
2327 new_child
.parent
= self
2328 assert new_child
isa TNe
2337 redef fun visit_all
(v
: Visitor)
2339 v
.enter_visit
(_n_ne
)
2342 redef class ALeMethid
2343 private init empty_init
do end
2345 init init_alemethid
(
2350 _n_le
= n_le
.as(not null)
2354 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2356 if _n_le
== old_child
then
2357 if new_child
!= null then
2358 new_child
.parent
= self
2359 assert new_child
isa TLe
2368 redef fun visit_all
(v
: Visitor)
2370 v
.enter_visit
(_n_le
)
2373 redef class AGeMethid
2374 private init empty_init
do end
2376 init init_agemethid
(
2381 _n_ge
= n_ge
.as(not null)
2385 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2387 if _n_ge
== old_child
then
2388 if new_child
!= null then
2389 new_child
.parent
= self
2390 assert new_child
isa TGe
2399 redef fun visit_all
(v
: Visitor)
2401 v
.enter_visit
(_n_ge
)
2404 redef class ALtMethid
2405 private init empty_init
do end
2407 init init_altmethid
(
2412 _n_lt
= n_lt
.as(not null)
2416 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2418 if _n_lt
== old_child
then
2419 if new_child
!= null then
2420 new_child
.parent
= self
2421 assert new_child
isa TLt
2430 redef fun visit_all
(v
: Visitor)
2432 v
.enter_visit
(_n_lt
)
2435 redef class AGtMethid
2436 private init empty_init
do end
2438 init init_agtmethid
(
2443 _n_gt
= n_gt
.as(not null)
2447 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2449 if _n_gt
== old_child
then
2450 if new_child
!= null then
2451 new_child
.parent
= self
2452 assert new_child
isa TGt
2461 redef fun visit_all
(v
: Visitor)
2463 v
.enter_visit
(_n_gt
)
2466 redef class ABraMethid
2467 private init empty_init
do end
2469 init init_abramethid
(
2470 n_obra
: nullable TObra,
2471 n_cbra
: nullable TCbra
2475 _n_obra
= n_obra
.as(not null)
2476 n_obra
.parent
= self
2477 _n_cbra
= n_cbra
.as(not null)
2478 n_cbra
.parent
= self
2481 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2483 if _n_obra
== old_child
then
2484 if new_child
!= null then
2485 new_child
.parent
= self
2486 assert new_child
isa TObra
2493 if _n_cbra
== old_child
then
2494 if new_child
!= null then
2495 new_child
.parent
= self
2496 assert new_child
isa TCbra
2505 redef fun visit_all
(v
: Visitor)
2507 v
.enter_visit
(_n_obra
)
2508 v
.enter_visit
(_n_cbra
)
2511 redef class AStarshipMethid
2512 private init empty_init
do end
2514 init init_astarshipmethid
(
2515 n_starship
: nullable TStarship
2519 _n_starship
= n_starship
.as(not null)
2520 n_starship
.parent
= self
2523 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2525 if _n_starship
== old_child
then
2526 if new_child
!= null then
2527 new_child
.parent
= self
2528 assert new_child
isa TStarship
2529 _n_starship
= new_child
2537 redef fun visit_all
(v
: Visitor)
2539 v
.enter_visit
(_n_starship
)
2542 redef class AAssignMethid
2543 private init empty_init
do end
2545 init init_aassignmethid
(
2547 n_assign
: nullable TAssign
2551 _n_id
= n_id
.as(not null)
2553 _n_assign
= n_assign
.as(not null)
2554 n_assign
.parent
= self
2557 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2559 if _n_id
== old_child
then
2560 if new_child
!= null then
2561 new_child
.parent
= self
2562 assert new_child
isa TId
2569 if _n_assign
== old_child
then
2570 if new_child
!= null then
2571 new_child
.parent
= self
2572 assert new_child
isa TAssign
2573 _n_assign
= new_child
2581 redef fun visit_all
(v
: Visitor)
2583 v
.enter_visit
(_n_id
)
2584 v
.enter_visit
(_n_assign
)
2587 redef class ABraassignMethid
2588 private init empty_init
do end
2590 init init_abraassignmethid
(
2591 n_obra
: nullable TObra,
2592 n_cbra
: nullable TCbra,
2593 n_assign
: nullable TAssign
2597 _n_obra
= n_obra
.as(not null)
2598 n_obra
.parent
= self
2599 _n_cbra
= n_cbra
.as(not null)
2600 n_cbra
.parent
= self
2601 _n_assign
= n_assign
.as(not null)
2602 n_assign
.parent
= self
2605 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2607 if _n_obra
== old_child
then
2608 if new_child
!= null then
2609 new_child
.parent
= self
2610 assert new_child
isa TObra
2617 if _n_cbra
== old_child
then
2618 if new_child
!= null then
2619 new_child
.parent
= self
2620 assert new_child
isa TCbra
2627 if _n_assign
== old_child
then
2628 if new_child
!= null then
2629 new_child
.parent
= self
2630 assert new_child
isa TAssign
2631 _n_assign
= new_child
2639 redef fun visit_all
(v
: Visitor)
2641 v
.enter_visit
(_n_obra
)
2642 v
.enter_visit
(_n_cbra
)
2643 v
.enter_visit
(_n_assign
)
2646 redef class ASignature
2647 private init empty_init
do end
2649 init init_asignature
(
2650 n_params
: Collection[Object], # Should be Collection[AParam]
2651 n_type
: nullable AType,
2652 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2656 for n
in n_params
do
2662 if n_type
!= null then
2663 n_type
.parent
= self
2665 for n
in n_closure_decls
do
2666 assert n
isa AClosureDecl
2667 _n_closure_decls
.add
(n
)
2672 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2674 for i
in [0.._n_params
.length
[ do
2675 if _n_params
[i
] == old_child
then
2676 if new_child
!= null then
2677 assert new_child
isa AParam
2678 _n_params
[i
] = new_child
2679 new_child
.parent
= self
2681 _n_params
.remove_at
(i
)
2686 if _n_type
== old_child
then
2687 if new_child
!= null then
2688 new_child
.parent
= self
2689 assert new_child
isa AType
2696 for i
in [0.._n_closure_decls
.length
[ do
2697 if _n_closure_decls
[i
] == old_child
then
2698 if new_child
!= null then
2699 assert new_child
isa AClosureDecl
2700 _n_closure_decls
[i
] = new_child
2701 new_child
.parent
= self
2703 _n_closure_decls
.remove_at
(i
)
2710 redef fun visit_all
(v
: Visitor)
2712 for n
in _n_params
do
2715 if _n_type
!= null then
2716 v
.enter_visit
(_n_type
.as(not null))
2718 for n
in _n_closure_decls
do
2724 private init empty_init
do end
2728 n_type
: nullable AType,
2729 n_dotdotdot
: nullable TDotdotdot
2733 _n_id
= n_id
.as(not null)
2736 if n_type
!= null then
2737 n_type
.parent
= self
2739 _n_dotdotdot
= n_dotdotdot
2740 if n_dotdotdot
!= null then
2741 n_dotdotdot
.parent
= self
2745 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2747 if _n_id
== old_child
then
2748 if new_child
!= null then
2749 new_child
.parent
= self
2750 assert new_child
isa TId
2757 if _n_type
== old_child
then
2758 if new_child
!= null then
2759 new_child
.parent
= self
2760 assert new_child
isa AType
2767 if _n_dotdotdot
== old_child
then
2768 if new_child
!= null then
2769 new_child
.parent
= self
2770 assert new_child
isa TDotdotdot
2771 _n_dotdotdot
= new_child
2779 redef fun visit_all
(v
: Visitor)
2781 v
.enter_visit
(_n_id
)
2782 if _n_type
!= null then
2783 v
.enter_visit
(_n_type
.as(not null))
2785 if _n_dotdotdot
!= null then
2786 v
.enter_visit
(_n_dotdotdot
.as(not null))
2790 redef class AClosureDecl
2791 private init empty_init
do end
2793 init init_aclosuredecl
(
2794 n_kwbreak
: nullable TKwbreak,
2795 n_bang
: nullable TBang,
2797 n_signature
: nullable ASignature,
2798 n_expr
: nullable AExpr
2802 _n_kwbreak
= n_kwbreak
2803 if n_kwbreak
!= null then
2804 n_kwbreak
.parent
= self
2806 _n_bang
= n_bang
.as(not null)
2807 n_bang
.parent
= self
2808 _n_id
= n_id
.as(not null)
2810 _n_signature
= n_signature
.as(not null)
2811 n_signature
.parent
= self
2813 if n_expr
!= null then
2814 n_expr
.parent
= self
2818 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2820 if _n_kwbreak
== old_child
then
2821 if new_child
!= null then
2822 new_child
.parent
= self
2823 assert new_child
isa TKwbreak
2824 _n_kwbreak
= new_child
2830 if _n_bang
== old_child
then
2831 if new_child
!= null then
2832 new_child
.parent
= self
2833 assert new_child
isa TBang
2840 if _n_id
== old_child
then
2841 if new_child
!= null then
2842 new_child
.parent
= self
2843 assert new_child
isa TId
2850 if _n_signature
== old_child
then
2851 if new_child
!= null then
2852 new_child
.parent
= self
2853 assert new_child
isa ASignature
2854 _n_signature
= new_child
2860 if _n_expr
== old_child
then
2861 if new_child
!= null then
2862 new_child
.parent
= self
2863 assert new_child
isa AExpr
2872 redef fun visit_all
(v
: Visitor)
2874 if _n_kwbreak
!= null then
2875 v
.enter_visit
(_n_kwbreak
.as(not null))
2877 v
.enter_visit
(_n_bang
)
2878 v
.enter_visit
(_n_id
)
2879 v
.enter_visit
(_n_signature
)
2880 if _n_expr
!= null then
2881 v
.enter_visit
(_n_expr
.as(not null))
2886 private init empty_init
do end
2889 n_kwnullable
: nullable TKwnullable,
2890 n_id
: nullable TClassid,
2891 n_types
: Collection[Object] # Should be Collection[AType]
2895 _n_kwnullable
= n_kwnullable
2896 if n_kwnullable
!= null then
2897 n_kwnullable
.parent
= self
2899 _n_id
= n_id
.as(not null)
2908 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2910 if _n_kwnullable
== old_child
then
2911 if new_child
!= null then
2912 new_child
.parent
= self
2913 assert new_child
isa TKwnullable
2914 _n_kwnullable
= new_child
2916 _n_kwnullable
= null
2920 if _n_id
== old_child
then
2921 if new_child
!= null then
2922 new_child
.parent
= self
2923 assert new_child
isa TClassid
2930 for i
in [0.._n_types
.length
[ do
2931 if _n_types
[i
] == old_child
then
2932 if new_child
!= null then
2933 assert new_child
isa AType
2934 _n_types
[i
] = new_child
2935 new_child
.parent
= self
2937 _n_types
.remove_at
(i
)
2944 redef fun visit_all
(v
: Visitor)
2946 if _n_kwnullable
!= null then
2947 v
.enter_visit
(_n_kwnullable
.as(not null))
2949 v
.enter_visit
(_n_id
)
2950 for n
in _n_types
do
2956 private init empty_init
do end
2959 n_kwlabel
: nullable TKwlabel,
2964 _n_kwlabel
= n_kwlabel
.as(not null)
2965 n_kwlabel
.parent
= self
2966 _n_id
= n_id
.as(not null)
2970 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2972 if _n_kwlabel
== old_child
then
2973 if new_child
!= null then
2974 new_child
.parent
= self
2975 assert new_child
isa TKwlabel
2976 _n_kwlabel
= new_child
2982 if _n_id
== old_child
then
2983 if new_child
!= null then
2984 new_child
.parent
= self
2985 assert new_child
isa TId
2994 redef fun visit_all
(v
: Visitor)
2996 v
.enter_visit
(_n_kwlabel
)
2997 v
.enter_visit
(_n_id
)
3000 redef class ABlockExpr
3001 private init empty_init
do end
3003 init init_ablockexpr
(
3004 n_expr
: Collection[Object] # Should be Collection[AExpr]
3015 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3017 for i
in [0.._n_expr
.length
[ do
3018 if _n_expr
[i
] == old_child
then
3019 if new_child
!= null then
3020 assert new_child
isa AExpr
3021 _n_expr
[i
] = new_child
3022 new_child
.parent
= self
3024 _n_expr
.remove_at
(i
)
3031 redef fun visit_all
(v
: Visitor)
3038 redef class AVardeclExpr
3039 private init empty_init
do end
3041 init init_avardeclexpr
(
3042 n_kwvar
: nullable TKwvar,
3044 n_type
: nullable AType,
3045 n_assign
: nullable TAssign,
3046 n_expr
: nullable AExpr
3050 _n_kwvar
= n_kwvar
.as(not null)
3051 n_kwvar
.parent
= self
3052 _n_id
= n_id
.as(not null)
3055 if n_type
!= null then
3056 n_type
.parent
= self
3058 _n_assign
= n_assign
3059 if n_assign
!= null then
3060 n_assign
.parent
= self
3063 if n_expr
!= null then
3064 n_expr
.parent
= self
3068 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3070 if _n_kwvar
== old_child
then
3071 if new_child
!= null then
3072 new_child
.parent
= self
3073 assert new_child
isa TKwvar
3074 _n_kwvar
= new_child
3080 if _n_id
== old_child
then
3081 if new_child
!= null then
3082 new_child
.parent
= self
3083 assert new_child
isa TId
3090 if _n_type
== old_child
then
3091 if new_child
!= null then
3092 new_child
.parent
= self
3093 assert new_child
isa AType
3100 if _n_assign
== old_child
then
3101 if new_child
!= null then
3102 new_child
.parent
= self
3103 assert new_child
isa TAssign
3104 _n_assign
= new_child
3110 if _n_expr
== old_child
then
3111 if new_child
!= null then
3112 new_child
.parent
= self
3113 assert new_child
isa AExpr
3122 redef fun visit_all
(v
: Visitor)
3124 v
.enter_visit
(_n_kwvar
)
3125 v
.enter_visit
(_n_id
)
3126 if _n_type
!= null then
3127 v
.enter_visit
(_n_type
.as(not null))
3129 if _n_assign
!= null then
3130 v
.enter_visit
(_n_assign
.as(not null))
3132 if _n_expr
!= null then
3133 v
.enter_visit
(_n_expr
.as(not null))
3137 redef class AReturnExpr
3138 private init empty_init
do end
3140 init init_areturnexpr
(
3141 n_kwreturn
: nullable TKwreturn,
3142 n_expr
: nullable AExpr
3146 _n_kwreturn
= n_kwreturn
3147 if n_kwreturn
!= null then
3148 n_kwreturn
.parent
= self
3151 if n_expr
!= null then
3152 n_expr
.parent
= self
3156 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3158 if _n_kwreturn
== old_child
then
3159 if new_child
!= null then
3160 new_child
.parent
= self
3161 assert new_child
isa TKwreturn
3162 _n_kwreturn
= new_child
3168 if _n_expr
== old_child
then
3169 if new_child
!= null then
3170 new_child
.parent
= self
3171 assert new_child
isa AExpr
3180 redef fun visit_all
(v
: Visitor)
3182 if _n_kwreturn
!= null then
3183 v
.enter_visit
(_n_kwreturn
.as(not null))
3185 if _n_expr
!= null then
3186 v
.enter_visit
(_n_expr
.as(not null))
3190 redef class ABreakExpr
3191 private init empty_init
do end
3193 init init_abreakexpr
(
3194 n_kwbreak
: nullable TKwbreak,
3195 n_label
: nullable ALabel,
3196 n_expr
: nullable AExpr
3200 _n_kwbreak
= n_kwbreak
.as(not null)
3201 n_kwbreak
.parent
= self
3203 if n_label
!= null then
3204 n_label
.parent
= self
3207 if n_expr
!= null then
3208 n_expr
.parent
= self
3212 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3214 if _n_kwbreak
== old_child
then
3215 if new_child
!= null then
3216 new_child
.parent
= self
3217 assert new_child
isa TKwbreak
3218 _n_kwbreak
= new_child
3224 if _n_label
== old_child
then
3225 if new_child
!= null then
3226 new_child
.parent
= self
3227 assert new_child
isa ALabel
3228 _n_label
= new_child
3234 if _n_expr
== old_child
then
3235 if new_child
!= null then
3236 new_child
.parent
= self
3237 assert new_child
isa AExpr
3246 redef fun visit_all
(v
: Visitor)
3248 v
.enter_visit
(_n_kwbreak
)
3249 if _n_label
!= null then
3250 v
.enter_visit
(_n_label
.as(not null))
3252 if _n_expr
!= null then
3253 v
.enter_visit
(_n_expr
.as(not null))
3257 redef class AAbortExpr
3258 private init empty_init
do end
3260 init init_aabortexpr
(
3261 n_kwabort
: nullable TKwabort
3265 _n_kwabort
= n_kwabort
.as(not null)
3266 n_kwabort
.parent
= self
3269 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3271 if _n_kwabort
== old_child
then
3272 if new_child
!= null then
3273 new_child
.parent
= self
3274 assert new_child
isa TKwabort
3275 _n_kwabort
= new_child
3283 redef fun visit_all
(v
: Visitor)
3285 v
.enter_visit
(_n_kwabort
)
3288 redef class AContinueExpr
3289 private init empty_init
do end
3291 init init_acontinueexpr
(
3292 n_kwcontinue
: nullable TKwcontinue,
3293 n_label
: nullable ALabel,
3294 n_expr
: nullable AExpr
3298 _n_kwcontinue
= n_kwcontinue
3299 if n_kwcontinue
!= null then
3300 n_kwcontinue
.parent
= self
3303 if n_label
!= null then
3304 n_label
.parent
= self
3307 if n_expr
!= null then
3308 n_expr
.parent
= self
3312 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3314 if _n_kwcontinue
== old_child
then
3315 if new_child
!= null then
3316 new_child
.parent
= self
3317 assert new_child
isa TKwcontinue
3318 _n_kwcontinue
= new_child
3320 _n_kwcontinue
= null
3324 if _n_label
== old_child
then
3325 if new_child
!= null then
3326 new_child
.parent
= self
3327 assert new_child
isa ALabel
3328 _n_label
= new_child
3334 if _n_expr
== old_child
then
3335 if new_child
!= null then
3336 new_child
.parent
= self
3337 assert new_child
isa AExpr
3346 redef fun visit_all
(v
: Visitor)
3348 if _n_kwcontinue
!= null then
3349 v
.enter_visit
(_n_kwcontinue
.as(not null))
3351 if _n_label
!= null then
3352 v
.enter_visit
(_n_label
.as(not null))
3354 if _n_expr
!= null then
3355 v
.enter_visit
(_n_expr
.as(not null))
3360 private init empty_init
do end
3363 n_kwdo
: nullable TKwdo,
3364 n_block
: nullable AExpr,
3365 n_label
: nullable ALabel
3369 _n_kwdo
= n_kwdo
.as(not null)
3370 n_kwdo
.parent
= self
3372 if n_block
!= null then
3373 n_block
.parent
= self
3376 if n_label
!= null then
3377 n_label
.parent
= self
3381 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3383 if _n_kwdo
== old_child
then
3384 if new_child
!= null then
3385 new_child
.parent
= self
3386 assert new_child
isa TKwdo
3393 if _n_block
== old_child
then
3394 if new_child
!= null then
3395 new_child
.parent
= self
3396 assert new_child
isa AExpr
3397 _n_block
= new_child
3403 if _n_label
== old_child
then
3404 if new_child
!= null then
3405 new_child
.parent
= self
3406 assert new_child
isa ALabel
3407 _n_label
= new_child
3415 redef fun visit_all
(v
: Visitor)
3417 v
.enter_visit
(_n_kwdo
)
3418 if _n_block
!= null then
3419 v
.enter_visit
(_n_block
.as(not null))
3421 if _n_label
!= null then
3422 v
.enter_visit
(_n_label
.as(not null))
3427 private init empty_init
do end
3430 n_kwif
: nullable TKwif,
3431 n_expr
: nullable AExpr,
3432 n_then
: nullable AExpr,
3433 n_else
: nullable AExpr
3437 _n_kwif
= n_kwif
.as(not null)
3438 n_kwif
.parent
= self
3439 _n_expr
= n_expr
.as(not null)
3440 n_expr
.parent
= self
3442 if n_then
!= null then
3443 n_then
.parent
= self
3446 if n_else
!= null then
3447 n_else
.parent
= self
3451 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3453 if _n_kwif
== old_child
then
3454 if new_child
!= null then
3455 new_child
.parent
= self
3456 assert new_child
isa TKwif
3463 if _n_expr
== old_child
then
3464 if new_child
!= null then
3465 new_child
.parent
= self
3466 assert new_child
isa AExpr
3473 if _n_then
== old_child
then
3474 if new_child
!= null then
3475 new_child
.parent
= self
3476 assert new_child
isa AExpr
3483 if _n_else
== old_child
then
3484 if new_child
!= null then
3485 new_child
.parent
= self
3486 assert new_child
isa AExpr
3495 redef fun visit_all
(v
: Visitor)
3497 v
.enter_visit
(_n_kwif
)
3498 v
.enter_visit
(_n_expr
)
3499 if _n_then
!= null then
3500 v
.enter_visit
(_n_then
.as(not null))
3502 if _n_else
!= null then
3503 v
.enter_visit
(_n_else
.as(not null))
3507 redef class AIfexprExpr
3508 private init empty_init
do end
3510 init init_aifexprexpr
(
3511 n_kwif
: nullable TKwif,
3512 n_expr
: nullable AExpr,
3513 n_kwthen
: nullable TKwthen,
3514 n_then
: nullable AExpr,
3515 n_kwelse
: nullable TKwelse,
3516 n_else
: nullable AExpr
3520 _n_kwif
= n_kwif
.as(not null)
3521 n_kwif
.parent
= self
3522 _n_expr
= n_expr
.as(not null)
3523 n_expr
.parent
= self
3524 _n_kwthen
= n_kwthen
.as(not null)
3525 n_kwthen
.parent
= self
3526 _n_then
= n_then
.as(not null)
3527 n_then
.parent
= self
3528 _n_kwelse
= n_kwelse
.as(not null)
3529 n_kwelse
.parent
= self
3530 _n_else
= n_else
.as(not null)
3531 n_else
.parent
= self
3534 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3536 if _n_kwif
== old_child
then
3537 if new_child
!= null then
3538 new_child
.parent
= self
3539 assert new_child
isa TKwif
3546 if _n_expr
== old_child
then
3547 if new_child
!= null then
3548 new_child
.parent
= self
3549 assert new_child
isa AExpr
3556 if _n_kwthen
== old_child
then
3557 if new_child
!= null then
3558 new_child
.parent
= self
3559 assert new_child
isa TKwthen
3560 _n_kwthen
= new_child
3566 if _n_then
== old_child
then
3567 if new_child
!= null then
3568 new_child
.parent
= self
3569 assert new_child
isa AExpr
3576 if _n_kwelse
== old_child
then
3577 if new_child
!= null then
3578 new_child
.parent
= self
3579 assert new_child
isa TKwelse
3580 _n_kwelse
= new_child
3586 if _n_else
== old_child
then
3587 if new_child
!= null then
3588 new_child
.parent
= self
3589 assert new_child
isa AExpr
3598 redef fun visit_all
(v
: Visitor)
3600 v
.enter_visit
(_n_kwif
)
3601 v
.enter_visit
(_n_expr
)
3602 v
.enter_visit
(_n_kwthen
)
3603 v
.enter_visit
(_n_then
)
3604 v
.enter_visit
(_n_kwelse
)
3605 v
.enter_visit
(_n_else
)
3608 redef class AWhileExpr
3609 private init empty_init
do end
3611 init init_awhileexpr
(
3612 n_kwwhile
: nullable TKwwhile,
3613 n_expr
: nullable AExpr,
3614 n_kwdo
: nullable TKwdo,
3615 n_block
: nullable AExpr,
3616 n_label
: nullable ALabel
3620 _n_kwwhile
= n_kwwhile
.as(not null)
3621 n_kwwhile
.parent
= self
3622 _n_expr
= n_expr
.as(not null)
3623 n_expr
.parent
= self
3624 _n_kwdo
= n_kwdo
.as(not null)
3625 n_kwdo
.parent
= self
3627 if n_block
!= null then
3628 n_block
.parent
= self
3631 if n_label
!= null then
3632 n_label
.parent
= self
3636 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3638 if _n_kwwhile
== old_child
then
3639 if new_child
!= null then
3640 new_child
.parent
= self
3641 assert new_child
isa TKwwhile
3642 _n_kwwhile
= new_child
3648 if _n_expr
== old_child
then
3649 if new_child
!= null then
3650 new_child
.parent
= self
3651 assert new_child
isa AExpr
3658 if _n_kwdo
== old_child
then
3659 if new_child
!= null then
3660 new_child
.parent
= self
3661 assert new_child
isa TKwdo
3668 if _n_block
== old_child
then
3669 if new_child
!= null then
3670 new_child
.parent
= self
3671 assert new_child
isa AExpr
3672 _n_block
= new_child
3678 if _n_label
== old_child
then
3679 if new_child
!= null then
3680 new_child
.parent
= self
3681 assert new_child
isa ALabel
3682 _n_label
= new_child
3690 redef fun visit_all
(v
: Visitor)
3692 v
.enter_visit
(_n_kwwhile
)
3693 v
.enter_visit
(_n_expr
)
3694 v
.enter_visit
(_n_kwdo
)
3695 if _n_block
!= null then
3696 v
.enter_visit
(_n_block
.as(not null))
3698 if _n_label
!= null then
3699 v
.enter_visit
(_n_label
.as(not null))
3703 redef class ALoopExpr
3704 private init empty_init
do end
3706 init init_aloopexpr
(
3707 n_kwloop
: nullable TKwloop,
3708 n_block
: nullable AExpr,
3709 n_label
: nullable ALabel
3713 _n_kwloop
= n_kwloop
.as(not null)
3714 n_kwloop
.parent
= self
3716 if n_block
!= null then
3717 n_block
.parent
= self
3720 if n_label
!= null then
3721 n_label
.parent
= self
3725 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3727 if _n_kwloop
== old_child
then
3728 if new_child
!= null then
3729 new_child
.parent
= self
3730 assert new_child
isa TKwloop
3731 _n_kwloop
= new_child
3737 if _n_block
== old_child
then
3738 if new_child
!= null then
3739 new_child
.parent
= self
3740 assert new_child
isa AExpr
3741 _n_block
= new_child
3747 if _n_label
== old_child
then
3748 if new_child
!= null then
3749 new_child
.parent
= self
3750 assert new_child
isa ALabel
3751 _n_label
= new_child
3759 redef fun visit_all
(v
: Visitor)
3761 v
.enter_visit
(_n_kwloop
)
3762 if _n_block
!= null then
3763 v
.enter_visit
(_n_block
.as(not null))
3765 if _n_label
!= null then
3766 v
.enter_visit
(_n_label
.as(not null))
3770 redef class AForExpr
3771 private init empty_init
do end
3773 init init_aforexpr
(
3774 n_kwfor
: nullable TKwfor,
3776 n_expr
: nullable AExpr,
3777 n_kwdo
: nullable TKwdo,
3778 n_block
: nullable AExpr,
3779 n_label
: nullable ALabel
3783 _n_kwfor
= n_kwfor
.as(not null)
3784 n_kwfor
.parent
= self
3785 _n_id
= n_id
.as(not null)
3787 _n_expr
= n_expr
.as(not null)
3788 n_expr
.parent
= self
3789 _n_kwdo
= n_kwdo
.as(not null)
3790 n_kwdo
.parent
= self
3792 if n_block
!= null then
3793 n_block
.parent
= self
3796 if n_label
!= null then
3797 n_label
.parent
= self
3801 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3803 if _n_kwfor
== old_child
then
3804 if new_child
!= null then
3805 new_child
.parent
= self
3806 assert new_child
isa TKwfor
3807 _n_kwfor
= new_child
3813 if _n_id
== old_child
then
3814 if new_child
!= null then
3815 new_child
.parent
= self
3816 assert new_child
isa TId
3823 if _n_expr
== old_child
then
3824 if new_child
!= null then
3825 new_child
.parent
= self
3826 assert new_child
isa AExpr
3833 if _n_kwdo
== old_child
then
3834 if new_child
!= null then
3835 new_child
.parent
= self
3836 assert new_child
isa TKwdo
3843 if _n_block
== old_child
then
3844 if new_child
!= null then
3845 new_child
.parent
= self
3846 assert new_child
isa AExpr
3847 _n_block
= new_child
3853 if _n_label
== old_child
then
3854 if new_child
!= null then
3855 new_child
.parent
= self
3856 assert new_child
isa ALabel
3857 _n_label
= new_child
3865 redef fun visit_all
(v
: Visitor)
3867 v
.enter_visit
(_n_kwfor
)
3868 v
.enter_visit
(_n_id
)
3869 v
.enter_visit
(_n_expr
)
3870 v
.enter_visit
(_n_kwdo
)
3871 if _n_block
!= null then
3872 v
.enter_visit
(_n_block
.as(not null))
3874 if _n_label
!= null then
3875 v
.enter_visit
(_n_label
.as(not null))
3879 redef class AAssertExpr
3880 private init empty_init
do end
3882 init init_aassertexpr
(
3883 n_kwassert
: nullable TKwassert,
3885 n_expr
: nullable AExpr,
3886 n_else
: nullable AExpr
3890 _n_kwassert
= n_kwassert
.as(not null)
3891 n_kwassert
.parent
= self
3893 if n_id
!= null then
3896 _n_expr
= n_expr
.as(not null)
3897 n_expr
.parent
= self
3899 if n_else
!= null then
3900 n_else
.parent
= self
3904 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3906 if _n_kwassert
== old_child
then
3907 if new_child
!= null then
3908 new_child
.parent
= self
3909 assert new_child
isa TKwassert
3910 _n_kwassert
= new_child
3916 if _n_id
== old_child
then
3917 if new_child
!= null then
3918 new_child
.parent
= self
3919 assert new_child
isa TId
3926 if _n_expr
== old_child
then
3927 if new_child
!= null then
3928 new_child
.parent
= self
3929 assert new_child
isa AExpr
3936 if _n_else
== old_child
then
3937 if new_child
!= null then
3938 new_child
.parent
= self
3939 assert new_child
isa AExpr
3948 redef fun visit_all
(v
: Visitor)
3950 v
.enter_visit
(_n_kwassert
)
3951 if _n_id
!= null then
3952 v
.enter_visit
(_n_id
.as(not null))
3954 v
.enter_visit
(_n_expr
)
3955 if _n_else
!= null then
3956 v
.enter_visit
(_n_else
.as(not null))
3960 redef class AOnceExpr
3961 private init empty_init
do end
3963 init init_aonceexpr
(
3964 n_kwonce
: nullable TKwonce,
3965 n_expr
: nullable AExpr
3969 _n_kwonce
= n_kwonce
.as(not null)
3970 n_kwonce
.parent
= self
3971 _n_expr
= n_expr
.as(not null)
3972 n_expr
.parent
= self
3975 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3977 if _n_kwonce
== old_child
then
3978 if new_child
!= null then
3979 new_child
.parent
= self
3980 assert new_child
isa TKwonce
3981 _n_kwonce
= new_child
3987 if _n_expr
== old_child
then
3988 if new_child
!= null then
3989 new_child
.parent
= self
3990 assert new_child
isa AExpr
3999 redef fun visit_all
(v
: Visitor)
4001 v
.enter_visit
(_n_kwonce
)
4002 v
.enter_visit
(_n_expr
)
4005 redef class ASendExpr
4006 private init empty_init
do end
4008 init init_asendexpr
(
4009 n_expr
: nullable AExpr
4013 _n_expr
= n_expr
.as(not null)
4014 n_expr
.parent
= self
4017 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4019 if _n_expr
== old_child
then
4020 if new_child
!= null then
4021 new_child
.parent
= self
4022 assert new_child
isa AExpr
4031 redef fun visit_all
(v
: Visitor)
4033 v
.enter_visit
(_n_expr
)
4036 redef class ABinopExpr
4037 private init empty_init
do end
4039 init init_abinopexpr
(
4040 n_expr
: nullable AExpr,
4041 n_expr2
: nullable AExpr
4045 _n_expr
= n_expr
.as(not null)
4046 n_expr
.parent
= self
4047 _n_expr2
= n_expr2
.as(not null)
4048 n_expr2
.parent
= self
4051 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4053 if _n_expr
== old_child
then
4054 if new_child
!= null then
4055 new_child
.parent
= self
4056 assert new_child
isa AExpr
4063 if _n_expr2
== old_child
then
4064 if new_child
!= null then
4065 new_child
.parent
= self
4066 assert new_child
isa AExpr
4067 _n_expr2
= new_child
4075 redef fun visit_all
(v
: Visitor)
4077 v
.enter_visit
(_n_expr
)
4078 v
.enter_visit
(_n_expr2
)
4082 private init empty_init
do end
4085 n_expr
: nullable AExpr,
4086 n_expr2
: nullable AExpr
4090 _n_expr
= n_expr
.as(not null)
4091 n_expr
.parent
= self
4092 _n_expr2
= n_expr2
.as(not null)
4093 n_expr2
.parent
= self
4096 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4098 if _n_expr
== old_child
then
4099 if new_child
!= null then
4100 new_child
.parent
= self
4101 assert new_child
isa AExpr
4108 if _n_expr2
== old_child
then
4109 if new_child
!= null then
4110 new_child
.parent
= self
4111 assert new_child
isa AExpr
4112 _n_expr2
= new_child
4120 redef fun visit_all
(v
: Visitor)
4122 v
.enter_visit
(_n_expr
)
4123 v
.enter_visit
(_n_expr2
)
4126 redef class AAndExpr
4127 private init empty_init
do end
4129 init init_aandexpr
(
4130 n_expr
: nullable AExpr,
4131 n_expr2
: nullable AExpr
4135 _n_expr
= n_expr
.as(not null)
4136 n_expr
.parent
= self
4137 _n_expr2
= n_expr2
.as(not null)
4138 n_expr2
.parent
= self
4141 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4143 if _n_expr
== old_child
then
4144 if new_child
!= null then
4145 new_child
.parent
= self
4146 assert new_child
isa AExpr
4153 if _n_expr2
== old_child
then
4154 if new_child
!= null then
4155 new_child
.parent
= self
4156 assert new_child
isa AExpr
4157 _n_expr2
= new_child
4165 redef fun visit_all
(v
: Visitor)
4167 v
.enter_visit
(_n_expr
)
4168 v
.enter_visit
(_n_expr2
)
4171 redef class AOrElseExpr
4172 private init empty_init
do end
4174 init init_aorelseexpr
(
4175 n_expr
: nullable AExpr,
4176 n_expr2
: nullable AExpr
4180 _n_expr
= n_expr
.as(not null)
4181 n_expr
.parent
= self
4182 _n_expr2
= n_expr2
.as(not null)
4183 n_expr2
.parent
= self
4186 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4188 if _n_expr
== old_child
then
4189 if new_child
!= null then
4190 new_child
.parent
= self
4191 assert new_child
isa AExpr
4198 if _n_expr2
== old_child
then
4199 if new_child
!= null then
4200 new_child
.parent
= self
4201 assert new_child
isa AExpr
4202 _n_expr2
= new_child
4210 redef fun visit_all
(v
: Visitor)
4212 v
.enter_visit
(_n_expr
)
4213 v
.enter_visit
(_n_expr2
)
4216 redef class ANotExpr
4217 private init empty_init
do end
4219 init init_anotexpr
(
4220 n_kwnot
: nullable TKwnot,
4221 n_expr
: nullable AExpr
4225 _n_kwnot
= n_kwnot
.as(not null)
4226 n_kwnot
.parent
= self
4227 _n_expr
= n_expr
.as(not null)
4228 n_expr
.parent
= self
4231 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4233 if _n_kwnot
== old_child
then
4234 if new_child
!= null then
4235 new_child
.parent
= self
4236 assert new_child
isa TKwnot
4237 _n_kwnot
= new_child
4243 if _n_expr
== old_child
then
4244 if new_child
!= null then
4245 new_child
.parent
= self
4246 assert new_child
isa AExpr
4255 redef fun visit_all
(v
: Visitor)
4257 v
.enter_visit
(_n_kwnot
)
4258 v
.enter_visit
(_n_expr
)
4262 private init empty_init
do end
4265 n_expr
: nullable AExpr,
4266 n_expr2
: nullable AExpr
4270 _n_expr
= n_expr
.as(not null)
4271 n_expr
.parent
= self
4272 _n_expr2
= n_expr2
.as(not null)
4273 n_expr2
.parent
= self
4276 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4278 if _n_expr
== old_child
then
4279 if new_child
!= null then
4280 new_child
.parent
= self
4281 assert new_child
isa AExpr
4288 if _n_expr2
== old_child
then
4289 if new_child
!= null then
4290 new_child
.parent
= self
4291 assert new_child
isa AExpr
4292 _n_expr2
= new_child
4300 redef fun visit_all
(v
: Visitor)
4302 v
.enter_visit
(_n_expr
)
4303 v
.enter_visit
(_n_expr2
)
4307 private init empty_init
do end
4310 n_expr
: nullable AExpr,
4311 n_expr2
: nullable AExpr
4315 _n_expr
= n_expr
.as(not null)
4316 n_expr
.parent
= self
4317 _n_expr2
= n_expr2
.as(not null)
4318 n_expr2
.parent
= self
4321 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4323 if _n_expr
== old_child
then
4324 if new_child
!= null then
4325 new_child
.parent
= self
4326 assert new_child
isa AExpr
4333 if _n_expr2
== old_child
then
4334 if new_child
!= null then
4335 new_child
.parent
= self
4336 assert new_child
isa AExpr
4337 _n_expr2
= new_child
4345 redef fun visit_all
(v
: Visitor)
4347 v
.enter_visit
(_n_expr
)
4348 v
.enter_visit
(_n_expr2
)
4352 private init empty_init
do end
4355 n_expr
: nullable AExpr,
4356 n_expr2
: nullable AExpr
4360 _n_expr
= n_expr
.as(not null)
4361 n_expr
.parent
= self
4362 _n_expr2
= n_expr2
.as(not null)
4363 n_expr2
.parent
= self
4366 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4368 if _n_expr
== old_child
then
4369 if new_child
!= null then
4370 new_child
.parent
= self
4371 assert new_child
isa AExpr
4378 if _n_expr2
== old_child
then
4379 if new_child
!= null then
4380 new_child
.parent
= self
4381 assert new_child
isa AExpr
4382 _n_expr2
= new_child
4390 redef fun visit_all
(v
: Visitor)
4392 v
.enter_visit
(_n_expr
)
4393 v
.enter_visit
(_n_expr2
)
4397 private init empty_init
do end
4400 n_expr
: nullable AExpr,
4401 n_expr2
: nullable AExpr
4405 _n_expr
= n_expr
.as(not null)
4406 n_expr
.parent
= self
4407 _n_expr2
= n_expr2
.as(not null)
4408 n_expr2
.parent
= self
4411 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4413 if _n_expr
== old_child
then
4414 if new_child
!= null then
4415 new_child
.parent
= self
4416 assert new_child
isa AExpr
4423 if _n_expr2
== old_child
then
4424 if new_child
!= null then
4425 new_child
.parent
= self
4426 assert new_child
isa AExpr
4427 _n_expr2
= new_child
4435 redef fun visit_all
(v
: Visitor)
4437 v
.enter_visit
(_n_expr
)
4438 v
.enter_visit
(_n_expr2
)
4442 private init empty_init
do end
4445 n_expr
: nullable AExpr,
4446 n_expr2
: nullable AExpr
4450 _n_expr
= n_expr
.as(not null)
4451 n_expr
.parent
= self
4452 _n_expr2
= n_expr2
.as(not null)
4453 n_expr2
.parent
= self
4456 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4458 if _n_expr
== old_child
then
4459 if new_child
!= null then
4460 new_child
.parent
= self
4461 assert new_child
isa AExpr
4468 if _n_expr2
== old_child
then
4469 if new_child
!= null then
4470 new_child
.parent
= self
4471 assert new_child
isa AExpr
4472 _n_expr2
= new_child
4480 redef fun visit_all
(v
: Visitor)
4482 v
.enter_visit
(_n_expr
)
4483 v
.enter_visit
(_n_expr2
)
4487 private init empty_init
do end
4490 n_expr
: nullable AExpr,
4491 n_expr2
: nullable AExpr
4495 _n_expr
= n_expr
.as(not null)
4496 n_expr
.parent
= self
4497 _n_expr2
= n_expr2
.as(not null)
4498 n_expr2
.parent
= self
4501 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4503 if _n_expr
== old_child
then
4504 if new_child
!= null then
4505 new_child
.parent
= self
4506 assert new_child
isa AExpr
4513 if _n_expr2
== old_child
then
4514 if new_child
!= null then
4515 new_child
.parent
= self
4516 assert new_child
isa AExpr
4517 _n_expr2
= new_child
4525 redef fun visit_all
(v
: Visitor)
4527 v
.enter_visit
(_n_expr
)
4528 v
.enter_visit
(_n_expr2
)
4532 private init empty_init
do end
4535 n_expr
: nullable AExpr,
4536 n_expr2
: nullable AExpr
4540 _n_expr
= n_expr
.as(not null)
4541 n_expr
.parent
= self
4542 _n_expr2
= n_expr2
.as(not null)
4543 n_expr2
.parent
= self
4546 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4548 if _n_expr
== old_child
then
4549 if new_child
!= null then
4550 new_child
.parent
= self
4551 assert new_child
isa AExpr
4558 if _n_expr2
== old_child
then
4559 if new_child
!= null then
4560 new_child
.parent
= self
4561 assert new_child
isa AExpr
4562 _n_expr2
= new_child
4570 redef fun visit_all
(v
: Visitor)
4572 v
.enter_visit
(_n_expr
)
4573 v
.enter_visit
(_n_expr2
)
4576 redef class AIsaExpr
4577 private init empty_init
do end
4579 init init_aisaexpr
(
4580 n_expr
: nullable AExpr,
4581 n_type
: nullable AType
4585 _n_expr
= n_expr
.as(not null)
4586 n_expr
.parent
= self
4587 _n_type
= n_type
.as(not null)
4588 n_type
.parent
= self
4591 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4593 if _n_expr
== old_child
then
4594 if new_child
!= null then
4595 new_child
.parent
= self
4596 assert new_child
isa AExpr
4603 if _n_type
== old_child
then
4604 if new_child
!= null then
4605 new_child
.parent
= self
4606 assert new_child
isa AType
4615 redef fun visit_all
(v
: Visitor)
4617 v
.enter_visit
(_n_expr
)
4618 v
.enter_visit
(_n_type
)
4621 redef class APlusExpr
4622 private init empty_init
do end
4624 init init_aplusexpr
(
4625 n_expr
: nullable AExpr,
4626 n_expr2
: nullable AExpr
4630 _n_expr
= n_expr
.as(not null)
4631 n_expr
.parent
= self
4632 _n_expr2
= n_expr2
.as(not null)
4633 n_expr2
.parent
= self
4636 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4638 if _n_expr
== old_child
then
4639 if new_child
!= null then
4640 new_child
.parent
= self
4641 assert new_child
isa AExpr
4648 if _n_expr2
== old_child
then
4649 if new_child
!= null then
4650 new_child
.parent
= self
4651 assert new_child
isa AExpr
4652 _n_expr2
= new_child
4660 redef fun visit_all
(v
: Visitor)
4662 v
.enter_visit
(_n_expr
)
4663 v
.enter_visit
(_n_expr2
)
4666 redef class AMinusExpr
4667 private init empty_init
do end
4669 init init_aminusexpr
(
4670 n_expr
: nullable AExpr,
4671 n_expr2
: nullable AExpr
4675 _n_expr
= n_expr
.as(not null)
4676 n_expr
.parent
= self
4677 _n_expr2
= n_expr2
.as(not null)
4678 n_expr2
.parent
= self
4681 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4683 if _n_expr
== old_child
then
4684 if new_child
!= null then
4685 new_child
.parent
= self
4686 assert new_child
isa AExpr
4693 if _n_expr2
== old_child
then
4694 if new_child
!= null then
4695 new_child
.parent
= self
4696 assert new_child
isa AExpr
4697 _n_expr2
= new_child
4705 redef fun visit_all
(v
: Visitor)
4707 v
.enter_visit
(_n_expr
)
4708 v
.enter_visit
(_n_expr2
)
4711 redef class AStarshipExpr
4712 private init empty_init
do end
4714 init init_astarshipexpr
(
4715 n_expr
: nullable AExpr,
4716 n_expr2
: nullable AExpr
4720 _n_expr
= n_expr
.as(not null)
4721 n_expr
.parent
= self
4722 _n_expr2
= n_expr2
.as(not null)
4723 n_expr2
.parent
= self
4726 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4728 if _n_expr
== old_child
then
4729 if new_child
!= null then
4730 new_child
.parent
= self
4731 assert new_child
isa AExpr
4738 if _n_expr2
== old_child
then
4739 if new_child
!= null then
4740 new_child
.parent
= self
4741 assert new_child
isa AExpr
4742 _n_expr2
= new_child
4750 redef fun visit_all
(v
: Visitor)
4752 v
.enter_visit
(_n_expr
)
4753 v
.enter_visit
(_n_expr2
)
4756 redef class AStarExpr
4757 private init empty_init
do end
4759 init init_astarexpr
(
4760 n_expr
: nullable AExpr,
4761 n_expr2
: nullable AExpr
4765 _n_expr
= n_expr
.as(not null)
4766 n_expr
.parent
= self
4767 _n_expr2
= n_expr2
.as(not null)
4768 n_expr2
.parent
= self
4771 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4773 if _n_expr
== old_child
then
4774 if new_child
!= null then
4775 new_child
.parent
= self
4776 assert new_child
isa AExpr
4783 if _n_expr2
== old_child
then
4784 if new_child
!= null then
4785 new_child
.parent
= self
4786 assert new_child
isa AExpr
4787 _n_expr2
= new_child
4795 redef fun visit_all
(v
: Visitor)
4797 v
.enter_visit
(_n_expr
)
4798 v
.enter_visit
(_n_expr2
)
4801 redef class ASlashExpr
4802 private init empty_init
do end
4804 init init_aslashexpr
(
4805 n_expr
: nullable AExpr,
4806 n_expr2
: nullable AExpr
4810 _n_expr
= n_expr
.as(not null)
4811 n_expr
.parent
= self
4812 _n_expr2
= n_expr2
.as(not null)
4813 n_expr2
.parent
= self
4816 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4818 if _n_expr
== old_child
then
4819 if new_child
!= null then
4820 new_child
.parent
= self
4821 assert new_child
isa AExpr
4828 if _n_expr2
== old_child
then
4829 if new_child
!= null then
4830 new_child
.parent
= self
4831 assert new_child
isa AExpr
4832 _n_expr2
= new_child
4840 redef fun visit_all
(v
: Visitor)
4842 v
.enter_visit
(_n_expr
)
4843 v
.enter_visit
(_n_expr2
)
4846 redef class APercentExpr
4847 private init empty_init
do end
4849 init init_apercentexpr
(
4850 n_expr
: nullable AExpr,
4851 n_expr2
: nullable AExpr
4855 _n_expr
= n_expr
.as(not null)
4856 n_expr
.parent
= self
4857 _n_expr2
= n_expr2
.as(not null)
4858 n_expr2
.parent
= self
4861 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4863 if _n_expr
== old_child
then
4864 if new_child
!= null then
4865 new_child
.parent
= self
4866 assert new_child
isa AExpr
4873 if _n_expr2
== old_child
then
4874 if new_child
!= null then
4875 new_child
.parent
= self
4876 assert new_child
isa AExpr
4877 _n_expr2
= new_child
4885 redef fun visit_all
(v
: Visitor)
4887 v
.enter_visit
(_n_expr
)
4888 v
.enter_visit
(_n_expr2
)
4891 redef class AUminusExpr
4892 private init empty_init
do end
4894 init init_auminusexpr
(
4895 n_minus
: nullable TMinus,
4896 n_expr
: nullable AExpr
4900 _n_minus
= n_minus
.as(not null)
4901 n_minus
.parent
= self
4902 _n_expr
= n_expr
.as(not null)
4903 n_expr
.parent
= self
4906 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4908 if _n_minus
== old_child
then
4909 if new_child
!= null then
4910 new_child
.parent
= self
4911 assert new_child
isa TMinus
4912 _n_minus
= new_child
4918 if _n_expr
== old_child
then
4919 if new_child
!= null then
4920 new_child
.parent
= self
4921 assert new_child
isa AExpr
4930 redef fun visit_all
(v
: Visitor)
4932 v
.enter_visit
(_n_minus
)
4933 v
.enter_visit
(_n_expr
)
4936 redef class ANewExpr
4937 private init empty_init
do end
4939 init init_anewexpr
(
4940 n_kwnew
: nullable TKwnew,
4941 n_type
: nullable AType,
4943 n_args
: Collection[Object] # Should be Collection[AExpr]
4947 _n_kwnew
= n_kwnew
.as(not null)
4948 n_kwnew
.parent
= self
4949 _n_type
= n_type
.as(not null)
4950 n_type
.parent
= self
4952 if n_id
!= null then
4962 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4964 if _n_kwnew
== old_child
then
4965 if new_child
!= null then
4966 new_child
.parent
= self
4967 assert new_child
isa TKwnew
4968 _n_kwnew
= new_child
4974 if _n_type
== old_child
then
4975 if new_child
!= null then
4976 new_child
.parent
= self
4977 assert new_child
isa AType
4984 if _n_id
== old_child
then
4985 if new_child
!= null then
4986 new_child
.parent
= self
4987 assert new_child
isa TId
4994 for i
in [0.._n_args
.length
[ do
4995 if _n_args
[i
] == old_child
then
4996 if new_child
!= null then
4997 assert new_child
isa AExpr
4998 _n_args
[i
] = new_child
4999 new_child
.parent
= self
5001 _n_args
.remove_at
(i
)
5008 redef fun visit_all
(v
: Visitor)
5010 v
.enter_visit
(_n_kwnew
)
5011 v
.enter_visit
(_n_type
)
5012 if _n_id
!= null then
5013 v
.enter_visit
(_n_id
.as(not null))
5020 redef class AAttrExpr
5021 private init empty_init
do end
5023 init init_aattrexpr
(
5024 n_expr
: nullable AExpr,
5025 n_id
: nullable TAttrid
5029 _n_expr
= n_expr
.as(not null)
5030 n_expr
.parent
= self
5031 _n_id
= n_id
.as(not null)
5035 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5037 if _n_expr
== old_child
then
5038 if new_child
!= null then
5039 new_child
.parent
= self
5040 assert new_child
isa AExpr
5047 if _n_id
== old_child
then
5048 if new_child
!= null then
5049 new_child
.parent
= self
5050 assert new_child
isa TAttrid
5059 redef fun visit_all
(v
: Visitor)
5061 v
.enter_visit
(_n_expr
)
5062 v
.enter_visit
(_n_id
)
5065 redef class AAttrAssignExpr
5066 private init empty_init
do end
5068 init init_aattrassignexpr
(
5069 n_expr
: nullable AExpr,
5070 n_id
: nullable TAttrid,
5071 n_assign
: nullable TAssign,
5072 n_value
: nullable AExpr
5076 _n_expr
= n_expr
.as(not null)
5077 n_expr
.parent
= self
5078 _n_id
= n_id
.as(not null)
5080 _n_assign
= n_assign
.as(not null)
5081 n_assign
.parent
= self
5082 _n_value
= n_value
.as(not null)
5083 n_value
.parent
= self
5086 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5088 if _n_expr
== old_child
then
5089 if new_child
!= null then
5090 new_child
.parent
= self
5091 assert new_child
isa AExpr
5098 if _n_id
== old_child
then
5099 if new_child
!= null then
5100 new_child
.parent
= self
5101 assert new_child
isa TAttrid
5108 if _n_assign
== old_child
then
5109 if new_child
!= null then
5110 new_child
.parent
= self
5111 assert new_child
isa TAssign
5112 _n_assign
= new_child
5118 if _n_value
== old_child
then
5119 if new_child
!= null then
5120 new_child
.parent
= self
5121 assert new_child
isa AExpr
5122 _n_value
= new_child
5130 redef fun visit_all
(v
: Visitor)
5132 v
.enter_visit
(_n_expr
)
5133 v
.enter_visit
(_n_id
)
5134 v
.enter_visit
(_n_assign
)
5135 v
.enter_visit
(_n_value
)
5138 redef class AAttrReassignExpr
5139 private init empty_init
do end
5141 init init_aattrreassignexpr
(
5142 n_expr
: nullable AExpr,
5143 n_id
: nullable TAttrid,
5144 n_assign_op
: nullable AAssignOp,
5145 n_value
: nullable AExpr
5149 _n_expr
= n_expr
.as(not null)
5150 n_expr
.parent
= self
5151 _n_id
= n_id
.as(not null)
5153 _n_assign_op
= n_assign_op
.as(not null)
5154 n_assign_op
.parent
= self
5155 _n_value
= n_value
.as(not null)
5156 n_value
.parent
= self
5159 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5161 if _n_expr
== old_child
then
5162 if new_child
!= null then
5163 new_child
.parent
= self
5164 assert new_child
isa AExpr
5171 if _n_id
== old_child
then
5172 if new_child
!= null then
5173 new_child
.parent
= self
5174 assert new_child
isa TAttrid
5181 if _n_assign_op
== old_child
then
5182 if new_child
!= null then
5183 new_child
.parent
= self
5184 assert new_child
isa AAssignOp
5185 _n_assign_op
= new_child
5191 if _n_value
== old_child
then
5192 if new_child
!= null then
5193 new_child
.parent
= self
5194 assert new_child
isa AExpr
5195 _n_value
= new_child
5203 redef fun visit_all
(v
: Visitor)
5205 v
.enter_visit
(_n_expr
)
5206 v
.enter_visit
(_n_id
)
5207 v
.enter_visit
(_n_assign_op
)
5208 v
.enter_visit
(_n_value
)
5211 redef class ACallExpr
5212 private init empty_init
do end
5214 init init_acallexpr
(
5215 n_expr
: nullable AExpr,
5217 n_args
: Collection[Object], # Should be Collection[AExpr]
5218 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5222 _n_expr
= n_expr
.as(not null)
5223 n_expr
.parent
= self
5224 _n_id
= n_id
.as(not null)
5231 for n
in n_closure_defs
do
5232 assert n
isa AClosureDef
5233 _n_closure_defs
.add
(n
)
5238 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5240 if _n_expr
== old_child
then
5241 if new_child
!= null then
5242 new_child
.parent
= self
5243 assert new_child
isa AExpr
5250 if _n_id
== old_child
then
5251 if new_child
!= null then
5252 new_child
.parent
= self
5253 assert new_child
isa TId
5260 for i
in [0.._n_args
.length
[ do
5261 if _n_args
[i
] == old_child
then
5262 if new_child
!= null then
5263 assert new_child
isa AExpr
5264 _n_args
[i
] = new_child
5265 new_child
.parent
= self
5267 _n_args
.remove_at
(i
)
5272 for i
in [0.._n_closure_defs
.length
[ do
5273 if _n_closure_defs
[i
] == old_child
then
5274 if new_child
!= null then
5275 assert new_child
isa AClosureDef
5276 _n_closure_defs
[i
] = new_child
5277 new_child
.parent
= self
5279 _n_closure_defs
.remove_at
(i
)
5286 redef fun visit_all
(v
: Visitor)
5288 v
.enter_visit
(_n_expr
)
5289 v
.enter_visit
(_n_id
)
5293 for n
in _n_closure_defs
do
5298 redef class ACallAssignExpr
5299 private init empty_init
do end
5301 init init_acallassignexpr
(
5302 n_expr
: nullable AExpr,
5304 n_args
: Collection[Object], # Should be Collection[AExpr]
5305 n_assign
: nullable TAssign,
5306 n_value
: nullable AExpr
5310 _n_expr
= n_expr
.as(not null)
5311 n_expr
.parent
= self
5312 _n_id
= n_id
.as(not null)
5319 _n_assign
= n_assign
.as(not null)
5320 n_assign
.parent
= self
5321 _n_value
= n_value
.as(not null)
5322 n_value
.parent
= self
5325 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5327 if _n_expr
== old_child
then
5328 if new_child
!= null then
5329 new_child
.parent
= self
5330 assert new_child
isa AExpr
5337 if _n_id
== old_child
then
5338 if new_child
!= null then
5339 new_child
.parent
= self
5340 assert new_child
isa TId
5347 for i
in [0.._n_args
.length
[ do
5348 if _n_args
[i
] == old_child
then
5349 if new_child
!= null then
5350 assert new_child
isa AExpr
5351 _n_args
[i
] = new_child
5352 new_child
.parent
= self
5354 _n_args
.remove_at
(i
)
5359 if _n_assign
== old_child
then
5360 if new_child
!= null then
5361 new_child
.parent
= self
5362 assert new_child
isa TAssign
5363 _n_assign
= new_child
5369 if _n_value
== old_child
then
5370 if new_child
!= null then
5371 new_child
.parent
= self
5372 assert new_child
isa AExpr
5373 _n_value
= new_child
5381 redef fun visit_all
(v
: Visitor)
5383 v
.enter_visit
(_n_expr
)
5384 v
.enter_visit
(_n_id
)
5388 v
.enter_visit
(_n_assign
)
5389 v
.enter_visit
(_n_value
)
5392 redef class ACallReassignExpr
5393 private init empty_init
do end
5395 init init_acallreassignexpr
(
5396 n_expr
: nullable AExpr,
5398 n_args
: Collection[Object], # Should be Collection[AExpr]
5399 n_assign_op
: nullable AAssignOp,
5400 n_value
: nullable AExpr
5404 _n_expr
= n_expr
.as(not null)
5405 n_expr
.parent
= self
5406 _n_id
= n_id
.as(not null)
5413 _n_assign_op
= n_assign_op
.as(not null)
5414 n_assign_op
.parent
= self
5415 _n_value
= n_value
.as(not null)
5416 n_value
.parent
= self
5419 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5421 if _n_expr
== old_child
then
5422 if new_child
!= null then
5423 new_child
.parent
= self
5424 assert new_child
isa AExpr
5431 if _n_id
== old_child
then
5432 if new_child
!= null then
5433 new_child
.parent
= self
5434 assert new_child
isa TId
5441 for i
in [0.._n_args
.length
[ do
5442 if _n_args
[i
] == old_child
then
5443 if new_child
!= null then
5444 assert new_child
isa AExpr
5445 _n_args
[i
] = new_child
5446 new_child
.parent
= self
5448 _n_args
.remove_at
(i
)
5453 if _n_assign_op
== old_child
then
5454 if new_child
!= null then
5455 new_child
.parent
= self
5456 assert new_child
isa AAssignOp
5457 _n_assign_op
= new_child
5463 if _n_value
== old_child
then
5464 if new_child
!= null then
5465 new_child
.parent
= self
5466 assert new_child
isa AExpr
5467 _n_value
= new_child
5475 redef fun visit_all
(v
: Visitor)
5477 v
.enter_visit
(_n_expr
)
5478 v
.enter_visit
(_n_id
)
5482 v
.enter_visit
(_n_assign_op
)
5483 v
.enter_visit
(_n_value
)
5486 redef class ASuperExpr
5487 private init empty_init
do end
5489 init init_asuperexpr
(
5490 n_qualified
: nullable AQualified,
5491 n_kwsuper
: nullable TKwsuper,
5492 n_args
: Collection[Object] # Should be Collection[AExpr]
5496 _n_qualified
= n_qualified
5497 if n_qualified
!= null then
5498 n_qualified
.parent
= self
5500 _n_kwsuper
= n_kwsuper
.as(not null)
5501 n_kwsuper
.parent
= self
5509 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5511 if _n_qualified
== old_child
then
5512 if new_child
!= null then
5513 new_child
.parent
= self
5514 assert new_child
isa AQualified
5515 _n_qualified
= new_child
5521 if _n_kwsuper
== old_child
then
5522 if new_child
!= null then
5523 new_child
.parent
= self
5524 assert new_child
isa TKwsuper
5525 _n_kwsuper
= new_child
5531 for i
in [0.._n_args
.length
[ do
5532 if _n_args
[i
] == old_child
then
5533 if new_child
!= null then
5534 assert new_child
isa AExpr
5535 _n_args
[i
] = new_child
5536 new_child
.parent
= self
5538 _n_args
.remove_at
(i
)
5545 redef fun visit_all
(v
: Visitor)
5547 if _n_qualified
!= null then
5548 v
.enter_visit
(_n_qualified
.as(not null))
5550 v
.enter_visit
(_n_kwsuper
)
5556 redef class AInitExpr
5557 private init empty_init
do end
5559 init init_ainitexpr
(
5560 n_expr
: nullable AExpr,
5561 n_kwinit
: nullable TKwinit,
5562 n_args
: Collection[Object] # Should be Collection[AExpr]
5566 _n_expr
= n_expr
.as(not null)
5567 n_expr
.parent
= self
5568 _n_kwinit
= n_kwinit
.as(not null)
5569 n_kwinit
.parent
= self
5577 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5579 if _n_expr
== old_child
then
5580 if new_child
!= null then
5581 new_child
.parent
= self
5582 assert new_child
isa AExpr
5589 if _n_kwinit
== old_child
then
5590 if new_child
!= null then
5591 new_child
.parent
= self
5592 assert new_child
isa TKwinit
5593 _n_kwinit
= new_child
5599 for i
in [0.._n_args
.length
[ do
5600 if _n_args
[i
] == old_child
then
5601 if new_child
!= null then
5602 assert new_child
isa AExpr
5603 _n_args
[i
] = new_child
5604 new_child
.parent
= self
5606 _n_args
.remove_at
(i
)
5613 redef fun visit_all
(v
: Visitor)
5615 v
.enter_visit
(_n_expr
)
5616 v
.enter_visit
(_n_kwinit
)
5622 redef class ABraExpr
5623 private init empty_init
do end
5625 init init_abraexpr
(
5626 n_expr
: nullable AExpr,
5627 n_args
: Collection[Object], # Should be Collection[AExpr]
5628 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5632 _n_expr
= n_expr
.as(not null)
5633 n_expr
.parent
= self
5639 for n
in n_closure_defs
do
5640 assert n
isa AClosureDef
5641 _n_closure_defs
.add
(n
)
5646 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5648 if _n_expr
== old_child
then
5649 if new_child
!= null then
5650 new_child
.parent
= self
5651 assert new_child
isa AExpr
5658 for i
in [0.._n_args
.length
[ do
5659 if _n_args
[i
] == old_child
then
5660 if new_child
!= null then
5661 assert new_child
isa AExpr
5662 _n_args
[i
] = new_child
5663 new_child
.parent
= self
5665 _n_args
.remove_at
(i
)
5670 for i
in [0.._n_closure_defs
.length
[ do
5671 if _n_closure_defs
[i
] == old_child
then
5672 if new_child
!= null then
5673 assert new_child
isa AClosureDef
5674 _n_closure_defs
[i
] = new_child
5675 new_child
.parent
= self
5677 _n_closure_defs
.remove_at
(i
)
5684 redef fun visit_all
(v
: Visitor)
5686 v
.enter_visit
(_n_expr
)
5690 for n
in _n_closure_defs
do
5695 redef class ABraAssignExpr
5696 private init empty_init
do end
5698 init init_abraassignexpr
(
5699 n_expr
: nullable AExpr,
5700 n_args
: Collection[Object], # Should be Collection[AExpr]
5701 n_assign
: nullable TAssign,
5702 n_value
: nullable AExpr
5706 _n_expr
= n_expr
.as(not null)
5707 n_expr
.parent
= self
5713 _n_assign
= n_assign
.as(not null)
5714 n_assign
.parent
= self
5715 _n_value
= n_value
.as(not null)
5716 n_value
.parent
= self
5719 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5721 if _n_expr
== old_child
then
5722 if new_child
!= null then
5723 new_child
.parent
= self
5724 assert new_child
isa AExpr
5731 for i
in [0.._n_args
.length
[ do
5732 if _n_args
[i
] == old_child
then
5733 if new_child
!= null then
5734 assert new_child
isa AExpr
5735 _n_args
[i
] = new_child
5736 new_child
.parent
= self
5738 _n_args
.remove_at
(i
)
5743 if _n_assign
== old_child
then
5744 if new_child
!= null then
5745 new_child
.parent
= self
5746 assert new_child
isa TAssign
5747 _n_assign
= new_child
5753 if _n_value
== old_child
then
5754 if new_child
!= null then
5755 new_child
.parent
= self
5756 assert new_child
isa AExpr
5757 _n_value
= new_child
5765 redef fun visit_all
(v
: Visitor)
5767 v
.enter_visit
(_n_expr
)
5771 v
.enter_visit
(_n_assign
)
5772 v
.enter_visit
(_n_value
)
5775 redef class ABraReassignExpr
5776 private init empty_init
do end
5778 init init_abrareassignexpr
(
5779 n_expr
: nullable AExpr,
5780 n_args
: Collection[Object], # Should be Collection[AExpr]
5781 n_assign_op
: nullable AAssignOp,
5782 n_value
: nullable AExpr
5786 _n_expr
= n_expr
.as(not null)
5787 n_expr
.parent
= self
5793 _n_assign_op
= n_assign_op
.as(not null)
5794 n_assign_op
.parent
= self
5795 _n_value
= n_value
.as(not null)
5796 n_value
.parent
= self
5799 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5801 if _n_expr
== old_child
then
5802 if new_child
!= null then
5803 new_child
.parent
= self
5804 assert new_child
isa AExpr
5811 for i
in [0.._n_args
.length
[ do
5812 if _n_args
[i
] == old_child
then
5813 if new_child
!= null then
5814 assert new_child
isa AExpr
5815 _n_args
[i
] = new_child
5816 new_child
.parent
= self
5818 _n_args
.remove_at
(i
)
5823 if _n_assign_op
== old_child
then
5824 if new_child
!= null then
5825 new_child
.parent
= self
5826 assert new_child
isa AAssignOp
5827 _n_assign_op
= new_child
5833 if _n_value
== old_child
then
5834 if new_child
!= null then
5835 new_child
.parent
= self
5836 assert new_child
isa AExpr
5837 _n_value
= new_child
5845 redef fun visit_all
(v
: Visitor)
5847 v
.enter_visit
(_n_expr
)
5851 v
.enter_visit
(_n_assign_op
)
5852 v
.enter_visit
(_n_value
)
5855 redef class AClosureCallExpr
5856 private init empty_init
do end
5858 init init_aclosurecallexpr
(
5860 n_args
: Collection[Object], # Should be Collection[AExpr]
5861 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5865 _n_id
= n_id
.as(not null)
5872 for n
in n_closure_defs
do
5873 assert n
isa AClosureDef
5874 _n_closure_defs
.add
(n
)
5879 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5881 if _n_id
== old_child
then
5882 if new_child
!= null then
5883 new_child
.parent
= self
5884 assert new_child
isa TId
5891 for i
in [0.._n_args
.length
[ do
5892 if _n_args
[i
] == old_child
then
5893 if new_child
!= null then
5894 assert new_child
isa AExpr
5895 _n_args
[i
] = new_child
5896 new_child
.parent
= self
5898 _n_args
.remove_at
(i
)
5903 for i
in [0.._n_closure_defs
.length
[ do
5904 if _n_closure_defs
[i
] == old_child
then
5905 if new_child
!= null then
5906 assert new_child
isa AClosureDef
5907 _n_closure_defs
[i
] = new_child
5908 new_child
.parent
= self
5910 _n_closure_defs
.remove_at
(i
)
5917 redef fun visit_all
(v
: Visitor)
5919 v
.enter_visit
(_n_id
)
5923 for n
in _n_closure_defs
do
5928 redef class AVarExpr
5929 private init empty_init
do end
5931 init init_avarexpr
(
5936 _n_id
= n_id
.as(not null)
5940 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5942 if _n_id
== old_child
then
5943 if new_child
!= null then
5944 new_child
.parent
= self
5945 assert new_child
isa TId
5954 redef fun visit_all
(v
: Visitor)
5956 v
.enter_visit
(_n_id
)
5959 redef class AVarAssignExpr
5960 private init empty_init
do end
5962 init init_avarassignexpr
(
5964 n_assign
: nullable TAssign,
5965 n_value
: nullable AExpr
5969 _n_id
= n_id
.as(not null)
5971 _n_assign
= n_assign
.as(not null)
5972 n_assign
.parent
= self
5973 _n_value
= n_value
.as(not null)
5974 n_value
.parent
= self
5977 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5979 if _n_id
== old_child
then
5980 if new_child
!= null then
5981 new_child
.parent
= self
5982 assert new_child
isa TId
5989 if _n_assign
== old_child
then
5990 if new_child
!= null then
5991 new_child
.parent
= self
5992 assert new_child
isa TAssign
5993 _n_assign
= new_child
5999 if _n_value
== old_child
then
6000 if new_child
!= null then
6001 new_child
.parent
= self
6002 assert new_child
isa AExpr
6003 _n_value
= new_child
6011 redef fun visit_all
(v
: Visitor)
6013 v
.enter_visit
(_n_id
)
6014 v
.enter_visit
(_n_assign
)
6015 v
.enter_visit
(_n_value
)
6018 redef class AVarReassignExpr
6019 private init empty_init
do end
6021 init init_avarreassignexpr
(
6023 n_assign_op
: nullable AAssignOp,
6024 n_value
: nullable AExpr
6028 _n_id
= n_id
.as(not null)
6030 _n_assign_op
= n_assign_op
.as(not null)
6031 n_assign_op
.parent
= self
6032 _n_value
= n_value
.as(not null)
6033 n_value
.parent
= self
6036 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6038 if _n_id
== old_child
then
6039 if new_child
!= null then
6040 new_child
.parent
= self
6041 assert new_child
isa TId
6048 if _n_assign_op
== old_child
then
6049 if new_child
!= null then
6050 new_child
.parent
= self
6051 assert new_child
isa AAssignOp
6052 _n_assign_op
= new_child
6058 if _n_value
== old_child
then
6059 if new_child
!= null then
6060 new_child
.parent
= self
6061 assert new_child
isa AExpr
6062 _n_value
= new_child
6070 redef fun visit_all
(v
: Visitor)
6072 v
.enter_visit
(_n_id
)
6073 v
.enter_visit
(_n_assign_op
)
6074 v
.enter_visit
(_n_value
)
6077 redef class ARangeExpr
6078 private init empty_init
do end
6080 init init_arangeexpr
(
6081 n_expr
: nullable AExpr,
6082 n_expr2
: nullable AExpr
6086 _n_expr
= n_expr
.as(not null)
6087 n_expr
.parent
= self
6088 _n_expr2
= n_expr2
.as(not null)
6089 n_expr2
.parent
= self
6092 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6094 if _n_expr
== old_child
then
6095 if new_child
!= null then
6096 new_child
.parent
= self
6097 assert new_child
isa AExpr
6104 if _n_expr2
== old_child
then
6105 if new_child
!= null then
6106 new_child
.parent
= self
6107 assert new_child
isa AExpr
6108 _n_expr2
= new_child
6116 redef fun visit_all
(v
: Visitor)
6118 v
.enter_visit
(_n_expr
)
6119 v
.enter_visit
(_n_expr2
)
6122 redef class ACrangeExpr
6123 private init empty_init
do end
6125 init init_acrangeexpr
(
6126 n_expr
: nullable AExpr,
6127 n_expr2
: nullable AExpr
6131 _n_expr
= n_expr
.as(not null)
6132 n_expr
.parent
= self
6133 _n_expr2
= n_expr2
.as(not null)
6134 n_expr2
.parent
= self
6137 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6139 if _n_expr
== old_child
then
6140 if new_child
!= null then
6141 new_child
.parent
= self
6142 assert new_child
isa AExpr
6149 if _n_expr2
== old_child
then
6150 if new_child
!= null then
6151 new_child
.parent
= self
6152 assert new_child
isa AExpr
6153 _n_expr2
= new_child
6161 redef fun visit_all
(v
: Visitor)
6163 v
.enter_visit
(_n_expr
)
6164 v
.enter_visit
(_n_expr2
)
6167 redef class AOrangeExpr
6168 private init empty_init
do end
6170 init init_aorangeexpr
(
6171 n_expr
: nullable AExpr,
6172 n_expr2
: nullable AExpr
6176 _n_expr
= n_expr
.as(not null)
6177 n_expr
.parent
= self
6178 _n_expr2
= n_expr2
.as(not null)
6179 n_expr2
.parent
= self
6182 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6184 if _n_expr
== old_child
then
6185 if new_child
!= null then
6186 new_child
.parent
= self
6187 assert new_child
isa AExpr
6194 if _n_expr2
== old_child
then
6195 if new_child
!= null then
6196 new_child
.parent
= self
6197 assert new_child
isa AExpr
6198 _n_expr2
= new_child
6206 redef fun visit_all
(v
: Visitor)
6208 v
.enter_visit
(_n_expr
)
6209 v
.enter_visit
(_n_expr2
)
6212 redef class AArrayExpr
6213 private init empty_init
do end
6215 init init_aarrayexpr
(
6216 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6227 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6229 for i
in [0.._n_exprs
.length
[ do
6230 if _n_exprs
[i
] == old_child
then
6231 if new_child
!= null then
6232 assert new_child
isa AExpr
6233 _n_exprs
[i
] = new_child
6234 new_child
.parent
= self
6236 _n_exprs
.remove_at
(i
)
6243 redef fun visit_all
(v
: Visitor)
6245 for n
in _n_exprs
do
6250 redef class ASelfExpr
6251 private init empty_init
do end
6253 init init_aselfexpr
(
6254 n_kwself
: nullable TKwself
6258 _n_kwself
= n_kwself
.as(not null)
6259 n_kwself
.parent
= self
6262 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6264 if _n_kwself
== old_child
then
6265 if new_child
!= null then
6266 new_child
.parent
= self
6267 assert new_child
isa TKwself
6268 _n_kwself
= new_child
6276 redef fun visit_all
(v
: Visitor)
6278 v
.enter_visit
(_n_kwself
)
6281 redef class AImplicitSelfExpr
6282 private init empty_init
do end
6284 init init_aimplicitselfexpr
6289 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6293 redef fun visit_all
(v
: Visitor)
6297 redef class ATrueExpr
6298 private init empty_init
do end
6300 init init_atrueexpr
(
6301 n_kwtrue
: nullable TKwtrue
6305 _n_kwtrue
= n_kwtrue
.as(not null)
6306 n_kwtrue
.parent
= self
6309 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6311 if _n_kwtrue
== old_child
then
6312 if new_child
!= null then
6313 new_child
.parent
= self
6314 assert new_child
isa TKwtrue
6315 _n_kwtrue
= new_child
6323 redef fun visit_all
(v
: Visitor)
6325 v
.enter_visit
(_n_kwtrue
)
6328 redef class AFalseExpr
6329 private init empty_init
do end
6331 init init_afalseexpr
(
6332 n_kwfalse
: nullable TKwfalse
6336 _n_kwfalse
= n_kwfalse
.as(not null)
6337 n_kwfalse
.parent
= self
6340 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6342 if _n_kwfalse
== old_child
then
6343 if new_child
!= null then
6344 new_child
.parent
= self
6345 assert new_child
isa TKwfalse
6346 _n_kwfalse
= new_child
6354 redef fun visit_all
(v
: Visitor)
6356 v
.enter_visit
(_n_kwfalse
)
6359 redef class ANullExpr
6360 private init empty_init
do end
6362 init init_anullexpr
(
6363 n_kwnull
: nullable TKwnull
6367 _n_kwnull
= n_kwnull
.as(not null)
6368 n_kwnull
.parent
= self
6371 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6373 if _n_kwnull
== old_child
then
6374 if new_child
!= null then
6375 new_child
.parent
= self
6376 assert new_child
isa TKwnull
6377 _n_kwnull
= new_child
6385 redef fun visit_all
(v
: Visitor)
6387 v
.enter_visit
(_n_kwnull
)
6390 redef class AIntExpr
6391 private init empty_init
do end
6393 init init_aintexpr
(
6394 n_number
: nullable TNumber
6398 _n_number
= n_number
.as(not null)
6399 n_number
.parent
= self
6402 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6404 if _n_number
== old_child
then
6405 if new_child
!= null then
6406 new_child
.parent
= self
6407 assert new_child
isa TNumber
6408 _n_number
= new_child
6416 redef fun visit_all
(v
: Visitor)
6418 v
.enter_visit
(_n_number
)
6421 redef class AFloatExpr
6422 private init empty_init
do end
6424 init init_afloatexpr
(
6425 n_float
: nullable TFloat
6429 _n_float
= n_float
.as(not null)
6430 n_float
.parent
= self
6433 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6435 if _n_float
== old_child
then
6436 if new_child
!= null then
6437 new_child
.parent
= self
6438 assert new_child
isa TFloat
6439 _n_float
= new_child
6447 redef fun visit_all
(v
: Visitor)
6449 v
.enter_visit
(_n_float
)
6452 redef class ACharExpr
6453 private init empty_init
do end
6455 init init_acharexpr
(
6456 n_char
: nullable TChar
6460 _n_char
= n_char
.as(not null)
6461 n_char
.parent
= self
6464 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6466 if _n_char
== old_child
then
6467 if new_child
!= null then
6468 new_child
.parent
= self
6469 assert new_child
isa TChar
6478 redef fun visit_all
(v
: Visitor)
6480 v
.enter_visit
(_n_char
)
6483 redef class AStringExpr
6484 private init empty_init
do end
6486 init init_astringexpr
(
6487 n_string
: nullable TString
6491 _n_string
= n_string
.as(not null)
6492 n_string
.parent
= self
6495 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6497 if _n_string
== old_child
then
6498 if new_child
!= null then
6499 new_child
.parent
= self
6500 assert new_child
isa TString
6501 _n_string
= new_child
6509 redef fun visit_all
(v
: Visitor)
6511 v
.enter_visit
(_n_string
)
6514 redef class AStartStringExpr
6515 private init empty_init
do end
6517 init init_astartstringexpr
(
6518 n_string
: nullable TStartString
6522 _n_string
= n_string
.as(not null)
6523 n_string
.parent
= self
6526 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6528 if _n_string
== old_child
then
6529 if new_child
!= null then
6530 new_child
.parent
= self
6531 assert new_child
isa TStartString
6532 _n_string
= new_child
6540 redef fun visit_all
(v
: Visitor)
6542 v
.enter_visit
(_n_string
)
6545 redef class AMidStringExpr
6546 private init empty_init
do end
6548 init init_amidstringexpr
(
6549 n_string
: nullable TMidString
6553 _n_string
= n_string
.as(not null)
6554 n_string
.parent
= self
6557 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6559 if _n_string
== old_child
then
6560 if new_child
!= null then
6561 new_child
.parent
= self
6562 assert new_child
isa TMidString
6563 _n_string
= new_child
6571 redef fun visit_all
(v
: Visitor)
6573 v
.enter_visit
(_n_string
)
6576 redef class AEndStringExpr
6577 private init empty_init
do end
6579 init init_aendstringexpr
(
6580 n_string
: nullable TEndString
6584 _n_string
= n_string
.as(not null)
6585 n_string
.parent
= self
6588 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6590 if _n_string
== old_child
then
6591 if new_child
!= null then
6592 new_child
.parent
= self
6593 assert new_child
isa TEndString
6594 _n_string
= new_child
6602 redef fun visit_all
(v
: Visitor)
6604 v
.enter_visit
(_n_string
)
6607 redef class ASuperstringExpr
6608 private init empty_init
do end
6610 init init_asuperstringexpr
(
6611 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6622 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6624 for i
in [0.._n_exprs
.length
[ do
6625 if _n_exprs
[i
] == old_child
then
6626 if new_child
!= null then
6627 assert new_child
isa AExpr
6628 _n_exprs
[i
] = new_child
6629 new_child
.parent
= self
6631 _n_exprs
.remove_at
(i
)
6638 redef fun visit_all
(v
: Visitor)
6640 for n
in _n_exprs
do
6645 redef class AParExpr
6646 private init empty_init
do end
6648 init init_aparexpr
(
6649 n_expr
: nullable AExpr
6653 _n_expr
= n_expr
.as(not null)
6654 n_expr
.parent
= self
6657 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6659 if _n_expr
== old_child
then
6660 if new_child
!= null then
6661 new_child
.parent
= self
6662 assert new_child
isa AExpr
6671 redef fun visit_all
(v
: Visitor)
6673 v
.enter_visit
(_n_expr
)
6676 redef class AAsCastExpr
6677 private init empty_init
do end
6679 init init_aascastexpr
(
6680 n_expr
: nullable AExpr,
6681 n_kwas
: nullable TKwas,
6682 n_type
: nullable AType
6686 _n_expr
= n_expr
.as(not null)
6687 n_expr
.parent
= self
6688 _n_kwas
= n_kwas
.as(not null)
6689 n_kwas
.parent
= self
6690 _n_type
= n_type
.as(not null)
6691 n_type
.parent
= self
6694 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6696 if _n_expr
== old_child
then
6697 if new_child
!= null then
6698 new_child
.parent
= self
6699 assert new_child
isa AExpr
6706 if _n_kwas
== old_child
then
6707 if new_child
!= null then
6708 new_child
.parent
= self
6709 assert new_child
isa TKwas
6716 if _n_type
== old_child
then
6717 if new_child
!= null then
6718 new_child
.parent
= self
6719 assert new_child
isa AType
6728 redef fun visit_all
(v
: Visitor)
6730 v
.enter_visit
(_n_expr
)
6731 v
.enter_visit
(_n_kwas
)
6732 v
.enter_visit
(_n_type
)
6735 redef class AAsNotnullExpr
6736 private init empty_init
do end
6738 init init_aasnotnullexpr
(
6739 n_expr
: nullable AExpr,
6740 n_kwas
: nullable TKwas,
6741 n_kwnot
: nullable TKwnot,
6742 n_kwnull
: nullable TKwnull
6746 _n_expr
= n_expr
.as(not null)
6747 n_expr
.parent
= self
6748 _n_kwas
= n_kwas
.as(not null)
6749 n_kwas
.parent
= self
6750 _n_kwnot
= n_kwnot
.as(not null)
6751 n_kwnot
.parent
= self
6752 _n_kwnull
= n_kwnull
.as(not null)
6753 n_kwnull
.parent
= self
6756 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6758 if _n_expr
== old_child
then
6759 if new_child
!= null then
6760 new_child
.parent
= self
6761 assert new_child
isa AExpr
6768 if _n_kwas
== old_child
then
6769 if new_child
!= null then
6770 new_child
.parent
= self
6771 assert new_child
isa TKwas
6778 if _n_kwnot
== old_child
then
6779 if new_child
!= null then
6780 new_child
.parent
= self
6781 assert new_child
isa TKwnot
6782 _n_kwnot
= new_child
6788 if _n_kwnull
== old_child
then
6789 if new_child
!= null then
6790 new_child
.parent
= self
6791 assert new_child
isa TKwnull
6792 _n_kwnull
= new_child
6800 redef fun visit_all
(v
: Visitor)
6802 v
.enter_visit
(_n_expr
)
6803 v
.enter_visit
(_n_kwas
)
6804 v
.enter_visit
(_n_kwnot
)
6805 v
.enter_visit
(_n_kwnull
)
6808 redef class AIssetAttrExpr
6809 private init empty_init
do end
6811 init init_aissetattrexpr
(
6812 n_kwisset
: nullable TKwisset,
6813 n_expr
: nullable AExpr,
6814 n_id
: nullable TAttrid
6818 _n_kwisset
= n_kwisset
.as(not null)
6819 n_kwisset
.parent
= self
6820 _n_expr
= n_expr
.as(not null)
6821 n_expr
.parent
= self
6822 _n_id
= n_id
.as(not null)
6826 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6828 if _n_kwisset
== old_child
then
6829 if new_child
!= null then
6830 new_child
.parent
= self
6831 assert new_child
isa TKwisset
6832 _n_kwisset
= new_child
6838 if _n_expr
== old_child
then
6839 if new_child
!= null then
6840 new_child
.parent
= self
6841 assert new_child
isa AExpr
6848 if _n_id
== old_child
then
6849 if new_child
!= null then
6850 new_child
.parent
= self
6851 assert new_child
isa TAttrid
6860 redef fun visit_all
(v
: Visitor)
6862 v
.enter_visit
(_n_kwisset
)
6863 v
.enter_visit
(_n_expr
)
6864 v
.enter_visit
(_n_id
)
6867 redef class APlusAssignOp
6868 private init empty_init
do end
6870 init init_aplusassignop
(
6871 n_pluseq
: nullable TPluseq
6875 _n_pluseq
= n_pluseq
.as(not null)
6876 n_pluseq
.parent
= self
6879 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6881 if _n_pluseq
== old_child
then
6882 if new_child
!= null then
6883 new_child
.parent
= self
6884 assert new_child
isa TPluseq
6885 _n_pluseq
= new_child
6893 redef fun visit_all
(v
: Visitor)
6895 v
.enter_visit
(_n_pluseq
)
6898 redef class AMinusAssignOp
6899 private init empty_init
do end
6901 init init_aminusassignop
(
6902 n_minuseq
: nullable TMinuseq
6906 _n_minuseq
= n_minuseq
.as(not null)
6907 n_minuseq
.parent
= self
6910 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6912 if _n_minuseq
== old_child
then
6913 if new_child
!= null then
6914 new_child
.parent
= self
6915 assert new_child
isa TMinuseq
6916 _n_minuseq
= new_child
6924 redef fun visit_all
(v
: Visitor)
6926 v
.enter_visit
(_n_minuseq
)
6929 redef class AClosureDef
6930 private init empty_init
do end
6932 init init_aclosuredef
(
6933 n_bang
: nullable TBang,
6934 n_id
: nullable AClosureId,
6935 n_ids
: Collection[Object], # Should be Collection[TId]
6936 n_kwdo
: nullable TKwdo,
6937 n_expr
: nullable AExpr,
6938 n_label
: nullable ALabel
6942 _n_bang
= n_bang
.as(not null)
6943 n_bang
.parent
= self
6944 _n_id
= n_id
.as(not null)
6952 if n_kwdo
!= null then
6953 n_kwdo
.parent
= self
6956 if n_expr
!= null then
6957 n_expr
.parent
= self
6960 if n_label
!= null then
6961 n_label
.parent
= self
6965 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6967 if _n_bang
== old_child
then
6968 if new_child
!= null then
6969 new_child
.parent
= self
6970 assert new_child
isa TBang
6977 if _n_id
== old_child
then
6978 if new_child
!= null then
6979 new_child
.parent
= self
6980 assert new_child
isa AClosureId
6987 for i
in [0.._n_ids
.length
[ do
6988 if _n_ids
[i
] == old_child
then
6989 if new_child
!= null then
6990 assert new_child
isa TId
6991 _n_ids
[i
] = new_child
6992 new_child
.parent
= self
6999 if _n_kwdo
== old_child
then
7000 if new_child
!= null then
7001 new_child
.parent
= self
7002 assert new_child
isa TKwdo
7009 if _n_expr
== old_child
then
7010 if new_child
!= null then
7011 new_child
.parent
= self
7012 assert new_child
isa AExpr
7019 if _n_label
== old_child
then
7020 if new_child
!= null then
7021 new_child
.parent
= self
7022 assert new_child
isa ALabel
7023 _n_label
= new_child
7031 redef fun visit_all
(v
: Visitor)
7033 v
.enter_visit
(_n_bang
)
7034 v
.enter_visit
(_n_id
)
7038 if _n_kwdo
!= null then
7039 v
.enter_visit
(_n_kwdo
.as(not null))
7041 if _n_expr
!= null then
7042 v
.enter_visit
(_n_expr
.as(not null))
7044 if _n_label
!= null then
7045 v
.enter_visit
(_n_label
.as(not null))
7049 redef class ASimpleClosureId
7050 private init empty_init
do end
7052 init init_asimpleclosureid
(
7057 _n_id
= n_id
.as(not null)
7061 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7063 if _n_id
== old_child
then
7064 if new_child
!= null then
7065 new_child
.parent
= self
7066 assert new_child
isa TId
7075 redef fun visit_all
(v
: Visitor)
7077 v
.enter_visit
(_n_id
)
7080 redef class ABreakClosureId
7081 private init empty_init
do end
7083 init init_abreakclosureid
(
7084 n_kwbreak
: nullable TKwbreak
7088 _n_kwbreak
= n_kwbreak
.as(not null)
7089 n_kwbreak
.parent
= self
7092 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7094 if _n_kwbreak
== old_child
then
7095 if new_child
!= null then
7096 new_child
.parent
= self
7097 assert new_child
isa TKwbreak
7098 _n_kwbreak
= new_child
7106 redef fun visit_all
(v
: Visitor)
7108 v
.enter_visit
(_n_kwbreak
)
7111 redef class AQualified
7112 private init empty_init
do end
7114 init init_aqualified
(
7115 n_id
: Collection[Object], # Should be Collection[TId]
7116 n_classid
: nullable TClassid
7125 _n_classid
= n_classid
7126 if n_classid
!= null then
7127 n_classid
.parent
= self
7131 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7133 for i
in [0.._n_id
.length
[ do
7134 if _n_id
[i
] == old_child
then
7135 if new_child
!= null then
7136 assert new_child
isa TId
7137 _n_id
[i
] = new_child
7138 new_child
.parent
= self
7145 if _n_classid
== old_child
then
7146 if new_child
!= null then
7147 new_child
.parent
= self
7148 assert new_child
isa TClassid
7149 _n_classid
= new_child
7157 redef fun visit_all
(v
: Visitor)
7162 if _n_classid
!= null then
7163 v
.enter_visit
(_n_classid
.as(not null))
7168 private init empty_init
do end
7171 n_comment
: Collection[Object] # Should be Collection[TComment]
7175 for n
in n_comment
do
7176 assert n
isa TComment
7182 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7184 for i
in [0.._n_comment
.length
[ do
7185 if _n_comment
[i
] == old_child
then
7186 if new_child
!= null then
7187 assert new_child
isa TComment
7188 _n_comment
[i
] = new_child
7189 new_child
.parent
= self
7191 _n_comment
.remove_at
(i
)
7198 redef fun visit_all
(v
: Visitor)
7200 for n
in _n_comment
do
7208 n_base
: nullable AModule,
7215 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7217 if _n_base
== old_child
then
7218 if new_child
== null then
7220 new_child
.parent
= self
7221 assert new_child
isa AModule
7224 old_child
.parent
= null
7229 redef fun visit_all
(v
: Visitor)
7231 if _n_base
!= null then
7232 v
.enter_visit
(_n_base
.as(not null))
7234 v
.enter_visit
(_n_eof
)