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,
940 n_type
: nullable AType,
941 n_expr
: nullable AExpr
946 if n_doc
!= null then
949 _n_readable
= n_readable
950 if n_readable
!= null then
951 n_readable
.parent
= self
953 _n_writable
= n_writable
954 if n_writable
!= null then
955 n_writable
.parent
= self
957 _n_kwredef
= n_kwredef
958 if n_kwredef
!= null then
959 n_kwredef
.parent
= self
961 _n_visibility
= n_visibility
.as(not null)
962 n_visibility
.parent
= self
963 _n_kwvar
= n_kwvar
.as(not null)
964 n_kwvar
.parent
= self
965 _n_id
= n_id
.as(not null)
968 if n_type
!= null then
972 if n_expr
!= null then
977 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
979 if _n_doc
== old_child
then
980 if new_child
!= null then
981 new_child
.parent
= self
982 assert new_child
isa ADoc
989 if _n_readable
== old_child
then
990 if new_child
!= null then
991 new_child
.parent
= self
992 assert new_child
isa AAble
993 _n_readable
= new_child
999 if _n_writable
== old_child
then
1000 if new_child
!= null then
1001 new_child
.parent
= self
1002 assert new_child
isa AAble
1003 _n_writable
= new_child
1009 if _n_kwredef
== old_child
then
1010 if new_child
!= null then
1011 new_child
.parent
= self
1012 assert new_child
isa TKwredef
1013 _n_kwredef
= new_child
1019 if _n_visibility
== old_child
then
1020 if new_child
!= null then
1021 new_child
.parent
= self
1022 assert new_child
isa AVisibility
1023 _n_visibility
= new_child
1029 if _n_kwvar
== old_child
then
1030 if new_child
!= null then
1031 new_child
.parent
= self
1032 assert new_child
isa TKwvar
1033 _n_kwvar
= new_child
1039 if _n_id
== old_child
then
1040 if new_child
!= null then
1041 new_child
.parent
= self
1042 assert new_child
isa TAttrid
1049 if _n_type
== old_child
then
1050 if new_child
!= null then
1051 new_child
.parent
= self
1052 assert new_child
isa AType
1059 if _n_expr
== old_child
then
1060 if new_child
!= null then
1061 new_child
.parent
= self
1062 assert new_child
isa AExpr
1071 redef fun visit_all
(v
: Visitor)
1073 if _n_doc
!= null then
1074 v
.enter_visit
(_n_doc
.as(not null))
1076 if _n_readable
!= null then
1077 v
.enter_visit
(_n_readable
.as(not null))
1079 if _n_writable
!= null then
1080 v
.enter_visit
(_n_writable
.as(not null))
1082 if _n_kwredef
!= null then
1083 v
.enter_visit
(_n_kwredef
.as(not null))
1085 v
.enter_visit
(_n_visibility
)
1086 v
.enter_visit
(_n_kwvar
)
1087 v
.enter_visit
(_n_id
)
1088 if _n_type
!= null then
1089 v
.enter_visit
(_n_type
.as(not null))
1091 if _n_expr
!= null then
1092 v
.enter_visit
(_n_expr
.as(not null))
1096 redef class AMethPropdef
1097 private init empty_init
do end
1099 init init_amethpropdef
(
1100 n_doc
: nullable ADoc,
1101 n_kwredef
: nullable TKwredef,
1102 n_visibility
: nullable AVisibility,
1103 n_methid
: nullable AMethid,
1104 n_signature
: nullable ASignature
1109 if n_doc
!= null then
1112 _n_kwredef
= n_kwredef
1113 if n_kwredef
!= null then
1114 n_kwredef
.parent
= self
1116 _n_visibility
= n_visibility
.as(not null)
1117 n_visibility
.parent
= self
1118 _n_methid
= n_methid
.as(not null)
1119 n_methid
.parent
= self
1120 _n_signature
= n_signature
.as(not null)
1121 n_signature
.parent
= self
1124 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1126 if _n_doc
== old_child
then
1127 if new_child
!= null then
1128 new_child
.parent
= self
1129 assert new_child
isa ADoc
1136 if _n_kwredef
== old_child
then
1137 if new_child
!= null then
1138 new_child
.parent
= self
1139 assert new_child
isa TKwredef
1140 _n_kwredef
= new_child
1146 if _n_visibility
== old_child
then
1147 if new_child
!= null then
1148 new_child
.parent
= self
1149 assert new_child
isa AVisibility
1150 _n_visibility
= new_child
1156 if _n_methid
== old_child
then
1157 if new_child
!= null then
1158 new_child
.parent
= self
1159 assert new_child
isa AMethid
1160 _n_methid
= new_child
1166 if _n_signature
== old_child
then
1167 if new_child
!= null then
1168 new_child
.parent
= self
1169 assert new_child
isa ASignature
1170 _n_signature
= new_child
1178 redef fun visit_all
(v
: Visitor)
1180 if _n_doc
!= null then
1181 v
.enter_visit
(_n_doc
.as(not null))
1183 if _n_kwredef
!= null then
1184 v
.enter_visit
(_n_kwredef
.as(not null))
1186 v
.enter_visit
(_n_visibility
)
1187 v
.enter_visit
(_n_methid
)
1188 v
.enter_visit
(_n_signature
)
1191 redef class ADeferredMethPropdef
1192 private init empty_init
do end
1194 init init_adeferredmethpropdef
(
1195 n_doc
: nullable ADoc,
1196 n_kwredef
: nullable TKwredef,
1197 n_visibility
: nullable AVisibility,
1198 n_kwmeth
: nullable TKwmeth,
1199 n_methid
: nullable AMethid,
1200 n_signature
: nullable ASignature
1205 if n_doc
!= null then
1208 _n_kwredef
= n_kwredef
1209 if n_kwredef
!= null then
1210 n_kwredef
.parent
= self
1212 _n_visibility
= n_visibility
.as(not null)
1213 n_visibility
.parent
= self
1214 _n_kwmeth
= n_kwmeth
.as(not null)
1215 n_kwmeth
.parent
= self
1216 _n_methid
= n_methid
.as(not null)
1217 n_methid
.parent
= self
1218 _n_signature
= n_signature
.as(not null)
1219 n_signature
.parent
= self
1222 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1224 if _n_doc
== old_child
then
1225 if new_child
!= null then
1226 new_child
.parent
= self
1227 assert new_child
isa ADoc
1234 if _n_kwredef
== old_child
then
1235 if new_child
!= null then
1236 new_child
.parent
= self
1237 assert new_child
isa TKwredef
1238 _n_kwredef
= new_child
1244 if _n_visibility
== old_child
then
1245 if new_child
!= null then
1246 new_child
.parent
= self
1247 assert new_child
isa AVisibility
1248 _n_visibility
= new_child
1254 if _n_kwmeth
== old_child
then
1255 if new_child
!= null then
1256 new_child
.parent
= self
1257 assert new_child
isa TKwmeth
1258 _n_kwmeth
= new_child
1264 if _n_methid
== old_child
then
1265 if new_child
!= null then
1266 new_child
.parent
= self
1267 assert new_child
isa AMethid
1268 _n_methid
= new_child
1274 if _n_signature
== old_child
then
1275 if new_child
!= null then
1276 new_child
.parent
= self
1277 assert new_child
isa ASignature
1278 _n_signature
= new_child
1286 redef fun visit_all
(v
: Visitor)
1288 if _n_doc
!= null then
1289 v
.enter_visit
(_n_doc
.as(not null))
1291 if _n_kwredef
!= null then
1292 v
.enter_visit
(_n_kwredef
.as(not null))
1294 v
.enter_visit
(_n_visibility
)
1295 v
.enter_visit
(_n_kwmeth
)
1296 v
.enter_visit
(_n_methid
)
1297 v
.enter_visit
(_n_signature
)
1300 redef class AInternMethPropdef
1301 private init empty_init
do end
1303 init init_ainternmethpropdef
(
1304 n_doc
: nullable ADoc,
1305 n_kwredef
: nullable TKwredef,
1306 n_visibility
: nullable AVisibility,
1307 n_kwmeth
: nullable TKwmeth,
1308 n_methid
: nullable AMethid,
1309 n_signature
: nullable ASignature
1314 if n_doc
!= null then
1317 _n_kwredef
= n_kwredef
1318 if n_kwredef
!= null then
1319 n_kwredef
.parent
= self
1321 _n_visibility
= n_visibility
.as(not null)
1322 n_visibility
.parent
= self
1323 _n_kwmeth
= n_kwmeth
.as(not null)
1324 n_kwmeth
.parent
= self
1325 _n_methid
= n_methid
.as(not null)
1326 n_methid
.parent
= self
1327 _n_signature
= n_signature
.as(not null)
1328 n_signature
.parent
= self
1331 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1333 if _n_doc
== old_child
then
1334 if new_child
!= null then
1335 new_child
.parent
= self
1336 assert new_child
isa ADoc
1343 if _n_kwredef
== old_child
then
1344 if new_child
!= null then
1345 new_child
.parent
= self
1346 assert new_child
isa TKwredef
1347 _n_kwredef
= new_child
1353 if _n_visibility
== old_child
then
1354 if new_child
!= null then
1355 new_child
.parent
= self
1356 assert new_child
isa AVisibility
1357 _n_visibility
= new_child
1363 if _n_kwmeth
== old_child
then
1364 if new_child
!= null then
1365 new_child
.parent
= self
1366 assert new_child
isa TKwmeth
1367 _n_kwmeth
= new_child
1373 if _n_methid
== old_child
then
1374 if new_child
!= null then
1375 new_child
.parent
= self
1376 assert new_child
isa AMethid
1377 _n_methid
= new_child
1383 if _n_signature
== old_child
then
1384 if new_child
!= null then
1385 new_child
.parent
= self
1386 assert new_child
isa ASignature
1387 _n_signature
= new_child
1395 redef fun visit_all
(v
: Visitor)
1397 if _n_doc
!= null then
1398 v
.enter_visit
(_n_doc
.as(not null))
1400 if _n_kwredef
!= null then
1401 v
.enter_visit
(_n_kwredef
.as(not null))
1403 v
.enter_visit
(_n_visibility
)
1404 v
.enter_visit
(_n_kwmeth
)
1405 v
.enter_visit
(_n_methid
)
1406 v
.enter_visit
(_n_signature
)
1409 redef class AExternMethPropdef
1410 private init empty_init
do end
1412 init init_aexternmethpropdef
(
1413 n_doc
: nullable ADoc,
1414 n_kwredef
: nullable TKwredef,
1415 n_visibility
: nullable AVisibility,
1416 n_kwmeth
: nullable TKwmeth,
1417 n_methid
: nullable AMethid,
1418 n_signature
: nullable ASignature,
1419 n_extern
: nullable TString
1424 if n_doc
!= null then
1427 _n_kwredef
= n_kwredef
1428 if n_kwredef
!= null then
1429 n_kwredef
.parent
= self
1431 _n_visibility
= n_visibility
.as(not null)
1432 n_visibility
.parent
= self
1433 _n_kwmeth
= n_kwmeth
.as(not null)
1434 n_kwmeth
.parent
= self
1435 _n_methid
= n_methid
.as(not null)
1436 n_methid
.parent
= self
1437 _n_signature
= n_signature
.as(not null)
1438 n_signature
.parent
= self
1439 _n_extern
= n_extern
1440 if n_extern
!= null then
1441 n_extern
.parent
= self
1445 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1447 if _n_doc
== old_child
then
1448 if new_child
!= null then
1449 new_child
.parent
= self
1450 assert new_child
isa ADoc
1457 if _n_kwredef
== old_child
then
1458 if new_child
!= null then
1459 new_child
.parent
= self
1460 assert new_child
isa TKwredef
1461 _n_kwredef
= new_child
1467 if _n_visibility
== old_child
then
1468 if new_child
!= null then
1469 new_child
.parent
= self
1470 assert new_child
isa AVisibility
1471 _n_visibility
= new_child
1477 if _n_kwmeth
== old_child
then
1478 if new_child
!= null then
1479 new_child
.parent
= self
1480 assert new_child
isa TKwmeth
1481 _n_kwmeth
= new_child
1487 if _n_methid
== old_child
then
1488 if new_child
!= null then
1489 new_child
.parent
= self
1490 assert new_child
isa AMethid
1491 _n_methid
= new_child
1497 if _n_signature
== old_child
then
1498 if new_child
!= null then
1499 new_child
.parent
= self
1500 assert new_child
isa ASignature
1501 _n_signature
= new_child
1507 if _n_extern
== old_child
then
1508 if new_child
!= null then
1509 new_child
.parent
= self
1510 assert new_child
isa TString
1511 _n_extern
= new_child
1519 redef fun visit_all
(v
: Visitor)
1521 if _n_doc
!= null then
1522 v
.enter_visit
(_n_doc
.as(not null))
1524 if _n_kwredef
!= null then
1525 v
.enter_visit
(_n_kwredef
.as(not null))
1527 v
.enter_visit
(_n_visibility
)
1528 v
.enter_visit
(_n_kwmeth
)
1529 v
.enter_visit
(_n_methid
)
1530 v
.enter_visit
(_n_signature
)
1531 if _n_extern
!= null then
1532 v
.enter_visit
(_n_extern
.as(not null))
1536 redef class AConcreteMethPropdef
1537 private init empty_init
do end
1539 init init_aconcretemethpropdef
(
1540 n_doc
: nullable ADoc,
1541 n_kwredef
: nullable TKwredef,
1542 n_visibility
: nullable AVisibility,
1543 n_kwmeth
: nullable TKwmeth,
1544 n_methid
: nullable AMethid,
1545 n_signature
: nullable ASignature,
1546 n_block
: nullable AExpr
1551 if n_doc
!= null then
1554 _n_kwredef
= n_kwredef
1555 if n_kwredef
!= null then
1556 n_kwredef
.parent
= self
1558 _n_visibility
= n_visibility
.as(not null)
1559 n_visibility
.parent
= self
1560 _n_kwmeth
= n_kwmeth
.as(not null)
1561 n_kwmeth
.parent
= self
1562 _n_methid
= n_methid
.as(not null)
1563 n_methid
.parent
= self
1564 _n_signature
= n_signature
.as(not null)
1565 n_signature
.parent
= self
1567 if n_block
!= null then
1568 n_block
.parent
= self
1572 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1574 if _n_doc
== old_child
then
1575 if new_child
!= null then
1576 new_child
.parent
= self
1577 assert new_child
isa ADoc
1584 if _n_kwredef
== old_child
then
1585 if new_child
!= null then
1586 new_child
.parent
= self
1587 assert new_child
isa TKwredef
1588 _n_kwredef
= new_child
1594 if _n_visibility
== old_child
then
1595 if new_child
!= null then
1596 new_child
.parent
= self
1597 assert new_child
isa AVisibility
1598 _n_visibility
= new_child
1604 if _n_kwmeth
== old_child
then
1605 if new_child
!= null then
1606 new_child
.parent
= self
1607 assert new_child
isa TKwmeth
1608 _n_kwmeth
= new_child
1614 if _n_methid
== old_child
then
1615 if new_child
!= null then
1616 new_child
.parent
= self
1617 assert new_child
isa AMethid
1618 _n_methid
= new_child
1624 if _n_signature
== old_child
then
1625 if new_child
!= null then
1626 new_child
.parent
= self
1627 assert new_child
isa ASignature
1628 _n_signature
= new_child
1634 if _n_block
== old_child
then
1635 if new_child
!= null then
1636 new_child
.parent
= self
1637 assert new_child
isa AExpr
1638 _n_block
= new_child
1646 redef fun visit_all
(v
: Visitor)
1648 if _n_doc
!= null then
1649 v
.enter_visit
(_n_doc
.as(not null))
1651 if _n_kwredef
!= null then
1652 v
.enter_visit
(_n_kwredef
.as(not null))
1654 v
.enter_visit
(_n_visibility
)
1655 v
.enter_visit
(_n_kwmeth
)
1656 v
.enter_visit
(_n_methid
)
1657 v
.enter_visit
(_n_signature
)
1658 if _n_block
!= null then
1659 v
.enter_visit
(_n_block
.as(not null))
1663 redef class AConcreteInitPropdef
1664 private init empty_init
do end
1666 init init_aconcreteinitpropdef
(
1667 n_doc
: nullable ADoc,
1668 n_kwredef
: nullable TKwredef,
1669 n_visibility
: nullable AVisibility,
1670 n_kwinit
: nullable TKwinit,
1671 n_methid
: nullable AMethid,
1672 n_signature
: nullable ASignature,
1673 n_block
: nullable AExpr
1678 if n_doc
!= null then
1681 _n_kwredef
= n_kwredef
1682 if n_kwredef
!= null then
1683 n_kwredef
.parent
= self
1685 _n_visibility
= n_visibility
.as(not null)
1686 n_visibility
.parent
= self
1687 _n_kwinit
= n_kwinit
.as(not null)
1688 n_kwinit
.parent
= self
1689 _n_methid
= n_methid
1690 if n_methid
!= null then
1691 n_methid
.parent
= self
1693 _n_signature
= n_signature
.as(not null)
1694 n_signature
.parent
= self
1696 if n_block
!= null then
1697 n_block
.parent
= self
1701 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1703 if _n_doc
== old_child
then
1704 if new_child
!= null then
1705 new_child
.parent
= self
1706 assert new_child
isa ADoc
1713 if _n_kwredef
== old_child
then
1714 if new_child
!= null then
1715 new_child
.parent
= self
1716 assert new_child
isa TKwredef
1717 _n_kwredef
= new_child
1723 if _n_visibility
== old_child
then
1724 if new_child
!= null then
1725 new_child
.parent
= self
1726 assert new_child
isa AVisibility
1727 _n_visibility
= new_child
1733 if _n_kwinit
== old_child
then
1734 if new_child
!= null then
1735 new_child
.parent
= self
1736 assert new_child
isa TKwinit
1737 _n_kwinit
= new_child
1743 if _n_methid
== old_child
then
1744 if new_child
!= null then
1745 new_child
.parent
= self
1746 assert new_child
isa AMethid
1747 _n_methid
= new_child
1753 if _n_signature
== old_child
then
1754 if new_child
!= null then
1755 new_child
.parent
= self
1756 assert new_child
isa ASignature
1757 _n_signature
= new_child
1763 if _n_block
== old_child
then
1764 if new_child
!= null then
1765 new_child
.parent
= self
1766 assert new_child
isa AExpr
1767 _n_block
= new_child
1775 redef fun visit_all
(v
: Visitor)
1777 if _n_doc
!= null then
1778 v
.enter_visit
(_n_doc
.as(not null))
1780 if _n_kwredef
!= null then
1781 v
.enter_visit
(_n_kwredef
.as(not null))
1783 v
.enter_visit
(_n_visibility
)
1784 v
.enter_visit
(_n_kwinit
)
1785 if _n_methid
!= null then
1786 v
.enter_visit
(_n_methid
.as(not null))
1788 v
.enter_visit
(_n_signature
)
1789 if _n_block
!= null then
1790 v
.enter_visit
(_n_block
.as(not null))
1794 redef class AMainMethPropdef
1795 private init empty_init
do end
1797 init init_amainmethpropdef
(
1798 n_kwredef
: nullable TKwredef,
1799 n_block
: nullable AExpr
1803 _n_kwredef
= n_kwredef
1804 if n_kwredef
!= null then
1805 n_kwredef
.parent
= self
1808 if n_block
!= null then
1809 n_block
.parent
= self
1813 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1815 if _n_kwredef
== old_child
then
1816 if new_child
!= null then
1817 new_child
.parent
= self
1818 assert new_child
isa TKwredef
1819 _n_kwredef
= new_child
1825 if _n_block
== old_child
then
1826 if new_child
!= null then
1827 new_child
.parent
= self
1828 assert new_child
isa AExpr
1829 _n_block
= new_child
1837 redef fun visit_all
(v
: Visitor)
1839 if _n_kwredef
!= null then
1840 v
.enter_visit
(_n_kwredef
.as(not null))
1842 if _n_block
!= null then
1843 v
.enter_visit
(_n_block
.as(not null))
1847 redef class ATypePropdef
1848 private init empty_init
do end
1850 init init_atypepropdef
(
1851 n_doc
: nullable ADoc,
1852 n_kwredef
: nullable TKwredef,
1853 n_visibility
: nullable AVisibility,
1854 n_kwtype
: nullable TKwtype,
1855 n_id
: nullable TClassid,
1856 n_type
: nullable AType
1861 if n_doc
!= null then
1864 _n_kwredef
= n_kwredef
1865 if n_kwredef
!= null then
1866 n_kwredef
.parent
= self
1868 _n_visibility
= n_visibility
.as(not null)
1869 n_visibility
.parent
= self
1870 _n_kwtype
= n_kwtype
.as(not null)
1871 n_kwtype
.parent
= self
1872 _n_id
= n_id
.as(not null)
1874 _n_type
= n_type
.as(not null)
1875 n_type
.parent
= self
1878 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1880 if _n_doc
== old_child
then
1881 if new_child
!= null then
1882 new_child
.parent
= self
1883 assert new_child
isa ADoc
1890 if _n_kwredef
== old_child
then
1891 if new_child
!= null then
1892 new_child
.parent
= self
1893 assert new_child
isa TKwredef
1894 _n_kwredef
= new_child
1900 if _n_visibility
== old_child
then
1901 if new_child
!= null then
1902 new_child
.parent
= self
1903 assert new_child
isa AVisibility
1904 _n_visibility
= new_child
1910 if _n_kwtype
== old_child
then
1911 if new_child
!= null then
1912 new_child
.parent
= self
1913 assert new_child
isa TKwtype
1914 _n_kwtype
= new_child
1920 if _n_id
== old_child
then
1921 if new_child
!= null then
1922 new_child
.parent
= self
1923 assert new_child
isa TClassid
1930 if _n_type
== old_child
then
1931 if new_child
!= null then
1932 new_child
.parent
= self
1933 assert new_child
isa AType
1942 redef fun visit_all
(v
: Visitor)
1944 if _n_doc
!= null then
1945 v
.enter_visit
(_n_doc
.as(not null))
1947 if _n_kwredef
!= null then
1948 v
.enter_visit
(_n_kwredef
.as(not null))
1950 v
.enter_visit
(_n_visibility
)
1951 v
.enter_visit
(_n_kwtype
)
1952 v
.enter_visit
(_n_id
)
1953 v
.enter_visit
(_n_type
)
1956 redef class AReadAble
1957 private init empty_init
do end
1959 init init_areadable
(
1960 n_kwredef
: nullable TKwredef,
1961 n_kwreadable
: nullable TKwreadable
1965 _n_kwredef
= n_kwredef
1966 if n_kwredef
!= null then
1967 n_kwredef
.parent
= self
1969 _n_kwreadable
= n_kwreadable
.as(not null)
1970 n_kwreadable
.parent
= self
1973 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1975 if _n_kwredef
== old_child
then
1976 if new_child
!= null then
1977 new_child
.parent
= self
1978 assert new_child
isa TKwredef
1979 _n_kwredef
= new_child
1985 if _n_kwreadable
== old_child
then
1986 if new_child
!= null then
1987 new_child
.parent
= self
1988 assert new_child
isa TKwreadable
1989 _n_kwreadable
= new_child
1997 redef fun visit_all
(v
: Visitor)
1999 if _n_kwredef
!= null then
2000 v
.enter_visit
(_n_kwredef
.as(not null))
2002 v
.enter_visit
(_n_kwreadable
)
2005 redef class AWriteAble
2006 private init empty_init
do end
2008 init init_awriteable
(
2009 n_kwredef
: nullable TKwredef,
2010 n_kwwritable
: nullable TKwwritable
2014 _n_kwredef
= n_kwredef
2015 if n_kwredef
!= null then
2016 n_kwredef
.parent
= self
2018 _n_kwwritable
= n_kwwritable
.as(not null)
2019 n_kwwritable
.parent
= self
2022 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2024 if _n_kwredef
== old_child
then
2025 if new_child
!= null then
2026 new_child
.parent
= self
2027 assert new_child
isa TKwredef
2028 _n_kwredef
= new_child
2034 if _n_kwwritable
== old_child
then
2035 if new_child
!= null then
2036 new_child
.parent
= self
2037 assert new_child
isa TKwwritable
2038 _n_kwwritable
= new_child
2046 redef fun visit_all
(v
: Visitor)
2048 if _n_kwredef
!= null then
2049 v
.enter_visit
(_n_kwredef
.as(not null))
2051 v
.enter_visit
(_n_kwwritable
)
2054 redef class AIdMethid
2055 private init empty_init
do end
2057 init init_aidmethid
(
2062 _n_id
= n_id
.as(not null)
2066 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2068 if _n_id
== old_child
then
2069 if new_child
!= null then
2070 new_child
.parent
= self
2071 assert new_child
isa TId
2080 redef fun visit_all
(v
: Visitor)
2082 v
.enter_visit
(_n_id
)
2085 redef class APlusMethid
2086 private init empty_init
do end
2088 init init_aplusmethid
(
2089 n_plus
: nullable TPlus
2093 _n_plus
= n_plus
.as(not null)
2094 n_plus
.parent
= self
2097 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2099 if _n_plus
== old_child
then
2100 if new_child
!= null then
2101 new_child
.parent
= self
2102 assert new_child
isa TPlus
2111 redef fun visit_all
(v
: Visitor)
2113 v
.enter_visit
(_n_plus
)
2116 redef class AMinusMethid
2117 private init empty_init
do end
2119 init init_aminusmethid
(
2120 n_minus
: nullable TMinus
2124 _n_minus
= n_minus
.as(not null)
2125 n_minus
.parent
= self
2128 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2130 if _n_minus
== old_child
then
2131 if new_child
!= null then
2132 new_child
.parent
= self
2133 assert new_child
isa TMinus
2134 _n_minus
= new_child
2142 redef fun visit_all
(v
: Visitor)
2144 v
.enter_visit
(_n_minus
)
2147 redef class AStarMethid
2148 private init empty_init
do end
2150 init init_astarmethid
(
2151 n_star
: nullable TStar
2155 _n_star
= n_star
.as(not null)
2156 n_star
.parent
= self
2159 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2161 if _n_star
== old_child
then
2162 if new_child
!= null then
2163 new_child
.parent
= self
2164 assert new_child
isa TStar
2173 redef fun visit_all
(v
: Visitor)
2175 v
.enter_visit
(_n_star
)
2178 redef class ASlashMethid
2179 private init empty_init
do end
2181 init init_aslashmethid
(
2182 n_slash
: nullable TSlash
2186 _n_slash
= n_slash
.as(not null)
2187 n_slash
.parent
= self
2190 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2192 if _n_slash
== old_child
then
2193 if new_child
!= null then
2194 new_child
.parent
= self
2195 assert new_child
isa TSlash
2196 _n_slash
= new_child
2204 redef fun visit_all
(v
: Visitor)
2206 v
.enter_visit
(_n_slash
)
2209 redef class APercentMethid
2210 private init empty_init
do end
2212 init init_apercentmethid
(
2213 n_percent
: nullable TPercent
2217 _n_percent
= n_percent
.as(not null)
2218 n_percent
.parent
= self
2221 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2223 if _n_percent
== old_child
then
2224 if new_child
!= null then
2225 new_child
.parent
= self
2226 assert new_child
isa TPercent
2227 _n_percent
= new_child
2235 redef fun visit_all
(v
: Visitor)
2237 v
.enter_visit
(_n_percent
)
2240 redef class AEqMethid
2241 private init empty_init
do end
2243 init init_aeqmethid
(
2248 _n_eq
= n_eq
.as(not null)
2252 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2254 if _n_eq
== old_child
then
2255 if new_child
!= null then
2256 new_child
.parent
= self
2257 assert new_child
isa TEq
2266 redef fun visit_all
(v
: Visitor)
2268 v
.enter_visit
(_n_eq
)
2271 redef class ANeMethid
2272 private init empty_init
do end
2274 init init_anemethid
(
2279 _n_ne
= n_ne
.as(not null)
2283 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2285 if _n_ne
== old_child
then
2286 if new_child
!= null then
2287 new_child
.parent
= self
2288 assert new_child
isa TNe
2297 redef fun visit_all
(v
: Visitor)
2299 v
.enter_visit
(_n_ne
)
2302 redef class ALeMethid
2303 private init empty_init
do end
2305 init init_alemethid
(
2310 _n_le
= n_le
.as(not null)
2314 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2316 if _n_le
== old_child
then
2317 if new_child
!= null then
2318 new_child
.parent
= self
2319 assert new_child
isa TLe
2328 redef fun visit_all
(v
: Visitor)
2330 v
.enter_visit
(_n_le
)
2333 redef class AGeMethid
2334 private init empty_init
do end
2336 init init_agemethid
(
2341 _n_ge
= n_ge
.as(not null)
2345 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2347 if _n_ge
== old_child
then
2348 if new_child
!= null then
2349 new_child
.parent
= self
2350 assert new_child
isa TGe
2359 redef fun visit_all
(v
: Visitor)
2361 v
.enter_visit
(_n_ge
)
2364 redef class ALtMethid
2365 private init empty_init
do end
2367 init init_altmethid
(
2372 _n_lt
= n_lt
.as(not null)
2376 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2378 if _n_lt
== old_child
then
2379 if new_child
!= null then
2380 new_child
.parent
= self
2381 assert new_child
isa TLt
2390 redef fun visit_all
(v
: Visitor)
2392 v
.enter_visit
(_n_lt
)
2395 redef class AGtMethid
2396 private init empty_init
do end
2398 init init_agtmethid
(
2403 _n_gt
= n_gt
.as(not null)
2407 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2409 if _n_gt
== old_child
then
2410 if new_child
!= null then
2411 new_child
.parent
= self
2412 assert new_child
isa TGt
2421 redef fun visit_all
(v
: Visitor)
2423 v
.enter_visit
(_n_gt
)
2426 redef class ABraMethid
2427 private init empty_init
do end
2429 init init_abramethid
(
2430 n_obra
: nullable TObra,
2431 n_cbra
: nullable TCbra
2435 _n_obra
= n_obra
.as(not null)
2436 n_obra
.parent
= self
2437 _n_cbra
= n_cbra
.as(not null)
2438 n_cbra
.parent
= self
2441 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2443 if _n_obra
== old_child
then
2444 if new_child
!= null then
2445 new_child
.parent
= self
2446 assert new_child
isa TObra
2453 if _n_cbra
== old_child
then
2454 if new_child
!= null then
2455 new_child
.parent
= self
2456 assert new_child
isa TCbra
2465 redef fun visit_all
(v
: Visitor)
2467 v
.enter_visit
(_n_obra
)
2468 v
.enter_visit
(_n_cbra
)
2471 redef class AStarshipMethid
2472 private init empty_init
do end
2474 init init_astarshipmethid
(
2475 n_starship
: nullable TStarship
2479 _n_starship
= n_starship
.as(not null)
2480 n_starship
.parent
= self
2483 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2485 if _n_starship
== old_child
then
2486 if new_child
!= null then
2487 new_child
.parent
= self
2488 assert new_child
isa TStarship
2489 _n_starship
= new_child
2497 redef fun visit_all
(v
: Visitor)
2499 v
.enter_visit
(_n_starship
)
2502 redef class AAssignMethid
2503 private init empty_init
do end
2505 init init_aassignmethid
(
2507 n_assign
: nullable TAssign
2511 _n_id
= n_id
.as(not null)
2513 _n_assign
= n_assign
.as(not null)
2514 n_assign
.parent
= self
2517 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2519 if _n_id
== old_child
then
2520 if new_child
!= null then
2521 new_child
.parent
= self
2522 assert new_child
isa TId
2529 if _n_assign
== old_child
then
2530 if new_child
!= null then
2531 new_child
.parent
= self
2532 assert new_child
isa TAssign
2533 _n_assign
= new_child
2541 redef fun visit_all
(v
: Visitor)
2543 v
.enter_visit
(_n_id
)
2544 v
.enter_visit
(_n_assign
)
2547 redef class ABraassignMethid
2548 private init empty_init
do end
2550 init init_abraassignmethid
(
2551 n_obra
: nullable TObra,
2552 n_cbra
: nullable TCbra,
2553 n_assign
: nullable TAssign
2557 _n_obra
= n_obra
.as(not null)
2558 n_obra
.parent
= self
2559 _n_cbra
= n_cbra
.as(not null)
2560 n_cbra
.parent
= self
2561 _n_assign
= n_assign
.as(not null)
2562 n_assign
.parent
= self
2565 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2567 if _n_obra
== old_child
then
2568 if new_child
!= null then
2569 new_child
.parent
= self
2570 assert new_child
isa TObra
2577 if _n_cbra
== old_child
then
2578 if new_child
!= null then
2579 new_child
.parent
= self
2580 assert new_child
isa TCbra
2587 if _n_assign
== old_child
then
2588 if new_child
!= null then
2589 new_child
.parent
= self
2590 assert new_child
isa TAssign
2591 _n_assign
= new_child
2599 redef fun visit_all
(v
: Visitor)
2601 v
.enter_visit
(_n_obra
)
2602 v
.enter_visit
(_n_cbra
)
2603 v
.enter_visit
(_n_assign
)
2606 redef class ASignature
2607 private init empty_init
do end
2609 init init_asignature
(
2610 n_params
: Collection[Object], # Should be Collection[AParam]
2611 n_type
: nullable AType,
2612 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2616 for n
in n_params
do
2622 if n_type
!= null then
2623 n_type
.parent
= self
2625 for n
in n_closure_decls
do
2626 assert n
isa AClosureDecl
2627 _n_closure_decls
.add
(n
)
2632 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2634 for i
in [0.._n_params
.length
[ do
2635 if _n_params
[i
] == old_child
then
2636 if new_child
!= null then
2637 assert new_child
isa AParam
2638 _n_params
[i
] = new_child
2639 new_child
.parent
= self
2641 _n_params
.remove_at
(i
)
2646 if _n_type
== old_child
then
2647 if new_child
!= null then
2648 new_child
.parent
= self
2649 assert new_child
isa AType
2656 for i
in [0.._n_closure_decls
.length
[ do
2657 if _n_closure_decls
[i
] == old_child
then
2658 if new_child
!= null then
2659 assert new_child
isa AClosureDecl
2660 _n_closure_decls
[i
] = new_child
2661 new_child
.parent
= self
2663 _n_closure_decls
.remove_at
(i
)
2670 redef fun visit_all
(v
: Visitor)
2672 for n
in _n_params
do
2675 if _n_type
!= null then
2676 v
.enter_visit
(_n_type
.as(not null))
2678 for n
in _n_closure_decls
do
2684 private init empty_init
do end
2688 n_type
: nullable AType,
2689 n_dotdotdot
: nullable TDotdotdot
2693 _n_id
= n_id
.as(not null)
2696 if n_type
!= null then
2697 n_type
.parent
= self
2699 _n_dotdotdot
= n_dotdotdot
2700 if n_dotdotdot
!= null then
2701 n_dotdotdot
.parent
= self
2705 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2707 if _n_id
== old_child
then
2708 if new_child
!= null then
2709 new_child
.parent
= self
2710 assert new_child
isa TId
2717 if _n_type
== old_child
then
2718 if new_child
!= null then
2719 new_child
.parent
= self
2720 assert new_child
isa AType
2727 if _n_dotdotdot
== old_child
then
2728 if new_child
!= null then
2729 new_child
.parent
= self
2730 assert new_child
isa TDotdotdot
2731 _n_dotdotdot
= new_child
2739 redef fun visit_all
(v
: Visitor)
2741 v
.enter_visit
(_n_id
)
2742 if _n_type
!= null then
2743 v
.enter_visit
(_n_type
.as(not null))
2745 if _n_dotdotdot
!= null then
2746 v
.enter_visit
(_n_dotdotdot
.as(not null))
2750 redef class AClosureDecl
2751 private init empty_init
do end
2753 init init_aclosuredecl
(
2754 n_kwbreak
: nullable TKwbreak,
2755 n_bang
: nullable TBang,
2757 n_signature
: nullable ASignature,
2758 n_expr
: nullable AExpr
2762 _n_kwbreak
= n_kwbreak
2763 if n_kwbreak
!= null then
2764 n_kwbreak
.parent
= self
2766 _n_bang
= n_bang
.as(not null)
2767 n_bang
.parent
= self
2768 _n_id
= n_id
.as(not null)
2770 _n_signature
= n_signature
.as(not null)
2771 n_signature
.parent
= self
2773 if n_expr
!= null then
2774 n_expr
.parent
= self
2778 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2780 if _n_kwbreak
== old_child
then
2781 if new_child
!= null then
2782 new_child
.parent
= self
2783 assert new_child
isa TKwbreak
2784 _n_kwbreak
= new_child
2790 if _n_bang
== old_child
then
2791 if new_child
!= null then
2792 new_child
.parent
= self
2793 assert new_child
isa TBang
2800 if _n_id
== old_child
then
2801 if new_child
!= null then
2802 new_child
.parent
= self
2803 assert new_child
isa TId
2810 if _n_signature
== old_child
then
2811 if new_child
!= null then
2812 new_child
.parent
= self
2813 assert new_child
isa ASignature
2814 _n_signature
= new_child
2820 if _n_expr
== old_child
then
2821 if new_child
!= null then
2822 new_child
.parent
= self
2823 assert new_child
isa AExpr
2832 redef fun visit_all
(v
: Visitor)
2834 if _n_kwbreak
!= null then
2835 v
.enter_visit
(_n_kwbreak
.as(not null))
2837 v
.enter_visit
(_n_bang
)
2838 v
.enter_visit
(_n_id
)
2839 v
.enter_visit
(_n_signature
)
2840 if _n_expr
!= null then
2841 v
.enter_visit
(_n_expr
.as(not null))
2846 private init empty_init
do end
2849 n_kwnullable
: nullable TKwnullable,
2850 n_id
: nullable TClassid,
2851 n_types
: Collection[Object] # Should be Collection[AType]
2855 _n_kwnullable
= n_kwnullable
2856 if n_kwnullable
!= null then
2857 n_kwnullable
.parent
= self
2859 _n_id
= n_id
.as(not null)
2868 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2870 if _n_kwnullable
== old_child
then
2871 if new_child
!= null then
2872 new_child
.parent
= self
2873 assert new_child
isa TKwnullable
2874 _n_kwnullable
= new_child
2876 _n_kwnullable
= null
2880 if _n_id
== old_child
then
2881 if new_child
!= null then
2882 new_child
.parent
= self
2883 assert new_child
isa TClassid
2890 for i
in [0.._n_types
.length
[ do
2891 if _n_types
[i
] == old_child
then
2892 if new_child
!= null then
2893 assert new_child
isa AType
2894 _n_types
[i
] = new_child
2895 new_child
.parent
= self
2897 _n_types
.remove_at
(i
)
2904 redef fun visit_all
(v
: Visitor)
2906 if _n_kwnullable
!= null then
2907 v
.enter_visit
(_n_kwnullable
.as(not null))
2909 v
.enter_visit
(_n_id
)
2910 for n
in _n_types
do
2916 private init empty_init
do end
2919 n_kwlabel
: nullable TKwlabel,
2924 _n_kwlabel
= n_kwlabel
.as(not null)
2925 n_kwlabel
.parent
= self
2926 _n_id
= n_id
.as(not null)
2930 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2932 if _n_kwlabel
== old_child
then
2933 if new_child
!= null then
2934 new_child
.parent
= self
2935 assert new_child
isa TKwlabel
2936 _n_kwlabel
= new_child
2942 if _n_id
== old_child
then
2943 if new_child
!= null then
2944 new_child
.parent
= self
2945 assert new_child
isa TId
2954 redef fun visit_all
(v
: Visitor)
2956 v
.enter_visit
(_n_kwlabel
)
2957 v
.enter_visit
(_n_id
)
2960 redef class ABlockExpr
2961 private init empty_init
do end
2963 init init_ablockexpr
(
2964 n_expr
: Collection[Object] # Should be Collection[AExpr]
2975 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2977 for i
in [0.._n_expr
.length
[ do
2978 if _n_expr
[i
] == old_child
then
2979 if new_child
!= null then
2980 assert new_child
isa AExpr
2981 _n_expr
[i
] = new_child
2982 new_child
.parent
= self
2984 _n_expr
.remove_at
(i
)
2991 redef fun visit_all
(v
: Visitor)
2998 redef class AVardeclExpr
2999 private init empty_init
do end
3001 init init_avardeclexpr
(
3002 n_kwvar
: nullable TKwvar,
3004 n_type
: nullable AType,
3005 n_assign
: nullable TAssign,
3006 n_expr
: nullable AExpr
3010 _n_kwvar
= n_kwvar
.as(not null)
3011 n_kwvar
.parent
= self
3012 _n_id
= n_id
.as(not null)
3015 if n_type
!= null then
3016 n_type
.parent
= self
3018 _n_assign
= n_assign
3019 if n_assign
!= null then
3020 n_assign
.parent
= self
3023 if n_expr
!= null then
3024 n_expr
.parent
= self
3028 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3030 if _n_kwvar
== old_child
then
3031 if new_child
!= null then
3032 new_child
.parent
= self
3033 assert new_child
isa TKwvar
3034 _n_kwvar
= new_child
3040 if _n_id
== old_child
then
3041 if new_child
!= null then
3042 new_child
.parent
= self
3043 assert new_child
isa TId
3050 if _n_type
== old_child
then
3051 if new_child
!= null then
3052 new_child
.parent
= self
3053 assert new_child
isa AType
3060 if _n_assign
== old_child
then
3061 if new_child
!= null then
3062 new_child
.parent
= self
3063 assert new_child
isa TAssign
3064 _n_assign
= new_child
3070 if _n_expr
== old_child
then
3071 if new_child
!= null then
3072 new_child
.parent
= self
3073 assert new_child
isa AExpr
3082 redef fun visit_all
(v
: Visitor)
3084 v
.enter_visit
(_n_kwvar
)
3085 v
.enter_visit
(_n_id
)
3086 if _n_type
!= null then
3087 v
.enter_visit
(_n_type
.as(not null))
3089 if _n_assign
!= null then
3090 v
.enter_visit
(_n_assign
.as(not null))
3092 if _n_expr
!= null then
3093 v
.enter_visit
(_n_expr
.as(not null))
3097 redef class AReturnExpr
3098 private init empty_init
do end
3100 init init_areturnexpr
(
3101 n_kwreturn
: nullable TKwreturn,
3102 n_expr
: nullable AExpr
3106 _n_kwreturn
= n_kwreturn
3107 if n_kwreturn
!= null then
3108 n_kwreturn
.parent
= self
3111 if n_expr
!= null then
3112 n_expr
.parent
= self
3116 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3118 if _n_kwreturn
== old_child
then
3119 if new_child
!= null then
3120 new_child
.parent
= self
3121 assert new_child
isa TKwreturn
3122 _n_kwreturn
= new_child
3128 if _n_expr
== old_child
then
3129 if new_child
!= null then
3130 new_child
.parent
= self
3131 assert new_child
isa AExpr
3140 redef fun visit_all
(v
: Visitor)
3142 if _n_kwreturn
!= null then
3143 v
.enter_visit
(_n_kwreturn
.as(not null))
3145 if _n_expr
!= null then
3146 v
.enter_visit
(_n_expr
.as(not null))
3150 redef class ABreakExpr
3151 private init empty_init
do end
3153 init init_abreakexpr
(
3154 n_kwbreak
: nullable TKwbreak,
3155 n_label
: nullable ALabel,
3156 n_expr
: nullable AExpr
3160 _n_kwbreak
= n_kwbreak
.as(not null)
3161 n_kwbreak
.parent
= self
3163 if n_label
!= null then
3164 n_label
.parent
= self
3167 if n_expr
!= null then
3168 n_expr
.parent
= self
3172 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3174 if _n_kwbreak
== old_child
then
3175 if new_child
!= null then
3176 new_child
.parent
= self
3177 assert new_child
isa TKwbreak
3178 _n_kwbreak
= new_child
3184 if _n_label
== old_child
then
3185 if new_child
!= null then
3186 new_child
.parent
= self
3187 assert new_child
isa ALabel
3188 _n_label
= new_child
3194 if _n_expr
== old_child
then
3195 if new_child
!= null then
3196 new_child
.parent
= self
3197 assert new_child
isa AExpr
3206 redef fun visit_all
(v
: Visitor)
3208 v
.enter_visit
(_n_kwbreak
)
3209 if _n_label
!= null then
3210 v
.enter_visit
(_n_label
.as(not null))
3212 if _n_expr
!= null then
3213 v
.enter_visit
(_n_expr
.as(not null))
3217 redef class AAbortExpr
3218 private init empty_init
do end
3220 init init_aabortexpr
(
3221 n_kwabort
: nullable TKwabort
3225 _n_kwabort
= n_kwabort
.as(not null)
3226 n_kwabort
.parent
= self
3229 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3231 if _n_kwabort
== old_child
then
3232 if new_child
!= null then
3233 new_child
.parent
= self
3234 assert new_child
isa TKwabort
3235 _n_kwabort
= new_child
3243 redef fun visit_all
(v
: Visitor)
3245 v
.enter_visit
(_n_kwabort
)
3248 redef class AContinueExpr
3249 private init empty_init
do end
3251 init init_acontinueexpr
(
3252 n_kwcontinue
: nullable TKwcontinue,
3253 n_label
: nullable ALabel,
3254 n_expr
: nullable AExpr
3258 _n_kwcontinue
= n_kwcontinue
3259 if n_kwcontinue
!= null then
3260 n_kwcontinue
.parent
= self
3263 if n_label
!= null then
3264 n_label
.parent
= self
3267 if n_expr
!= null then
3268 n_expr
.parent
= self
3272 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3274 if _n_kwcontinue
== old_child
then
3275 if new_child
!= null then
3276 new_child
.parent
= self
3277 assert new_child
isa TKwcontinue
3278 _n_kwcontinue
= new_child
3280 _n_kwcontinue
= null
3284 if _n_label
== old_child
then
3285 if new_child
!= null then
3286 new_child
.parent
= self
3287 assert new_child
isa ALabel
3288 _n_label
= new_child
3294 if _n_expr
== old_child
then
3295 if new_child
!= null then
3296 new_child
.parent
= self
3297 assert new_child
isa AExpr
3306 redef fun visit_all
(v
: Visitor)
3308 if _n_kwcontinue
!= null then
3309 v
.enter_visit
(_n_kwcontinue
.as(not null))
3311 if _n_label
!= null then
3312 v
.enter_visit
(_n_label
.as(not null))
3314 if _n_expr
!= null then
3315 v
.enter_visit
(_n_expr
.as(not null))
3320 private init empty_init
do end
3323 n_kwdo
: nullable TKwdo,
3324 n_block
: nullable AExpr,
3325 n_label
: nullable ALabel
3329 _n_kwdo
= n_kwdo
.as(not null)
3330 n_kwdo
.parent
= self
3332 if n_block
!= null then
3333 n_block
.parent
= self
3336 if n_label
!= null then
3337 n_label
.parent
= self
3341 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3343 if _n_kwdo
== old_child
then
3344 if new_child
!= null then
3345 new_child
.parent
= self
3346 assert new_child
isa TKwdo
3353 if _n_block
== old_child
then
3354 if new_child
!= null then
3355 new_child
.parent
= self
3356 assert new_child
isa AExpr
3357 _n_block
= new_child
3363 if _n_label
== old_child
then
3364 if new_child
!= null then
3365 new_child
.parent
= self
3366 assert new_child
isa ALabel
3367 _n_label
= new_child
3375 redef fun visit_all
(v
: Visitor)
3377 v
.enter_visit
(_n_kwdo
)
3378 if _n_block
!= null then
3379 v
.enter_visit
(_n_block
.as(not null))
3381 if _n_label
!= null then
3382 v
.enter_visit
(_n_label
.as(not null))
3387 private init empty_init
do end
3390 n_kwif
: nullable TKwif,
3391 n_expr
: nullable AExpr,
3392 n_then
: nullable AExpr,
3393 n_else
: nullable AExpr
3397 _n_kwif
= n_kwif
.as(not null)
3398 n_kwif
.parent
= self
3399 _n_expr
= n_expr
.as(not null)
3400 n_expr
.parent
= self
3402 if n_then
!= null then
3403 n_then
.parent
= self
3406 if n_else
!= null then
3407 n_else
.parent
= self
3411 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3413 if _n_kwif
== old_child
then
3414 if new_child
!= null then
3415 new_child
.parent
= self
3416 assert new_child
isa TKwif
3423 if _n_expr
== old_child
then
3424 if new_child
!= null then
3425 new_child
.parent
= self
3426 assert new_child
isa AExpr
3433 if _n_then
== old_child
then
3434 if new_child
!= null then
3435 new_child
.parent
= self
3436 assert new_child
isa AExpr
3443 if _n_else
== old_child
then
3444 if new_child
!= null then
3445 new_child
.parent
= self
3446 assert new_child
isa AExpr
3455 redef fun visit_all
(v
: Visitor)
3457 v
.enter_visit
(_n_kwif
)
3458 v
.enter_visit
(_n_expr
)
3459 if _n_then
!= null then
3460 v
.enter_visit
(_n_then
.as(not null))
3462 if _n_else
!= null then
3463 v
.enter_visit
(_n_else
.as(not null))
3467 redef class AIfexprExpr
3468 private init empty_init
do end
3470 init init_aifexprexpr
(
3471 n_kwif
: nullable TKwif,
3472 n_expr
: nullable AExpr,
3473 n_kwthen
: nullable TKwthen,
3474 n_then
: nullable AExpr,
3475 n_kwelse
: nullable TKwelse,
3476 n_else
: nullable AExpr
3480 _n_kwif
= n_kwif
.as(not null)
3481 n_kwif
.parent
= self
3482 _n_expr
= n_expr
.as(not null)
3483 n_expr
.parent
= self
3484 _n_kwthen
= n_kwthen
.as(not null)
3485 n_kwthen
.parent
= self
3486 _n_then
= n_then
.as(not null)
3487 n_then
.parent
= self
3488 _n_kwelse
= n_kwelse
.as(not null)
3489 n_kwelse
.parent
= self
3490 _n_else
= n_else
.as(not null)
3491 n_else
.parent
= self
3494 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3496 if _n_kwif
== old_child
then
3497 if new_child
!= null then
3498 new_child
.parent
= self
3499 assert new_child
isa TKwif
3506 if _n_expr
== old_child
then
3507 if new_child
!= null then
3508 new_child
.parent
= self
3509 assert new_child
isa AExpr
3516 if _n_kwthen
== old_child
then
3517 if new_child
!= null then
3518 new_child
.parent
= self
3519 assert new_child
isa TKwthen
3520 _n_kwthen
= new_child
3526 if _n_then
== old_child
then
3527 if new_child
!= null then
3528 new_child
.parent
= self
3529 assert new_child
isa AExpr
3536 if _n_kwelse
== old_child
then
3537 if new_child
!= null then
3538 new_child
.parent
= self
3539 assert new_child
isa TKwelse
3540 _n_kwelse
= new_child
3546 if _n_else
== old_child
then
3547 if new_child
!= null then
3548 new_child
.parent
= self
3549 assert new_child
isa AExpr
3558 redef fun visit_all
(v
: Visitor)
3560 v
.enter_visit
(_n_kwif
)
3561 v
.enter_visit
(_n_expr
)
3562 v
.enter_visit
(_n_kwthen
)
3563 v
.enter_visit
(_n_then
)
3564 v
.enter_visit
(_n_kwelse
)
3565 v
.enter_visit
(_n_else
)
3568 redef class AWhileExpr
3569 private init empty_init
do end
3571 init init_awhileexpr
(
3572 n_kwwhile
: nullable TKwwhile,
3573 n_expr
: nullable AExpr,
3574 n_kwdo
: nullable TKwdo,
3575 n_block
: nullable AExpr,
3576 n_label
: nullable ALabel
3580 _n_kwwhile
= n_kwwhile
.as(not null)
3581 n_kwwhile
.parent
= self
3582 _n_expr
= n_expr
.as(not null)
3583 n_expr
.parent
= self
3584 _n_kwdo
= n_kwdo
.as(not null)
3585 n_kwdo
.parent
= self
3587 if n_block
!= null then
3588 n_block
.parent
= self
3591 if n_label
!= null then
3592 n_label
.parent
= self
3596 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3598 if _n_kwwhile
== old_child
then
3599 if new_child
!= null then
3600 new_child
.parent
= self
3601 assert new_child
isa TKwwhile
3602 _n_kwwhile
= new_child
3608 if _n_expr
== old_child
then
3609 if new_child
!= null then
3610 new_child
.parent
= self
3611 assert new_child
isa AExpr
3618 if _n_kwdo
== old_child
then
3619 if new_child
!= null then
3620 new_child
.parent
= self
3621 assert new_child
isa TKwdo
3628 if _n_block
== old_child
then
3629 if new_child
!= null then
3630 new_child
.parent
= self
3631 assert new_child
isa AExpr
3632 _n_block
= new_child
3638 if _n_label
== old_child
then
3639 if new_child
!= null then
3640 new_child
.parent
= self
3641 assert new_child
isa ALabel
3642 _n_label
= new_child
3650 redef fun visit_all
(v
: Visitor)
3652 v
.enter_visit
(_n_kwwhile
)
3653 v
.enter_visit
(_n_expr
)
3654 v
.enter_visit
(_n_kwdo
)
3655 if _n_block
!= null then
3656 v
.enter_visit
(_n_block
.as(not null))
3658 if _n_label
!= null then
3659 v
.enter_visit
(_n_label
.as(not null))
3663 redef class ALoopExpr
3664 private init empty_init
do end
3666 init init_aloopexpr
(
3667 n_kwloop
: nullable TKwloop,
3668 n_block
: nullable AExpr,
3669 n_label
: nullable ALabel
3673 _n_kwloop
= n_kwloop
.as(not null)
3674 n_kwloop
.parent
= self
3676 if n_block
!= null then
3677 n_block
.parent
= self
3680 if n_label
!= null then
3681 n_label
.parent
= self
3685 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3687 if _n_kwloop
== old_child
then
3688 if new_child
!= null then
3689 new_child
.parent
= self
3690 assert new_child
isa TKwloop
3691 _n_kwloop
= new_child
3697 if _n_block
== old_child
then
3698 if new_child
!= null then
3699 new_child
.parent
= self
3700 assert new_child
isa AExpr
3701 _n_block
= new_child
3707 if _n_label
== old_child
then
3708 if new_child
!= null then
3709 new_child
.parent
= self
3710 assert new_child
isa ALabel
3711 _n_label
= new_child
3719 redef fun visit_all
(v
: Visitor)
3721 v
.enter_visit
(_n_kwloop
)
3722 if _n_block
!= null then
3723 v
.enter_visit
(_n_block
.as(not null))
3725 if _n_label
!= null then
3726 v
.enter_visit
(_n_label
.as(not null))
3730 redef class AForExpr
3731 private init empty_init
do end
3733 init init_aforexpr
(
3734 n_kwfor
: nullable TKwfor,
3736 n_expr
: nullable AExpr,
3737 n_kwdo
: nullable TKwdo,
3738 n_block
: nullable AExpr,
3739 n_label
: nullable ALabel
3743 _n_kwfor
= n_kwfor
.as(not null)
3744 n_kwfor
.parent
= self
3745 _n_id
= n_id
.as(not null)
3747 _n_expr
= n_expr
.as(not null)
3748 n_expr
.parent
= self
3749 _n_kwdo
= n_kwdo
.as(not null)
3750 n_kwdo
.parent
= self
3752 if n_block
!= null then
3753 n_block
.parent
= self
3756 if n_label
!= null then
3757 n_label
.parent
= self
3761 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3763 if _n_kwfor
== old_child
then
3764 if new_child
!= null then
3765 new_child
.parent
= self
3766 assert new_child
isa TKwfor
3767 _n_kwfor
= new_child
3773 if _n_id
== old_child
then
3774 if new_child
!= null then
3775 new_child
.parent
= self
3776 assert new_child
isa TId
3783 if _n_expr
== old_child
then
3784 if new_child
!= null then
3785 new_child
.parent
= self
3786 assert new_child
isa AExpr
3793 if _n_kwdo
== old_child
then
3794 if new_child
!= null then
3795 new_child
.parent
= self
3796 assert new_child
isa TKwdo
3803 if _n_block
== old_child
then
3804 if new_child
!= null then
3805 new_child
.parent
= self
3806 assert new_child
isa AExpr
3807 _n_block
= new_child
3813 if _n_label
== old_child
then
3814 if new_child
!= null then
3815 new_child
.parent
= self
3816 assert new_child
isa ALabel
3817 _n_label
= new_child
3825 redef fun visit_all
(v
: Visitor)
3827 v
.enter_visit
(_n_kwfor
)
3828 v
.enter_visit
(_n_id
)
3829 v
.enter_visit
(_n_expr
)
3830 v
.enter_visit
(_n_kwdo
)
3831 if _n_block
!= null then
3832 v
.enter_visit
(_n_block
.as(not null))
3834 if _n_label
!= null then
3835 v
.enter_visit
(_n_label
.as(not null))
3839 redef class AAssertExpr
3840 private init empty_init
do end
3842 init init_aassertexpr
(
3843 n_kwassert
: nullable TKwassert,
3845 n_expr
: nullable AExpr,
3846 n_else
: nullable AExpr
3850 _n_kwassert
= n_kwassert
.as(not null)
3851 n_kwassert
.parent
= self
3853 if n_id
!= null then
3856 _n_expr
= n_expr
.as(not null)
3857 n_expr
.parent
= self
3859 if n_else
!= null then
3860 n_else
.parent
= self
3864 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3866 if _n_kwassert
== old_child
then
3867 if new_child
!= null then
3868 new_child
.parent
= self
3869 assert new_child
isa TKwassert
3870 _n_kwassert
= new_child
3876 if _n_id
== old_child
then
3877 if new_child
!= null then
3878 new_child
.parent
= self
3879 assert new_child
isa TId
3886 if _n_expr
== old_child
then
3887 if new_child
!= null then
3888 new_child
.parent
= self
3889 assert new_child
isa AExpr
3896 if _n_else
== old_child
then
3897 if new_child
!= null then
3898 new_child
.parent
= self
3899 assert new_child
isa AExpr
3908 redef fun visit_all
(v
: Visitor)
3910 v
.enter_visit
(_n_kwassert
)
3911 if _n_id
!= null then
3912 v
.enter_visit
(_n_id
.as(not null))
3914 v
.enter_visit
(_n_expr
)
3915 if _n_else
!= null then
3916 v
.enter_visit
(_n_else
.as(not null))
3920 redef class AOnceExpr
3921 private init empty_init
do end
3923 init init_aonceexpr
(
3924 n_kwonce
: nullable TKwonce,
3925 n_expr
: nullable AExpr
3929 _n_kwonce
= n_kwonce
.as(not null)
3930 n_kwonce
.parent
= self
3931 _n_expr
= n_expr
.as(not null)
3932 n_expr
.parent
= self
3935 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3937 if _n_kwonce
== old_child
then
3938 if new_child
!= null then
3939 new_child
.parent
= self
3940 assert new_child
isa TKwonce
3941 _n_kwonce
= new_child
3947 if _n_expr
== old_child
then
3948 if new_child
!= null then
3949 new_child
.parent
= self
3950 assert new_child
isa AExpr
3959 redef fun visit_all
(v
: Visitor)
3961 v
.enter_visit
(_n_kwonce
)
3962 v
.enter_visit
(_n_expr
)
3965 redef class ASendExpr
3966 private init empty_init
do end
3968 init init_asendexpr
(
3969 n_expr
: nullable AExpr
3973 _n_expr
= n_expr
.as(not null)
3974 n_expr
.parent
= self
3977 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3979 if _n_expr
== old_child
then
3980 if new_child
!= null then
3981 new_child
.parent
= self
3982 assert new_child
isa AExpr
3991 redef fun visit_all
(v
: Visitor)
3993 v
.enter_visit
(_n_expr
)
3996 redef class ABinopExpr
3997 private init empty_init
do end
3999 init init_abinopexpr
(
4000 n_expr
: nullable AExpr,
4001 n_expr2
: nullable AExpr
4005 _n_expr
= n_expr
.as(not null)
4006 n_expr
.parent
= self
4007 _n_expr2
= n_expr2
.as(not null)
4008 n_expr2
.parent
= self
4011 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4013 if _n_expr
== old_child
then
4014 if new_child
!= null then
4015 new_child
.parent
= self
4016 assert new_child
isa AExpr
4023 if _n_expr2
== old_child
then
4024 if new_child
!= null then
4025 new_child
.parent
= self
4026 assert new_child
isa AExpr
4027 _n_expr2
= new_child
4035 redef fun visit_all
(v
: Visitor)
4037 v
.enter_visit
(_n_expr
)
4038 v
.enter_visit
(_n_expr2
)
4042 private init empty_init
do end
4045 n_expr
: nullable AExpr,
4046 n_expr2
: nullable AExpr
4050 _n_expr
= n_expr
.as(not null)
4051 n_expr
.parent
= self
4052 _n_expr2
= n_expr2
.as(not null)
4053 n_expr2
.parent
= self
4056 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4058 if _n_expr
== old_child
then
4059 if new_child
!= null then
4060 new_child
.parent
= self
4061 assert new_child
isa AExpr
4068 if _n_expr2
== old_child
then
4069 if new_child
!= null then
4070 new_child
.parent
= self
4071 assert new_child
isa AExpr
4072 _n_expr2
= new_child
4080 redef fun visit_all
(v
: Visitor)
4082 v
.enter_visit
(_n_expr
)
4083 v
.enter_visit
(_n_expr2
)
4086 redef class AAndExpr
4087 private init empty_init
do end
4089 init init_aandexpr
(
4090 n_expr
: nullable AExpr,
4091 n_expr2
: nullable AExpr
4095 _n_expr
= n_expr
.as(not null)
4096 n_expr
.parent
= self
4097 _n_expr2
= n_expr2
.as(not null)
4098 n_expr2
.parent
= self
4101 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4103 if _n_expr
== old_child
then
4104 if new_child
!= null then
4105 new_child
.parent
= self
4106 assert new_child
isa AExpr
4113 if _n_expr2
== old_child
then
4114 if new_child
!= null then
4115 new_child
.parent
= self
4116 assert new_child
isa AExpr
4117 _n_expr2
= new_child
4125 redef fun visit_all
(v
: Visitor)
4127 v
.enter_visit
(_n_expr
)
4128 v
.enter_visit
(_n_expr2
)
4131 redef class AOrElseExpr
4132 private init empty_init
do end
4134 init init_aorelseexpr
(
4135 n_expr
: nullable AExpr,
4136 n_expr2
: nullable AExpr
4140 _n_expr
= n_expr
.as(not null)
4141 n_expr
.parent
= self
4142 _n_expr2
= n_expr2
.as(not null)
4143 n_expr2
.parent
= self
4146 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4148 if _n_expr
== old_child
then
4149 if new_child
!= null then
4150 new_child
.parent
= self
4151 assert new_child
isa AExpr
4158 if _n_expr2
== old_child
then
4159 if new_child
!= null then
4160 new_child
.parent
= self
4161 assert new_child
isa AExpr
4162 _n_expr2
= new_child
4170 redef fun visit_all
(v
: Visitor)
4172 v
.enter_visit
(_n_expr
)
4173 v
.enter_visit
(_n_expr2
)
4176 redef class ANotExpr
4177 private init empty_init
do end
4179 init init_anotexpr
(
4180 n_kwnot
: nullable TKwnot,
4181 n_expr
: nullable AExpr
4185 _n_kwnot
= n_kwnot
.as(not null)
4186 n_kwnot
.parent
= self
4187 _n_expr
= n_expr
.as(not null)
4188 n_expr
.parent
= self
4191 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4193 if _n_kwnot
== old_child
then
4194 if new_child
!= null then
4195 new_child
.parent
= self
4196 assert new_child
isa TKwnot
4197 _n_kwnot
= new_child
4203 if _n_expr
== old_child
then
4204 if new_child
!= null then
4205 new_child
.parent
= self
4206 assert new_child
isa AExpr
4215 redef fun visit_all
(v
: Visitor)
4217 v
.enter_visit
(_n_kwnot
)
4218 v
.enter_visit
(_n_expr
)
4222 private init empty_init
do end
4225 n_expr
: nullable AExpr,
4226 n_expr2
: nullable AExpr
4230 _n_expr
= n_expr
.as(not null)
4231 n_expr
.parent
= self
4232 _n_expr2
= n_expr2
.as(not null)
4233 n_expr2
.parent
= self
4236 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4238 if _n_expr
== old_child
then
4239 if new_child
!= null then
4240 new_child
.parent
= self
4241 assert new_child
isa AExpr
4248 if _n_expr2
== old_child
then
4249 if new_child
!= null then
4250 new_child
.parent
= self
4251 assert new_child
isa AExpr
4252 _n_expr2
= new_child
4260 redef fun visit_all
(v
: Visitor)
4262 v
.enter_visit
(_n_expr
)
4263 v
.enter_visit
(_n_expr2
)
4267 private init empty_init
do end
4270 n_expr
: nullable AExpr,
4271 n_expr2
: nullable AExpr
4275 _n_expr
= n_expr
.as(not null)
4276 n_expr
.parent
= self
4277 _n_expr2
= n_expr2
.as(not null)
4278 n_expr2
.parent
= self
4281 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4283 if _n_expr
== old_child
then
4284 if new_child
!= null then
4285 new_child
.parent
= self
4286 assert new_child
isa AExpr
4293 if _n_expr2
== old_child
then
4294 if new_child
!= null then
4295 new_child
.parent
= self
4296 assert new_child
isa AExpr
4297 _n_expr2
= new_child
4305 redef fun visit_all
(v
: Visitor)
4307 v
.enter_visit
(_n_expr
)
4308 v
.enter_visit
(_n_expr2
)
4312 private init empty_init
do end
4315 n_expr
: nullable AExpr,
4316 n_expr2
: nullable AExpr
4320 _n_expr
= n_expr
.as(not null)
4321 n_expr
.parent
= self
4322 _n_expr2
= n_expr2
.as(not null)
4323 n_expr2
.parent
= self
4326 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4328 if _n_expr
== old_child
then
4329 if new_child
!= null then
4330 new_child
.parent
= self
4331 assert new_child
isa AExpr
4338 if _n_expr2
== old_child
then
4339 if new_child
!= null then
4340 new_child
.parent
= self
4341 assert new_child
isa AExpr
4342 _n_expr2
= new_child
4350 redef fun visit_all
(v
: Visitor)
4352 v
.enter_visit
(_n_expr
)
4353 v
.enter_visit
(_n_expr2
)
4357 private init empty_init
do end
4360 n_expr
: nullable AExpr,
4361 n_expr2
: nullable AExpr
4365 _n_expr
= n_expr
.as(not null)
4366 n_expr
.parent
= self
4367 _n_expr2
= n_expr2
.as(not null)
4368 n_expr2
.parent
= self
4371 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4373 if _n_expr
== old_child
then
4374 if new_child
!= null then
4375 new_child
.parent
= self
4376 assert new_child
isa AExpr
4383 if _n_expr2
== old_child
then
4384 if new_child
!= null then
4385 new_child
.parent
= self
4386 assert new_child
isa AExpr
4387 _n_expr2
= new_child
4395 redef fun visit_all
(v
: Visitor)
4397 v
.enter_visit
(_n_expr
)
4398 v
.enter_visit
(_n_expr2
)
4402 private init empty_init
do end
4405 n_expr
: nullable AExpr,
4406 n_expr2
: nullable AExpr
4410 _n_expr
= n_expr
.as(not null)
4411 n_expr
.parent
= self
4412 _n_expr2
= n_expr2
.as(not null)
4413 n_expr2
.parent
= self
4416 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4418 if _n_expr
== old_child
then
4419 if new_child
!= null then
4420 new_child
.parent
= self
4421 assert new_child
isa AExpr
4428 if _n_expr2
== old_child
then
4429 if new_child
!= null then
4430 new_child
.parent
= self
4431 assert new_child
isa AExpr
4432 _n_expr2
= new_child
4440 redef fun visit_all
(v
: Visitor)
4442 v
.enter_visit
(_n_expr
)
4443 v
.enter_visit
(_n_expr2
)
4447 private init empty_init
do end
4450 n_expr
: nullable AExpr,
4451 n_expr2
: nullable AExpr
4455 _n_expr
= n_expr
.as(not null)
4456 n_expr
.parent
= self
4457 _n_expr2
= n_expr2
.as(not null)
4458 n_expr2
.parent
= self
4461 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4463 if _n_expr
== old_child
then
4464 if new_child
!= null then
4465 new_child
.parent
= self
4466 assert new_child
isa AExpr
4473 if _n_expr2
== old_child
then
4474 if new_child
!= null then
4475 new_child
.parent
= self
4476 assert new_child
isa AExpr
4477 _n_expr2
= new_child
4485 redef fun visit_all
(v
: Visitor)
4487 v
.enter_visit
(_n_expr
)
4488 v
.enter_visit
(_n_expr2
)
4492 private init empty_init
do end
4495 n_expr
: nullable AExpr,
4496 n_expr2
: nullable AExpr
4500 _n_expr
= n_expr
.as(not null)
4501 n_expr
.parent
= self
4502 _n_expr2
= n_expr2
.as(not null)
4503 n_expr2
.parent
= self
4506 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4508 if _n_expr
== old_child
then
4509 if new_child
!= null then
4510 new_child
.parent
= self
4511 assert new_child
isa AExpr
4518 if _n_expr2
== old_child
then
4519 if new_child
!= null then
4520 new_child
.parent
= self
4521 assert new_child
isa AExpr
4522 _n_expr2
= new_child
4530 redef fun visit_all
(v
: Visitor)
4532 v
.enter_visit
(_n_expr
)
4533 v
.enter_visit
(_n_expr2
)
4536 redef class AIsaExpr
4537 private init empty_init
do end
4539 init init_aisaexpr
(
4540 n_expr
: nullable AExpr,
4541 n_type
: nullable AType
4545 _n_expr
= n_expr
.as(not null)
4546 n_expr
.parent
= self
4547 _n_type
= n_type
.as(not null)
4548 n_type
.parent
= self
4551 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4553 if _n_expr
== old_child
then
4554 if new_child
!= null then
4555 new_child
.parent
= self
4556 assert new_child
isa AExpr
4563 if _n_type
== old_child
then
4564 if new_child
!= null then
4565 new_child
.parent
= self
4566 assert new_child
isa AType
4575 redef fun visit_all
(v
: Visitor)
4577 v
.enter_visit
(_n_expr
)
4578 v
.enter_visit
(_n_type
)
4581 redef class APlusExpr
4582 private init empty_init
do end
4584 init init_aplusexpr
(
4585 n_expr
: nullable AExpr,
4586 n_expr2
: nullable AExpr
4590 _n_expr
= n_expr
.as(not null)
4591 n_expr
.parent
= self
4592 _n_expr2
= n_expr2
.as(not null)
4593 n_expr2
.parent
= self
4596 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4598 if _n_expr
== old_child
then
4599 if new_child
!= null then
4600 new_child
.parent
= self
4601 assert new_child
isa AExpr
4608 if _n_expr2
== old_child
then
4609 if new_child
!= null then
4610 new_child
.parent
= self
4611 assert new_child
isa AExpr
4612 _n_expr2
= new_child
4620 redef fun visit_all
(v
: Visitor)
4622 v
.enter_visit
(_n_expr
)
4623 v
.enter_visit
(_n_expr2
)
4626 redef class AMinusExpr
4627 private init empty_init
do end
4629 init init_aminusexpr
(
4630 n_expr
: nullable AExpr,
4631 n_expr2
: nullable AExpr
4635 _n_expr
= n_expr
.as(not null)
4636 n_expr
.parent
= self
4637 _n_expr2
= n_expr2
.as(not null)
4638 n_expr2
.parent
= self
4641 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4643 if _n_expr
== old_child
then
4644 if new_child
!= null then
4645 new_child
.parent
= self
4646 assert new_child
isa AExpr
4653 if _n_expr2
== old_child
then
4654 if new_child
!= null then
4655 new_child
.parent
= self
4656 assert new_child
isa AExpr
4657 _n_expr2
= new_child
4665 redef fun visit_all
(v
: Visitor)
4667 v
.enter_visit
(_n_expr
)
4668 v
.enter_visit
(_n_expr2
)
4671 redef class AStarshipExpr
4672 private init empty_init
do end
4674 init init_astarshipexpr
(
4675 n_expr
: nullable AExpr,
4676 n_expr2
: nullable AExpr
4680 _n_expr
= n_expr
.as(not null)
4681 n_expr
.parent
= self
4682 _n_expr2
= n_expr2
.as(not null)
4683 n_expr2
.parent
= self
4686 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4688 if _n_expr
== old_child
then
4689 if new_child
!= null then
4690 new_child
.parent
= self
4691 assert new_child
isa AExpr
4698 if _n_expr2
== old_child
then
4699 if new_child
!= null then
4700 new_child
.parent
= self
4701 assert new_child
isa AExpr
4702 _n_expr2
= new_child
4710 redef fun visit_all
(v
: Visitor)
4712 v
.enter_visit
(_n_expr
)
4713 v
.enter_visit
(_n_expr2
)
4716 redef class AStarExpr
4717 private init empty_init
do end
4719 init init_astarexpr
(
4720 n_expr
: nullable AExpr,
4721 n_expr2
: nullable AExpr
4725 _n_expr
= n_expr
.as(not null)
4726 n_expr
.parent
= self
4727 _n_expr2
= n_expr2
.as(not null)
4728 n_expr2
.parent
= self
4731 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4733 if _n_expr
== old_child
then
4734 if new_child
!= null then
4735 new_child
.parent
= self
4736 assert new_child
isa AExpr
4743 if _n_expr2
== old_child
then
4744 if new_child
!= null then
4745 new_child
.parent
= self
4746 assert new_child
isa AExpr
4747 _n_expr2
= new_child
4755 redef fun visit_all
(v
: Visitor)
4757 v
.enter_visit
(_n_expr
)
4758 v
.enter_visit
(_n_expr2
)
4761 redef class ASlashExpr
4762 private init empty_init
do end
4764 init init_aslashexpr
(
4765 n_expr
: nullable AExpr,
4766 n_expr2
: nullable AExpr
4770 _n_expr
= n_expr
.as(not null)
4771 n_expr
.parent
= self
4772 _n_expr2
= n_expr2
.as(not null)
4773 n_expr2
.parent
= self
4776 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4778 if _n_expr
== old_child
then
4779 if new_child
!= null then
4780 new_child
.parent
= self
4781 assert new_child
isa AExpr
4788 if _n_expr2
== old_child
then
4789 if new_child
!= null then
4790 new_child
.parent
= self
4791 assert new_child
isa AExpr
4792 _n_expr2
= new_child
4800 redef fun visit_all
(v
: Visitor)
4802 v
.enter_visit
(_n_expr
)
4803 v
.enter_visit
(_n_expr2
)
4806 redef class APercentExpr
4807 private init empty_init
do end
4809 init init_apercentexpr
(
4810 n_expr
: nullable AExpr,
4811 n_expr2
: nullable AExpr
4815 _n_expr
= n_expr
.as(not null)
4816 n_expr
.parent
= self
4817 _n_expr2
= n_expr2
.as(not null)
4818 n_expr2
.parent
= self
4821 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4823 if _n_expr
== old_child
then
4824 if new_child
!= null then
4825 new_child
.parent
= self
4826 assert new_child
isa AExpr
4833 if _n_expr2
== old_child
then
4834 if new_child
!= null then
4835 new_child
.parent
= self
4836 assert new_child
isa AExpr
4837 _n_expr2
= new_child
4845 redef fun visit_all
(v
: Visitor)
4847 v
.enter_visit
(_n_expr
)
4848 v
.enter_visit
(_n_expr2
)
4851 redef class AUminusExpr
4852 private init empty_init
do end
4854 init init_auminusexpr
(
4855 n_minus
: nullable TMinus,
4856 n_expr
: nullable AExpr
4860 _n_minus
= n_minus
.as(not null)
4861 n_minus
.parent
= self
4862 _n_expr
= n_expr
.as(not null)
4863 n_expr
.parent
= self
4866 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4868 if _n_minus
== old_child
then
4869 if new_child
!= null then
4870 new_child
.parent
= self
4871 assert new_child
isa TMinus
4872 _n_minus
= new_child
4878 if _n_expr
== old_child
then
4879 if new_child
!= null then
4880 new_child
.parent
= self
4881 assert new_child
isa AExpr
4890 redef fun visit_all
(v
: Visitor)
4892 v
.enter_visit
(_n_minus
)
4893 v
.enter_visit
(_n_expr
)
4896 redef class ANewExpr
4897 private init empty_init
do end
4899 init init_anewexpr
(
4900 n_kwnew
: nullable TKwnew,
4901 n_type
: nullable AType,
4903 n_args
: Collection[Object] # Should be Collection[AExpr]
4907 _n_kwnew
= n_kwnew
.as(not null)
4908 n_kwnew
.parent
= self
4909 _n_type
= n_type
.as(not null)
4910 n_type
.parent
= self
4912 if n_id
!= null then
4922 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4924 if _n_kwnew
== old_child
then
4925 if new_child
!= null then
4926 new_child
.parent
= self
4927 assert new_child
isa TKwnew
4928 _n_kwnew
= new_child
4934 if _n_type
== old_child
then
4935 if new_child
!= null then
4936 new_child
.parent
= self
4937 assert new_child
isa AType
4944 if _n_id
== old_child
then
4945 if new_child
!= null then
4946 new_child
.parent
= self
4947 assert new_child
isa TId
4954 for i
in [0.._n_args
.length
[ do
4955 if _n_args
[i
] == old_child
then
4956 if new_child
!= null then
4957 assert new_child
isa AExpr
4958 _n_args
[i
] = new_child
4959 new_child
.parent
= self
4961 _n_args
.remove_at
(i
)
4968 redef fun visit_all
(v
: Visitor)
4970 v
.enter_visit
(_n_kwnew
)
4971 v
.enter_visit
(_n_type
)
4972 if _n_id
!= null then
4973 v
.enter_visit
(_n_id
.as(not null))
4980 redef class AAttrExpr
4981 private init empty_init
do end
4983 init init_aattrexpr
(
4984 n_expr
: nullable AExpr,
4985 n_id
: nullable TAttrid
4989 _n_expr
= n_expr
.as(not null)
4990 n_expr
.parent
= self
4991 _n_id
= n_id
.as(not null)
4995 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4997 if _n_expr
== old_child
then
4998 if new_child
!= null then
4999 new_child
.parent
= self
5000 assert new_child
isa AExpr
5007 if _n_id
== old_child
then
5008 if new_child
!= null then
5009 new_child
.parent
= self
5010 assert new_child
isa TAttrid
5019 redef fun visit_all
(v
: Visitor)
5021 v
.enter_visit
(_n_expr
)
5022 v
.enter_visit
(_n_id
)
5025 redef class AAttrAssignExpr
5026 private init empty_init
do end
5028 init init_aattrassignexpr
(
5029 n_expr
: nullable AExpr,
5030 n_id
: nullable TAttrid,
5031 n_assign
: nullable TAssign,
5032 n_value
: nullable AExpr
5036 _n_expr
= n_expr
.as(not null)
5037 n_expr
.parent
= self
5038 _n_id
= n_id
.as(not null)
5040 _n_assign
= n_assign
.as(not null)
5041 n_assign
.parent
= self
5042 _n_value
= n_value
.as(not null)
5043 n_value
.parent
= self
5046 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5048 if _n_expr
== old_child
then
5049 if new_child
!= null then
5050 new_child
.parent
= self
5051 assert new_child
isa AExpr
5058 if _n_id
== old_child
then
5059 if new_child
!= null then
5060 new_child
.parent
= self
5061 assert new_child
isa TAttrid
5068 if _n_assign
== old_child
then
5069 if new_child
!= null then
5070 new_child
.parent
= self
5071 assert new_child
isa TAssign
5072 _n_assign
= new_child
5078 if _n_value
== old_child
then
5079 if new_child
!= null then
5080 new_child
.parent
= self
5081 assert new_child
isa AExpr
5082 _n_value
= new_child
5090 redef fun visit_all
(v
: Visitor)
5092 v
.enter_visit
(_n_expr
)
5093 v
.enter_visit
(_n_id
)
5094 v
.enter_visit
(_n_assign
)
5095 v
.enter_visit
(_n_value
)
5098 redef class AAttrReassignExpr
5099 private init empty_init
do end
5101 init init_aattrreassignexpr
(
5102 n_expr
: nullable AExpr,
5103 n_id
: nullable TAttrid,
5104 n_assign_op
: nullable AAssignOp,
5105 n_value
: nullable AExpr
5109 _n_expr
= n_expr
.as(not null)
5110 n_expr
.parent
= self
5111 _n_id
= n_id
.as(not null)
5113 _n_assign_op
= n_assign_op
.as(not null)
5114 n_assign_op
.parent
= self
5115 _n_value
= n_value
.as(not null)
5116 n_value
.parent
= self
5119 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5121 if _n_expr
== old_child
then
5122 if new_child
!= null then
5123 new_child
.parent
= self
5124 assert new_child
isa AExpr
5131 if _n_id
== old_child
then
5132 if new_child
!= null then
5133 new_child
.parent
= self
5134 assert new_child
isa TAttrid
5141 if _n_assign_op
== old_child
then
5142 if new_child
!= null then
5143 new_child
.parent
= self
5144 assert new_child
isa AAssignOp
5145 _n_assign_op
= new_child
5151 if _n_value
== old_child
then
5152 if new_child
!= null then
5153 new_child
.parent
= self
5154 assert new_child
isa AExpr
5155 _n_value
= new_child
5163 redef fun visit_all
(v
: Visitor)
5165 v
.enter_visit
(_n_expr
)
5166 v
.enter_visit
(_n_id
)
5167 v
.enter_visit
(_n_assign_op
)
5168 v
.enter_visit
(_n_value
)
5171 redef class ACallExpr
5172 private init empty_init
do end
5174 init init_acallexpr
(
5175 n_expr
: nullable AExpr,
5177 n_args
: Collection[Object], # Should be Collection[AExpr]
5178 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5182 _n_expr
= n_expr
.as(not null)
5183 n_expr
.parent
= self
5184 _n_id
= n_id
.as(not null)
5191 for n
in n_closure_defs
do
5192 assert n
isa AClosureDef
5193 _n_closure_defs
.add
(n
)
5198 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5200 if _n_expr
== old_child
then
5201 if new_child
!= null then
5202 new_child
.parent
= self
5203 assert new_child
isa AExpr
5210 if _n_id
== old_child
then
5211 if new_child
!= null then
5212 new_child
.parent
= self
5213 assert new_child
isa TId
5220 for i
in [0.._n_args
.length
[ do
5221 if _n_args
[i
] == old_child
then
5222 if new_child
!= null then
5223 assert new_child
isa AExpr
5224 _n_args
[i
] = new_child
5225 new_child
.parent
= self
5227 _n_args
.remove_at
(i
)
5232 for i
in [0.._n_closure_defs
.length
[ do
5233 if _n_closure_defs
[i
] == old_child
then
5234 if new_child
!= null then
5235 assert new_child
isa AClosureDef
5236 _n_closure_defs
[i
] = new_child
5237 new_child
.parent
= self
5239 _n_closure_defs
.remove_at
(i
)
5246 redef fun visit_all
(v
: Visitor)
5248 v
.enter_visit
(_n_expr
)
5249 v
.enter_visit
(_n_id
)
5253 for n
in _n_closure_defs
do
5258 redef class ACallAssignExpr
5259 private init empty_init
do end
5261 init init_acallassignexpr
(
5262 n_expr
: nullable AExpr,
5264 n_args
: Collection[Object], # Should be Collection[AExpr]
5265 n_assign
: nullable TAssign,
5266 n_value
: nullable AExpr
5270 _n_expr
= n_expr
.as(not null)
5271 n_expr
.parent
= self
5272 _n_id
= n_id
.as(not null)
5279 _n_assign
= n_assign
.as(not null)
5280 n_assign
.parent
= self
5281 _n_value
= n_value
.as(not null)
5282 n_value
.parent
= self
5285 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5287 if _n_expr
== old_child
then
5288 if new_child
!= null then
5289 new_child
.parent
= self
5290 assert new_child
isa AExpr
5297 if _n_id
== old_child
then
5298 if new_child
!= null then
5299 new_child
.parent
= self
5300 assert new_child
isa TId
5307 for i
in [0.._n_args
.length
[ do
5308 if _n_args
[i
] == old_child
then
5309 if new_child
!= null then
5310 assert new_child
isa AExpr
5311 _n_args
[i
] = new_child
5312 new_child
.parent
= self
5314 _n_args
.remove_at
(i
)
5319 if _n_assign
== old_child
then
5320 if new_child
!= null then
5321 new_child
.parent
= self
5322 assert new_child
isa TAssign
5323 _n_assign
= new_child
5329 if _n_value
== old_child
then
5330 if new_child
!= null then
5331 new_child
.parent
= self
5332 assert new_child
isa AExpr
5333 _n_value
= new_child
5341 redef fun visit_all
(v
: Visitor)
5343 v
.enter_visit
(_n_expr
)
5344 v
.enter_visit
(_n_id
)
5348 v
.enter_visit
(_n_assign
)
5349 v
.enter_visit
(_n_value
)
5352 redef class ACallReassignExpr
5353 private init empty_init
do end
5355 init init_acallreassignexpr
(
5356 n_expr
: nullable AExpr,
5358 n_args
: Collection[Object], # Should be Collection[AExpr]
5359 n_assign_op
: nullable AAssignOp,
5360 n_value
: nullable AExpr
5364 _n_expr
= n_expr
.as(not null)
5365 n_expr
.parent
= self
5366 _n_id
= n_id
.as(not null)
5373 _n_assign_op
= n_assign_op
.as(not null)
5374 n_assign_op
.parent
= self
5375 _n_value
= n_value
.as(not null)
5376 n_value
.parent
= self
5379 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5381 if _n_expr
== old_child
then
5382 if new_child
!= null then
5383 new_child
.parent
= self
5384 assert new_child
isa AExpr
5391 if _n_id
== old_child
then
5392 if new_child
!= null then
5393 new_child
.parent
= self
5394 assert new_child
isa TId
5401 for i
in [0.._n_args
.length
[ do
5402 if _n_args
[i
] == old_child
then
5403 if new_child
!= null then
5404 assert new_child
isa AExpr
5405 _n_args
[i
] = new_child
5406 new_child
.parent
= self
5408 _n_args
.remove_at
(i
)
5413 if _n_assign_op
== old_child
then
5414 if new_child
!= null then
5415 new_child
.parent
= self
5416 assert new_child
isa AAssignOp
5417 _n_assign_op
= new_child
5423 if _n_value
== old_child
then
5424 if new_child
!= null then
5425 new_child
.parent
= self
5426 assert new_child
isa AExpr
5427 _n_value
= new_child
5435 redef fun visit_all
(v
: Visitor)
5437 v
.enter_visit
(_n_expr
)
5438 v
.enter_visit
(_n_id
)
5442 v
.enter_visit
(_n_assign_op
)
5443 v
.enter_visit
(_n_value
)
5446 redef class ASuperExpr
5447 private init empty_init
do end
5449 init init_asuperexpr
(
5450 n_qualified
: nullable AQualified,
5451 n_kwsuper
: nullable TKwsuper,
5452 n_args
: Collection[Object] # Should be Collection[AExpr]
5456 _n_qualified
= n_qualified
5457 if n_qualified
!= null then
5458 n_qualified
.parent
= self
5460 _n_kwsuper
= n_kwsuper
.as(not null)
5461 n_kwsuper
.parent
= self
5469 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5471 if _n_qualified
== old_child
then
5472 if new_child
!= null then
5473 new_child
.parent
= self
5474 assert new_child
isa AQualified
5475 _n_qualified
= new_child
5481 if _n_kwsuper
== old_child
then
5482 if new_child
!= null then
5483 new_child
.parent
= self
5484 assert new_child
isa TKwsuper
5485 _n_kwsuper
= new_child
5491 for i
in [0.._n_args
.length
[ do
5492 if _n_args
[i
] == old_child
then
5493 if new_child
!= null then
5494 assert new_child
isa AExpr
5495 _n_args
[i
] = new_child
5496 new_child
.parent
= self
5498 _n_args
.remove_at
(i
)
5505 redef fun visit_all
(v
: Visitor)
5507 if _n_qualified
!= null then
5508 v
.enter_visit
(_n_qualified
.as(not null))
5510 v
.enter_visit
(_n_kwsuper
)
5516 redef class AInitExpr
5517 private init empty_init
do end
5519 init init_ainitexpr
(
5520 n_expr
: nullable AExpr,
5521 n_kwinit
: nullable TKwinit,
5522 n_args
: Collection[Object] # Should be Collection[AExpr]
5526 _n_expr
= n_expr
.as(not null)
5527 n_expr
.parent
= self
5528 _n_kwinit
= n_kwinit
.as(not null)
5529 n_kwinit
.parent
= self
5537 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5539 if _n_expr
== old_child
then
5540 if new_child
!= null then
5541 new_child
.parent
= self
5542 assert new_child
isa AExpr
5549 if _n_kwinit
== old_child
then
5550 if new_child
!= null then
5551 new_child
.parent
= self
5552 assert new_child
isa TKwinit
5553 _n_kwinit
= new_child
5559 for i
in [0.._n_args
.length
[ do
5560 if _n_args
[i
] == old_child
then
5561 if new_child
!= null then
5562 assert new_child
isa AExpr
5563 _n_args
[i
] = new_child
5564 new_child
.parent
= self
5566 _n_args
.remove_at
(i
)
5573 redef fun visit_all
(v
: Visitor)
5575 v
.enter_visit
(_n_expr
)
5576 v
.enter_visit
(_n_kwinit
)
5582 redef class ABraExpr
5583 private init empty_init
do end
5585 init init_abraexpr
(
5586 n_expr
: nullable AExpr,
5587 n_args
: Collection[Object], # Should be Collection[AExpr]
5588 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5592 _n_expr
= n_expr
.as(not null)
5593 n_expr
.parent
= self
5599 for n
in n_closure_defs
do
5600 assert n
isa AClosureDef
5601 _n_closure_defs
.add
(n
)
5606 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5608 if _n_expr
== old_child
then
5609 if new_child
!= null then
5610 new_child
.parent
= self
5611 assert new_child
isa AExpr
5618 for i
in [0.._n_args
.length
[ do
5619 if _n_args
[i
] == old_child
then
5620 if new_child
!= null then
5621 assert new_child
isa AExpr
5622 _n_args
[i
] = new_child
5623 new_child
.parent
= self
5625 _n_args
.remove_at
(i
)
5630 for i
in [0.._n_closure_defs
.length
[ do
5631 if _n_closure_defs
[i
] == old_child
then
5632 if new_child
!= null then
5633 assert new_child
isa AClosureDef
5634 _n_closure_defs
[i
] = new_child
5635 new_child
.parent
= self
5637 _n_closure_defs
.remove_at
(i
)
5644 redef fun visit_all
(v
: Visitor)
5646 v
.enter_visit
(_n_expr
)
5650 for n
in _n_closure_defs
do
5655 redef class ABraAssignExpr
5656 private init empty_init
do end
5658 init init_abraassignexpr
(
5659 n_expr
: nullable AExpr,
5660 n_args
: Collection[Object], # Should be Collection[AExpr]
5661 n_assign
: nullable TAssign,
5662 n_value
: nullable AExpr
5666 _n_expr
= n_expr
.as(not null)
5667 n_expr
.parent
= self
5673 _n_assign
= n_assign
.as(not null)
5674 n_assign
.parent
= self
5675 _n_value
= n_value
.as(not null)
5676 n_value
.parent
= self
5679 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5681 if _n_expr
== old_child
then
5682 if new_child
!= null then
5683 new_child
.parent
= self
5684 assert new_child
isa AExpr
5691 for i
in [0.._n_args
.length
[ do
5692 if _n_args
[i
] == old_child
then
5693 if new_child
!= null then
5694 assert new_child
isa AExpr
5695 _n_args
[i
] = new_child
5696 new_child
.parent
= self
5698 _n_args
.remove_at
(i
)
5703 if _n_assign
== old_child
then
5704 if new_child
!= null then
5705 new_child
.parent
= self
5706 assert new_child
isa TAssign
5707 _n_assign
= new_child
5713 if _n_value
== old_child
then
5714 if new_child
!= null then
5715 new_child
.parent
= self
5716 assert new_child
isa AExpr
5717 _n_value
= new_child
5725 redef fun visit_all
(v
: Visitor)
5727 v
.enter_visit
(_n_expr
)
5731 v
.enter_visit
(_n_assign
)
5732 v
.enter_visit
(_n_value
)
5735 redef class ABraReassignExpr
5736 private init empty_init
do end
5738 init init_abrareassignexpr
(
5739 n_expr
: nullable AExpr,
5740 n_args
: Collection[Object], # Should be Collection[AExpr]
5741 n_assign_op
: nullable AAssignOp,
5742 n_value
: nullable AExpr
5746 _n_expr
= n_expr
.as(not null)
5747 n_expr
.parent
= self
5753 _n_assign_op
= n_assign_op
.as(not null)
5754 n_assign_op
.parent
= self
5755 _n_value
= n_value
.as(not null)
5756 n_value
.parent
= self
5759 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5761 if _n_expr
== old_child
then
5762 if new_child
!= null then
5763 new_child
.parent
= self
5764 assert new_child
isa AExpr
5771 for i
in [0.._n_args
.length
[ do
5772 if _n_args
[i
] == old_child
then
5773 if new_child
!= null then
5774 assert new_child
isa AExpr
5775 _n_args
[i
] = new_child
5776 new_child
.parent
= self
5778 _n_args
.remove_at
(i
)
5783 if _n_assign_op
== old_child
then
5784 if new_child
!= null then
5785 new_child
.parent
= self
5786 assert new_child
isa AAssignOp
5787 _n_assign_op
= new_child
5793 if _n_value
== old_child
then
5794 if new_child
!= null then
5795 new_child
.parent
= self
5796 assert new_child
isa AExpr
5797 _n_value
= new_child
5805 redef fun visit_all
(v
: Visitor)
5807 v
.enter_visit
(_n_expr
)
5811 v
.enter_visit
(_n_assign_op
)
5812 v
.enter_visit
(_n_value
)
5815 redef class AClosureCallExpr
5816 private init empty_init
do end
5818 init init_aclosurecallexpr
(
5820 n_args
: Collection[Object], # Should be Collection[AExpr]
5821 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5825 _n_id
= n_id
.as(not null)
5832 for n
in n_closure_defs
do
5833 assert n
isa AClosureDef
5834 _n_closure_defs
.add
(n
)
5839 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5841 if _n_id
== old_child
then
5842 if new_child
!= null then
5843 new_child
.parent
= self
5844 assert new_child
isa TId
5851 for i
in [0.._n_args
.length
[ do
5852 if _n_args
[i
] == old_child
then
5853 if new_child
!= null then
5854 assert new_child
isa AExpr
5855 _n_args
[i
] = new_child
5856 new_child
.parent
= self
5858 _n_args
.remove_at
(i
)
5863 for i
in [0.._n_closure_defs
.length
[ do
5864 if _n_closure_defs
[i
] == old_child
then
5865 if new_child
!= null then
5866 assert new_child
isa AClosureDef
5867 _n_closure_defs
[i
] = new_child
5868 new_child
.parent
= self
5870 _n_closure_defs
.remove_at
(i
)
5877 redef fun visit_all
(v
: Visitor)
5879 v
.enter_visit
(_n_id
)
5883 for n
in _n_closure_defs
do
5888 redef class AVarExpr
5889 private init empty_init
do end
5891 init init_avarexpr
(
5896 _n_id
= n_id
.as(not null)
5900 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5902 if _n_id
== old_child
then
5903 if new_child
!= null then
5904 new_child
.parent
= self
5905 assert new_child
isa TId
5914 redef fun visit_all
(v
: Visitor)
5916 v
.enter_visit
(_n_id
)
5919 redef class AVarAssignExpr
5920 private init empty_init
do end
5922 init init_avarassignexpr
(
5924 n_assign
: nullable TAssign,
5925 n_value
: nullable AExpr
5929 _n_id
= n_id
.as(not null)
5931 _n_assign
= n_assign
.as(not null)
5932 n_assign
.parent
= self
5933 _n_value
= n_value
.as(not null)
5934 n_value
.parent
= self
5937 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5939 if _n_id
== old_child
then
5940 if new_child
!= null then
5941 new_child
.parent
= self
5942 assert new_child
isa TId
5949 if _n_assign
== old_child
then
5950 if new_child
!= null then
5951 new_child
.parent
= self
5952 assert new_child
isa TAssign
5953 _n_assign
= new_child
5959 if _n_value
== old_child
then
5960 if new_child
!= null then
5961 new_child
.parent
= self
5962 assert new_child
isa AExpr
5963 _n_value
= new_child
5971 redef fun visit_all
(v
: Visitor)
5973 v
.enter_visit
(_n_id
)
5974 v
.enter_visit
(_n_assign
)
5975 v
.enter_visit
(_n_value
)
5978 redef class AVarReassignExpr
5979 private init empty_init
do end
5981 init init_avarreassignexpr
(
5983 n_assign_op
: nullable AAssignOp,
5984 n_value
: nullable AExpr
5988 _n_id
= n_id
.as(not null)
5990 _n_assign_op
= n_assign_op
.as(not null)
5991 n_assign_op
.parent
= self
5992 _n_value
= n_value
.as(not null)
5993 n_value
.parent
= self
5996 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5998 if _n_id
== old_child
then
5999 if new_child
!= null then
6000 new_child
.parent
= self
6001 assert new_child
isa TId
6008 if _n_assign_op
== old_child
then
6009 if new_child
!= null then
6010 new_child
.parent
= self
6011 assert new_child
isa AAssignOp
6012 _n_assign_op
= new_child
6018 if _n_value
== old_child
then
6019 if new_child
!= null then
6020 new_child
.parent
= self
6021 assert new_child
isa AExpr
6022 _n_value
= new_child
6030 redef fun visit_all
(v
: Visitor)
6032 v
.enter_visit
(_n_id
)
6033 v
.enter_visit
(_n_assign_op
)
6034 v
.enter_visit
(_n_value
)
6037 redef class ARangeExpr
6038 private init empty_init
do end
6040 init init_arangeexpr
(
6041 n_expr
: nullable AExpr,
6042 n_expr2
: nullable AExpr
6046 _n_expr
= n_expr
.as(not null)
6047 n_expr
.parent
= self
6048 _n_expr2
= n_expr2
.as(not null)
6049 n_expr2
.parent
= self
6052 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6054 if _n_expr
== old_child
then
6055 if new_child
!= null then
6056 new_child
.parent
= self
6057 assert new_child
isa AExpr
6064 if _n_expr2
== old_child
then
6065 if new_child
!= null then
6066 new_child
.parent
= self
6067 assert new_child
isa AExpr
6068 _n_expr2
= new_child
6076 redef fun visit_all
(v
: Visitor)
6078 v
.enter_visit
(_n_expr
)
6079 v
.enter_visit
(_n_expr2
)
6082 redef class ACrangeExpr
6083 private init empty_init
do end
6085 init init_acrangeexpr
(
6086 n_expr
: nullable AExpr,
6087 n_expr2
: nullable AExpr
6091 _n_expr
= n_expr
.as(not null)
6092 n_expr
.parent
= self
6093 _n_expr2
= n_expr2
.as(not null)
6094 n_expr2
.parent
= self
6097 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6099 if _n_expr
== old_child
then
6100 if new_child
!= null then
6101 new_child
.parent
= self
6102 assert new_child
isa AExpr
6109 if _n_expr2
== old_child
then
6110 if new_child
!= null then
6111 new_child
.parent
= self
6112 assert new_child
isa AExpr
6113 _n_expr2
= new_child
6121 redef fun visit_all
(v
: Visitor)
6123 v
.enter_visit
(_n_expr
)
6124 v
.enter_visit
(_n_expr2
)
6127 redef class AOrangeExpr
6128 private init empty_init
do end
6130 init init_aorangeexpr
(
6131 n_expr
: nullable AExpr,
6132 n_expr2
: nullable AExpr
6136 _n_expr
= n_expr
.as(not null)
6137 n_expr
.parent
= self
6138 _n_expr2
= n_expr2
.as(not null)
6139 n_expr2
.parent
= self
6142 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6144 if _n_expr
== old_child
then
6145 if new_child
!= null then
6146 new_child
.parent
= self
6147 assert new_child
isa AExpr
6154 if _n_expr2
== old_child
then
6155 if new_child
!= null then
6156 new_child
.parent
= self
6157 assert new_child
isa AExpr
6158 _n_expr2
= new_child
6166 redef fun visit_all
(v
: Visitor)
6168 v
.enter_visit
(_n_expr
)
6169 v
.enter_visit
(_n_expr2
)
6172 redef class AArrayExpr
6173 private init empty_init
do end
6175 init init_aarrayexpr
(
6176 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6187 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6189 for i
in [0.._n_exprs
.length
[ do
6190 if _n_exprs
[i
] == old_child
then
6191 if new_child
!= null then
6192 assert new_child
isa AExpr
6193 _n_exprs
[i
] = new_child
6194 new_child
.parent
= self
6196 _n_exprs
.remove_at
(i
)
6203 redef fun visit_all
(v
: Visitor)
6205 for n
in _n_exprs
do
6210 redef class ASelfExpr
6211 private init empty_init
do end
6213 init init_aselfexpr
(
6214 n_kwself
: nullable TKwself
6218 _n_kwself
= n_kwself
.as(not null)
6219 n_kwself
.parent
= self
6222 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6224 if _n_kwself
== old_child
then
6225 if new_child
!= null then
6226 new_child
.parent
= self
6227 assert new_child
isa TKwself
6228 _n_kwself
= new_child
6236 redef fun visit_all
(v
: Visitor)
6238 v
.enter_visit
(_n_kwself
)
6241 redef class AImplicitSelfExpr
6242 private init empty_init
do end
6244 init init_aimplicitselfexpr
6249 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6253 redef fun visit_all
(v
: Visitor)
6257 redef class ATrueExpr
6258 private init empty_init
do end
6260 init init_atrueexpr
(
6261 n_kwtrue
: nullable TKwtrue
6265 _n_kwtrue
= n_kwtrue
.as(not null)
6266 n_kwtrue
.parent
= self
6269 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6271 if _n_kwtrue
== old_child
then
6272 if new_child
!= null then
6273 new_child
.parent
= self
6274 assert new_child
isa TKwtrue
6275 _n_kwtrue
= new_child
6283 redef fun visit_all
(v
: Visitor)
6285 v
.enter_visit
(_n_kwtrue
)
6288 redef class AFalseExpr
6289 private init empty_init
do end
6291 init init_afalseexpr
(
6292 n_kwfalse
: nullable TKwfalse
6296 _n_kwfalse
= n_kwfalse
.as(not null)
6297 n_kwfalse
.parent
= self
6300 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6302 if _n_kwfalse
== old_child
then
6303 if new_child
!= null then
6304 new_child
.parent
= self
6305 assert new_child
isa TKwfalse
6306 _n_kwfalse
= new_child
6314 redef fun visit_all
(v
: Visitor)
6316 v
.enter_visit
(_n_kwfalse
)
6319 redef class ANullExpr
6320 private init empty_init
do end
6322 init init_anullexpr
(
6323 n_kwnull
: nullable TKwnull
6327 _n_kwnull
= n_kwnull
.as(not null)
6328 n_kwnull
.parent
= self
6331 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6333 if _n_kwnull
== old_child
then
6334 if new_child
!= null then
6335 new_child
.parent
= self
6336 assert new_child
isa TKwnull
6337 _n_kwnull
= new_child
6345 redef fun visit_all
(v
: Visitor)
6347 v
.enter_visit
(_n_kwnull
)
6350 redef class AIntExpr
6351 private init empty_init
do end
6353 init init_aintexpr
(
6354 n_number
: nullable TNumber
6358 _n_number
= n_number
.as(not null)
6359 n_number
.parent
= self
6362 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6364 if _n_number
== old_child
then
6365 if new_child
!= null then
6366 new_child
.parent
= self
6367 assert new_child
isa TNumber
6368 _n_number
= new_child
6376 redef fun visit_all
(v
: Visitor)
6378 v
.enter_visit
(_n_number
)
6381 redef class AFloatExpr
6382 private init empty_init
do end
6384 init init_afloatexpr
(
6385 n_float
: nullable TFloat
6389 _n_float
= n_float
.as(not null)
6390 n_float
.parent
= self
6393 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6395 if _n_float
== old_child
then
6396 if new_child
!= null then
6397 new_child
.parent
= self
6398 assert new_child
isa TFloat
6399 _n_float
= new_child
6407 redef fun visit_all
(v
: Visitor)
6409 v
.enter_visit
(_n_float
)
6412 redef class ACharExpr
6413 private init empty_init
do end
6415 init init_acharexpr
(
6416 n_char
: nullable TChar
6420 _n_char
= n_char
.as(not null)
6421 n_char
.parent
= self
6424 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6426 if _n_char
== old_child
then
6427 if new_child
!= null then
6428 new_child
.parent
= self
6429 assert new_child
isa TChar
6438 redef fun visit_all
(v
: Visitor)
6440 v
.enter_visit
(_n_char
)
6443 redef class AStringExpr
6444 private init empty_init
do end
6446 init init_astringexpr
(
6447 n_string
: nullable TString
6451 _n_string
= n_string
.as(not null)
6452 n_string
.parent
= self
6455 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6457 if _n_string
== old_child
then
6458 if new_child
!= null then
6459 new_child
.parent
= self
6460 assert new_child
isa TString
6461 _n_string
= new_child
6469 redef fun visit_all
(v
: Visitor)
6471 v
.enter_visit
(_n_string
)
6474 redef class AStartStringExpr
6475 private init empty_init
do end
6477 init init_astartstringexpr
(
6478 n_string
: nullable TStartString
6482 _n_string
= n_string
.as(not null)
6483 n_string
.parent
= self
6486 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6488 if _n_string
== old_child
then
6489 if new_child
!= null then
6490 new_child
.parent
= self
6491 assert new_child
isa TStartString
6492 _n_string
= new_child
6500 redef fun visit_all
(v
: Visitor)
6502 v
.enter_visit
(_n_string
)
6505 redef class AMidStringExpr
6506 private init empty_init
do end
6508 init init_amidstringexpr
(
6509 n_string
: nullable TMidString
6513 _n_string
= n_string
.as(not null)
6514 n_string
.parent
= self
6517 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6519 if _n_string
== old_child
then
6520 if new_child
!= null then
6521 new_child
.parent
= self
6522 assert new_child
isa TMidString
6523 _n_string
= new_child
6531 redef fun visit_all
(v
: Visitor)
6533 v
.enter_visit
(_n_string
)
6536 redef class AEndStringExpr
6537 private init empty_init
do end
6539 init init_aendstringexpr
(
6540 n_string
: nullable TEndString
6544 _n_string
= n_string
.as(not null)
6545 n_string
.parent
= self
6548 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6550 if _n_string
== old_child
then
6551 if new_child
!= null then
6552 new_child
.parent
= self
6553 assert new_child
isa TEndString
6554 _n_string
= new_child
6562 redef fun visit_all
(v
: Visitor)
6564 v
.enter_visit
(_n_string
)
6567 redef class ASuperstringExpr
6568 private init empty_init
do end
6570 init init_asuperstringexpr
(
6571 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6582 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6584 for i
in [0.._n_exprs
.length
[ do
6585 if _n_exprs
[i
] == old_child
then
6586 if new_child
!= null then
6587 assert new_child
isa AExpr
6588 _n_exprs
[i
] = new_child
6589 new_child
.parent
= self
6591 _n_exprs
.remove_at
(i
)
6598 redef fun visit_all
(v
: Visitor)
6600 for n
in _n_exprs
do
6605 redef class AParExpr
6606 private init empty_init
do end
6608 init init_aparexpr
(
6609 n_expr
: nullable AExpr
6613 _n_expr
= n_expr
.as(not null)
6614 n_expr
.parent
= self
6617 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6619 if _n_expr
== old_child
then
6620 if new_child
!= null then
6621 new_child
.parent
= self
6622 assert new_child
isa AExpr
6631 redef fun visit_all
(v
: Visitor)
6633 v
.enter_visit
(_n_expr
)
6636 redef class AAsCastExpr
6637 private init empty_init
do end
6639 init init_aascastexpr
(
6640 n_expr
: nullable AExpr,
6641 n_kwas
: nullable TKwas,
6642 n_type
: nullable AType
6646 _n_expr
= n_expr
.as(not null)
6647 n_expr
.parent
= self
6648 _n_kwas
= n_kwas
.as(not null)
6649 n_kwas
.parent
= self
6650 _n_type
= n_type
.as(not null)
6651 n_type
.parent
= self
6654 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6656 if _n_expr
== old_child
then
6657 if new_child
!= null then
6658 new_child
.parent
= self
6659 assert new_child
isa AExpr
6666 if _n_kwas
== old_child
then
6667 if new_child
!= null then
6668 new_child
.parent
= self
6669 assert new_child
isa TKwas
6676 if _n_type
== old_child
then
6677 if new_child
!= null then
6678 new_child
.parent
= self
6679 assert new_child
isa AType
6688 redef fun visit_all
(v
: Visitor)
6690 v
.enter_visit
(_n_expr
)
6691 v
.enter_visit
(_n_kwas
)
6692 v
.enter_visit
(_n_type
)
6695 redef class AAsNotnullExpr
6696 private init empty_init
do end
6698 init init_aasnotnullexpr
(
6699 n_expr
: nullable AExpr,
6700 n_kwas
: nullable TKwas,
6701 n_kwnot
: nullable TKwnot,
6702 n_kwnull
: nullable TKwnull
6706 _n_expr
= n_expr
.as(not null)
6707 n_expr
.parent
= self
6708 _n_kwas
= n_kwas
.as(not null)
6709 n_kwas
.parent
= self
6710 _n_kwnot
= n_kwnot
.as(not null)
6711 n_kwnot
.parent
= self
6712 _n_kwnull
= n_kwnull
.as(not null)
6713 n_kwnull
.parent
= self
6716 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6718 if _n_expr
== old_child
then
6719 if new_child
!= null then
6720 new_child
.parent
= self
6721 assert new_child
isa AExpr
6728 if _n_kwas
== old_child
then
6729 if new_child
!= null then
6730 new_child
.parent
= self
6731 assert new_child
isa TKwas
6738 if _n_kwnot
== old_child
then
6739 if new_child
!= null then
6740 new_child
.parent
= self
6741 assert new_child
isa TKwnot
6742 _n_kwnot
= new_child
6748 if _n_kwnull
== old_child
then
6749 if new_child
!= null then
6750 new_child
.parent
= self
6751 assert new_child
isa TKwnull
6752 _n_kwnull
= new_child
6760 redef fun visit_all
(v
: Visitor)
6762 v
.enter_visit
(_n_expr
)
6763 v
.enter_visit
(_n_kwas
)
6764 v
.enter_visit
(_n_kwnot
)
6765 v
.enter_visit
(_n_kwnull
)
6768 redef class AIssetAttrExpr
6769 private init empty_init
do end
6771 init init_aissetattrexpr
(
6772 n_kwisset
: nullable TKwisset,
6773 n_expr
: nullable AExpr,
6774 n_id
: nullable TAttrid
6778 _n_kwisset
= n_kwisset
.as(not null)
6779 n_kwisset
.parent
= self
6780 _n_expr
= n_expr
.as(not null)
6781 n_expr
.parent
= self
6782 _n_id
= n_id
.as(not null)
6786 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6788 if _n_kwisset
== old_child
then
6789 if new_child
!= null then
6790 new_child
.parent
= self
6791 assert new_child
isa TKwisset
6792 _n_kwisset
= new_child
6798 if _n_expr
== old_child
then
6799 if new_child
!= null then
6800 new_child
.parent
= self
6801 assert new_child
isa AExpr
6808 if _n_id
== old_child
then
6809 if new_child
!= null then
6810 new_child
.parent
= self
6811 assert new_child
isa TAttrid
6820 redef fun visit_all
(v
: Visitor)
6822 v
.enter_visit
(_n_kwisset
)
6823 v
.enter_visit
(_n_expr
)
6824 v
.enter_visit
(_n_id
)
6827 redef class APlusAssignOp
6828 private init empty_init
do end
6830 init init_aplusassignop
(
6831 n_pluseq
: nullable TPluseq
6835 _n_pluseq
= n_pluseq
.as(not null)
6836 n_pluseq
.parent
= self
6839 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6841 if _n_pluseq
== old_child
then
6842 if new_child
!= null then
6843 new_child
.parent
= self
6844 assert new_child
isa TPluseq
6845 _n_pluseq
= new_child
6853 redef fun visit_all
(v
: Visitor)
6855 v
.enter_visit
(_n_pluseq
)
6858 redef class AMinusAssignOp
6859 private init empty_init
do end
6861 init init_aminusassignop
(
6862 n_minuseq
: nullable TMinuseq
6866 _n_minuseq
= n_minuseq
.as(not null)
6867 n_minuseq
.parent
= self
6870 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6872 if _n_minuseq
== old_child
then
6873 if new_child
!= null then
6874 new_child
.parent
= self
6875 assert new_child
isa TMinuseq
6876 _n_minuseq
= new_child
6884 redef fun visit_all
(v
: Visitor)
6886 v
.enter_visit
(_n_minuseq
)
6889 redef class AClosureDef
6890 private init empty_init
do end
6892 init init_aclosuredef
(
6893 n_bang
: nullable TBang,
6894 n_id
: nullable AClosureId,
6895 n_ids
: Collection[Object], # Should be Collection[TId]
6896 n_kwdo
: nullable TKwdo,
6897 n_expr
: nullable AExpr,
6898 n_label
: nullable ALabel
6902 _n_bang
= n_bang
.as(not null)
6903 n_bang
.parent
= self
6904 _n_id
= n_id
.as(not null)
6912 if n_kwdo
!= null then
6913 n_kwdo
.parent
= self
6916 if n_expr
!= null then
6917 n_expr
.parent
= self
6920 if n_label
!= null then
6921 n_label
.parent
= self
6925 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6927 if _n_bang
== old_child
then
6928 if new_child
!= null then
6929 new_child
.parent
= self
6930 assert new_child
isa TBang
6937 if _n_id
== old_child
then
6938 if new_child
!= null then
6939 new_child
.parent
= self
6940 assert new_child
isa AClosureId
6947 for i
in [0.._n_ids
.length
[ do
6948 if _n_ids
[i
] == old_child
then
6949 if new_child
!= null then
6950 assert new_child
isa TId
6951 _n_ids
[i
] = new_child
6952 new_child
.parent
= self
6959 if _n_kwdo
== old_child
then
6960 if new_child
!= null then
6961 new_child
.parent
= self
6962 assert new_child
isa TKwdo
6969 if _n_expr
== old_child
then
6970 if new_child
!= null then
6971 new_child
.parent
= self
6972 assert new_child
isa AExpr
6979 if _n_label
== old_child
then
6980 if new_child
!= null then
6981 new_child
.parent
= self
6982 assert new_child
isa ALabel
6983 _n_label
= new_child
6991 redef fun visit_all
(v
: Visitor)
6993 v
.enter_visit
(_n_bang
)
6994 v
.enter_visit
(_n_id
)
6998 if _n_kwdo
!= null then
6999 v
.enter_visit
(_n_kwdo
.as(not null))
7001 if _n_expr
!= null then
7002 v
.enter_visit
(_n_expr
.as(not null))
7004 if _n_label
!= null then
7005 v
.enter_visit
(_n_label
.as(not null))
7009 redef class ASimpleClosureId
7010 private init empty_init
do end
7012 init init_asimpleclosureid
(
7017 _n_id
= n_id
.as(not null)
7021 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7023 if _n_id
== old_child
then
7024 if new_child
!= null then
7025 new_child
.parent
= self
7026 assert new_child
isa TId
7035 redef fun visit_all
(v
: Visitor)
7037 v
.enter_visit
(_n_id
)
7040 redef class ABreakClosureId
7041 private init empty_init
do end
7043 init init_abreakclosureid
(
7044 n_kwbreak
: nullable TKwbreak
7048 _n_kwbreak
= n_kwbreak
.as(not null)
7049 n_kwbreak
.parent
= self
7052 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7054 if _n_kwbreak
== old_child
then
7055 if new_child
!= null then
7056 new_child
.parent
= self
7057 assert new_child
isa TKwbreak
7058 _n_kwbreak
= new_child
7066 redef fun visit_all
(v
: Visitor)
7068 v
.enter_visit
(_n_kwbreak
)
7071 redef class AQualified
7072 private init empty_init
do end
7074 init init_aqualified
(
7075 n_id
: Collection[Object], # Should be Collection[TId]
7076 n_classid
: nullable TClassid
7085 _n_classid
= n_classid
7086 if n_classid
!= null then
7087 n_classid
.parent
= self
7091 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7093 for i
in [0.._n_id
.length
[ do
7094 if _n_id
[i
] == old_child
then
7095 if new_child
!= null then
7096 assert new_child
isa TId
7097 _n_id
[i
] = new_child
7098 new_child
.parent
= self
7105 if _n_classid
== old_child
then
7106 if new_child
!= null then
7107 new_child
.parent
= self
7108 assert new_child
isa TClassid
7109 _n_classid
= new_child
7117 redef fun visit_all
(v
: Visitor)
7122 if _n_classid
!= null then
7123 v
.enter_visit
(_n_classid
.as(not null))
7128 private init empty_init
do end
7131 n_comment
: Collection[Object] # Should be Collection[TComment]
7135 for n
in n_comment
do
7136 assert n
isa TComment
7142 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7144 for i
in [0.._n_comment
.length
[ do
7145 if _n_comment
[i
] == old_child
then
7146 if new_child
!= null then
7147 assert new_child
isa TComment
7148 _n_comment
[i
] = new_child
7149 new_child
.parent
= self
7151 _n_comment
.remove_at
(i
)
7158 redef fun visit_all
(v
: Visitor)
7160 for n
in _n_comment
do
7168 n_base
: nullable AModule,
7175 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7177 if _n_base
== old_child
then
7178 if new_child
== null then
7180 new_child
.parent
= self
7181 assert new_child
isa AModule
7184 old_child
.parent
= null
7189 redef fun visit_all
(v
: Visitor)
7191 if _n_base
!= null then
7192 v
.enter_visit
(_n_base
.as(not null))
7194 v
.enter_visit
(_n_eof
)