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
50 abstract class 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_moduledecl
: nullable AModuledecl,
75 n_imports
: Collection[Object], # Should be Collection[AImport]
76 n_extern_code_blocks
: Collection[Object], # Should be Collection[AExternCodeBlock]
77 n_classdefs
: Collection[Object] # Should be Collection[AClassdef]
81 _n_moduledecl
= n_moduledecl
82 if n_moduledecl
!= null then
83 n_moduledecl
.parent
= self
90 for n
in n_extern_code_blocks
do
91 assert n
isa AExternCodeBlock
92 _n_extern_code_blocks
.add
(n
)
95 for n
in n_classdefs
do
96 assert n
isa AClassdef
102 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
104 if _n_moduledecl
== old_child
then
105 if new_child
!= null then
106 new_child
.parent
= self
107 assert new_child
isa AModuledecl
108 _n_moduledecl
= new_child
114 for i
in [0.._n_imports
.length
[ do
115 if _n_imports
[i
] == old_child
then
116 if new_child
!= null then
117 assert new_child
isa AImport
118 _n_imports
[i
] = new_child
119 new_child
.parent
= self
121 _n_imports
.remove_at
(i
)
126 for i
in [0.._n_extern_code_blocks
.length
[ do
127 if _n_extern_code_blocks
[i
] == old_child
then
128 if new_child
!= null then
129 assert new_child
isa AExternCodeBlock
130 _n_extern_code_blocks
[i
] = new_child
131 new_child
.parent
= self
133 _n_extern_code_blocks
.remove_at
(i
)
138 for i
in [0.._n_classdefs
.length
[ do
139 if _n_classdefs
[i
] == old_child
then
140 if new_child
!= null then
141 assert new_child
isa AClassdef
142 _n_classdefs
[i
] = new_child
143 new_child
.parent
= self
145 _n_classdefs
.remove_at
(i
)
152 redef fun visit_all
(v
: Visitor)
154 if _n_moduledecl
!= null then
155 v
.enter_visit
(_n_moduledecl
.as(not null))
157 for n
in _n_imports
do
160 for n
in _n_extern_code_blocks
do
163 for n
in _n_classdefs
do
168 redef class AModuledecl
169 private init empty_init
do end
171 init init_amoduledecl
(
172 n_doc
: nullable ADoc,
173 n_kwmodule
: nullable TKwmodule,
174 n_name
: nullable AModuleName
179 if n_doc
!= null then
182 _n_kwmodule
= n_kwmodule
.as(not null)
183 n_kwmodule
.parent
= self
184 _n_name
= n_name
.as(not null)
188 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
190 if _n_doc
== old_child
then
191 if new_child
!= null then
192 new_child
.parent
= self
193 assert new_child
isa ADoc
200 if _n_kwmodule
== old_child
then
201 if new_child
!= null then
202 new_child
.parent
= self
203 assert new_child
isa TKwmodule
204 _n_kwmodule
= new_child
210 if _n_name
== old_child
then
211 if new_child
!= null then
212 new_child
.parent
= self
213 assert new_child
isa AModuleName
222 redef fun visit_all
(v
: Visitor)
224 if _n_doc
!= null then
225 v
.enter_visit
(_n_doc
.as(not null))
227 v
.enter_visit
(_n_kwmodule
)
228 v
.enter_visit
(_n_name
)
231 redef class AStdImport
232 private init empty_init
do end
234 init init_astdimport
(
235 n_visibility
: nullable AVisibility,
236 n_kwimport
: nullable TKwimport,
237 n_name
: nullable AModuleName
241 _n_visibility
= n_visibility
.as(not null)
242 n_visibility
.parent
= self
243 _n_kwimport
= n_kwimport
.as(not null)
244 n_kwimport
.parent
= self
245 _n_name
= n_name
.as(not null)
249 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
251 if _n_visibility
== old_child
then
252 if new_child
!= null then
253 new_child
.parent
= self
254 assert new_child
isa AVisibility
255 _n_visibility
= new_child
261 if _n_kwimport
== old_child
then
262 if new_child
!= null then
263 new_child
.parent
= self
264 assert new_child
isa TKwimport
265 _n_kwimport
= new_child
271 if _n_name
== old_child
then
272 if new_child
!= null then
273 new_child
.parent
= self
274 assert new_child
isa AModuleName
283 redef fun visit_all
(v
: Visitor)
285 v
.enter_visit
(_n_visibility
)
286 v
.enter_visit
(_n_kwimport
)
287 v
.enter_visit
(_n_name
)
290 redef class ANoImport
291 private init empty_init
do end
293 init init_anoimport
(
294 n_visibility
: nullable AVisibility,
295 n_kwimport
: nullable TKwimport,
296 n_kwend
: nullable TKwend
300 _n_visibility
= n_visibility
.as(not null)
301 n_visibility
.parent
= self
302 _n_kwimport
= n_kwimport
.as(not null)
303 n_kwimport
.parent
= self
304 _n_kwend
= n_kwend
.as(not null)
305 n_kwend
.parent
= self
308 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
310 if _n_visibility
== old_child
then
311 if new_child
!= null then
312 new_child
.parent
= self
313 assert new_child
isa AVisibility
314 _n_visibility
= new_child
320 if _n_kwimport
== old_child
then
321 if new_child
!= null then
322 new_child
.parent
= self
323 assert new_child
isa TKwimport
324 _n_kwimport
= new_child
330 if _n_kwend
== old_child
then
331 if new_child
!= null then
332 new_child
.parent
= self
333 assert new_child
isa TKwend
342 redef fun visit_all
(v
: Visitor)
344 v
.enter_visit
(_n_visibility
)
345 v
.enter_visit
(_n_kwimport
)
346 v
.enter_visit
(_n_kwend
)
349 redef class APublicVisibility
350 private init empty_init
do end
352 init init_apublicvisibility
357 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
361 redef fun visit_all
(v
: Visitor)
365 redef class APrivateVisibility
366 private init empty_init
do end
368 init init_aprivatevisibility
(
369 n_kwprivate
: nullable TKwprivate
373 _n_kwprivate
= n_kwprivate
.as(not null)
374 n_kwprivate
.parent
= self
377 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
379 if _n_kwprivate
== old_child
then
380 if new_child
!= null then
381 new_child
.parent
= self
382 assert new_child
isa TKwprivate
383 _n_kwprivate
= new_child
391 redef fun visit_all
(v
: Visitor)
393 v
.enter_visit
(_n_kwprivate
)
396 redef class AProtectedVisibility
397 private init empty_init
do end
399 init init_aprotectedvisibility
(
400 n_kwprotected
: nullable TKwprotected
404 _n_kwprotected
= n_kwprotected
.as(not null)
405 n_kwprotected
.parent
= self
408 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
410 if _n_kwprotected
== old_child
then
411 if new_child
!= null then
412 new_child
.parent
= self
413 assert new_child
isa TKwprotected
414 _n_kwprotected
= new_child
422 redef fun visit_all
(v
: Visitor)
424 v
.enter_visit
(_n_kwprotected
)
427 redef class AIntrudeVisibility
428 private init empty_init
do end
430 init init_aintrudevisibility
(
431 n_kwintrude
: nullable TKwintrude
435 _n_kwintrude
= n_kwintrude
.as(not null)
436 n_kwintrude
.parent
= self
439 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
441 if _n_kwintrude
== old_child
then
442 if new_child
!= null then
443 new_child
.parent
= self
444 assert new_child
isa TKwintrude
445 _n_kwintrude
= new_child
453 redef fun visit_all
(v
: Visitor)
455 v
.enter_visit
(_n_kwintrude
)
458 redef class AStdClassdef
459 private init empty_init
do end
461 init init_astdclassdef
(
462 n_doc
: nullable ADoc,
463 n_kwredef
: nullable TKwredef,
464 n_visibility
: nullable AVisibility,
465 n_classkind
: nullable AClasskind,
466 n_id
: nullable TClassid,
467 n_formaldefs
: Collection[Object], # Should be Collection[AFormaldef]
468 n_extern_code_block
: nullable AExternCodeBlock,
469 n_superclasses
: Collection[Object], # Should be Collection[ASuperclass]
470 n_propdefs
: Collection[Object], # Should be Collection[APropdef]
471 n_kwend
: nullable TKwend
476 if n_doc
!= null then
479 _n_kwredef
= n_kwredef
480 if n_kwredef
!= null then
481 n_kwredef
.parent
= self
483 _n_visibility
= n_visibility
.as(not null)
484 n_visibility
.parent
= self
485 _n_classkind
= n_classkind
.as(not null)
486 n_classkind
.parent
= self
491 for n
in n_formaldefs
do
492 assert n
isa AFormaldef
496 _n_extern_code_block
= n_extern_code_block
497 if n_extern_code_block
!= null then
498 n_extern_code_block
.parent
= self
500 for n
in n_superclasses
do
501 assert n
isa ASuperclass
502 _n_superclasses
.add
(n
)
505 for n
in n_propdefs
do
506 assert n
isa APropdef
510 _n_kwend
= n_kwend
.as(not null)
511 n_kwend
.parent
= self
514 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
516 if _n_doc
== old_child
then
517 if new_child
!= null then
518 new_child
.parent
= self
519 assert new_child
isa ADoc
526 if _n_kwredef
== old_child
then
527 if new_child
!= null then
528 new_child
.parent
= self
529 assert new_child
isa TKwredef
530 _n_kwredef
= new_child
536 if _n_visibility
== old_child
then
537 if new_child
!= null then
538 new_child
.parent
= self
539 assert new_child
isa AVisibility
540 _n_visibility
= new_child
546 if _n_classkind
== old_child
then
547 if new_child
!= null then
548 new_child
.parent
= self
549 assert new_child
isa AClasskind
550 _n_classkind
= new_child
556 if _n_id
== old_child
then
557 if new_child
!= null then
558 new_child
.parent
= self
559 assert new_child
isa TClassid
566 for i
in [0.._n_formaldefs
.length
[ do
567 if _n_formaldefs
[i
] == old_child
then
568 if new_child
!= null then
569 assert new_child
isa AFormaldef
570 _n_formaldefs
[i
] = new_child
571 new_child
.parent
= self
573 _n_formaldefs
.remove_at
(i
)
578 if _n_extern_code_block
== old_child
then
579 if new_child
!= null then
580 new_child
.parent
= self
581 assert new_child
isa AExternCodeBlock
582 _n_extern_code_block
= new_child
584 _n_extern_code_block
= null
588 for i
in [0.._n_superclasses
.length
[ do
589 if _n_superclasses
[i
] == old_child
then
590 if new_child
!= null then
591 assert new_child
isa ASuperclass
592 _n_superclasses
[i
] = new_child
593 new_child
.parent
= self
595 _n_superclasses
.remove_at
(i
)
600 for i
in [0.._n_propdefs
.length
[ do
601 if _n_propdefs
[i
] == old_child
then
602 if new_child
!= null then
603 assert new_child
isa APropdef
604 _n_propdefs
[i
] = new_child
605 new_child
.parent
= self
607 _n_propdefs
.remove_at
(i
)
612 if _n_kwend
== old_child
then
613 if new_child
!= null then
614 new_child
.parent
= self
615 assert new_child
isa TKwend
624 redef fun visit_all
(v
: Visitor)
626 if _n_doc
!= null then
627 v
.enter_visit
(_n_doc
.as(not null))
629 if _n_kwredef
!= null then
630 v
.enter_visit
(_n_kwredef
.as(not null))
632 v
.enter_visit
(_n_visibility
)
633 v
.enter_visit
(_n_classkind
)
634 if _n_id
!= null then
635 v
.enter_visit
(_n_id
.as(not null))
637 for n
in _n_formaldefs
do
640 if _n_extern_code_block
!= null then
641 v
.enter_visit
(_n_extern_code_block
.as(not null))
643 for n
in _n_superclasses
do
646 for n
in _n_propdefs
do
649 v
.enter_visit
(_n_kwend
)
652 redef class ATopClassdef
653 private init empty_init
do end
655 init init_atopclassdef
(
656 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
660 for n
in n_propdefs
do
661 assert n
isa APropdef
667 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
669 for i
in [0.._n_propdefs
.length
[ do
670 if _n_propdefs
[i
] == old_child
then
671 if new_child
!= null then
672 assert new_child
isa APropdef
673 _n_propdefs
[i
] = new_child
674 new_child
.parent
= self
676 _n_propdefs
.remove_at
(i
)
683 redef fun visit_all
(v
: Visitor)
685 for n
in _n_propdefs
do
690 redef class AMainClassdef
691 private init empty_init
do end
693 init init_amainclassdef
(
694 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
698 for n
in n_propdefs
do
699 assert n
isa APropdef
705 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
707 for i
in [0.._n_propdefs
.length
[ do
708 if _n_propdefs
[i
] == old_child
then
709 if new_child
!= null then
710 assert new_child
isa APropdef
711 _n_propdefs
[i
] = new_child
712 new_child
.parent
= self
714 _n_propdefs
.remove_at
(i
)
721 redef fun visit_all
(v
: Visitor)
723 for n
in _n_propdefs
do
728 redef class AConcreteClasskind
729 private init empty_init
do end
731 init init_aconcreteclasskind
(
732 n_kwclass
: nullable TKwclass
736 _n_kwclass
= n_kwclass
.as(not null)
737 n_kwclass
.parent
= self
740 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
742 if _n_kwclass
== old_child
then
743 if new_child
!= null then
744 new_child
.parent
= self
745 assert new_child
isa TKwclass
746 _n_kwclass
= new_child
754 redef fun visit_all
(v
: Visitor)
756 v
.enter_visit
(_n_kwclass
)
759 redef class AAbstractClasskind
760 private init empty_init
do end
762 init init_aabstractclasskind
(
763 n_kwabstract
: nullable TKwabstract,
764 n_kwclass
: nullable TKwclass
768 _n_kwabstract
= n_kwabstract
.as(not null)
769 n_kwabstract
.parent
= self
770 _n_kwclass
= n_kwclass
.as(not null)
771 n_kwclass
.parent
= self
774 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
776 if _n_kwabstract
== old_child
then
777 if new_child
!= null then
778 new_child
.parent
= self
779 assert new_child
isa TKwabstract
780 _n_kwabstract
= new_child
786 if _n_kwclass
== old_child
then
787 if new_child
!= null then
788 new_child
.parent
= self
789 assert new_child
isa TKwclass
790 _n_kwclass
= new_child
798 redef fun visit_all
(v
: Visitor)
800 v
.enter_visit
(_n_kwabstract
)
801 v
.enter_visit
(_n_kwclass
)
804 redef class AInterfaceClasskind
805 private init empty_init
do end
807 init init_ainterfaceclasskind
(
808 n_kwinterface
: nullable TKwinterface
812 _n_kwinterface
= n_kwinterface
.as(not null)
813 n_kwinterface
.parent
= self
816 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
818 if _n_kwinterface
== old_child
then
819 if new_child
!= null then
820 new_child
.parent
= self
821 assert new_child
isa TKwinterface
822 _n_kwinterface
= new_child
830 redef fun visit_all
(v
: Visitor)
832 v
.enter_visit
(_n_kwinterface
)
835 redef class AEnumClasskind
836 private init empty_init
do end
838 init init_aenumclasskind
(
839 n_kwenum
: nullable TKwenum
843 _n_kwenum
= n_kwenum
.as(not null)
844 n_kwenum
.parent
= self
847 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
849 if _n_kwenum
== old_child
then
850 if new_child
!= null then
851 new_child
.parent
= self
852 assert new_child
isa TKwenum
853 _n_kwenum
= new_child
861 redef fun visit_all
(v
: Visitor)
863 v
.enter_visit
(_n_kwenum
)
866 redef class AExternClasskind
867 private init empty_init
do end
869 init init_aexternclasskind
(
870 n_kwextern
: nullable TKwextern,
871 n_kwclass
: nullable TKwclass
875 _n_kwextern
= n_kwextern
.as(not null)
876 n_kwextern
.parent
= self
877 _n_kwclass
= n_kwclass
878 if n_kwclass
!= null then
879 n_kwclass
.parent
= self
883 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
885 if _n_kwextern
== old_child
then
886 if new_child
!= null then
887 new_child
.parent
= self
888 assert new_child
isa TKwextern
889 _n_kwextern
= new_child
895 if _n_kwclass
== old_child
then
896 if new_child
!= null then
897 new_child
.parent
= self
898 assert new_child
isa TKwclass
899 _n_kwclass
= new_child
907 redef fun visit_all
(v
: Visitor)
909 v
.enter_visit
(_n_kwextern
)
910 if _n_kwclass
!= null then
911 v
.enter_visit
(_n_kwclass
.as(not null))
915 redef class AFormaldef
916 private init empty_init
do end
918 init init_aformaldef
(
919 n_id
: nullable TClassid,
920 n_type
: nullable AType
924 _n_id
= n_id
.as(not null)
927 if n_type
!= null then
932 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
934 if _n_id
== old_child
then
935 if new_child
!= null then
936 new_child
.parent
= self
937 assert new_child
isa TClassid
944 if _n_type
== old_child
then
945 if new_child
!= null then
946 new_child
.parent
= self
947 assert new_child
isa AType
956 redef fun visit_all
(v
: Visitor)
959 if _n_type
!= null then
960 v
.enter_visit
(_n_type
.as(not null))
964 redef class ASuperclass
965 private init empty_init
do end
967 init init_asuperclass
(
968 n_kwsuper
: nullable TKwsuper,
969 n_type
: nullable AType
973 _n_kwsuper
= n_kwsuper
.as(not null)
974 n_kwsuper
.parent
= self
975 _n_type
= n_type
.as(not null)
979 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
981 if _n_kwsuper
== old_child
then
982 if new_child
!= null then
983 new_child
.parent
= self
984 assert new_child
isa TKwsuper
985 _n_kwsuper
= new_child
991 if _n_type
== old_child
then
992 if new_child
!= null then
993 new_child
.parent
= self
994 assert new_child
isa AType
1003 redef fun visit_all
(v
: Visitor)
1005 v
.enter_visit
(_n_kwsuper
)
1006 v
.enter_visit
(_n_type
)
1009 redef class AAttrPropdef
1010 private init empty_init
do end
1012 init init_aattrpropdef
(
1013 n_doc
: nullable ADoc,
1014 n_readable
: nullable AAble,
1015 n_writable
: nullable AAble,
1016 n_kwredef
: nullable TKwredef,
1017 n_visibility
: nullable AVisibility,
1018 n_kwvar
: nullable TKwvar,
1019 n_id
: nullable TAttrid,
1020 n_id2
: nullable TId,
1021 n_type
: nullable AType,
1022 n_expr
: nullable AExpr
1027 if n_doc
!= null then
1030 _n_readable
= n_readable
1031 if n_readable
!= null then
1032 n_readable
.parent
= self
1034 _n_writable
= n_writable
1035 if n_writable
!= null then
1036 n_writable
.parent
= self
1038 _n_kwredef
= n_kwredef
1039 if n_kwredef
!= null then
1040 n_kwredef
.parent
= self
1042 _n_visibility
= n_visibility
.as(not null)
1043 n_visibility
.parent
= self
1044 _n_kwvar
= n_kwvar
.as(not null)
1045 n_kwvar
.parent
= self
1047 if n_id
!= null then
1051 if n_id2
!= null then
1055 if n_type
!= null then
1056 n_type
.parent
= self
1059 if n_expr
!= null then
1060 n_expr
.parent
= self
1064 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1066 if _n_doc
== old_child
then
1067 if new_child
!= null then
1068 new_child
.parent
= self
1069 assert new_child
isa ADoc
1076 if _n_readable
== old_child
then
1077 if new_child
!= null then
1078 new_child
.parent
= self
1079 assert new_child
isa AAble
1080 _n_readable
= new_child
1086 if _n_writable
== old_child
then
1087 if new_child
!= null then
1088 new_child
.parent
= self
1089 assert new_child
isa AAble
1090 _n_writable
= new_child
1096 if _n_kwredef
== old_child
then
1097 if new_child
!= null then
1098 new_child
.parent
= self
1099 assert new_child
isa TKwredef
1100 _n_kwredef
= new_child
1106 if _n_visibility
== old_child
then
1107 if new_child
!= null then
1108 new_child
.parent
= self
1109 assert new_child
isa AVisibility
1110 _n_visibility
= new_child
1116 if _n_kwvar
== old_child
then
1117 if new_child
!= null then
1118 new_child
.parent
= self
1119 assert new_child
isa TKwvar
1120 _n_kwvar
= new_child
1126 if _n_id
== old_child
then
1127 if new_child
!= null then
1128 new_child
.parent
= self
1129 assert new_child
isa TAttrid
1136 if _n_id2
== old_child
then
1137 if new_child
!= null then
1138 new_child
.parent
= self
1139 assert new_child
isa TId
1146 if _n_type
== old_child
then
1147 if new_child
!= null then
1148 new_child
.parent
= self
1149 assert new_child
isa AType
1156 if _n_expr
== old_child
then
1157 if new_child
!= null then
1158 new_child
.parent
= self
1159 assert new_child
isa AExpr
1168 redef fun visit_all
(v
: Visitor)
1170 if _n_doc
!= null then
1171 v
.enter_visit
(_n_doc
.as(not null))
1173 if _n_readable
!= null then
1174 v
.enter_visit
(_n_readable
.as(not null))
1176 if _n_writable
!= null then
1177 v
.enter_visit
(_n_writable
.as(not null))
1179 if _n_kwredef
!= null then
1180 v
.enter_visit
(_n_kwredef
.as(not null))
1182 v
.enter_visit
(_n_visibility
)
1183 v
.enter_visit
(_n_kwvar
)
1184 if _n_id
!= null then
1185 v
.enter_visit
(_n_id
.as(not null))
1187 if _n_id2
!= null then
1188 v
.enter_visit
(_n_id2
.as(not null))
1190 if _n_type
!= null then
1191 v
.enter_visit
(_n_type
.as(not null))
1193 if _n_expr
!= null then
1194 v
.enter_visit
(_n_expr
.as(not null))
1198 redef class AMethPropdef
1199 private init empty_init
do end
1201 init init_amethpropdef
(
1202 n_doc
: nullable ADoc,
1203 n_kwredef
: nullable TKwredef,
1204 n_visibility
: nullable AVisibility,
1205 n_methid
: nullable AMethid,
1206 n_signature
: nullable ASignature
1211 if n_doc
!= null then
1214 _n_kwredef
= n_kwredef
1215 if n_kwredef
!= null then
1216 n_kwredef
.parent
= self
1218 _n_visibility
= n_visibility
.as(not null)
1219 n_visibility
.parent
= self
1220 _n_methid
= n_methid
.as(not null)
1221 n_methid
.parent
= self
1222 _n_signature
= n_signature
.as(not null)
1223 n_signature
.parent
= self
1226 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1228 if _n_doc
== old_child
then
1229 if new_child
!= null then
1230 new_child
.parent
= self
1231 assert new_child
isa ADoc
1238 if _n_kwredef
== old_child
then
1239 if new_child
!= null then
1240 new_child
.parent
= self
1241 assert new_child
isa TKwredef
1242 _n_kwredef
= new_child
1248 if _n_visibility
== old_child
then
1249 if new_child
!= null then
1250 new_child
.parent
= self
1251 assert new_child
isa AVisibility
1252 _n_visibility
= new_child
1258 if _n_methid
== old_child
then
1259 if new_child
!= null then
1260 new_child
.parent
= self
1261 assert new_child
isa AMethid
1262 _n_methid
= new_child
1268 if _n_signature
== old_child
then
1269 if new_child
!= null then
1270 new_child
.parent
= self
1271 assert new_child
isa ASignature
1272 _n_signature
= new_child
1280 redef fun visit_all
(v
: Visitor)
1282 if _n_doc
!= null then
1283 v
.enter_visit
(_n_doc
.as(not null))
1285 if _n_kwredef
!= null then
1286 v
.enter_visit
(_n_kwredef
.as(not null))
1288 v
.enter_visit
(_n_visibility
)
1289 v
.enter_visit
(_n_methid
)
1290 v
.enter_visit
(_n_signature
)
1293 redef class ADeferredMethPropdef
1294 private init empty_init
do end
1296 init init_adeferredmethpropdef
(
1297 n_doc
: nullable ADoc,
1298 n_kwredef
: nullable TKwredef,
1299 n_visibility
: nullable AVisibility,
1300 n_kwmeth
: nullable TKwmeth,
1301 n_methid
: nullable AMethid,
1302 n_signature
: nullable ASignature
1307 if n_doc
!= null then
1310 _n_kwredef
= n_kwredef
1311 if n_kwredef
!= null then
1312 n_kwredef
.parent
= self
1314 _n_visibility
= n_visibility
.as(not null)
1315 n_visibility
.parent
= self
1316 _n_kwmeth
= n_kwmeth
.as(not null)
1317 n_kwmeth
.parent
= self
1318 _n_methid
= n_methid
.as(not null)
1319 n_methid
.parent
= self
1320 _n_signature
= n_signature
.as(not null)
1321 n_signature
.parent
= self
1324 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1326 if _n_doc
== old_child
then
1327 if new_child
!= null then
1328 new_child
.parent
= self
1329 assert new_child
isa ADoc
1336 if _n_kwredef
== old_child
then
1337 if new_child
!= null then
1338 new_child
.parent
= self
1339 assert new_child
isa TKwredef
1340 _n_kwredef
= new_child
1346 if _n_visibility
== old_child
then
1347 if new_child
!= null then
1348 new_child
.parent
= self
1349 assert new_child
isa AVisibility
1350 _n_visibility
= new_child
1356 if _n_kwmeth
== old_child
then
1357 if new_child
!= null then
1358 new_child
.parent
= self
1359 assert new_child
isa TKwmeth
1360 _n_kwmeth
= new_child
1366 if _n_methid
== old_child
then
1367 if new_child
!= null then
1368 new_child
.parent
= self
1369 assert new_child
isa AMethid
1370 _n_methid
= new_child
1376 if _n_signature
== old_child
then
1377 if new_child
!= null then
1378 new_child
.parent
= self
1379 assert new_child
isa ASignature
1380 _n_signature
= new_child
1388 redef fun visit_all
(v
: Visitor)
1390 if _n_doc
!= null then
1391 v
.enter_visit
(_n_doc
.as(not null))
1393 if _n_kwredef
!= null then
1394 v
.enter_visit
(_n_kwredef
.as(not null))
1396 v
.enter_visit
(_n_visibility
)
1397 v
.enter_visit
(_n_kwmeth
)
1398 v
.enter_visit
(_n_methid
)
1399 v
.enter_visit
(_n_signature
)
1402 redef class AInternMethPropdef
1403 private init empty_init
do end
1405 init init_ainternmethpropdef
(
1406 n_doc
: nullable ADoc,
1407 n_kwredef
: nullable TKwredef,
1408 n_visibility
: nullable AVisibility,
1409 n_kwmeth
: nullable TKwmeth,
1410 n_methid
: nullable AMethid,
1411 n_signature
: nullable ASignature
1416 if n_doc
!= null then
1419 _n_kwredef
= n_kwredef
1420 if n_kwredef
!= null then
1421 n_kwredef
.parent
= self
1423 _n_visibility
= n_visibility
.as(not null)
1424 n_visibility
.parent
= self
1425 _n_kwmeth
= n_kwmeth
.as(not null)
1426 n_kwmeth
.parent
= self
1427 _n_methid
= n_methid
.as(not null)
1428 n_methid
.parent
= self
1429 _n_signature
= n_signature
.as(not null)
1430 n_signature
.parent
= self
1433 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1435 if _n_doc
== old_child
then
1436 if new_child
!= null then
1437 new_child
.parent
= self
1438 assert new_child
isa ADoc
1445 if _n_kwredef
== old_child
then
1446 if new_child
!= null then
1447 new_child
.parent
= self
1448 assert new_child
isa TKwredef
1449 _n_kwredef
= new_child
1455 if _n_visibility
== old_child
then
1456 if new_child
!= null then
1457 new_child
.parent
= self
1458 assert new_child
isa AVisibility
1459 _n_visibility
= new_child
1465 if _n_kwmeth
== old_child
then
1466 if new_child
!= null then
1467 new_child
.parent
= self
1468 assert new_child
isa TKwmeth
1469 _n_kwmeth
= new_child
1475 if _n_methid
== old_child
then
1476 if new_child
!= null then
1477 new_child
.parent
= self
1478 assert new_child
isa AMethid
1479 _n_methid
= new_child
1485 if _n_signature
== old_child
then
1486 if new_child
!= null then
1487 new_child
.parent
= self
1488 assert new_child
isa ASignature
1489 _n_signature
= new_child
1497 redef fun visit_all
(v
: Visitor)
1499 if _n_doc
!= null then
1500 v
.enter_visit
(_n_doc
.as(not null))
1502 if _n_kwredef
!= null then
1503 v
.enter_visit
(_n_kwredef
.as(not null))
1505 v
.enter_visit
(_n_visibility
)
1506 v
.enter_visit
(_n_kwmeth
)
1507 v
.enter_visit
(_n_methid
)
1508 v
.enter_visit
(_n_signature
)
1511 redef class AExternMethPropdef
1512 private init empty_init
do end
1514 init init_aexternmethpropdef
(
1515 n_doc
: nullable ADoc,
1516 n_kwredef
: nullable TKwredef,
1517 n_visibility
: nullable AVisibility,
1518 n_kwmeth
: nullable TKwmeth,
1519 n_methid
: nullable AMethid,
1520 n_signature
: nullable ASignature,
1521 n_extern
: nullable TString,
1522 n_extern_calls
: nullable AExternCalls,
1523 n_extern_code_block
: nullable AExternCodeBlock
1528 if n_doc
!= null then
1531 _n_kwredef
= n_kwredef
1532 if n_kwredef
!= null then
1533 n_kwredef
.parent
= self
1535 _n_visibility
= n_visibility
.as(not null)
1536 n_visibility
.parent
= self
1537 _n_kwmeth
= n_kwmeth
.as(not null)
1538 n_kwmeth
.parent
= self
1539 _n_methid
= n_methid
.as(not null)
1540 n_methid
.parent
= self
1541 _n_signature
= n_signature
.as(not null)
1542 n_signature
.parent
= self
1543 _n_extern
= n_extern
1544 if n_extern
!= null then
1545 n_extern
.parent
= self
1547 _n_extern_calls
= n_extern_calls
1548 if n_extern_calls
!= null then
1549 n_extern_calls
.parent
= self
1551 _n_extern_code_block
= n_extern_code_block
1552 if n_extern_code_block
!= null then
1553 n_extern_code_block
.parent
= self
1557 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1559 if _n_doc
== old_child
then
1560 if new_child
!= null then
1561 new_child
.parent
= self
1562 assert new_child
isa ADoc
1569 if _n_kwredef
== old_child
then
1570 if new_child
!= null then
1571 new_child
.parent
= self
1572 assert new_child
isa TKwredef
1573 _n_kwredef
= new_child
1579 if _n_visibility
== old_child
then
1580 if new_child
!= null then
1581 new_child
.parent
= self
1582 assert new_child
isa AVisibility
1583 _n_visibility
= new_child
1589 if _n_kwmeth
== old_child
then
1590 if new_child
!= null then
1591 new_child
.parent
= self
1592 assert new_child
isa TKwmeth
1593 _n_kwmeth
= new_child
1599 if _n_methid
== old_child
then
1600 if new_child
!= null then
1601 new_child
.parent
= self
1602 assert new_child
isa AMethid
1603 _n_methid
= new_child
1609 if _n_signature
== old_child
then
1610 if new_child
!= null then
1611 new_child
.parent
= self
1612 assert new_child
isa ASignature
1613 _n_signature
= new_child
1619 if _n_extern
== old_child
then
1620 if new_child
!= null then
1621 new_child
.parent
= self
1622 assert new_child
isa TString
1623 _n_extern
= new_child
1629 if _n_extern_calls
== old_child
then
1630 if new_child
!= null then
1631 new_child
.parent
= self
1632 assert new_child
isa AExternCalls
1633 _n_extern_calls
= new_child
1635 _n_extern_calls
= null
1639 if _n_extern_code_block
== old_child
then
1640 if new_child
!= null then
1641 new_child
.parent
= self
1642 assert new_child
isa AExternCodeBlock
1643 _n_extern_code_block
= new_child
1645 _n_extern_code_block
= null
1651 redef fun visit_all
(v
: Visitor)
1653 if _n_doc
!= null then
1654 v
.enter_visit
(_n_doc
.as(not null))
1656 if _n_kwredef
!= null then
1657 v
.enter_visit
(_n_kwredef
.as(not null))
1659 v
.enter_visit
(_n_visibility
)
1660 v
.enter_visit
(_n_kwmeth
)
1661 v
.enter_visit
(_n_methid
)
1662 v
.enter_visit
(_n_signature
)
1663 if _n_extern
!= null then
1664 v
.enter_visit
(_n_extern
.as(not null))
1666 if _n_extern_calls
!= null then
1667 v
.enter_visit
(_n_extern_calls
.as(not null))
1669 if _n_extern_code_block
!= null then
1670 v
.enter_visit
(_n_extern_code_block
.as(not null))
1674 redef class AConcreteMethPropdef
1675 private init empty_init
do end
1677 init init_aconcretemethpropdef
(
1678 n_doc
: nullable ADoc,
1679 n_kwredef
: nullable TKwredef,
1680 n_visibility
: nullable AVisibility,
1681 n_kwmeth
: nullable TKwmeth,
1682 n_methid
: nullable AMethid,
1683 n_signature
: nullable ASignature,
1684 n_block
: nullable AExpr
1689 if n_doc
!= null then
1692 _n_kwredef
= n_kwredef
1693 if n_kwredef
!= null then
1694 n_kwredef
.parent
= self
1696 _n_visibility
= n_visibility
.as(not null)
1697 n_visibility
.parent
= self
1698 _n_kwmeth
= n_kwmeth
.as(not null)
1699 n_kwmeth
.parent
= self
1700 _n_methid
= n_methid
.as(not null)
1701 n_methid
.parent
= self
1702 _n_signature
= n_signature
.as(not null)
1703 n_signature
.parent
= self
1705 if n_block
!= null then
1706 n_block
.parent
= self
1710 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1712 if _n_doc
== old_child
then
1713 if new_child
!= null then
1714 new_child
.parent
= self
1715 assert new_child
isa ADoc
1722 if _n_kwredef
== old_child
then
1723 if new_child
!= null then
1724 new_child
.parent
= self
1725 assert new_child
isa TKwredef
1726 _n_kwredef
= new_child
1732 if _n_visibility
== old_child
then
1733 if new_child
!= null then
1734 new_child
.parent
= self
1735 assert new_child
isa AVisibility
1736 _n_visibility
= new_child
1742 if _n_kwmeth
== old_child
then
1743 if new_child
!= null then
1744 new_child
.parent
= self
1745 assert new_child
isa TKwmeth
1746 _n_kwmeth
= new_child
1752 if _n_methid
== old_child
then
1753 if new_child
!= null then
1754 new_child
.parent
= self
1755 assert new_child
isa AMethid
1756 _n_methid
= new_child
1762 if _n_signature
== old_child
then
1763 if new_child
!= null then
1764 new_child
.parent
= self
1765 assert new_child
isa ASignature
1766 _n_signature
= new_child
1772 if _n_block
== old_child
then
1773 if new_child
!= null then
1774 new_child
.parent
= self
1775 assert new_child
isa AExpr
1776 _n_block
= new_child
1784 redef fun visit_all
(v
: Visitor)
1786 if _n_doc
!= null then
1787 v
.enter_visit
(_n_doc
.as(not null))
1789 if _n_kwredef
!= null then
1790 v
.enter_visit
(_n_kwredef
.as(not null))
1792 v
.enter_visit
(_n_visibility
)
1793 v
.enter_visit
(_n_kwmeth
)
1794 v
.enter_visit
(_n_methid
)
1795 v
.enter_visit
(_n_signature
)
1796 if _n_block
!= null then
1797 v
.enter_visit
(_n_block
.as(not null))
1801 redef class AConcreteInitPropdef
1802 private init empty_init
do end
1804 init init_aconcreteinitpropdef
(
1805 n_doc
: nullable ADoc,
1806 n_kwredef
: nullable TKwredef,
1807 n_visibility
: nullable AVisibility,
1808 n_kwinit
: nullable TKwinit,
1809 n_methid
: nullable AMethid,
1810 n_signature
: nullable ASignature,
1811 n_block
: nullable AExpr
1816 if n_doc
!= null then
1819 _n_kwredef
= n_kwredef
1820 if n_kwredef
!= null then
1821 n_kwredef
.parent
= self
1823 _n_visibility
= n_visibility
.as(not null)
1824 n_visibility
.parent
= self
1825 _n_kwinit
= n_kwinit
.as(not null)
1826 n_kwinit
.parent
= self
1827 _n_methid
= n_methid
1828 if n_methid
!= null then
1829 n_methid
.parent
= self
1831 _n_signature
= n_signature
.as(not null)
1832 n_signature
.parent
= self
1834 if n_block
!= null then
1835 n_block
.parent
= self
1839 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1841 if _n_doc
== old_child
then
1842 if new_child
!= null then
1843 new_child
.parent
= self
1844 assert new_child
isa ADoc
1851 if _n_kwredef
== old_child
then
1852 if new_child
!= null then
1853 new_child
.parent
= self
1854 assert new_child
isa TKwredef
1855 _n_kwredef
= new_child
1861 if _n_visibility
== old_child
then
1862 if new_child
!= null then
1863 new_child
.parent
= self
1864 assert new_child
isa AVisibility
1865 _n_visibility
= new_child
1871 if _n_kwinit
== old_child
then
1872 if new_child
!= null then
1873 new_child
.parent
= self
1874 assert new_child
isa TKwinit
1875 _n_kwinit
= new_child
1881 if _n_methid
== old_child
then
1882 if new_child
!= null then
1883 new_child
.parent
= self
1884 assert new_child
isa AMethid
1885 _n_methid
= new_child
1891 if _n_signature
== old_child
then
1892 if new_child
!= null then
1893 new_child
.parent
= self
1894 assert new_child
isa ASignature
1895 _n_signature
= new_child
1901 if _n_block
== old_child
then
1902 if new_child
!= null then
1903 new_child
.parent
= self
1904 assert new_child
isa AExpr
1905 _n_block
= new_child
1913 redef fun visit_all
(v
: Visitor)
1915 if _n_doc
!= null then
1916 v
.enter_visit
(_n_doc
.as(not null))
1918 if _n_kwredef
!= null then
1919 v
.enter_visit
(_n_kwredef
.as(not null))
1921 v
.enter_visit
(_n_visibility
)
1922 v
.enter_visit
(_n_kwinit
)
1923 if _n_methid
!= null then
1924 v
.enter_visit
(_n_methid
.as(not null))
1926 v
.enter_visit
(_n_signature
)
1927 if _n_block
!= null then
1928 v
.enter_visit
(_n_block
.as(not null))
1932 redef class AExternInitPropdef
1933 private init empty_init
do end
1935 init init_aexterninitpropdef
(
1936 n_doc
: nullable ADoc,
1937 n_kwredef
: nullable TKwredef,
1938 n_visibility
: nullable AVisibility,
1939 n_kwnew
: nullable TKwnew,
1940 n_methid
: nullable AMethid,
1941 n_signature
: nullable ASignature,
1942 n_extern
: nullable TString,
1943 n_extern_calls
: nullable AExternCalls,
1944 n_extern_code_block
: nullable AExternCodeBlock
1949 if n_doc
!= null then
1952 _n_kwredef
= n_kwredef
1953 if n_kwredef
!= null then
1954 n_kwredef
.parent
= self
1956 _n_visibility
= n_visibility
.as(not null)
1957 n_visibility
.parent
= self
1958 _n_kwnew
= n_kwnew
.as(not null)
1959 n_kwnew
.parent
= self
1960 _n_methid
= n_methid
1961 if n_methid
!= null then
1962 n_methid
.parent
= self
1964 _n_signature
= n_signature
.as(not null)
1965 n_signature
.parent
= self
1966 _n_extern
= n_extern
1967 if n_extern
!= null then
1968 n_extern
.parent
= self
1970 _n_extern_calls
= n_extern_calls
1971 if n_extern_calls
!= null then
1972 n_extern_calls
.parent
= self
1974 _n_extern_code_block
= n_extern_code_block
1975 if n_extern_code_block
!= null then
1976 n_extern_code_block
.parent
= self
1980 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1982 if _n_doc
== old_child
then
1983 if new_child
!= null then
1984 new_child
.parent
= self
1985 assert new_child
isa ADoc
1992 if _n_kwredef
== old_child
then
1993 if new_child
!= null then
1994 new_child
.parent
= self
1995 assert new_child
isa TKwredef
1996 _n_kwredef
= new_child
2002 if _n_visibility
== old_child
then
2003 if new_child
!= null then
2004 new_child
.parent
= self
2005 assert new_child
isa AVisibility
2006 _n_visibility
= new_child
2012 if _n_kwnew
== old_child
then
2013 if new_child
!= null then
2014 new_child
.parent
= self
2015 assert new_child
isa TKwnew
2016 _n_kwnew
= new_child
2022 if _n_methid
== old_child
then
2023 if new_child
!= null then
2024 new_child
.parent
= self
2025 assert new_child
isa AMethid
2026 _n_methid
= new_child
2032 if _n_signature
== old_child
then
2033 if new_child
!= null then
2034 new_child
.parent
= self
2035 assert new_child
isa ASignature
2036 _n_signature
= new_child
2042 if _n_extern
== old_child
then
2043 if new_child
!= null then
2044 new_child
.parent
= self
2045 assert new_child
isa TString
2046 _n_extern
= new_child
2052 if _n_extern_calls
== old_child
then
2053 if new_child
!= null then
2054 new_child
.parent
= self
2055 assert new_child
isa AExternCalls
2056 _n_extern_calls
= new_child
2058 _n_extern_calls
= null
2062 if _n_extern_code_block
== old_child
then
2063 if new_child
!= null then
2064 new_child
.parent
= self
2065 assert new_child
isa AExternCodeBlock
2066 _n_extern_code_block
= new_child
2068 _n_extern_code_block
= null
2074 redef fun visit_all
(v
: Visitor)
2076 if _n_doc
!= null then
2077 v
.enter_visit
(_n_doc
.as(not null))
2079 if _n_kwredef
!= null then
2080 v
.enter_visit
(_n_kwredef
.as(not null))
2082 v
.enter_visit
(_n_visibility
)
2083 v
.enter_visit
(_n_kwnew
)
2084 if _n_methid
!= null then
2085 v
.enter_visit
(_n_methid
.as(not null))
2087 v
.enter_visit
(_n_signature
)
2088 if _n_extern
!= null then
2089 v
.enter_visit
(_n_extern
.as(not null))
2091 if _n_extern_calls
!= null then
2092 v
.enter_visit
(_n_extern_calls
.as(not null))
2094 if _n_extern_code_block
!= null then
2095 v
.enter_visit
(_n_extern_code_block
.as(not null))
2099 redef class AMainMethPropdef
2100 private init empty_init
do end
2102 init init_amainmethpropdef
(
2103 n_kwredef
: nullable TKwredef,
2104 n_block
: nullable AExpr
2108 _n_kwredef
= n_kwredef
2109 if n_kwredef
!= null then
2110 n_kwredef
.parent
= self
2113 if n_block
!= null then
2114 n_block
.parent
= self
2118 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2120 if _n_kwredef
== old_child
then
2121 if new_child
!= null then
2122 new_child
.parent
= self
2123 assert new_child
isa TKwredef
2124 _n_kwredef
= new_child
2130 if _n_block
== old_child
then
2131 if new_child
!= null then
2132 new_child
.parent
= self
2133 assert new_child
isa AExpr
2134 _n_block
= new_child
2142 redef fun visit_all
(v
: Visitor)
2144 if _n_kwredef
!= null then
2145 v
.enter_visit
(_n_kwredef
.as(not null))
2147 if _n_block
!= null then
2148 v
.enter_visit
(_n_block
.as(not null))
2152 redef class ATypePropdef
2153 private init empty_init
do end
2155 init init_atypepropdef
(
2156 n_doc
: nullable ADoc,
2157 n_kwredef
: nullable TKwredef,
2158 n_visibility
: nullable AVisibility,
2159 n_kwtype
: nullable TKwtype,
2160 n_id
: nullable TClassid,
2161 n_type
: nullable AType
2166 if n_doc
!= null then
2169 _n_kwredef
= n_kwredef
2170 if n_kwredef
!= null then
2171 n_kwredef
.parent
= self
2173 _n_visibility
= n_visibility
.as(not null)
2174 n_visibility
.parent
= self
2175 _n_kwtype
= n_kwtype
.as(not null)
2176 n_kwtype
.parent
= self
2177 _n_id
= n_id
.as(not null)
2179 _n_type
= n_type
.as(not null)
2180 n_type
.parent
= self
2183 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2185 if _n_doc
== old_child
then
2186 if new_child
!= null then
2187 new_child
.parent
= self
2188 assert new_child
isa ADoc
2195 if _n_kwredef
== old_child
then
2196 if new_child
!= null then
2197 new_child
.parent
= self
2198 assert new_child
isa TKwredef
2199 _n_kwredef
= new_child
2205 if _n_visibility
== old_child
then
2206 if new_child
!= null then
2207 new_child
.parent
= self
2208 assert new_child
isa AVisibility
2209 _n_visibility
= new_child
2215 if _n_kwtype
== old_child
then
2216 if new_child
!= null then
2217 new_child
.parent
= self
2218 assert new_child
isa TKwtype
2219 _n_kwtype
= new_child
2225 if _n_id
== old_child
then
2226 if new_child
!= null then
2227 new_child
.parent
= self
2228 assert new_child
isa TClassid
2235 if _n_type
== old_child
then
2236 if new_child
!= null then
2237 new_child
.parent
= self
2238 assert new_child
isa AType
2247 redef fun visit_all
(v
: Visitor)
2249 if _n_doc
!= null then
2250 v
.enter_visit
(_n_doc
.as(not null))
2252 if _n_kwredef
!= null then
2253 v
.enter_visit
(_n_kwredef
.as(not null))
2255 v
.enter_visit
(_n_visibility
)
2256 v
.enter_visit
(_n_kwtype
)
2257 v
.enter_visit
(_n_id
)
2258 v
.enter_visit
(_n_type
)
2261 redef class AReadAble
2262 private init empty_init
do end
2264 init init_areadable
(
2265 n_kwredef
: nullable TKwredef,
2266 n_kwreadable
: nullable TKwreadable
2270 _n_kwredef
= n_kwredef
2271 if n_kwredef
!= null then
2272 n_kwredef
.parent
= self
2274 _n_kwreadable
= n_kwreadable
.as(not null)
2275 n_kwreadable
.parent
= self
2278 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2280 if _n_kwredef
== old_child
then
2281 if new_child
!= null then
2282 new_child
.parent
= self
2283 assert new_child
isa TKwredef
2284 _n_kwredef
= new_child
2290 if _n_kwreadable
== old_child
then
2291 if new_child
!= null then
2292 new_child
.parent
= self
2293 assert new_child
isa TKwreadable
2294 _n_kwreadable
= new_child
2302 redef fun visit_all
(v
: Visitor)
2304 if _n_kwredef
!= null then
2305 v
.enter_visit
(_n_kwredef
.as(not null))
2307 v
.enter_visit
(_n_kwreadable
)
2310 redef class AWriteAble
2311 private init empty_init
do end
2313 init init_awriteable
(
2314 n_kwredef
: nullable TKwredef,
2315 n_visibility
: nullable AVisibility,
2316 n_kwwritable
: nullable TKwwritable
2320 _n_kwredef
= n_kwredef
2321 if n_kwredef
!= null then
2322 n_kwredef
.parent
= self
2324 _n_visibility
= n_visibility
2325 if n_visibility
!= null then
2326 n_visibility
.parent
= self
2328 _n_kwwritable
= n_kwwritable
.as(not null)
2329 n_kwwritable
.parent
= self
2332 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2334 if _n_kwredef
== old_child
then
2335 if new_child
!= null then
2336 new_child
.parent
= self
2337 assert new_child
isa TKwredef
2338 _n_kwredef
= new_child
2344 if _n_visibility
== old_child
then
2345 if new_child
!= null then
2346 new_child
.parent
= self
2347 assert new_child
isa AVisibility
2348 _n_visibility
= new_child
2350 _n_visibility
= null
2354 if _n_kwwritable
== old_child
then
2355 if new_child
!= null then
2356 new_child
.parent
= self
2357 assert new_child
isa TKwwritable
2358 _n_kwwritable
= new_child
2366 redef fun visit_all
(v
: Visitor)
2368 if _n_kwredef
!= null then
2369 v
.enter_visit
(_n_kwredef
.as(not null))
2371 if _n_visibility
!= null then
2372 v
.enter_visit
(_n_visibility
.as(not null))
2374 v
.enter_visit
(_n_kwwritable
)
2377 redef class AIdMethid
2378 private init empty_init
do end
2380 init init_aidmethid
(
2385 _n_id
= n_id
.as(not null)
2389 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2391 if _n_id
== old_child
then
2392 if new_child
!= null then
2393 new_child
.parent
= self
2394 assert new_child
isa TId
2403 redef fun visit_all
(v
: Visitor)
2405 v
.enter_visit
(_n_id
)
2408 redef class APlusMethid
2409 private init empty_init
do end
2411 init init_aplusmethid
(
2412 n_plus
: nullable TPlus
2416 _n_plus
= n_plus
.as(not null)
2417 n_plus
.parent
= self
2420 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2422 if _n_plus
== old_child
then
2423 if new_child
!= null then
2424 new_child
.parent
= self
2425 assert new_child
isa TPlus
2434 redef fun visit_all
(v
: Visitor)
2436 v
.enter_visit
(_n_plus
)
2439 redef class AMinusMethid
2440 private init empty_init
do end
2442 init init_aminusmethid
(
2443 n_minus
: nullable TMinus
2447 _n_minus
= n_minus
.as(not null)
2448 n_minus
.parent
= self
2451 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2453 if _n_minus
== old_child
then
2454 if new_child
!= null then
2455 new_child
.parent
= self
2456 assert new_child
isa TMinus
2457 _n_minus
= new_child
2465 redef fun visit_all
(v
: Visitor)
2467 v
.enter_visit
(_n_minus
)
2470 redef class AStarMethid
2471 private init empty_init
do end
2473 init init_astarmethid
(
2474 n_star
: nullable TStar
2478 _n_star
= n_star
.as(not null)
2479 n_star
.parent
= self
2482 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2484 if _n_star
== old_child
then
2485 if new_child
!= null then
2486 new_child
.parent
= self
2487 assert new_child
isa TStar
2496 redef fun visit_all
(v
: Visitor)
2498 v
.enter_visit
(_n_star
)
2501 redef class ASlashMethid
2502 private init empty_init
do end
2504 init init_aslashmethid
(
2505 n_slash
: nullable TSlash
2509 _n_slash
= n_slash
.as(not null)
2510 n_slash
.parent
= self
2513 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2515 if _n_slash
== old_child
then
2516 if new_child
!= null then
2517 new_child
.parent
= self
2518 assert new_child
isa TSlash
2519 _n_slash
= new_child
2527 redef fun visit_all
(v
: Visitor)
2529 v
.enter_visit
(_n_slash
)
2532 redef class APercentMethid
2533 private init empty_init
do end
2535 init init_apercentmethid
(
2536 n_percent
: nullable TPercent
2540 _n_percent
= n_percent
.as(not null)
2541 n_percent
.parent
= self
2544 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2546 if _n_percent
== old_child
then
2547 if new_child
!= null then
2548 new_child
.parent
= self
2549 assert new_child
isa TPercent
2550 _n_percent
= new_child
2558 redef fun visit_all
(v
: Visitor)
2560 v
.enter_visit
(_n_percent
)
2563 redef class AEqMethid
2564 private init empty_init
do end
2566 init init_aeqmethid
(
2571 _n_eq
= n_eq
.as(not null)
2575 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2577 if _n_eq
== old_child
then
2578 if new_child
!= null then
2579 new_child
.parent
= self
2580 assert new_child
isa TEq
2589 redef fun visit_all
(v
: Visitor)
2591 v
.enter_visit
(_n_eq
)
2594 redef class ANeMethid
2595 private init empty_init
do end
2597 init init_anemethid
(
2602 _n_ne
= n_ne
.as(not null)
2606 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2608 if _n_ne
== old_child
then
2609 if new_child
!= null then
2610 new_child
.parent
= self
2611 assert new_child
isa TNe
2620 redef fun visit_all
(v
: Visitor)
2622 v
.enter_visit
(_n_ne
)
2625 redef class ALeMethid
2626 private init empty_init
do end
2628 init init_alemethid
(
2633 _n_le
= n_le
.as(not null)
2637 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2639 if _n_le
== old_child
then
2640 if new_child
!= null then
2641 new_child
.parent
= self
2642 assert new_child
isa TLe
2651 redef fun visit_all
(v
: Visitor)
2653 v
.enter_visit
(_n_le
)
2656 redef class AGeMethid
2657 private init empty_init
do end
2659 init init_agemethid
(
2664 _n_ge
= n_ge
.as(not null)
2668 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2670 if _n_ge
== old_child
then
2671 if new_child
!= null then
2672 new_child
.parent
= self
2673 assert new_child
isa TGe
2682 redef fun visit_all
(v
: Visitor)
2684 v
.enter_visit
(_n_ge
)
2687 redef class ALtMethid
2688 private init empty_init
do end
2690 init init_altmethid
(
2695 _n_lt
= n_lt
.as(not null)
2699 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2701 if _n_lt
== old_child
then
2702 if new_child
!= null then
2703 new_child
.parent
= self
2704 assert new_child
isa TLt
2713 redef fun visit_all
(v
: Visitor)
2715 v
.enter_visit
(_n_lt
)
2718 redef class AGtMethid
2719 private init empty_init
do end
2721 init init_agtmethid
(
2726 _n_gt
= n_gt
.as(not null)
2730 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2732 if _n_gt
== old_child
then
2733 if new_child
!= null then
2734 new_child
.parent
= self
2735 assert new_child
isa TGt
2744 redef fun visit_all
(v
: Visitor)
2746 v
.enter_visit
(_n_gt
)
2749 redef class ALlMethid
2750 private init empty_init
do end
2752 init init_allmethid
(
2757 _n_ll
= n_ll
.as(not null)
2761 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2763 if _n_ll
== old_child
then
2764 if new_child
!= null then
2765 new_child
.parent
= self
2766 assert new_child
isa TLl
2775 redef fun visit_all
(v
: Visitor)
2777 v
.enter_visit
(_n_ll
)
2780 redef class AGgMethid
2781 private init empty_init
do end
2783 init init_aggmethid
(
2788 _n_gg
= n_gg
.as(not null)
2792 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2794 if _n_gg
== old_child
then
2795 if new_child
!= null then
2796 new_child
.parent
= self
2797 assert new_child
isa TGg
2806 redef fun visit_all
(v
: Visitor)
2808 v
.enter_visit
(_n_gg
)
2811 redef class ABraMethid
2812 private init empty_init
do end
2814 init init_abramethid
(
2815 n_obra
: nullable TObra,
2816 n_cbra
: nullable TCbra
2820 _n_obra
= n_obra
.as(not null)
2821 n_obra
.parent
= self
2822 _n_cbra
= n_cbra
.as(not null)
2823 n_cbra
.parent
= self
2826 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2828 if _n_obra
== old_child
then
2829 if new_child
!= null then
2830 new_child
.parent
= self
2831 assert new_child
isa TObra
2838 if _n_cbra
== old_child
then
2839 if new_child
!= null then
2840 new_child
.parent
= self
2841 assert new_child
isa TCbra
2850 redef fun visit_all
(v
: Visitor)
2852 v
.enter_visit
(_n_obra
)
2853 v
.enter_visit
(_n_cbra
)
2856 redef class AStarshipMethid
2857 private init empty_init
do end
2859 init init_astarshipmethid
(
2860 n_starship
: nullable TStarship
2864 _n_starship
= n_starship
.as(not null)
2865 n_starship
.parent
= self
2868 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2870 if _n_starship
== old_child
then
2871 if new_child
!= null then
2872 new_child
.parent
= self
2873 assert new_child
isa TStarship
2874 _n_starship
= new_child
2882 redef fun visit_all
(v
: Visitor)
2884 v
.enter_visit
(_n_starship
)
2887 redef class AAssignMethid
2888 private init empty_init
do end
2890 init init_aassignmethid
(
2892 n_assign
: nullable TAssign
2896 _n_id
= n_id
.as(not null)
2898 _n_assign
= n_assign
.as(not null)
2899 n_assign
.parent
= self
2902 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2904 if _n_id
== old_child
then
2905 if new_child
!= null then
2906 new_child
.parent
= self
2907 assert new_child
isa TId
2914 if _n_assign
== old_child
then
2915 if new_child
!= null then
2916 new_child
.parent
= self
2917 assert new_child
isa TAssign
2918 _n_assign
= new_child
2926 redef fun visit_all
(v
: Visitor)
2928 v
.enter_visit
(_n_id
)
2929 v
.enter_visit
(_n_assign
)
2932 redef class ABraassignMethid
2933 private init empty_init
do end
2935 init init_abraassignmethid
(
2936 n_obra
: nullable TObra,
2937 n_cbra
: nullable TCbra,
2938 n_assign
: nullable TAssign
2942 _n_obra
= n_obra
.as(not null)
2943 n_obra
.parent
= self
2944 _n_cbra
= n_cbra
.as(not null)
2945 n_cbra
.parent
= self
2946 _n_assign
= n_assign
.as(not null)
2947 n_assign
.parent
= self
2950 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2952 if _n_obra
== old_child
then
2953 if new_child
!= null then
2954 new_child
.parent
= self
2955 assert new_child
isa TObra
2962 if _n_cbra
== old_child
then
2963 if new_child
!= null then
2964 new_child
.parent
= self
2965 assert new_child
isa TCbra
2972 if _n_assign
== old_child
then
2973 if new_child
!= null then
2974 new_child
.parent
= self
2975 assert new_child
isa TAssign
2976 _n_assign
= new_child
2984 redef fun visit_all
(v
: Visitor)
2986 v
.enter_visit
(_n_obra
)
2987 v
.enter_visit
(_n_cbra
)
2988 v
.enter_visit
(_n_assign
)
2991 redef class ASignature
2992 private init empty_init
do end
2994 init init_asignature
(
2995 n_opar
: nullable TOpar,
2996 n_params
: Collection[Object], # Should be Collection[AParam]
2997 n_cpar
: nullable TCpar,
2998 n_type
: nullable AType,
2999 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
3004 if n_opar
!= null then
3005 n_opar
.parent
= self
3007 for n
in n_params
do
3013 if n_cpar
!= null then
3014 n_cpar
.parent
= self
3017 if n_type
!= null then
3018 n_type
.parent
= self
3020 for n
in n_closure_decls
do
3021 assert n
isa AClosureDecl
3022 _n_closure_decls
.add
(n
)
3027 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3029 if _n_opar
== old_child
then
3030 if new_child
!= null then
3031 new_child
.parent
= self
3032 assert new_child
isa TOpar
3039 for i
in [0.._n_params
.length
[ do
3040 if _n_params
[i
] == old_child
then
3041 if new_child
!= null then
3042 assert new_child
isa AParam
3043 _n_params
[i
] = new_child
3044 new_child
.parent
= self
3046 _n_params
.remove_at
(i
)
3051 if _n_cpar
== old_child
then
3052 if new_child
!= null then
3053 new_child
.parent
= self
3054 assert new_child
isa TCpar
3061 if _n_type
== old_child
then
3062 if new_child
!= null then
3063 new_child
.parent
= self
3064 assert new_child
isa AType
3071 for i
in [0.._n_closure_decls
.length
[ do
3072 if _n_closure_decls
[i
] == old_child
then
3073 if new_child
!= null then
3074 assert new_child
isa AClosureDecl
3075 _n_closure_decls
[i
] = new_child
3076 new_child
.parent
= self
3078 _n_closure_decls
.remove_at
(i
)
3085 redef fun visit_all
(v
: Visitor)
3087 if _n_opar
!= null then
3088 v
.enter_visit
(_n_opar
.as(not null))
3090 for n
in _n_params
do
3093 if _n_cpar
!= null then
3094 v
.enter_visit
(_n_cpar
.as(not null))
3096 if _n_type
!= null then
3097 v
.enter_visit
(_n_type
.as(not null))
3099 for n
in _n_closure_decls
do
3105 private init empty_init
do end
3109 n_type
: nullable AType,
3110 n_dotdotdot
: nullable TDotdotdot
3114 _n_id
= n_id
.as(not null)
3117 if n_type
!= null then
3118 n_type
.parent
= self
3120 _n_dotdotdot
= n_dotdotdot
3121 if n_dotdotdot
!= null then
3122 n_dotdotdot
.parent
= self
3126 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3128 if _n_id
== old_child
then
3129 if new_child
!= null then
3130 new_child
.parent
= self
3131 assert new_child
isa TId
3138 if _n_type
== old_child
then
3139 if new_child
!= null then
3140 new_child
.parent
= self
3141 assert new_child
isa AType
3148 if _n_dotdotdot
== old_child
then
3149 if new_child
!= null then
3150 new_child
.parent
= self
3151 assert new_child
isa TDotdotdot
3152 _n_dotdotdot
= new_child
3160 redef fun visit_all
(v
: Visitor)
3162 v
.enter_visit
(_n_id
)
3163 if _n_type
!= null then
3164 v
.enter_visit
(_n_type
.as(not null))
3166 if _n_dotdotdot
!= null then
3167 v
.enter_visit
(_n_dotdotdot
.as(not null))
3171 redef class AClosureDecl
3172 private init empty_init
do end
3174 init init_aclosuredecl
(
3175 n_kwbreak
: nullable TKwbreak,
3176 n_bang
: nullable TBang,
3178 n_signature
: nullable ASignature,
3179 n_expr
: nullable AExpr
3183 _n_kwbreak
= n_kwbreak
3184 if n_kwbreak
!= null then
3185 n_kwbreak
.parent
= self
3187 _n_bang
= n_bang
.as(not null)
3188 n_bang
.parent
= self
3189 _n_id
= n_id
.as(not null)
3191 _n_signature
= n_signature
.as(not null)
3192 n_signature
.parent
= self
3194 if n_expr
!= null then
3195 n_expr
.parent
= self
3199 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3201 if _n_kwbreak
== old_child
then
3202 if new_child
!= null then
3203 new_child
.parent
= self
3204 assert new_child
isa TKwbreak
3205 _n_kwbreak
= new_child
3211 if _n_bang
== old_child
then
3212 if new_child
!= null then
3213 new_child
.parent
= self
3214 assert new_child
isa TBang
3221 if _n_id
== old_child
then
3222 if new_child
!= null then
3223 new_child
.parent
= self
3224 assert new_child
isa TId
3231 if _n_signature
== old_child
then
3232 if new_child
!= null then
3233 new_child
.parent
= self
3234 assert new_child
isa ASignature
3235 _n_signature
= new_child
3241 if _n_expr
== old_child
then
3242 if new_child
!= null then
3243 new_child
.parent
= self
3244 assert new_child
isa AExpr
3253 redef fun visit_all
(v
: Visitor)
3255 if _n_kwbreak
!= null then
3256 v
.enter_visit
(_n_kwbreak
.as(not null))
3258 v
.enter_visit
(_n_bang
)
3259 v
.enter_visit
(_n_id
)
3260 v
.enter_visit
(_n_signature
)
3261 if _n_expr
!= null then
3262 v
.enter_visit
(_n_expr
.as(not null))
3267 private init empty_init
do end
3270 n_kwnullable
: nullable TKwnullable,
3271 n_id
: nullable TClassid,
3272 n_types
: Collection[Object] # Should be Collection[AType]
3276 _n_kwnullable
= n_kwnullable
3277 if n_kwnullable
!= null then
3278 n_kwnullable
.parent
= self
3280 _n_id
= n_id
.as(not null)
3289 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3291 if _n_kwnullable
== old_child
then
3292 if new_child
!= null then
3293 new_child
.parent
= self
3294 assert new_child
isa TKwnullable
3295 _n_kwnullable
= new_child
3297 _n_kwnullable
= null
3301 if _n_id
== old_child
then
3302 if new_child
!= null then
3303 new_child
.parent
= self
3304 assert new_child
isa TClassid
3311 for i
in [0.._n_types
.length
[ do
3312 if _n_types
[i
] == old_child
then
3313 if new_child
!= null then
3314 assert new_child
isa AType
3315 _n_types
[i
] = new_child
3316 new_child
.parent
= self
3318 _n_types
.remove_at
(i
)
3325 redef fun visit_all
(v
: Visitor)
3327 if _n_kwnullable
!= null then
3328 v
.enter_visit
(_n_kwnullable
.as(not null))
3330 v
.enter_visit
(_n_id
)
3331 for n
in _n_types
do
3337 private init empty_init
do end
3340 n_kwlabel
: nullable TKwlabel,
3345 _n_kwlabel
= n_kwlabel
.as(not null)
3346 n_kwlabel
.parent
= self
3347 _n_id
= n_id
.as(not null)
3351 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3353 if _n_kwlabel
== old_child
then
3354 if new_child
!= null then
3355 new_child
.parent
= self
3356 assert new_child
isa TKwlabel
3357 _n_kwlabel
= new_child
3363 if _n_id
== old_child
then
3364 if new_child
!= null then
3365 new_child
.parent
= self
3366 assert new_child
isa TId
3375 redef fun visit_all
(v
: Visitor)
3377 v
.enter_visit
(_n_kwlabel
)
3378 v
.enter_visit
(_n_id
)
3381 redef class ABlockExpr
3382 private init empty_init
do end
3384 init init_ablockexpr
(
3385 n_expr
: Collection[Object], # Should be Collection[AExpr]
3386 n_kwend
: nullable TKwend
3396 if n_kwend
!= null then
3397 n_kwend
.parent
= self
3401 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3403 for i
in [0.._n_expr
.length
[ do
3404 if _n_expr
[i
] == old_child
then
3405 if new_child
!= null then
3406 assert new_child
isa AExpr
3407 _n_expr
[i
] = new_child
3408 new_child
.parent
= self
3410 _n_expr
.remove_at
(i
)
3415 if _n_kwend
== old_child
then
3416 if new_child
!= null then
3417 new_child
.parent
= self
3418 assert new_child
isa TKwend
3419 _n_kwend
= new_child
3427 redef fun visit_all
(v
: Visitor)
3432 if _n_kwend
!= null then
3433 v
.enter_visit
(_n_kwend
.as(not null))
3437 redef class AVardeclExpr
3438 private init empty_init
do end
3440 init init_avardeclexpr
(
3441 n_kwvar
: nullable TKwvar,
3443 n_type
: nullable AType,
3444 n_assign
: nullable TAssign,
3445 n_expr
: nullable AExpr
3449 _n_kwvar
= n_kwvar
.as(not null)
3450 n_kwvar
.parent
= self
3451 _n_id
= n_id
.as(not null)
3454 if n_type
!= null then
3455 n_type
.parent
= self
3457 _n_assign
= n_assign
3458 if n_assign
!= null then
3459 n_assign
.parent
= self
3462 if n_expr
!= null then
3463 n_expr
.parent
= self
3467 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3469 if _n_kwvar
== old_child
then
3470 if new_child
!= null then
3471 new_child
.parent
= self
3472 assert new_child
isa TKwvar
3473 _n_kwvar
= new_child
3479 if _n_id
== old_child
then
3480 if new_child
!= null then
3481 new_child
.parent
= self
3482 assert new_child
isa TId
3489 if _n_type
== old_child
then
3490 if new_child
!= null then
3491 new_child
.parent
= self
3492 assert new_child
isa AType
3499 if _n_assign
== old_child
then
3500 if new_child
!= null then
3501 new_child
.parent
= self
3502 assert new_child
isa TAssign
3503 _n_assign
= new_child
3509 if _n_expr
== old_child
then
3510 if new_child
!= null then
3511 new_child
.parent
= self
3512 assert new_child
isa AExpr
3521 redef fun visit_all
(v
: Visitor)
3523 v
.enter_visit
(_n_kwvar
)
3524 v
.enter_visit
(_n_id
)
3525 if _n_type
!= null then
3526 v
.enter_visit
(_n_type
.as(not null))
3528 if _n_assign
!= null then
3529 v
.enter_visit
(_n_assign
.as(not null))
3531 if _n_expr
!= null then
3532 v
.enter_visit
(_n_expr
.as(not null))
3536 redef class AReturnExpr
3537 private init empty_init
do end
3539 init init_areturnexpr
(
3540 n_kwreturn
: nullable TKwreturn,
3541 n_expr
: nullable AExpr
3545 _n_kwreturn
= n_kwreturn
3546 if n_kwreturn
!= null then
3547 n_kwreturn
.parent
= self
3550 if n_expr
!= null then
3551 n_expr
.parent
= self
3555 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3557 if _n_kwreturn
== old_child
then
3558 if new_child
!= null then
3559 new_child
.parent
= self
3560 assert new_child
isa TKwreturn
3561 _n_kwreturn
= new_child
3567 if _n_expr
== old_child
then
3568 if new_child
!= null then
3569 new_child
.parent
= self
3570 assert new_child
isa AExpr
3579 redef fun visit_all
(v
: Visitor)
3581 if _n_kwreturn
!= null then
3582 v
.enter_visit
(_n_kwreturn
.as(not null))
3584 if _n_expr
!= null then
3585 v
.enter_visit
(_n_expr
.as(not null))
3589 redef class ABreakExpr
3590 private init empty_init
do end
3592 init init_abreakexpr
(
3593 n_kwbreak
: nullable TKwbreak,
3594 n_label
: nullable ALabel,
3595 n_expr
: nullable AExpr
3599 _n_kwbreak
= n_kwbreak
.as(not null)
3600 n_kwbreak
.parent
= self
3602 if n_label
!= null then
3603 n_label
.parent
= self
3606 if n_expr
!= null then
3607 n_expr
.parent
= self
3611 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3613 if _n_kwbreak
== old_child
then
3614 if new_child
!= null then
3615 new_child
.parent
= self
3616 assert new_child
isa TKwbreak
3617 _n_kwbreak
= new_child
3623 if _n_label
== old_child
then
3624 if new_child
!= null then
3625 new_child
.parent
= self
3626 assert new_child
isa ALabel
3627 _n_label
= new_child
3633 if _n_expr
== old_child
then
3634 if new_child
!= null then
3635 new_child
.parent
= self
3636 assert new_child
isa AExpr
3645 redef fun visit_all
(v
: Visitor)
3647 v
.enter_visit
(_n_kwbreak
)
3648 if _n_label
!= null then
3649 v
.enter_visit
(_n_label
.as(not null))
3651 if _n_expr
!= null then
3652 v
.enter_visit
(_n_expr
.as(not null))
3656 redef class AAbortExpr
3657 private init empty_init
do end
3659 init init_aabortexpr
(
3660 n_kwabort
: nullable TKwabort
3664 _n_kwabort
= n_kwabort
.as(not null)
3665 n_kwabort
.parent
= self
3668 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3670 if _n_kwabort
== old_child
then
3671 if new_child
!= null then
3672 new_child
.parent
= self
3673 assert new_child
isa TKwabort
3674 _n_kwabort
= new_child
3682 redef fun visit_all
(v
: Visitor)
3684 v
.enter_visit
(_n_kwabort
)
3687 redef class AContinueExpr
3688 private init empty_init
do end
3690 init init_acontinueexpr
(
3691 n_kwcontinue
: nullable TKwcontinue,
3692 n_label
: nullable ALabel,
3693 n_expr
: nullable AExpr
3697 _n_kwcontinue
= n_kwcontinue
3698 if n_kwcontinue
!= null then
3699 n_kwcontinue
.parent
= self
3702 if n_label
!= null then
3703 n_label
.parent
= self
3706 if n_expr
!= null then
3707 n_expr
.parent
= self
3711 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3713 if _n_kwcontinue
== old_child
then
3714 if new_child
!= null then
3715 new_child
.parent
= self
3716 assert new_child
isa TKwcontinue
3717 _n_kwcontinue
= new_child
3719 _n_kwcontinue
= null
3723 if _n_label
== old_child
then
3724 if new_child
!= null then
3725 new_child
.parent
= self
3726 assert new_child
isa ALabel
3727 _n_label
= new_child
3733 if _n_expr
== old_child
then
3734 if new_child
!= null then
3735 new_child
.parent
= self
3736 assert new_child
isa AExpr
3745 redef fun visit_all
(v
: Visitor)
3747 if _n_kwcontinue
!= null then
3748 v
.enter_visit
(_n_kwcontinue
.as(not null))
3750 if _n_label
!= null then
3751 v
.enter_visit
(_n_label
.as(not null))
3753 if _n_expr
!= null then
3754 v
.enter_visit
(_n_expr
.as(not null))
3759 private init empty_init
do end
3762 n_kwdo
: nullable TKwdo,
3763 n_block
: nullable AExpr,
3764 n_label
: nullable ALabel
3768 _n_kwdo
= n_kwdo
.as(not null)
3769 n_kwdo
.parent
= self
3771 if n_block
!= null then
3772 n_block
.parent
= self
3775 if n_label
!= null then
3776 n_label
.parent
= self
3780 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3782 if _n_kwdo
== old_child
then
3783 if new_child
!= null then
3784 new_child
.parent
= self
3785 assert new_child
isa TKwdo
3792 if _n_block
== old_child
then
3793 if new_child
!= null then
3794 new_child
.parent
= self
3795 assert new_child
isa AExpr
3796 _n_block
= new_child
3802 if _n_label
== old_child
then
3803 if new_child
!= null then
3804 new_child
.parent
= self
3805 assert new_child
isa ALabel
3806 _n_label
= new_child
3814 redef fun visit_all
(v
: Visitor)
3816 v
.enter_visit
(_n_kwdo
)
3817 if _n_block
!= null then
3818 v
.enter_visit
(_n_block
.as(not null))
3820 if _n_label
!= null then
3821 v
.enter_visit
(_n_label
.as(not null))
3826 private init empty_init
do end
3829 n_kwif
: nullable TKwif,
3830 n_expr
: nullable AExpr,
3831 n_then
: nullable AExpr,
3832 n_else
: nullable AExpr
3836 _n_kwif
= n_kwif
.as(not null)
3837 n_kwif
.parent
= self
3838 _n_expr
= n_expr
.as(not null)
3839 n_expr
.parent
= self
3841 if n_then
!= null then
3842 n_then
.parent
= self
3845 if n_else
!= null then
3846 n_else
.parent
= self
3850 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3852 if _n_kwif
== old_child
then
3853 if new_child
!= null then
3854 new_child
.parent
= self
3855 assert new_child
isa TKwif
3862 if _n_expr
== old_child
then
3863 if new_child
!= null then
3864 new_child
.parent
= self
3865 assert new_child
isa AExpr
3872 if _n_then
== old_child
then
3873 if new_child
!= null then
3874 new_child
.parent
= self
3875 assert new_child
isa AExpr
3882 if _n_else
== old_child
then
3883 if new_child
!= null then
3884 new_child
.parent
= self
3885 assert new_child
isa AExpr
3894 redef fun visit_all
(v
: Visitor)
3896 v
.enter_visit
(_n_kwif
)
3897 v
.enter_visit
(_n_expr
)
3898 if _n_then
!= null then
3899 v
.enter_visit
(_n_then
.as(not null))
3901 if _n_else
!= null then
3902 v
.enter_visit
(_n_else
.as(not null))
3906 redef class AIfexprExpr
3907 private init empty_init
do end
3909 init init_aifexprexpr
(
3910 n_kwif
: nullable TKwif,
3911 n_expr
: nullable AExpr,
3912 n_kwthen
: nullable TKwthen,
3913 n_then
: nullable AExpr,
3914 n_kwelse
: nullable TKwelse,
3915 n_else
: nullable AExpr
3919 _n_kwif
= n_kwif
.as(not null)
3920 n_kwif
.parent
= self
3921 _n_expr
= n_expr
.as(not null)
3922 n_expr
.parent
= self
3923 _n_kwthen
= n_kwthen
.as(not null)
3924 n_kwthen
.parent
= self
3925 _n_then
= n_then
.as(not null)
3926 n_then
.parent
= self
3927 _n_kwelse
= n_kwelse
.as(not null)
3928 n_kwelse
.parent
= self
3929 _n_else
= n_else
.as(not null)
3930 n_else
.parent
= self
3933 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3935 if _n_kwif
== old_child
then
3936 if new_child
!= null then
3937 new_child
.parent
= self
3938 assert new_child
isa TKwif
3945 if _n_expr
== old_child
then
3946 if new_child
!= null then
3947 new_child
.parent
= self
3948 assert new_child
isa AExpr
3955 if _n_kwthen
== old_child
then
3956 if new_child
!= null then
3957 new_child
.parent
= self
3958 assert new_child
isa TKwthen
3959 _n_kwthen
= new_child
3965 if _n_then
== old_child
then
3966 if new_child
!= null then
3967 new_child
.parent
= self
3968 assert new_child
isa AExpr
3975 if _n_kwelse
== old_child
then
3976 if new_child
!= null then
3977 new_child
.parent
= self
3978 assert new_child
isa TKwelse
3979 _n_kwelse
= new_child
3985 if _n_else
== old_child
then
3986 if new_child
!= null then
3987 new_child
.parent
= self
3988 assert new_child
isa AExpr
3997 redef fun visit_all
(v
: Visitor)
3999 v
.enter_visit
(_n_kwif
)
4000 v
.enter_visit
(_n_expr
)
4001 v
.enter_visit
(_n_kwthen
)
4002 v
.enter_visit
(_n_then
)
4003 v
.enter_visit
(_n_kwelse
)
4004 v
.enter_visit
(_n_else
)
4007 redef class AWhileExpr
4008 private init empty_init
do end
4010 init init_awhileexpr
(
4011 n_kwwhile
: nullable TKwwhile,
4012 n_expr
: nullable AExpr,
4013 n_kwdo
: nullable TKwdo,
4014 n_block
: nullable AExpr,
4015 n_label
: nullable ALabel
4019 _n_kwwhile
= n_kwwhile
.as(not null)
4020 n_kwwhile
.parent
= self
4021 _n_expr
= n_expr
.as(not null)
4022 n_expr
.parent
= self
4023 _n_kwdo
= n_kwdo
.as(not null)
4024 n_kwdo
.parent
= self
4026 if n_block
!= null then
4027 n_block
.parent
= self
4030 if n_label
!= null then
4031 n_label
.parent
= self
4035 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4037 if _n_kwwhile
== old_child
then
4038 if new_child
!= null then
4039 new_child
.parent
= self
4040 assert new_child
isa TKwwhile
4041 _n_kwwhile
= new_child
4047 if _n_expr
== old_child
then
4048 if new_child
!= null then
4049 new_child
.parent
= self
4050 assert new_child
isa AExpr
4057 if _n_kwdo
== old_child
then
4058 if new_child
!= null then
4059 new_child
.parent
= self
4060 assert new_child
isa TKwdo
4067 if _n_block
== old_child
then
4068 if new_child
!= null then
4069 new_child
.parent
= self
4070 assert new_child
isa AExpr
4071 _n_block
= new_child
4077 if _n_label
== old_child
then
4078 if new_child
!= null then
4079 new_child
.parent
= self
4080 assert new_child
isa ALabel
4081 _n_label
= new_child
4089 redef fun visit_all
(v
: Visitor)
4091 v
.enter_visit
(_n_kwwhile
)
4092 v
.enter_visit
(_n_expr
)
4093 v
.enter_visit
(_n_kwdo
)
4094 if _n_block
!= null then
4095 v
.enter_visit
(_n_block
.as(not null))
4097 if _n_label
!= null then
4098 v
.enter_visit
(_n_label
.as(not null))
4102 redef class ALoopExpr
4103 private init empty_init
do end
4105 init init_aloopexpr
(
4106 n_kwloop
: nullable TKwloop,
4107 n_block
: nullable AExpr,
4108 n_label
: nullable ALabel
4112 _n_kwloop
= n_kwloop
.as(not null)
4113 n_kwloop
.parent
= self
4115 if n_block
!= null then
4116 n_block
.parent
= self
4119 if n_label
!= null then
4120 n_label
.parent
= self
4124 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4126 if _n_kwloop
== old_child
then
4127 if new_child
!= null then
4128 new_child
.parent
= self
4129 assert new_child
isa TKwloop
4130 _n_kwloop
= new_child
4136 if _n_block
== old_child
then
4137 if new_child
!= null then
4138 new_child
.parent
= self
4139 assert new_child
isa AExpr
4140 _n_block
= new_child
4146 if _n_label
== old_child
then
4147 if new_child
!= null then
4148 new_child
.parent
= self
4149 assert new_child
isa ALabel
4150 _n_label
= new_child
4158 redef fun visit_all
(v
: Visitor)
4160 v
.enter_visit
(_n_kwloop
)
4161 if _n_block
!= null then
4162 v
.enter_visit
(_n_block
.as(not null))
4164 if _n_label
!= null then
4165 v
.enter_visit
(_n_label
.as(not null))
4169 redef class AForExpr
4170 private init empty_init
do end
4172 init init_aforexpr
(
4173 n_kwfor
: nullable TKwfor,
4174 n_ids
: Collection[Object], # Should be Collection[TId]
4175 n_expr
: nullable AExpr,
4176 n_kwdo
: nullable TKwdo,
4177 n_block
: nullable AExpr,
4178 n_label
: nullable ALabel
4182 _n_kwfor
= n_kwfor
.as(not null)
4183 n_kwfor
.parent
= self
4189 _n_expr
= n_expr
.as(not null)
4190 n_expr
.parent
= self
4191 _n_kwdo
= n_kwdo
.as(not null)
4192 n_kwdo
.parent
= self
4194 if n_block
!= null then
4195 n_block
.parent
= self
4198 if n_label
!= null then
4199 n_label
.parent
= self
4203 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4205 if _n_kwfor
== old_child
then
4206 if new_child
!= null then
4207 new_child
.parent
= self
4208 assert new_child
isa TKwfor
4209 _n_kwfor
= new_child
4215 for i
in [0.._n_ids
.length
[ do
4216 if _n_ids
[i
] == old_child
then
4217 if new_child
!= null then
4218 assert new_child
isa TId
4219 _n_ids
[i
] = new_child
4220 new_child
.parent
= self
4227 if _n_expr
== old_child
then
4228 if new_child
!= null then
4229 new_child
.parent
= self
4230 assert new_child
isa AExpr
4237 if _n_kwdo
== old_child
then
4238 if new_child
!= null then
4239 new_child
.parent
= self
4240 assert new_child
isa TKwdo
4247 if _n_block
== old_child
then
4248 if new_child
!= null then
4249 new_child
.parent
= self
4250 assert new_child
isa AExpr
4251 _n_block
= new_child
4257 if _n_label
== old_child
then
4258 if new_child
!= null then
4259 new_child
.parent
= self
4260 assert new_child
isa ALabel
4261 _n_label
= new_child
4269 redef fun visit_all
(v
: Visitor)
4271 v
.enter_visit
(_n_kwfor
)
4275 v
.enter_visit
(_n_expr
)
4276 v
.enter_visit
(_n_kwdo
)
4277 if _n_block
!= null then
4278 v
.enter_visit
(_n_block
.as(not null))
4280 if _n_label
!= null then
4281 v
.enter_visit
(_n_label
.as(not null))
4285 redef class AAssertExpr
4286 private init empty_init
do end
4288 init init_aassertexpr
(
4289 n_kwassert
: nullable TKwassert,
4291 n_expr
: nullable AExpr,
4292 n_else
: nullable AExpr
4296 _n_kwassert
= n_kwassert
.as(not null)
4297 n_kwassert
.parent
= self
4299 if n_id
!= null then
4302 _n_expr
= n_expr
.as(not null)
4303 n_expr
.parent
= self
4305 if n_else
!= null then
4306 n_else
.parent
= self
4310 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4312 if _n_kwassert
== old_child
then
4313 if new_child
!= null then
4314 new_child
.parent
= self
4315 assert new_child
isa TKwassert
4316 _n_kwassert
= new_child
4322 if _n_id
== old_child
then
4323 if new_child
!= null then
4324 new_child
.parent
= self
4325 assert new_child
isa TId
4332 if _n_expr
== old_child
then
4333 if new_child
!= null then
4334 new_child
.parent
= self
4335 assert new_child
isa AExpr
4342 if _n_else
== old_child
then
4343 if new_child
!= null then
4344 new_child
.parent
= self
4345 assert new_child
isa AExpr
4354 redef fun visit_all
(v
: Visitor)
4356 v
.enter_visit
(_n_kwassert
)
4357 if _n_id
!= null then
4358 v
.enter_visit
(_n_id
.as(not null))
4360 v
.enter_visit
(_n_expr
)
4361 if _n_else
!= null then
4362 v
.enter_visit
(_n_else
.as(not null))
4366 redef class AOnceExpr
4367 private init empty_init
do end
4369 init init_aonceexpr
(
4370 n_kwonce
: nullable TKwonce,
4371 n_expr
: nullable AExpr
4375 _n_kwonce
= n_kwonce
.as(not null)
4376 n_kwonce
.parent
= self
4377 _n_expr
= n_expr
.as(not null)
4378 n_expr
.parent
= self
4381 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4383 if _n_kwonce
== old_child
then
4384 if new_child
!= null then
4385 new_child
.parent
= self
4386 assert new_child
isa TKwonce
4387 _n_kwonce
= new_child
4393 if _n_expr
== old_child
then
4394 if new_child
!= null then
4395 new_child
.parent
= self
4396 assert new_child
isa AExpr
4405 redef fun visit_all
(v
: Visitor)
4407 v
.enter_visit
(_n_kwonce
)
4408 v
.enter_visit
(_n_expr
)
4411 redef class ASendExpr
4412 private init empty_init
do end
4414 init init_asendexpr
(
4415 n_expr
: nullable AExpr
4419 _n_expr
= n_expr
.as(not null)
4420 n_expr
.parent
= self
4423 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4425 if _n_expr
== old_child
then
4426 if new_child
!= null then
4427 new_child
.parent
= self
4428 assert new_child
isa AExpr
4437 redef fun visit_all
(v
: Visitor)
4439 v
.enter_visit
(_n_expr
)
4442 redef class ABinopExpr
4443 private init empty_init
do end
4445 init init_abinopexpr
(
4446 n_expr
: nullable AExpr,
4447 n_expr2
: nullable AExpr
4451 _n_expr
= n_expr
.as(not null)
4452 n_expr
.parent
= self
4453 _n_expr2
= n_expr2
.as(not null)
4454 n_expr2
.parent
= self
4457 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4459 if _n_expr
== old_child
then
4460 if new_child
!= null then
4461 new_child
.parent
= self
4462 assert new_child
isa AExpr
4469 if _n_expr2
== old_child
then
4470 if new_child
!= null then
4471 new_child
.parent
= self
4472 assert new_child
isa AExpr
4473 _n_expr2
= new_child
4481 redef fun visit_all
(v
: Visitor)
4483 v
.enter_visit
(_n_expr
)
4484 v
.enter_visit
(_n_expr2
)
4488 private init empty_init
do end
4491 n_expr
: nullable AExpr,
4492 n_expr2
: nullable AExpr
4496 _n_expr
= n_expr
.as(not null)
4497 n_expr
.parent
= self
4498 _n_expr2
= n_expr2
.as(not null)
4499 n_expr2
.parent
= self
4502 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4504 if _n_expr
== old_child
then
4505 if new_child
!= null then
4506 new_child
.parent
= self
4507 assert new_child
isa AExpr
4514 if _n_expr2
== old_child
then
4515 if new_child
!= null then
4516 new_child
.parent
= self
4517 assert new_child
isa AExpr
4518 _n_expr2
= new_child
4526 redef fun visit_all
(v
: Visitor)
4528 v
.enter_visit
(_n_expr
)
4529 v
.enter_visit
(_n_expr2
)
4532 redef class AAndExpr
4533 private init empty_init
do end
4535 init init_aandexpr
(
4536 n_expr
: nullable AExpr,
4537 n_expr2
: nullable AExpr
4541 _n_expr
= n_expr
.as(not null)
4542 n_expr
.parent
= self
4543 _n_expr2
= n_expr2
.as(not null)
4544 n_expr2
.parent
= self
4547 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4549 if _n_expr
== old_child
then
4550 if new_child
!= null then
4551 new_child
.parent
= self
4552 assert new_child
isa AExpr
4559 if _n_expr2
== old_child
then
4560 if new_child
!= null then
4561 new_child
.parent
= self
4562 assert new_child
isa AExpr
4563 _n_expr2
= new_child
4571 redef fun visit_all
(v
: Visitor)
4573 v
.enter_visit
(_n_expr
)
4574 v
.enter_visit
(_n_expr2
)
4577 redef class AOrElseExpr
4578 private init empty_init
do end
4580 init init_aorelseexpr
(
4581 n_expr
: nullable AExpr,
4582 n_expr2
: nullable AExpr
4586 _n_expr
= n_expr
.as(not null)
4587 n_expr
.parent
= self
4588 _n_expr2
= n_expr2
.as(not null)
4589 n_expr2
.parent
= self
4592 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4594 if _n_expr
== old_child
then
4595 if new_child
!= null then
4596 new_child
.parent
= self
4597 assert new_child
isa AExpr
4604 if _n_expr2
== old_child
then
4605 if new_child
!= null then
4606 new_child
.parent
= self
4607 assert new_child
isa AExpr
4608 _n_expr2
= new_child
4616 redef fun visit_all
(v
: Visitor)
4618 v
.enter_visit
(_n_expr
)
4619 v
.enter_visit
(_n_expr2
)
4622 redef class ANotExpr
4623 private init empty_init
do end
4625 init init_anotexpr
(
4626 n_kwnot
: nullable TKwnot,
4627 n_expr
: nullable AExpr
4631 _n_kwnot
= n_kwnot
.as(not null)
4632 n_kwnot
.parent
= self
4633 _n_expr
= n_expr
.as(not null)
4634 n_expr
.parent
= self
4637 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4639 if _n_kwnot
== old_child
then
4640 if new_child
!= null then
4641 new_child
.parent
= self
4642 assert new_child
isa TKwnot
4643 _n_kwnot
= new_child
4649 if _n_expr
== old_child
then
4650 if new_child
!= null then
4651 new_child
.parent
= self
4652 assert new_child
isa AExpr
4661 redef fun visit_all
(v
: Visitor)
4663 v
.enter_visit
(_n_kwnot
)
4664 v
.enter_visit
(_n_expr
)
4668 private init empty_init
do end
4671 n_expr
: nullable AExpr,
4672 n_expr2
: nullable AExpr
4676 _n_expr
= n_expr
.as(not null)
4677 n_expr
.parent
= self
4678 _n_expr2
= n_expr2
.as(not null)
4679 n_expr2
.parent
= self
4682 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4684 if _n_expr
== old_child
then
4685 if new_child
!= null then
4686 new_child
.parent
= self
4687 assert new_child
isa AExpr
4694 if _n_expr2
== old_child
then
4695 if new_child
!= null then
4696 new_child
.parent
= self
4697 assert new_child
isa AExpr
4698 _n_expr2
= new_child
4706 redef fun visit_all
(v
: Visitor)
4708 v
.enter_visit
(_n_expr
)
4709 v
.enter_visit
(_n_expr2
)
4713 private init empty_init
do end
4716 n_expr
: nullable AExpr,
4717 n_expr2
: nullable AExpr
4721 _n_expr
= n_expr
.as(not null)
4722 n_expr
.parent
= self
4723 _n_expr2
= n_expr2
.as(not null)
4724 n_expr2
.parent
= self
4727 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4729 if _n_expr
== old_child
then
4730 if new_child
!= null then
4731 new_child
.parent
= self
4732 assert new_child
isa AExpr
4739 if _n_expr2
== old_child
then
4740 if new_child
!= null then
4741 new_child
.parent
= self
4742 assert new_child
isa AExpr
4743 _n_expr2
= new_child
4751 redef fun visit_all
(v
: Visitor)
4753 v
.enter_visit
(_n_expr
)
4754 v
.enter_visit
(_n_expr2
)
4758 private init empty_init
do end
4761 n_expr
: nullable AExpr,
4762 n_expr2
: nullable AExpr
4766 _n_expr
= n_expr
.as(not null)
4767 n_expr
.parent
= self
4768 _n_expr2
= n_expr2
.as(not null)
4769 n_expr2
.parent
= self
4772 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4774 if _n_expr
== old_child
then
4775 if new_child
!= null then
4776 new_child
.parent
= self
4777 assert new_child
isa AExpr
4784 if _n_expr2
== old_child
then
4785 if new_child
!= null then
4786 new_child
.parent
= self
4787 assert new_child
isa AExpr
4788 _n_expr2
= new_child
4796 redef fun visit_all
(v
: Visitor)
4798 v
.enter_visit
(_n_expr
)
4799 v
.enter_visit
(_n_expr2
)
4803 private init empty_init
do end
4806 n_expr
: nullable AExpr,
4807 n_expr2
: nullable AExpr
4811 _n_expr
= n_expr
.as(not null)
4812 n_expr
.parent
= self
4813 _n_expr2
= n_expr2
.as(not null)
4814 n_expr2
.parent
= self
4817 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4819 if _n_expr
== old_child
then
4820 if new_child
!= null then
4821 new_child
.parent
= self
4822 assert new_child
isa AExpr
4829 if _n_expr2
== old_child
then
4830 if new_child
!= null then
4831 new_child
.parent
= self
4832 assert new_child
isa AExpr
4833 _n_expr2
= new_child
4841 redef fun visit_all
(v
: Visitor)
4843 v
.enter_visit
(_n_expr
)
4844 v
.enter_visit
(_n_expr2
)
4848 private init empty_init
do end
4851 n_expr
: nullable AExpr,
4852 n_expr2
: nullable AExpr
4856 _n_expr
= n_expr
.as(not null)
4857 n_expr
.parent
= self
4858 _n_expr2
= n_expr2
.as(not null)
4859 n_expr2
.parent
= self
4862 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4864 if _n_expr
== old_child
then
4865 if new_child
!= null then
4866 new_child
.parent
= self
4867 assert new_child
isa AExpr
4874 if _n_expr2
== old_child
then
4875 if new_child
!= null then
4876 new_child
.parent
= self
4877 assert new_child
isa AExpr
4878 _n_expr2
= new_child
4886 redef fun visit_all
(v
: Visitor)
4888 v
.enter_visit
(_n_expr
)
4889 v
.enter_visit
(_n_expr2
)
4893 private init empty_init
do end
4896 n_expr
: nullable AExpr,
4897 n_expr2
: nullable AExpr
4901 _n_expr
= n_expr
.as(not null)
4902 n_expr
.parent
= self
4903 _n_expr2
= n_expr2
.as(not null)
4904 n_expr2
.parent
= self
4907 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4909 if _n_expr
== old_child
then
4910 if new_child
!= null then
4911 new_child
.parent
= self
4912 assert new_child
isa AExpr
4919 if _n_expr2
== old_child
then
4920 if new_child
!= null then
4921 new_child
.parent
= self
4922 assert new_child
isa AExpr
4923 _n_expr2
= new_child
4931 redef fun visit_all
(v
: Visitor)
4933 v
.enter_visit
(_n_expr
)
4934 v
.enter_visit
(_n_expr2
)
4938 private init empty_init
do end
4941 n_expr
: nullable AExpr,
4942 n_expr2
: nullable AExpr
4946 _n_expr
= n_expr
.as(not null)
4947 n_expr
.parent
= self
4948 _n_expr2
= n_expr2
.as(not null)
4949 n_expr2
.parent
= self
4952 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4954 if _n_expr
== old_child
then
4955 if new_child
!= null then
4956 new_child
.parent
= self
4957 assert new_child
isa AExpr
4964 if _n_expr2
== old_child
then
4965 if new_child
!= null then
4966 new_child
.parent
= self
4967 assert new_child
isa AExpr
4968 _n_expr2
= new_child
4976 redef fun visit_all
(v
: Visitor)
4978 v
.enter_visit
(_n_expr
)
4979 v
.enter_visit
(_n_expr2
)
4983 private init empty_init
do end
4986 n_expr
: nullable AExpr,
4987 n_expr2
: nullable AExpr
4991 _n_expr
= n_expr
.as(not null)
4992 n_expr
.parent
= self
4993 _n_expr2
= n_expr2
.as(not null)
4994 n_expr2
.parent
= self
4997 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4999 if _n_expr
== old_child
then
5000 if new_child
!= null then
5001 new_child
.parent
= self
5002 assert new_child
isa AExpr
5009 if _n_expr2
== old_child
then
5010 if new_child
!= null then
5011 new_child
.parent
= self
5012 assert new_child
isa AExpr
5013 _n_expr2
= new_child
5021 redef fun visit_all
(v
: Visitor)
5023 v
.enter_visit
(_n_expr
)
5024 v
.enter_visit
(_n_expr2
)
5028 private init empty_init
do end
5031 n_expr
: nullable AExpr,
5032 n_expr2
: nullable AExpr
5036 _n_expr
= n_expr
.as(not null)
5037 n_expr
.parent
= self
5038 _n_expr2
= n_expr2
.as(not null)
5039 n_expr2
.parent
= self
5042 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5044 if _n_expr
== old_child
then
5045 if new_child
!= null then
5046 new_child
.parent
= self
5047 assert new_child
isa AExpr
5054 if _n_expr2
== old_child
then
5055 if new_child
!= null then
5056 new_child
.parent
= self
5057 assert new_child
isa AExpr
5058 _n_expr2
= new_child
5066 redef fun visit_all
(v
: Visitor)
5068 v
.enter_visit
(_n_expr
)
5069 v
.enter_visit
(_n_expr2
)
5072 redef class AIsaExpr
5073 private init empty_init
do end
5075 init init_aisaexpr
(
5076 n_expr
: nullable AExpr,
5077 n_type
: nullable AType
5081 _n_expr
= n_expr
.as(not null)
5082 n_expr
.parent
= self
5083 _n_type
= n_type
.as(not null)
5084 n_type
.parent
= self
5087 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5089 if _n_expr
== old_child
then
5090 if new_child
!= null then
5091 new_child
.parent
= self
5092 assert new_child
isa AExpr
5099 if _n_type
== old_child
then
5100 if new_child
!= null then
5101 new_child
.parent
= self
5102 assert new_child
isa AType
5111 redef fun visit_all
(v
: Visitor)
5113 v
.enter_visit
(_n_expr
)
5114 v
.enter_visit
(_n_type
)
5117 redef class APlusExpr
5118 private init empty_init
do end
5120 init init_aplusexpr
(
5121 n_expr
: nullable AExpr,
5122 n_expr2
: nullable AExpr
5126 _n_expr
= n_expr
.as(not null)
5127 n_expr
.parent
= self
5128 _n_expr2
= n_expr2
.as(not null)
5129 n_expr2
.parent
= self
5132 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5134 if _n_expr
== old_child
then
5135 if new_child
!= null then
5136 new_child
.parent
= self
5137 assert new_child
isa AExpr
5144 if _n_expr2
== old_child
then
5145 if new_child
!= null then
5146 new_child
.parent
= self
5147 assert new_child
isa AExpr
5148 _n_expr2
= new_child
5156 redef fun visit_all
(v
: Visitor)
5158 v
.enter_visit
(_n_expr
)
5159 v
.enter_visit
(_n_expr2
)
5162 redef class AMinusExpr
5163 private init empty_init
do end
5165 init init_aminusexpr
(
5166 n_expr
: nullable AExpr,
5167 n_expr2
: nullable AExpr
5171 _n_expr
= n_expr
.as(not null)
5172 n_expr
.parent
= self
5173 _n_expr2
= n_expr2
.as(not null)
5174 n_expr2
.parent
= self
5177 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5179 if _n_expr
== old_child
then
5180 if new_child
!= null then
5181 new_child
.parent
= self
5182 assert new_child
isa AExpr
5189 if _n_expr2
== old_child
then
5190 if new_child
!= null then
5191 new_child
.parent
= self
5192 assert new_child
isa AExpr
5193 _n_expr2
= new_child
5201 redef fun visit_all
(v
: Visitor)
5203 v
.enter_visit
(_n_expr
)
5204 v
.enter_visit
(_n_expr2
)
5207 redef class AStarshipExpr
5208 private init empty_init
do end
5210 init init_astarshipexpr
(
5211 n_expr
: nullable AExpr,
5212 n_expr2
: nullable AExpr
5216 _n_expr
= n_expr
.as(not null)
5217 n_expr
.parent
= self
5218 _n_expr2
= n_expr2
.as(not null)
5219 n_expr2
.parent
= self
5222 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5224 if _n_expr
== old_child
then
5225 if new_child
!= null then
5226 new_child
.parent
= self
5227 assert new_child
isa AExpr
5234 if _n_expr2
== old_child
then
5235 if new_child
!= null then
5236 new_child
.parent
= self
5237 assert new_child
isa AExpr
5238 _n_expr2
= new_child
5246 redef fun visit_all
(v
: Visitor)
5248 v
.enter_visit
(_n_expr
)
5249 v
.enter_visit
(_n_expr2
)
5252 redef class AStarExpr
5253 private init empty_init
do end
5255 init init_astarexpr
(
5256 n_expr
: nullable AExpr,
5257 n_expr2
: nullable AExpr
5261 _n_expr
= n_expr
.as(not null)
5262 n_expr
.parent
= self
5263 _n_expr2
= n_expr2
.as(not null)
5264 n_expr2
.parent
= self
5267 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5269 if _n_expr
== old_child
then
5270 if new_child
!= null then
5271 new_child
.parent
= self
5272 assert new_child
isa AExpr
5279 if _n_expr2
== old_child
then
5280 if new_child
!= null then
5281 new_child
.parent
= self
5282 assert new_child
isa AExpr
5283 _n_expr2
= new_child
5291 redef fun visit_all
(v
: Visitor)
5293 v
.enter_visit
(_n_expr
)
5294 v
.enter_visit
(_n_expr2
)
5297 redef class ASlashExpr
5298 private init empty_init
do end
5300 init init_aslashexpr
(
5301 n_expr
: nullable AExpr,
5302 n_expr2
: nullable AExpr
5306 _n_expr
= n_expr
.as(not null)
5307 n_expr
.parent
= self
5308 _n_expr2
= n_expr2
.as(not null)
5309 n_expr2
.parent
= self
5312 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5314 if _n_expr
== old_child
then
5315 if new_child
!= null then
5316 new_child
.parent
= self
5317 assert new_child
isa AExpr
5324 if _n_expr2
== old_child
then
5325 if new_child
!= null then
5326 new_child
.parent
= self
5327 assert new_child
isa AExpr
5328 _n_expr2
= new_child
5336 redef fun visit_all
(v
: Visitor)
5338 v
.enter_visit
(_n_expr
)
5339 v
.enter_visit
(_n_expr2
)
5342 redef class APercentExpr
5343 private init empty_init
do end
5345 init init_apercentexpr
(
5346 n_expr
: nullable AExpr,
5347 n_expr2
: nullable AExpr
5351 _n_expr
= n_expr
.as(not null)
5352 n_expr
.parent
= self
5353 _n_expr2
= n_expr2
.as(not null)
5354 n_expr2
.parent
= self
5357 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5359 if _n_expr
== old_child
then
5360 if new_child
!= null then
5361 new_child
.parent
= self
5362 assert new_child
isa AExpr
5369 if _n_expr2
== old_child
then
5370 if new_child
!= null then
5371 new_child
.parent
= self
5372 assert new_child
isa AExpr
5373 _n_expr2
= new_child
5381 redef fun visit_all
(v
: Visitor)
5383 v
.enter_visit
(_n_expr
)
5384 v
.enter_visit
(_n_expr2
)
5387 redef class AUminusExpr
5388 private init empty_init
do end
5390 init init_auminusexpr
(
5391 n_minus
: nullable TMinus,
5392 n_expr
: nullable AExpr
5396 _n_minus
= n_minus
.as(not null)
5397 n_minus
.parent
= self
5398 _n_expr
= n_expr
.as(not null)
5399 n_expr
.parent
= self
5402 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5404 if _n_minus
== old_child
then
5405 if new_child
!= null then
5406 new_child
.parent
= self
5407 assert new_child
isa TMinus
5408 _n_minus
= new_child
5414 if _n_expr
== old_child
then
5415 if new_child
!= null then
5416 new_child
.parent
= self
5417 assert new_child
isa AExpr
5426 redef fun visit_all
(v
: Visitor)
5428 v
.enter_visit
(_n_minus
)
5429 v
.enter_visit
(_n_expr
)
5432 redef class ANewExpr
5433 private init empty_init
do end
5435 init init_anewexpr
(
5436 n_kwnew
: nullable TKwnew,
5437 n_type
: nullable AType,
5439 n_args
: nullable AExprs
5443 _n_kwnew
= n_kwnew
.as(not null)
5444 n_kwnew
.parent
= self
5445 _n_type
= n_type
.as(not null)
5446 n_type
.parent
= self
5448 if n_id
!= null then
5451 _n_args
= n_args
.as(not null)
5452 n_args
.parent
= self
5455 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5457 if _n_kwnew
== old_child
then
5458 if new_child
!= null then
5459 new_child
.parent
= self
5460 assert new_child
isa TKwnew
5461 _n_kwnew
= new_child
5467 if _n_type
== old_child
then
5468 if new_child
!= null then
5469 new_child
.parent
= self
5470 assert new_child
isa AType
5477 if _n_id
== old_child
then
5478 if new_child
!= null then
5479 new_child
.parent
= self
5480 assert new_child
isa TId
5487 if _n_args
== old_child
then
5488 if new_child
!= null then
5489 new_child
.parent
= self
5490 assert new_child
isa AExprs
5499 redef fun visit_all
(v
: Visitor)
5501 v
.enter_visit
(_n_kwnew
)
5502 v
.enter_visit
(_n_type
)
5503 if _n_id
!= null then
5504 v
.enter_visit
(_n_id
.as(not null))
5506 v
.enter_visit
(_n_args
)
5509 redef class AAttrExpr
5510 private init empty_init
do end
5512 init init_aattrexpr
(
5513 n_expr
: nullable AExpr,
5514 n_id
: nullable TAttrid
5518 _n_expr
= n_expr
.as(not null)
5519 n_expr
.parent
= self
5520 _n_id
= n_id
.as(not null)
5524 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5526 if _n_expr
== old_child
then
5527 if new_child
!= null then
5528 new_child
.parent
= self
5529 assert new_child
isa AExpr
5536 if _n_id
== old_child
then
5537 if new_child
!= null then
5538 new_child
.parent
= self
5539 assert new_child
isa TAttrid
5548 redef fun visit_all
(v
: Visitor)
5550 v
.enter_visit
(_n_expr
)
5551 v
.enter_visit
(_n_id
)
5554 redef class AAttrAssignExpr
5555 private init empty_init
do end
5557 init init_aattrassignexpr
(
5558 n_expr
: nullable AExpr,
5559 n_id
: nullable TAttrid,
5560 n_assign
: nullable TAssign,
5561 n_value
: nullable AExpr
5565 _n_expr
= n_expr
.as(not null)
5566 n_expr
.parent
= self
5567 _n_id
= n_id
.as(not null)
5569 _n_assign
= n_assign
.as(not null)
5570 n_assign
.parent
= self
5571 _n_value
= n_value
.as(not null)
5572 n_value
.parent
= self
5575 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5577 if _n_expr
== old_child
then
5578 if new_child
!= null then
5579 new_child
.parent
= self
5580 assert new_child
isa AExpr
5587 if _n_id
== old_child
then
5588 if new_child
!= null then
5589 new_child
.parent
= self
5590 assert new_child
isa TAttrid
5597 if _n_assign
== old_child
then
5598 if new_child
!= null then
5599 new_child
.parent
= self
5600 assert new_child
isa TAssign
5601 _n_assign
= new_child
5607 if _n_value
== old_child
then
5608 if new_child
!= null then
5609 new_child
.parent
= self
5610 assert new_child
isa AExpr
5611 _n_value
= new_child
5619 redef fun visit_all
(v
: Visitor)
5621 v
.enter_visit
(_n_expr
)
5622 v
.enter_visit
(_n_id
)
5623 v
.enter_visit
(_n_assign
)
5624 v
.enter_visit
(_n_value
)
5627 redef class AAttrReassignExpr
5628 private init empty_init
do end
5630 init init_aattrreassignexpr
(
5631 n_expr
: nullable AExpr,
5632 n_id
: nullable TAttrid,
5633 n_assign_op
: nullable AAssignOp,
5634 n_value
: nullable AExpr
5638 _n_expr
= n_expr
.as(not null)
5639 n_expr
.parent
= self
5640 _n_id
= n_id
.as(not null)
5642 _n_assign_op
= n_assign_op
.as(not null)
5643 n_assign_op
.parent
= self
5644 _n_value
= n_value
.as(not null)
5645 n_value
.parent
= self
5648 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5650 if _n_expr
== old_child
then
5651 if new_child
!= null then
5652 new_child
.parent
= self
5653 assert new_child
isa AExpr
5660 if _n_id
== old_child
then
5661 if new_child
!= null then
5662 new_child
.parent
= self
5663 assert new_child
isa TAttrid
5670 if _n_assign_op
== old_child
then
5671 if new_child
!= null then
5672 new_child
.parent
= self
5673 assert new_child
isa AAssignOp
5674 _n_assign_op
= new_child
5680 if _n_value
== old_child
then
5681 if new_child
!= null then
5682 new_child
.parent
= self
5683 assert new_child
isa AExpr
5684 _n_value
= new_child
5692 redef fun visit_all
(v
: Visitor)
5694 v
.enter_visit
(_n_expr
)
5695 v
.enter_visit
(_n_id
)
5696 v
.enter_visit
(_n_assign_op
)
5697 v
.enter_visit
(_n_value
)
5700 redef class ACallExpr
5701 private init empty_init
do end
5703 init init_acallexpr
(
5704 n_expr
: nullable AExpr,
5706 n_args
: nullable AExprs,
5707 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5711 _n_expr
= n_expr
.as(not null)
5712 n_expr
.parent
= self
5713 _n_id
= n_id
.as(not null)
5715 _n_args
= n_args
.as(not null)
5716 n_args
.parent
= self
5717 for n
in n_closure_defs
do
5718 assert n
isa AClosureDef
5719 _n_closure_defs
.add
(n
)
5724 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5726 if _n_expr
== old_child
then
5727 if new_child
!= null then
5728 new_child
.parent
= self
5729 assert new_child
isa AExpr
5736 if _n_id
== old_child
then
5737 if new_child
!= null then
5738 new_child
.parent
= self
5739 assert new_child
isa TId
5746 if _n_args
== old_child
then
5747 if new_child
!= null then
5748 new_child
.parent
= self
5749 assert new_child
isa AExprs
5756 for i
in [0.._n_closure_defs
.length
[ do
5757 if _n_closure_defs
[i
] == old_child
then
5758 if new_child
!= null then
5759 assert new_child
isa AClosureDef
5760 _n_closure_defs
[i
] = new_child
5761 new_child
.parent
= self
5763 _n_closure_defs
.remove_at
(i
)
5770 redef fun visit_all
(v
: Visitor)
5772 v
.enter_visit
(_n_expr
)
5773 v
.enter_visit
(_n_id
)
5774 v
.enter_visit
(_n_args
)
5775 for n
in _n_closure_defs
do
5780 redef class ACallAssignExpr
5781 private init empty_init
do end
5783 init init_acallassignexpr
(
5784 n_expr
: nullable AExpr,
5786 n_args
: nullable AExprs,
5787 n_assign
: nullable TAssign,
5788 n_value
: nullable AExpr
5792 _n_expr
= n_expr
.as(not null)
5793 n_expr
.parent
= self
5794 _n_id
= n_id
.as(not null)
5796 _n_args
= n_args
.as(not null)
5797 n_args
.parent
= self
5798 _n_assign
= n_assign
.as(not null)
5799 n_assign
.parent
= self
5800 _n_value
= n_value
.as(not null)
5801 n_value
.parent
= self
5804 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5806 if _n_expr
== old_child
then
5807 if new_child
!= null then
5808 new_child
.parent
= self
5809 assert new_child
isa AExpr
5816 if _n_id
== old_child
then
5817 if new_child
!= null then
5818 new_child
.parent
= self
5819 assert new_child
isa TId
5826 if _n_args
== old_child
then
5827 if new_child
!= null then
5828 new_child
.parent
= self
5829 assert new_child
isa AExprs
5836 if _n_assign
== old_child
then
5837 if new_child
!= null then
5838 new_child
.parent
= self
5839 assert new_child
isa TAssign
5840 _n_assign
= new_child
5846 if _n_value
== old_child
then
5847 if new_child
!= null then
5848 new_child
.parent
= self
5849 assert new_child
isa AExpr
5850 _n_value
= new_child
5858 redef fun visit_all
(v
: Visitor)
5860 v
.enter_visit
(_n_expr
)
5861 v
.enter_visit
(_n_id
)
5862 v
.enter_visit
(_n_args
)
5863 v
.enter_visit
(_n_assign
)
5864 v
.enter_visit
(_n_value
)
5867 redef class ACallReassignExpr
5868 private init empty_init
do end
5870 init init_acallreassignexpr
(
5871 n_expr
: nullable AExpr,
5873 n_args
: nullable AExprs,
5874 n_assign_op
: nullable AAssignOp,
5875 n_value
: nullable AExpr
5879 _n_expr
= n_expr
.as(not null)
5880 n_expr
.parent
= self
5881 _n_id
= n_id
.as(not null)
5883 _n_args
= n_args
.as(not null)
5884 n_args
.parent
= self
5885 _n_assign_op
= n_assign_op
.as(not null)
5886 n_assign_op
.parent
= self
5887 _n_value
= n_value
.as(not null)
5888 n_value
.parent
= self
5891 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5893 if _n_expr
== old_child
then
5894 if new_child
!= null then
5895 new_child
.parent
= self
5896 assert new_child
isa AExpr
5903 if _n_id
== old_child
then
5904 if new_child
!= null then
5905 new_child
.parent
= self
5906 assert new_child
isa TId
5913 if _n_args
== old_child
then
5914 if new_child
!= null then
5915 new_child
.parent
= self
5916 assert new_child
isa AExprs
5923 if _n_assign_op
== old_child
then
5924 if new_child
!= null then
5925 new_child
.parent
= self
5926 assert new_child
isa AAssignOp
5927 _n_assign_op
= new_child
5933 if _n_value
== old_child
then
5934 if new_child
!= null then
5935 new_child
.parent
= self
5936 assert new_child
isa AExpr
5937 _n_value
= new_child
5945 redef fun visit_all
(v
: Visitor)
5947 v
.enter_visit
(_n_expr
)
5948 v
.enter_visit
(_n_id
)
5949 v
.enter_visit
(_n_args
)
5950 v
.enter_visit
(_n_assign_op
)
5951 v
.enter_visit
(_n_value
)
5954 redef class ASuperExpr
5955 private init empty_init
do end
5957 init init_asuperexpr
(
5958 n_qualified
: nullable AQualified,
5959 n_kwsuper
: nullable TKwsuper,
5960 n_args
: nullable AExprs
5964 _n_qualified
= n_qualified
5965 if n_qualified
!= null then
5966 n_qualified
.parent
= self
5968 _n_kwsuper
= n_kwsuper
.as(not null)
5969 n_kwsuper
.parent
= self
5970 _n_args
= n_args
.as(not null)
5971 n_args
.parent
= self
5974 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5976 if _n_qualified
== old_child
then
5977 if new_child
!= null then
5978 new_child
.parent
= self
5979 assert new_child
isa AQualified
5980 _n_qualified
= new_child
5986 if _n_kwsuper
== old_child
then
5987 if new_child
!= null then
5988 new_child
.parent
= self
5989 assert new_child
isa TKwsuper
5990 _n_kwsuper
= new_child
5996 if _n_args
== old_child
then
5997 if new_child
!= null then
5998 new_child
.parent
= self
5999 assert new_child
isa AExprs
6008 redef fun visit_all
(v
: Visitor)
6010 if _n_qualified
!= null then
6011 v
.enter_visit
(_n_qualified
.as(not null))
6013 v
.enter_visit
(_n_kwsuper
)
6014 v
.enter_visit
(_n_args
)
6017 redef class AInitExpr
6018 private init empty_init
do end
6020 init init_ainitexpr
(
6021 n_expr
: nullable AExpr,
6022 n_kwinit
: nullable TKwinit,
6023 n_args
: nullable AExprs
6027 _n_expr
= n_expr
.as(not null)
6028 n_expr
.parent
= self
6029 _n_kwinit
= n_kwinit
.as(not null)
6030 n_kwinit
.parent
= self
6031 _n_args
= n_args
.as(not null)
6032 n_args
.parent
= self
6035 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6037 if _n_expr
== old_child
then
6038 if new_child
!= null then
6039 new_child
.parent
= self
6040 assert new_child
isa AExpr
6047 if _n_kwinit
== old_child
then
6048 if new_child
!= null then
6049 new_child
.parent
= self
6050 assert new_child
isa TKwinit
6051 _n_kwinit
= new_child
6057 if _n_args
== old_child
then
6058 if new_child
!= null then
6059 new_child
.parent
= self
6060 assert new_child
isa AExprs
6069 redef fun visit_all
(v
: Visitor)
6071 v
.enter_visit
(_n_expr
)
6072 v
.enter_visit
(_n_kwinit
)
6073 v
.enter_visit
(_n_args
)
6076 redef class ABraExpr
6077 private init empty_init
do end
6079 init init_abraexpr
(
6080 n_expr
: nullable AExpr,
6081 n_args
: nullable AExprs,
6082 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6086 _n_expr
= n_expr
.as(not null)
6087 n_expr
.parent
= self
6088 _n_args
= n_args
.as(not null)
6089 n_args
.parent
= self
6090 for n
in n_closure_defs
do
6091 assert n
isa AClosureDef
6092 _n_closure_defs
.add
(n
)
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_args
== old_child
then
6110 if new_child
!= null then
6111 new_child
.parent
= self
6112 assert new_child
isa AExprs
6119 for i
in [0.._n_closure_defs
.length
[ do
6120 if _n_closure_defs
[i
] == old_child
then
6121 if new_child
!= null then
6122 assert new_child
isa AClosureDef
6123 _n_closure_defs
[i
] = new_child
6124 new_child
.parent
= self
6126 _n_closure_defs
.remove_at
(i
)
6133 redef fun visit_all
(v
: Visitor)
6135 v
.enter_visit
(_n_expr
)
6136 v
.enter_visit
(_n_args
)
6137 for n
in _n_closure_defs
do
6142 redef class ABraAssignExpr
6143 private init empty_init
do end
6145 init init_abraassignexpr
(
6146 n_expr
: nullable AExpr,
6147 n_args
: nullable AExprs,
6148 n_assign
: nullable TAssign,
6149 n_value
: nullable AExpr
6153 _n_expr
= n_expr
.as(not null)
6154 n_expr
.parent
= self
6155 _n_args
= n_args
.as(not null)
6156 n_args
.parent
= self
6157 _n_assign
= n_assign
.as(not null)
6158 n_assign
.parent
= self
6159 _n_value
= n_value
.as(not null)
6160 n_value
.parent
= self
6163 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6165 if _n_expr
== old_child
then
6166 if new_child
!= null then
6167 new_child
.parent
= self
6168 assert new_child
isa AExpr
6175 if _n_args
== old_child
then
6176 if new_child
!= null then
6177 new_child
.parent
= self
6178 assert new_child
isa AExprs
6185 if _n_assign
== old_child
then
6186 if new_child
!= null then
6187 new_child
.parent
= self
6188 assert new_child
isa TAssign
6189 _n_assign
= new_child
6195 if _n_value
== old_child
then
6196 if new_child
!= null then
6197 new_child
.parent
= self
6198 assert new_child
isa AExpr
6199 _n_value
= new_child
6207 redef fun visit_all
(v
: Visitor)
6209 v
.enter_visit
(_n_expr
)
6210 v
.enter_visit
(_n_args
)
6211 v
.enter_visit
(_n_assign
)
6212 v
.enter_visit
(_n_value
)
6215 redef class ABraReassignExpr
6216 private init empty_init
do end
6218 init init_abrareassignexpr
(
6219 n_expr
: nullable AExpr,
6220 n_args
: nullable AExprs,
6221 n_assign_op
: nullable AAssignOp,
6222 n_value
: nullable AExpr
6226 _n_expr
= n_expr
.as(not null)
6227 n_expr
.parent
= self
6228 _n_args
= n_args
.as(not null)
6229 n_args
.parent
= self
6230 _n_assign_op
= n_assign_op
.as(not null)
6231 n_assign_op
.parent
= self
6232 _n_value
= n_value
.as(not null)
6233 n_value
.parent
= self
6236 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6238 if _n_expr
== old_child
then
6239 if new_child
!= null then
6240 new_child
.parent
= self
6241 assert new_child
isa AExpr
6248 if _n_args
== old_child
then
6249 if new_child
!= null then
6250 new_child
.parent
= self
6251 assert new_child
isa AExprs
6258 if _n_assign_op
== old_child
then
6259 if new_child
!= null then
6260 new_child
.parent
= self
6261 assert new_child
isa AAssignOp
6262 _n_assign_op
= new_child
6268 if _n_value
== old_child
then
6269 if new_child
!= null then
6270 new_child
.parent
= self
6271 assert new_child
isa AExpr
6272 _n_value
= new_child
6280 redef fun visit_all
(v
: Visitor)
6282 v
.enter_visit
(_n_expr
)
6283 v
.enter_visit
(_n_args
)
6284 v
.enter_visit
(_n_assign_op
)
6285 v
.enter_visit
(_n_value
)
6288 redef class AClosureCallExpr
6289 private init empty_init
do end
6291 init init_aclosurecallexpr
(
6293 n_args
: nullable AExprs,
6294 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6298 _n_id
= n_id
.as(not null)
6300 _n_args
= n_args
.as(not null)
6301 n_args
.parent
= self
6302 for n
in n_closure_defs
do
6303 assert n
isa AClosureDef
6304 _n_closure_defs
.add
(n
)
6309 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6311 if _n_id
== old_child
then
6312 if new_child
!= null then
6313 new_child
.parent
= self
6314 assert new_child
isa TId
6321 if _n_args
== old_child
then
6322 if new_child
!= null then
6323 new_child
.parent
= self
6324 assert new_child
isa AExprs
6331 for i
in [0.._n_closure_defs
.length
[ do
6332 if _n_closure_defs
[i
] == old_child
then
6333 if new_child
!= null then
6334 assert new_child
isa AClosureDef
6335 _n_closure_defs
[i
] = new_child
6336 new_child
.parent
= self
6338 _n_closure_defs
.remove_at
(i
)
6345 redef fun visit_all
(v
: Visitor)
6347 v
.enter_visit
(_n_id
)
6348 v
.enter_visit
(_n_args
)
6349 for n
in _n_closure_defs
do
6354 redef class AVarExpr
6355 private init empty_init
do end
6357 init init_avarexpr
(
6362 _n_id
= n_id
.as(not null)
6366 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6368 if _n_id
== old_child
then
6369 if new_child
!= null then
6370 new_child
.parent
= self
6371 assert new_child
isa TId
6380 redef fun visit_all
(v
: Visitor)
6382 v
.enter_visit
(_n_id
)
6385 redef class AVarAssignExpr
6386 private init empty_init
do end
6388 init init_avarassignexpr
(
6390 n_assign
: nullable TAssign,
6391 n_value
: nullable AExpr
6395 _n_id
= n_id
.as(not null)
6397 _n_assign
= n_assign
.as(not null)
6398 n_assign
.parent
= self
6399 _n_value
= n_value
.as(not null)
6400 n_value
.parent
= self
6403 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6405 if _n_id
== old_child
then
6406 if new_child
!= null then
6407 new_child
.parent
= self
6408 assert new_child
isa TId
6415 if _n_assign
== old_child
then
6416 if new_child
!= null then
6417 new_child
.parent
= self
6418 assert new_child
isa TAssign
6419 _n_assign
= new_child
6425 if _n_value
== old_child
then
6426 if new_child
!= null then
6427 new_child
.parent
= self
6428 assert new_child
isa AExpr
6429 _n_value
= new_child
6437 redef fun visit_all
(v
: Visitor)
6439 v
.enter_visit
(_n_id
)
6440 v
.enter_visit
(_n_assign
)
6441 v
.enter_visit
(_n_value
)
6444 redef class AVarReassignExpr
6445 private init empty_init
do end
6447 init init_avarreassignexpr
(
6449 n_assign_op
: nullable AAssignOp,
6450 n_value
: nullable AExpr
6454 _n_id
= n_id
.as(not null)
6456 _n_assign_op
= n_assign_op
.as(not null)
6457 n_assign_op
.parent
= self
6458 _n_value
= n_value
.as(not null)
6459 n_value
.parent
= self
6462 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6464 if _n_id
== old_child
then
6465 if new_child
!= null then
6466 new_child
.parent
= self
6467 assert new_child
isa TId
6474 if _n_assign_op
== old_child
then
6475 if new_child
!= null then
6476 new_child
.parent
= self
6477 assert new_child
isa AAssignOp
6478 _n_assign_op
= new_child
6484 if _n_value
== old_child
then
6485 if new_child
!= null then
6486 new_child
.parent
= self
6487 assert new_child
isa AExpr
6488 _n_value
= new_child
6496 redef fun visit_all
(v
: Visitor)
6498 v
.enter_visit
(_n_id
)
6499 v
.enter_visit
(_n_assign_op
)
6500 v
.enter_visit
(_n_value
)
6503 redef class ARangeExpr
6504 private init empty_init
do end
6506 init init_arangeexpr
(
6507 n_expr
: nullable AExpr,
6508 n_expr2
: nullable AExpr
6512 _n_expr
= n_expr
.as(not null)
6513 n_expr
.parent
= self
6514 _n_expr2
= n_expr2
.as(not null)
6515 n_expr2
.parent
= self
6518 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6520 if _n_expr
== old_child
then
6521 if new_child
!= null then
6522 new_child
.parent
= self
6523 assert new_child
isa AExpr
6530 if _n_expr2
== old_child
then
6531 if new_child
!= null then
6532 new_child
.parent
= self
6533 assert new_child
isa AExpr
6534 _n_expr2
= new_child
6542 redef fun visit_all
(v
: Visitor)
6544 v
.enter_visit
(_n_expr
)
6545 v
.enter_visit
(_n_expr2
)
6548 redef class ACrangeExpr
6549 private init empty_init
do end
6551 init init_acrangeexpr
(
6552 n_obra
: nullable TObra,
6553 n_expr
: nullable AExpr,
6554 n_expr2
: nullable AExpr,
6555 n_cbra
: nullable TCbra
6559 _n_obra
= n_obra
.as(not null)
6560 n_obra
.parent
= self
6561 _n_expr
= n_expr
.as(not null)
6562 n_expr
.parent
= self
6563 _n_expr2
= n_expr2
.as(not null)
6564 n_expr2
.parent
= self
6565 _n_cbra
= n_cbra
.as(not null)
6566 n_cbra
.parent
= self
6569 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6571 if _n_obra
== old_child
then
6572 if new_child
!= null then
6573 new_child
.parent
= self
6574 assert new_child
isa TObra
6581 if _n_expr
== old_child
then
6582 if new_child
!= null then
6583 new_child
.parent
= self
6584 assert new_child
isa AExpr
6591 if _n_expr2
== old_child
then
6592 if new_child
!= null then
6593 new_child
.parent
= self
6594 assert new_child
isa AExpr
6595 _n_expr2
= new_child
6601 if _n_cbra
== old_child
then
6602 if new_child
!= null then
6603 new_child
.parent
= self
6604 assert new_child
isa TCbra
6613 redef fun visit_all
(v
: Visitor)
6615 v
.enter_visit
(_n_obra
)
6616 v
.enter_visit
(_n_expr
)
6617 v
.enter_visit
(_n_expr2
)
6618 v
.enter_visit
(_n_cbra
)
6621 redef class AOrangeExpr
6622 private init empty_init
do end
6624 init init_aorangeexpr
(
6625 n_obra
: nullable TObra,
6626 n_expr
: nullable AExpr,
6627 n_expr2
: nullable AExpr,
6628 n_cbra
: nullable TObra
6632 _n_obra
= n_obra
.as(not null)
6633 n_obra
.parent
= self
6634 _n_expr
= n_expr
.as(not null)
6635 n_expr
.parent
= self
6636 _n_expr2
= n_expr2
.as(not null)
6637 n_expr2
.parent
= self
6638 _n_cbra
= n_cbra
.as(not null)
6639 n_cbra
.parent
= self
6642 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6644 if _n_obra
== old_child
then
6645 if new_child
!= null then
6646 new_child
.parent
= self
6647 assert new_child
isa TObra
6654 if _n_expr
== old_child
then
6655 if new_child
!= null then
6656 new_child
.parent
= self
6657 assert new_child
isa AExpr
6664 if _n_expr2
== old_child
then
6665 if new_child
!= null then
6666 new_child
.parent
= self
6667 assert new_child
isa AExpr
6668 _n_expr2
= new_child
6674 if _n_cbra
== old_child
then
6675 if new_child
!= null then
6676 new_child
.parent
= self
6677 assert new_child
isa TObra
6686 redef fun visit_all
(v
: Visitor)
6688 v
.enter_visit
(_n_obra
)
6689 v
.enter_visit
(_n_expr
)
6690 v
.enter_visit
(_n_expr2
)
6691 v
.enter_visit
(_n_cbra
)
6694 redef class AArrayExpr
6695 private init empty_init
do end
6697 init init_aarrayexpr
(
6698 n_exprs
: nullable AExprs
6702 _n_exprs
= n_exprs
.as(not null)
6703 n_exprs
.parent
= self
6706 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6708 if _n_exprs
== old_child
then
6709 if new_child
!= null then
6710 new_child
.parent
= self
6711 assert new_child
isa AExprs
6712 _n_exprs
= new_child
6720 redef fun visit_all
(v
: Visitor)
6722 v
.enter_visit
(_n_exprs
)
6725 redef class ASelfExpr
6726 private init empty_init
do end
6728 init init_aselfexpr
(
6729 n_kwself
: nullable TKwself
6733 _n_kwself
= n_kwself
.as(not null)
6734 n_kwself
.parent
= self
6737 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6739 if _n_kwself
== old_child
then
6740 if new_child
!= null then
6741 new_child
.parent
= self
6742 assert new_child
isa TKwself
6743 _n_kwself
= new_child
6751 redef fun visit_all
(v
: Visitor)
6753 v
.enter_visit
(_n_kwself
)
6756 redef class AImplicitSelfExpr
6757 private init empty_init
do end
6759 init init_aimplicitselfexpr
6764 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6768 redef fun visit_all
(v
: Visitor)
6772 redef class ATrueExpr
6773 private init empty_init
do end
6775 init init_atrueexpr
(
6776 n_kwtrue
: nullable TKwtrue
6780 _n_kwtrue
= n_kwtrue
.as(not null)
6781 n_kwtrue
.parent
= self
6784 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6786 if _n_kwtrue
== old_child
then
6787 if new_child
!= null then
6788 new_child
.parent
= self
6789 assert new_child
isa TKwtrue
6790 _n_kwtrue
= new_child
6798 redef fun visit_all
(v
: Visitor)
6800 v
.enter_visit
(_n_kwtrue
)
6803 redef class AFalseExpr
6804 private init empty_init
do end
6806 init init_afalseexpr
(
6807 n_kwfalse
: nullable TKwfalse
6811 _n_kwfalse
= n_kwfalse
.as(not null)
6812 n_kwfalse
.parent
= self
6815 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6817 if _n_kwfalse
== old_child
then
6818 if new_child
!= null then
6819 new_child
.parent
= self
6820 assert new_child
isa TKwfalse
6821 _n_kwfalse
= new_child
6829 redef fun visit_all
(v
: Visitor)
6831 v
.enter_visit
(_n_kwfalse
)
6834 redef class ANullExpr
6835 private init empty_init
do end
6837 init init_anullexpr
(
6838 n_kwnull
: nullable TKwnull
6842 _n_kwnull
= n_kwnull
.as(not null)
6843 n_kwnull
.parent
= self
6846 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6848 if _n_kwnull
== old_child
then
6849 if new_child
!= null then
6850 new_child
.parent
= self
6851 assert new_child
isa TKwnull
6852 _n_kwnull
= new_child
6860 redef fun visit_all
(v
: Visitor)
6862 v
.enter_visit
(_n_kwnull
)
6865 redef class AIntExpr
6866 private init empty_init
do end
6868 init init_aintexpr
(
6869 n_number
: nullable TNumber
6873 _n_number
= n_number
.as(not null)
6874 n_number
.parent
= self
6877 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6879 if _n_number
== old_child
then
6880 if new_child
!= null then
6881 new_child
.parent
= self
6882 assert new_child
isa TNumber
6883 _n_number
= new_child
6891 redef fun visit_all
(v
: Visitor)
6893 v
.enter_visit
(_n_number
)
6896 redef class AFloatExpr
6897 private init empty_init
do end
6899 init init_afloatexpr
(
6900 n_float
: nullable TFloat
6904 _n_float
= n_float
.as(not null)
6905 n_float
.parent
= self
6908 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6910 if _n_float
== old_child
then
6911 if new_child
!= null then
6912 new_child
.parent
= self
6913 assert new_child
isa TFloat
6914 _n_float
= new_child
6922 redef fun visit_all
(v
: Visitor)
6924 v
.enter_visit
(_n_float
)
6927 redef class ACharExpr
6928 private init empty_init
do end
6930 init init_acharexpr
(
6931 n_char
: nullable TChar
6935 _n_char
= n_char
.as(not null)
6936 n_char
.parent
= self
6939 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6941 if _n_char
== old_child
then
6942 if new_child
!= null then
6943 new_child
.parent
= self
6944 assert new_child
isa TChar
6953 redef fun visit_all
(v
: Visitor)
6955 v
.enter_visit
(_n_char
)
6958 redef class AStringExpr
6959 private init empty_init
do end
6961 init init_astringexpr
(
6962 n_string
: nullable TString
6966 _n_string
= n_string
.as(not null)
6967 n_string
.parent
= self
6970 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6972 if _n_string
== old_child
then
6973 if new_child
!= null then
6974 new_child
.parent
= self
6975 assert new_child
isa TString
6976 _n_string
= new_child
6984 redef fun visit_all
(v
: Visitor)
6986 v
.enter_visit
(_n_string
)
6989 redef class AStartStringExpr
6990 private init empty_init
do end
6992 init init_astartstringexpr
(
6993 n_string
: nullable TStartString
6997 _n_string
= n_string
.as(not null)
6998 n_string
.parent
= self
7001 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7003 if _n_string
== old_child
then
7004 if new_child
!= null then
7005 new_child
.parent
= self
7006 assert new_child
isa TStartString
7007 _n_string
= new_child
7015 redef fun visit_all
(v
: Visitor)
7017 v
.enter_visit
(_n_string
)
7020 redef class AMidStringExpr
7021 private init empty_init
do end
7023 init init_amidstringexpr
(
7024 n_string
: nullable TMidString
7028 _n_string
= n_string
.as(not null)
7029 n_string
.parent
= self
7032 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7034 if _n_string
== old_child
then
7035 if new_child
!= null then
7036 new_child
.parent
= self
7037 assert new_child
isa TMidString
7038 _n_string
= new_child
7046 redef fun visit_all
(v
: Visitor)
7048 v
.enter_visit
(_n_string
)
7051 redef class AEndStringExpr
7052 private init empty_init
do end
7054 init init_aendstringexpr
(
7055 n_string
: nullable TEndString
7059 _n_string
= n_string
.as(not null)
7060 n_string
.parent
= self
7063 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7065 if _n_string
== old_child
then
7066 if new_child
!= null then
7067 new_child
.parent
= self
7068 assert new_child
isa TEndString
7069 _n_string
= new_child
7077 redef fun visit_all
(v
: Visitor)
7079 v
.enter_visit
(_n_string
)
7082 redef class ASuperstringExpr
7083 private init empty_init
do end
7085 init init_asuperstringexpr
(
7086 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7097 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7099 for i
in [0.._n_exprs
.length
[ do
7100 if _n_exprs
[i
] == old_child
then
7101 if new_child
!= null then
7102 assert new_child
isa AExpr
7103 _n_exprs
[i
] = new_child
7104 new_child
.parent
= self
7106 _n_exprs
.remove_at
(i
)
7113 redef fun visit_all
(v
: Visitor)
7115 for n
in _n_exprs
do
7120 redef class AParExpr
7121 private init empty_init
do end
7123 init init_aparexpr
(
7124 n_opar
: nullable TOpar,
7125 n_expr
: nullable AExpr,
7126 n_cpar
: nullable TCpar
7130 _n_opar
= n_opar
.as(not null)
7131 n_opar
.parent
= self
7132 _n_expr
= n_expr
.as(not null)
7133 n_expr
.parent
= self
7134 _n_cpar
= n_cpar
.as(not null)
7135 n_cpar
.parent
= self
7138 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7140 if _n_opar
== old_child
then
7141 if new_child
!= null then
7142 new_child
.parent
= self
7143 assert new_child
isa TOpar
7150 if _n_expr
== old_child
then
7151 if new_child
!= null then
7152 new_child
.parent
= self
7153 assert new_child
isa AExpr
7160 if _n_cpar
== old_child
then
7161 if new_child
!= null then
7162 new_child
.parent
= self
7163 assert new_child
isa TCpar
7172 redef fun visit_all
(v
: Visitor)
7174 v
.enter_visit
(_n_opar
)
7175 v
.enter_visit
(_n_expr
)
7176 v
.enter_visit
(_n_cpar
)
7179 redef class AAsCastExpr
7180 private init empty_init
do end
7182 init init_aascastexpr
(
7183 n_expr
: nullable AExpr,
7184 n_kwas
: nullable TKwas,
7185 n_opar
: nullable TOpar,
7186 n_type
: nullable AType,
7187 n_cpar
: nullable TCpar
7191 _n_expr
= n_expr
.as(not null)
7192 n_expr
.parent
= self
7193 _n_kwas
= n_kwas
.as(not null)
7194 n_kwas
.parent
= self
7195 _n_opar
= n_opar
.as(not null)
7196 n_opar
.parent
= self
7197 _n_type
= n_type
.as(not null)
7198 n_type
.parent
= self
7199 _n_cpar
= n_cpar
.as(not null)
7200 n_cpar
.parent
= self
7203 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7205 if _n_expr
== old_child
then
7206 if new_child
!= null then
7207 new_child
.parent
= self
7208 assert new_child
isa AExpr
7215 if _n_kwas
== old_child
then
7216 if new_child
!= null then
7217 new_child
.parent
= self
7218 assert new_child
isa TKwas
7225 if _n_opar
== old_child
then
7226 if new_child
!= null then
7227 new_child
.parent
= self
7228 assert new_child
isa TOpar
7235 if _n_type
== old_child
then
7236 if new_child
!= null then
7237 new_child
.parent
= self
7238 assert new_child
isa AType
7245 if _n_cpar
== old_child
then
7246 if new_child
!= null then
7247 new_child
.parent
= self
7248 assert new_child
isa TCpar
7257 redef fun visit_all
(v
: Visitor)
7259 v
.enter_visit
(_n_expr
)
7260 v
.enter_visit
(_n_kwas
)
7261 v
.enter_visit
(_n_opar
)
7262 v
.enter_visit
(_n_type
)
7263 v
.enter_visit
(_n_cpar
)
7266 redef class AAsNotnullExpr
7267 private init empty_init
do end
7269 init init_aasnotnullexpr
(
7270 n_expr
: nullable AExpr,
7271 n_kwas
: nullable TKwas,
7272 n_opar
: nullable TOpar,
7273 n_kwnot
: nullable TKwnot,
7274 n_kwnull
: nullable TKwnull,
7275 n_cpar
: nullable TCpar
7279 _n_expr
= n_expr
.as(not null)
7280 n_expr
.parent
= self
7281 _n_kwas
= n_kwas
.as(not null)
7282 n_kwas
.parent
= self
7283 _n_opar
= n_opar
.as(not null)
7284 n_opar
.parent
= self
7285 _n_kwnot
= n_kwnot
.as(not null)
7286 n_kwnot
.parent
= self
7287 _n_kwnull
= n_kwnull
.as(not null)
7288 n_kwnull
.parent
= self
7289 _n_cpar
= n_cpar
.as(not null)
7290 n_cpar
.parent
= self
7293 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7295 if _n_expr
== old_child
then
7296 if new_child
!= null then
7297 new_child
.parent
= self
7298 assert new_child
isa AExpr
7305 if _n_kwas
== old_child
then
7306 if new_child
!= null then
7307 new_child
.parent
= self
7308 assert new_child
isa TKwas
7315 if _n_opar
== old_child
then
7316 if new_child
!= null then
7317 new_child
.parent
= self
7318 assert new_child
isa TOpar
7325 if _n_kwnot
== old_child
then
7326 if new_child
!= null then
7327 new_child
.parent
= self
7328 assert new_child
isa TKwnot
7329 _n_kwnot
= new_child
7335 if _n_kwnull
== old_child
then
7336 if new_child
!= null then
7337 new_child
.parent
= self
7338 assert new_child
isa TKwnull
7339 _n_kwnull
= new_child
7345 if _n_cpar
== old_child
then
7346 if new_child
!= null then
7347 new_child
.parent
= self
7348 assert new_child
isa TCpar
7357 redef fun visit_all
(v
: Visitor)
7359 v
.enter_visit
(_n_expr
)
7360 v
.enter_visit
(_n_kwas
)
7361 v
.enter_visit
(_n_opar
)
7362 v
.enter_visit
(_n_kwnot
)
7363 v
.enter_visit
(_n_kwnull
)
7364 v
.enter_visit
(_n_cpar
)
7367 redef class AIssetAttrExpr
7368 private init empty_init
do end
7370 init init_aissetattrexpr
(
7371 n_kwisset
: nullable TKwisset,
7372 n_expr
: nullable AExpr,
7373 n_id
: nullable TAttrid
7377 _n_kwisset
= n_kwisset
.as(not null)
7378 n_kwisset
.parent
= self
7379 _n_expr
= n_expr
.as(not null)
7380 n_expr
.parent
= self
7381 _n_id
= n_id
.as(not null)
7385 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7387 if _n_kwisset
== old_child
then
7388 if new_child
!= null then
7389 new_child
.parent
= self
7390 assert new_child
isa TKwisset
7391 _n_kwisset
= new_child
7397 if _n_expr
== old_child
then
7398 if new_child
!= null then
7399 new_child
.parent
= self
7400 assert new_child
isa AExpr
7407 if _n_id
== old_child
then
7408 if new_child
!= null then
7409 new_child
.parent
= self
7410 assert new_child
isa TAttrid
7419 redef fun visit_all
(v
: Visitor)
7421 v
.enter_visit
(_n_kwisset
)
7422 v
.enter_visit
(_n_expr
)
7423 v
.enter_visit
(_n_id
)
7426 redef class ADebugTypeExpr
7427 private init empty_init
do end
7429 init init_adebugtypeexpr
(
7430 n_kwdebug
: nullable TKwdebug,
7431 n_kwtype
: nullable TKwtype,
7432 n_expr
: nullable AExpr,
7433 n_type
: nullable AType
7437 _n_kwdebug
= n_kwdebug
.as(not null)
7438 n_kwdebug
.parent
= self
7439 _n_kwtype
= n_kwtype
.as(not null)
7440 n_kwtype
.parent
= self
7441 _n_expr
= n_expr
.as(not null)
7442 n_expr
.parent
= self
7443 _n_type
= n_type
.as(not null)
7444 n_type
.parent
= self
7447 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7449 if _n_kwdebug
== old_child
then
7450 if new_child
!= null then
7451 new_child
.parent
= self
7452 assert new_child
isa TKwdebug
7453 _n_kwdebug
= new_child
7459 if _n_kwtype
== old_child
then
7460 if new_child
!= null then
7461 new_child
.parent
= self
7462 assert new_child
isa TKwtype
7463 _n_kwtype
= new_child
7469 if _n_expr
== old_child
then
7470 if new_child
!= null then
7471 new_child
.parent
= self
7472 assert new_child
isa AExpr
7479 if _n_type
== old_child
then
7480 if new_child
!= null then
7481 new_child
.parent
= self
7482 assert new_child
isa AType
7491 redef fun visit_all
(v
: Visitor)
7493 v
.enter_visit
(_n_kwdebug
)
7494 v
.enter_visit
(_n_kwtype
)
7495 v
.enter_visit
(_n_expr
)
7496 v
.enter_visit
(_n_type
)
7499 redef class AListExprs
7500 private init empty_init
do end
7502 init init_alistexprs
(
7503 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7514 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7516 for i
in [0.._n_exprs
.length
[ do
7517 if _n_exprs
[i
] == old_child
then
7518 if new_child
!= null then
7519 assert new_child
isa AExpr
7520 _n_exprs
[i
] = new_child
7521 new_child
.parent
= self
7523 _n_exprs
.remove_at
(i
)
7530 redef fun visit_all
(v
: Visitor)
7532 for n
in _n_exprs
do
7537 redef class AParExprs
7538 private init empty_init
do end
7540 init init_aparexprs
(
7541 n_opar
: nullable TOpar,
7542 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7543 n_cpar
: nullable TCpar
7547 _n_opar
= n_opar
.as(not null)
7548 n_opar
.parent
= self
7554 _n_cpar
= n_cpar
.as(not null)
7555 n_cpar
.parent
= self
7558 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7560 if _n_opar
== old_child
then
7561 if new_child
!= null then
7562 new_child
.parent
= self
7563 assert new_child
isa TOpar
7570 for i
in [0.._n_exprs
.length
[ do
7571 if _n_exprs
[i
] == old_child
then
7572 if new_child
!= null then
7573 assert new_child
isa AExpr
7574 _n_exprs
[i
] = new_child
7575 new_child
.parent
= self
7577 _n_exprs
.remove_at
(i
)
7582 if _n_cpar
== old_child
then
7583 if new_child
!= null then
7584 new_child
.parent
= self
7585 assert new_child
isa TCpar
7594 redef fun visit_all
(v
: Visitor)
7596 v
.enter_visit
(_n_opar
)
7597 for n
in _n_exprs
do
7600 v
.enter_visit
(_n_cpar
)
7603 redef class ABraExprs
7604 private init empty_init
do end
7606 init init_abraexprs
(
7607 n_obra
: nullable TObra,
7608 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7609 n_cbra
: nullable TCbra
7613 _n_obra
= n_obra
.as(not null)
7614 n_obra
.parent
= self
7620 _n_cbra
= n_cbra
.as(not null)
7621 n_cbra
.parent
= self
7624 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7626 if _n_obra
== old_child
then
7627 if new_child
!= null then
7628 new_child
.parent
= self
7629 assert new_child
isa TObra
7636 for i
in [0.._n_exprs
.length
[ do
7637 if _n_exprs
[i
] == old_child
then
7638 if new_child
!= null then
7639 assert new_child
isa AExpr
7640 _n_exprs
[i
] = new_child
7641 new_child
.parent
= self
7643 _n_exprs
.remove_at
(i
)
7648 if _n_cbra
== old_child
then
7649 if new_child
!= null then
7650 new_child
.parent
= self
7651 assert new_child
isa TCbra
7660 redef fun visit_all
(v
: Visitor)
7662 v
.enter_visit
(_n_obra
)
7663 for n
in _n_exprs
do
7666 v
.enter_visit
(_n_cbra
)
7669 redef class APlusAssignOp
7670 private init empty_init
do end
7672 init init_aplusassignop
(
7673 n_pluseq
: nullable TPluseq
7677 _n_pluseq
= n_pluseq
.as(not null)
7678 n_pluseq
.parent
= self
7681 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7683 if _n_pluseq
== old_child
then
7684 if new_child
!= null then
7685 new_child
.parent
= self
7686 assert new_child
isa TPluseq
7687 _n_pluseq
= new_child
7695 redef fun visit_all
(v
: Visitor)
7697 v
.enter_visit
(_n_pluseq
)
7700 redef class AMinusAssignOp
7701 private init empty_init
do end
7703 init init_aminusassignop
(
7704 n_minuseq
: nullable TMinuseq
7708 _n_minuseq
= n_minuseq
.as(not null)
7709 n_minuseq
.parent
= self
7712 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7714 if _n_minuseq
== old_child
then
7715 if new_child
!= null then
7716 new_child
.parent
= self
7717 assert new_child
isa TMinuseq
7718 _n_minuseq
= new_child
7726 redef fun visit_all
(v
: Visitor)
7728 v
.enter_visit
(_n_minuseq
)
7731 redef class AClosureDef
7732 private init empty_init
do end
7734 init init_aclosuredef
(
7735 n_bang
: nullable TBang,
7736 n_id
: nullable AClosureId,
7737 n_ids
: Collection[Object], # Should be Collection[TId]
7738 n_kwdo
: nullable TKwdo,
7739 n_expr
: nullable AExpr,
7740 n_label
: nullable ALabel
7744 _n_bang
= n_bang
.as(not null)
7745 n_bang
.parent
= self
7746 _n_id
= n_id
.as(not null)
7754 if n_kwdo
!= null then
7755 n_kwdo
.parent
= self
7758 if n_expr
!= null then
7759 n_expr
.parent
= self
7762 if n_label
!= null then
7763 n_label
.parent
= self
7767 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7769 if _n_bang
== old_child
then
7770 if new_child
!= null then
7771 new_child
.parent
= self
7772 assert new_child
isa TBang
7779 if _n_id
== old_child
then
7780 if new_child
!= null then
7781 new_child
.parent
= self
7782 assert new_child
isa AClosureId
7789 for i
in [0.._n_ids
.length
[ do
7790 if _n_ids
[i
] == old_child
then
7791 if new_child
!= null then
7792 assert new_child
isa TId
7793 _n_ids
[i
] = new_child
7794 new_child
.parent
= self
7801 if _n_kwdo
== old_child
then
7802 if new_child
!= null then
7803 new_child
.parent
= self
7804 assert new_child
isa TKwdo
7811 if _n_expr
== old_child
then
7812 if new_child
!= null then
7813 new_child
.parent
= self
7814 assert new_child
isa AExpr
7821 if _n_label
== old_child
then
7822 if new_child
!= null then
7823 new_child
.parent
= self
7824 assert new_child
isa ALabel
7825 _n_label
= new_child
7833 redef fun visit_all
(v
: Visitor)
7835 v
.enter_visit
(_n_bang
)
7836 v
.enter_visit
(_n_id
)
7840 if _n_kwdo
!= null then
7841 v
.enter_visit
(_n_kwdo
.as(not null))
7843 if _n_expr
!= null then
7844 v
.enter_visit
(_n_expr
.as(not null))
7846 if _n_label
!= null then
7847 v
.enter_visit
(_n_label
.as(not null))
7851 redef class ASimpleClosureId
7852 private init empty_init
do end
7854 init init_asimpleclosureid
(
7859 _n_id
= n_id
.as(not null)
7863 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7865 if _n_id
== old_child
then
7866 if new_child
!= null then
7867 new_child
.parent
= self
7868 assert new_child
isa TId
7877 redef fun visit_all
(v
: Visitor)
7879 v
.enter_visit
(_n_id
)
7882 redef class ABreakClosureId
7883 private init empty_init
do end
7885 init init_abreakclosureid
(
7886 n_kwbreak
: nullable TKwbreak
7890 _n_kwbreak
= n_kwbreak
.as(not null)
7891 n_kwbreak
.parent
= self
7894 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7896 if _n_kwbreak
== old_child
then
7897 if new_child
!= null then
7898 new_child
.parent
= self
7899 assert new_child
isa TKwbreak
7900 _n_kwbreak
= new_child
7908 redef fun visit_all
(v
: Visitor)
7910 v
.enter_visit
(_n_kwbreak
)
7913 redef class AModuleName
7914 private init empty_init
do end
7916 init init_amodulename
(
7917 n_quad
: nullable TQuad,
7918 n_path
: Collection[Object], # Should be Collection[TId]
7924 if n_quad
!= null then
7925 n_quad
.parent
= self
7932 _n_id
= n_id
.as(not null)
7936 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7938 if _n_quad
== old_child
then
7939 if new_child
!= null then
7940 new_child
.parent
= self
7941 assert new_child
isa TQuad
7948 for i
in [0.._n_path
.length
[ do
7949 if _n_path
[i
] == old_child
then
7950 if new_child
!= null then
7951 assert new_child
isa TId
7952 _n_path
[i
] = new_child
7953 new_child
.parent
= self
7955 _n_path
.remove_at
(i
)
7960 if _n_id
== old_child
then
7961 if new_child
!= null then
7962 new_child
.parent
= self
7963 assert new_child
isa TId
7972 redef fun visit_all
(v
: Visitor)
7974 if _n_quad
!= null then
7975 v
.enter_visit
(_n_quad
.as(not null))
7980 v
.enter_visit
(_n_id
)
7983 redef class AExternCalls
7984 private init empty_init
do end
7986 init init_aexterncalls
(
7987 n_kwimport
: nullable TKwimport,
7988 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7992 _n_kwimport
= n_kwimport
.as(not null)
7993 n_kwimport
.parent
= self
7994 for n
in n_extern_calls
do
7995 assert n
isa AExternCall
7996 _n_extern_calls
.add
(n
)
8001 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8003 if _n_kwimport
== old_child
then
8004 if new_child
!= null then
8005 new_child
.parent
= self
8006 assert new_child
isa TKwimport
8007 _n_kwimport
= new_child
8013 for i
in [0.._n_extern_calls
.length
[ do
8014 if _n_extern_calls
[i
] == old_child
then
8015 if new_child
!= null then
8016 assert new_child
isa AExternCall
8017 _n_extern_calls
[i
] = new_child
8018 new_child
.parent
= self
8020 _n_extern_calls
.remove_at
(i
)
8027 redef fun visit_all
(v
: Visitor)
8029 v
.enter_visit
(_n_kwimport
)
8030 for n
in _n_extern_calls
do
8035 redef class AExternCall
8036 private init empty_init
do end
8038 init init_aexterncall
8043 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8047 redef fun visit_all
(v
: Visitor)
8051 redef class ASuperExternCall
8052 private init empty_init
do end
8054 init init_asuperexterncall
(
8055 n_kwsuper
: nullable TKwsuper
8059 _n_kwsuper
= n_kwsuper
.as(not null)
8060 n_kwsuper
.parent
= self
8063 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8065 if _n_kwsuper
== old_child
then
8066 if new_child
!= null then
8067 new_child
.parent
= self
8068 assert new_child
isa TKwsuper
8069 _n_kwsuper
= new_child
8077 redef fun visit_all
(v
: Visitor)
8079 v
.enter_visit
(_n_kwsuper
)
8082 redef class ALocalPropExternCall
8083 private init empty_init
do end
8085 init init_alocalpropexterncall
(
8086 n_methid
: nullable AMethid
8090 _n_methid
= n_methid
.as(not null)
8091 n_methid
.parent
= self
8094 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8096 if _n_methid
== old_child
then
8097 if new_child
!= null then
8098 new_child
.parent
= self
8099 assert new_child
isa AMethid
8100 _n_methid
= new_child
8108 redef fun visit_all
(v
: Visitor)
8110 v
.enter_visit
(_n_methid
)
8113 redef class AFullPropExternCall
8114 private init empty_init
do end
8116 init init_afullpropexterncall
(
8117 n_classid
: nullable TClassid,
8118 n_quad
: nullable TQuad,
8119 n_methid
: nullable AMethid
8123 _n_classid
= n_classid
.as(not null)
8124 n_classid
.parent
= self
8126 if n_quad
!= null then
8127 n_quad
.parent
= self
8129 _n_methid
= n_methid
.as(not null)
8130 n_methid
.parent
= self
8133 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8135 if _n_classid
== old_child
then
8136 if new_child
!= null then
8137 new_child
.parent
= self
8138 assert new_child
isa TClassid
8139 _n_classid
= new_child
8145 if _n_quad
== old_child
then
8146 if new_child
!= null then
8147 new_child
.parent
= self
8148 assert new_child
isa TQuad
8155 if _n_methid
== old_child
then
8156 if new_child
!= null then
8157 new_child
.parent
= self
8158 assert new_child
isa AMethid
8159 _n_methid
= new_child
8167 redef fun visit_all
(v
: Visitor)
8169 v
.enter_visit
(_n_classid
)
8170 if _n_quad
!= null then
8171 v
.enter_visit
(_n_quad
.as(not null))
8173 v
.enter_visit
(_n_methid
)
8176 redef class AInitPropExternCall
8177 private init empty_init
do end
8179 init init_ainitpropexterncall
(
8180 n_classid
: nullable TClassid
8184 _n_classid
= n_classid
.as(not null)
8185 n_classid
.parent
= self
8188 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8190 if _n_classid
== old_child
then
8191 if new_child
!= null then
8192 new_child
.parent
= self
8193 assert new_child
isa TClassid
8194 _n_classid
= new_child
8202 redef fun visit_all
(v
: Visitor)
8204 v
.enter_visit
(_n_classid
)
8207 redef class ACastAsExternCall
8208 private init empty_init
do end
8210 init init_acastasexterncall
(
8211 n_from_type
: nullable AType,
8212 n_kwas
: nullable TKwas,
8213 n_to_type
: nullable AType
8217 _n_from_type
= n_from_type
.as(not null)
8218 n_from_type
.parent
= self
8219 _n_kwas
= n_kwas
.as(not null)
8220 n_kwas
.parent
= self
8221 _n_to_type
= n_to_type
.as(not null)
8222 n_to_type
.parent
= self
8225 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8227 if _n_from_type
== old_child
then
8228 if new_child
!= null then
8229 new_child
.parent
= self
8230 assert new_child
isa AType
8231 _n_from_type
= new_child
8237 if _n_kwas
== old_child
then
8238 if new_child
!= null then
8239 new_child
.parent
= self
8240 assert new_child
isa TKwas
8247 if _n_to_type
== old_child
then
8248 if new_child
!= null then
8249 new_child
.parent
= self
8250 assert new_child
isa AType
8251 _n_to_type
= new_child
8259 redef fun visit_all
(v
: Visitor)
8261 v
.enter_visit
(_n_from_type
)
8262 v
.enter_visit
(_n_kwas
)
8263 v
.enter_visit
(_n_to_type
)
8266 redef class AAsNullableExternCall
8267 private init empty_init
do end
8269 init init_aasnullableexterncall
(
8270 n_type
: nullable AType,
8271 n_kwas
: nullable TKwas,
8272 n_kwnullable
: nullable TKwnullable
8276 _n_type
= n_type
.as(not null)
8277 n_type
.parent
= self
8278 _n_kwas
= n_kwas
.as(not null)
8279 n_kwas
.parent
= self
8280 _n_kwnullable
= n_kwnullable
.as(not null)
8281 n_kwnullable
.parent
= self
8284 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8286 if _n_type
== old_child
then
8287 if new_child
!= null then
8288 new_child
.parent
= self
8289 assert new_child
isa AType
8296 if _n_kwas
== old_child
then
8297 if new_child
!= null then
8298 new_child
.parent
= self
8299 assert new_child
isa TKwas
8306 if _n_kwnullable
== old_child
then
8307 if new_child
!= null then
8308 new_child
.parent
= self
8309 assert new_child
isa TKwnullable
8310 _n_kwnullable
= new_child
8318 redef fun visit_all
(v
: Visitor)
8320 v
.enter_visit
(_n_type
)
8321 v
.enter_visit
(_n_kwas
)
8322 v
.enter_visit
(_n_kwnullable
)
8325 redef class AAsNotNullableExternCall
8326 private init empty_init
do end
8328 init init_aasnotnullableexterncall
(
8329 n_type
: nullable AType,
8330 n_kwas
: nullable TKwas,
8331 n_kwnot
: nullable TKwnot,
8332 n_kwnullable
: nullable TKwnullable
8336 _n_type
= n_type
.as(not null)
8337 n_type
.parent
= self
8338 _n_kwas
= n_kwas
.as(not null)
8339 n_kwas
.parent
= self
8340 _n_kwnot
= n_kwnot
.as(not null)
8341 n_kwnot
.parent
= self
8342 _n_kwnullable
= n_kwnullable
.as(not null)
8343 n_kwnullable
.parent
= self
8346 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8348 if _n_type
== old_child
then
8349 if new_child
!= null then
8350 new_child
.parent
= self
8351 assert new_child
isa AType
8358 if _n_kwas
== old_child
then
8359 if new_child
!= null then
8360 new_child
.parent
= self
8361 assert new_child
isa TKwas
8368 if _n_kwnot
== old_child
then
8369 if new_child
!= null then
8370 new_child
.parent
= self
8371 assert new_child
isa TKwnot
8372 _n_kwnot
= new_child
8378 if _n_kwnullable
== old_child
then
8379 if new_child
!= null then
8380 new_child
.parent
= self
8381 assert new_child
isa TKwnullable
8382 _n_kwnullable
= new_child
8390 redef fun visit_all
(v
: Visitor)
8392 v
.enter_visit
(_n_type
)
8393 v
.enter_visit
(_n_kwas
)
8394 v
.enter_visit
(_n_kwnot
)
8395 v
.enter_visit
(_n_kwnullable
)
8398 redef class AInLanguage
8399 private init empty_init
do end
8401 init init_ainlanguage
(
8402 n_kwin
: nullable TKwin,
8403 n_string
: nullable TString
8407 _n_kwin
= n_kwin
.as(not null)
8408 n_kwin
.parent
= self
8409 _n_string
= n_string
.as(not null)
8410 n_string
.parent
= self
8413 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8415 if _n_kwin
== old_child
then
8416 if new_child
!= null then
8417 new_child
.parent
= self
8418 assert new_child
isa TKwin
8425 if _n_string
== old_child
then
8426 if new_child
!= null then
8427 new_child
.parent
= self
8428 assert new_child
isa TString
8429 _n_string
= new_child
8437 redef fun visit_all
(v
: Visitor)
8439 v
.enter_visit
(_n_kwin
)
8440 v
.enter_visit
(_n_string
)
8443 redef class AExternCodeBlock
8444 private init empty_init
do end
8446 init init_aexterncodeblock
(
8447 n_in_language
: nullable AInLanguage,
8448 n_extern_code_segment
: nullable TExternCodeSegment
8452 _n_in_language
= n_in_language
8453 if n_in_language
!= null then
8454 n_in_language
.parent
= self
8456 _n_extern_code_segment
= n_extern_code_segment
.as(not null)
8457 n_extern_code_segment
.parent
= self
8460 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8462 if _n_in_language
== old_child
then
8463 if new_child
!= null then
8464 new_child
.parent
= self
8465 assert new_child
isa AInLanguage
8466 _n_in_language
= new_child
8468 _n_in_language
= null
8472 if _n_extern_code_segment
== old_child
then
8473 if new_child
!= null then
8474 new_child
.parent
= self
8475 assert new_child
isa TExternCodeSegment
8476 _n_extern_code_segment
= new_child
8484 redef fun visit_all
(v
: Visitor)
8486 if _n_in_language
!= null then
8487 v
.enter_visit
(_n_in_language
.as(not null))
8489 v
.enter_visit
(_n_extern_code_segment
)
8492 redef class AQualified
8493 private init empty_init
do end
8495 init init_aqualified
(
8496 n_id
: Collection[Object], # Should be Collection[TId]
8497 n_classid
: nullable TClassid
8506 _n_classid
= n_classid
8507 if n_classid
!= null then
8508 n_classid
.parent
= self
8512 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8514 for i
in [0.._n_id
.length
[ do
8515 if _n_id
[i
] == old_child
then
8516 if new_child
!= null then
8517 assert new_child
isa TId
8518 _n_id
[i
] = new_child
8519 new_child
.parent
= self
8526 if _n_classid
== old_child
then
8527 if new_child
!= null then
8528 new_child
.parent
= self
8529 assert new_child
isa TClassid
8530 _n_classid
= new_child
8538 redef fun visit_all
(v
: Visitor)
8543 if _n_classid
!= null then
8544 v
.enter_visit
(_n_classid
.as(not null))
8549 private init empty_init
do end
8552 n_comment
: Collection[Object] # Should be Collection[TComment]
8556 for n
in n_comment
do
8557 assert n
isa TComment
8563 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8565 for i
in [0.._n_comment
.length
[ do
8566 if _n_comment
[i
] == old_child
then
8567 if new_child
!= null then
8568 assert new_child
isa TComment
8569 _n_comment
[i
] = new_child
8570 new_child
.parent
= self
8572 _n_comment
.remove_at
(i
)
8579 redef fun visit_all
(v
: Visitor)
8581 for n
in _n_comment
do
8588 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8590 if _n_base
== old_child
then
8591 if new_child
== null then
8593 new_child
.parent
= self
8594 assert new_child
isa AModule
8597 old_child
.parent
= null
8602 redef fun visit_all
(v
: Visitor)
8604 if _n_base
!= null then
8605 v
.enter_visit
(_n_base
.as(not null))
8607 v
.enter_visit
(_n_eof
)