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
874 _n_kwextern
= n_kwextern
.as(not null)
875 n_kwextern
.parent
= self
878 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
880 if _n_kwextern
== old_child
then
881 if new_child
!= null then
882 new_child
.parent
= self
883 assert new_child
isa TKwextern
884 _n_kwextern
= new_child
892 redef fun visit_all
(v
: Visitor)
894 v
.enter_visit
(_n_kwextern
)
897 redef class AFormaldef
898 private init empty_init
do end
900 init init_aformaldef
(
901 n_id
: nullable TClassid,
902 n_type
: nullable AType
906 _n_id
= n_id
.as(not null)
909 if n_type
!= null then
914 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
916 if _n_id
== old_child
then
917 if new_child
!= null then
918 new_child
.parent
= self
919 assert new_child
isa TClassid
926 if _n_type
== old_child
then
927 if new_child
!= null then
928 new_child
.parent
= self
929 assert new_child
isa AType
938 redef fun visit_all
(v
: Visitor)
941 if _n_type
!= null then
942 v
.enter_visit
(_n_type
.as(not null))
946 redef class ASuperclass
947 private init empty_init
do end
949 init init_asuperclass
(
950 n_kwsuper
: nullable TKwsuper,
951 n_type
: nullable AType
955 _n_kwsuper
= n_kwsuper
.as(not null)
956 n_kwsuper
.parent
= self
957 _n_type
= n_type
.as(not null)
961 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
963 if _n_kwsuper
== old_child
then
964 if new_child
!= null then
965 new_child
.parent
= self
966 assert new_child
isa TKwsuper
967 _n_kwsuper
= new_child
973 if _n_type
== old_child
then
974 if new_child
!= null then
975 new_child
.parent
= self
976 assert new_child
isa AType
985 redef fun visit_all
(v
: Visitor)
987 v
.enter_visit
(_n_kwsuper
)
988 v
.enter_visit
(_n_type
)
991 redef class AAttrPropdef
992 private init empty_init
do end
994 init init_aattrpropdef
(
995 n_doc
: nullable ADoc,
996 n_readable
: nullable AAble,
997 n_writable
: nullable AAble,
998 n_kwredef
: nullable TKwredef,
999 n_visibility
: nullable AVisibility,
1000 n_kwvar
: nullable TKwvar,
1001 n_id
: nullable TAttrid,
1002 n_id2
: nullable TId,
1003 n_type
: nullable AType,
1004 n_expr
: nullable AExpr
1009 if n_doc
!= null then
1012 _n_readable
= n_readable
1013 if n_readable
!= null then
1014 n_readable
.parent
= self
1016 _n_writable
= n_writable
1017 if n_writable
!= null then
1018 n_writable
.parent
= self
1020 _n_kwredef
= n_kwredef
1021 if n_kwredef
!= null then
1022 n_kwredef
.parent
= self
1024 _n_visibility
= n_visibility
.as(not null)
1025 n_visibility
.parent
= self
1026 _n_kwvar
= n_kwvar
.as(not null)
1027 n_kwvar
.parent
= self
1029 if n_id
!= null then
1033 if n_id2
!= null then
1037 if n_type
!= null then
1038 n_type
.parent
= self
1041 if n_expr
!= null then
1042 n_expr
.parent
= self
1046 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1048 if _n_doc
== old_child
then
1049 if new_child
!= null then
1050 new_child
.parent
= self
1051 assert new_child
isa ADoc
1058 if _n_readable
== old_child
then
1059 if new_child
!= null then
1060 new_child
.parent
= self
1061 assert new_child
isa AAble
1062 _n_readable
= new_child
1068 if _n_writable
== old_child
then
1069 if new_child
!= null then
1070 new_child
.parent
= self
1071 assert new_child
isa AAble
1072 _n_writable
= new_child
1078 if _n_kwredef
== old_child
then
1079 if new_child
!= null then
1080 new_child
.parent
= self
1081 assert new_child
isa TKwredef
1082 _n_kwredef
= new_child
1088 if _n_visibility
== old_child
then
1089 if new_child
!= null then
1090 new_child
.parent
= self
1091 assert new_child
isa AVisibility
1092 _n_visibility
= new_child
1098 if _n_kwvar
== old_child
then
1099 if new_child
!= null then
1100 new_child
.parent
= self
1101 assert new_child
isa TKwvar
1102 _n_kwvar
= new_child
1108 if _n_id
== old_child
then
1109 if new_child
!= null then
1110 new_child
.parent
= self
1111 assert new_child
isa TAttrid
1118 if _n_id2
== old_child
then
1119 if new_child
!= null then
1120 new_child
.parent
= self
1121 assert new_child
isa TId
1128 if _n_type
== old_child
then
1129 if new_child
!= null then
1130 new_child
.parent
= self
1131 assert new_child
isa AType
1138 if _n_expr
== old_child
then
1139 if new_child
!= null then
1140 new_child
.parent
= self
1141 assert new_child
isa AExpr
1150 redef fun visit_all
(v
: Visitor)
1152 if _n_doc
!= null then
1153 v
.enter_visit
(_n_doc
.as(not null))
1155 if _n_readable
!= null then
1156 v
.enter_visit
(_n_readable
.as(not null))
1158 if _n_writable
!= null then
1159 v
.enter_visit
(_n_writable
.as(not null))
1161 if _n_kwredef
!= null then
1162 v
.enter_visit
(_n_kwredef
.as(not null))
1164 v
.enter_visit
(_n_visibility
)
1165 v
.enter_visit
(_n_kwvar
)
1166 if _n_id
!= null then
1167 v
.enter_visit
(_n_id
.as(not null))
1169 if _n_id2
!= null then
1170 v
.enter_visit
(_n_id2
.as(not null))
1172 if _n_type
!= null then
1173 v
.enter_visit
(_n_type
.as(not null))
1175 if _n_expr
!= null then
1176 v
.enter_visit
(_n_expr
.as(not null))
1180 redef class AMethPropdef
1181 private init empty_init
do end
1183 init init_amethpropdef
(
1184 n_doc
: nullable ADoc,
1185 n_kwredef
: nullable TKwredef,
1186 n_visibility
: nullable AVisibility,
1187 n_methid
: nullable AMethid,
1188 n_signature
: nullable ASignature
1193 if n_doc
!= null then
1196 _n_kwredef
= n_kwredef
1197 if n_kwredef
!= null then
1198 n_kwredef
.parent
= self
1200 _n_visibility
= n_visibility
.as(not null)
1201 n_visibility
.parent
= self
1202 _n_methid
= n_methid
.as(not null)
1203 n_methid
.parent
= self
1204 _n_signature
= n_signature
.as(not null)
1205 n_signature
.parent
= self
1208 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1210 if _n_doc
== old_child
then
1211 if new_child
!= null then
1212 new_child
.parent
= self
1213 assert new_child
isa ADoc
1220 if _n_kwredef
== old_child
then
1221 if new_child
!= null then
1222 new_child
.parent
= self
1223 assert new_child
isa TKwredef
1224 _n_kwredef
= new_child
1230 if _n_visibility
== old_child
then
1231 if new_child
!= null then
1232 new_child
.parent
= self
1233 assert new_child
isa AVisibility
1234 _n_visibility
= new_child
1240 if _n_methid
== old_child
then
1241 if new_child
!= null then
1242 new_child
.parent
= self
1243 assert new_child
isa AMethid
1244 _n_methid
= new_child
1250 if _n_signature
== old_child
then
1251 if new_child
!= null then
1252 new_child
.parent
= self
1253 assert new_child
isa ASignature
1254 _n_signature
= new_child
1262 redef fun visit_all
(v
: Visitor)
1264 if _n_doc
!= null then
1265 v
.enter_visit
(_n_doc
.as(not null))
1267 if _n_kwredef
!= null then
1268 v
.enter_visit
(_n_kwredef
.as(not null))
1270 v
.enter_visit
(_n_visibility
)
1271 v
.enter_visit
(_n_methid
)
1272 v
.enter_visit
(_n_signature
)
1275 redef class ADeferredMethPropdef
1276 private init empty_init
do end
1278 init init_adeferredmethpropdef
(
1279 n_doc
: nullable ADoc,
1280 n_kwredef
: nullable TKwredef,
1281 n_visibility
: nullable AVisibility,
1282 n_kwmeth
: nullable TKwmeth,
1283 n_methid
: nullable AMethid,
1284 n_signature
: nullable ASignature
1289 if n_doc
!= null then
1292 _n_kwredef
= n_kwredef
1293 if n_kwredef
!= null then
1294 n_kwredef
.parent
= self
1296 _n_visibility
= n_visibility
.as(not null)
1297 n_visibility
.parent
= self
1298 _n_kwmeth
= n_kwmeth
.as(not null)
1299 n_kwmeth
.parent
= self
1300 _n_methid
= n_methid
.as(not null)
1301 n_methid
.parent
= self
1302 _n_signature
= n_signature
.as(not null)
1303 n_signature
.parent
= self
1306 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1308 if _n_doc
== old_child
then
1309 if new_child
!= null then
1310 new_child
.parent
= self
1311 assert new_child
isa ADoc
1318 if _n_kwredef
== old_child
then
1319 if new_child
!= null then
1320 new_child
.parent
= self
1321 assert new_child
isa TKwredef
1322 _n_kwredef
= new_child
1328 if _n_visibility
== old_child
then
1329 if new_child
!= null then
1330 new_child
.parent
= self
1331 assert new_child
isa AVisibility
1332 _n_visibility
= new_child
1338 if _n_kwmeth
== old_child
then
1339 if new_child
!= null then
1340 new_child
.parent
= self
1341 assert new_child
isa TKwmeth
1342 _n_kwmeth
= new_child
1348 if _n_methid
== old_child
then
1349 if new_child
!= null then
1350 new_child
.parent
= self
1351 assert new_child
isa AMethid
1352 _n_methid
= new_child
1358 if _n_signature
== old_child
then
1359 if new_child
!= null then
1360 new_child
.parent
= self
1361 assert new_child
isa ASignature
1362 _n_signature
= new_child
1370 redef fun visit_all
(v
: Visitor)
1372 if _n_doc
!= null then
1373 v
.enter_visit
(_n_doc
.as(not null))
1375 if _n_kwredef
!= null then
1376 v
.enter_visit
(_n_kwredef
.as(not null))
1378 v
.enter_visit
(_n_visibility
)
1379 v
.enter_visit
(_n_kwmeth
)
1380 v
.enter_visit
(_n_methid
)
1381 v
.enter_visit
(_n_signature
)
1384 redef class AInternMethPropdef
1385 private init empty_init
do end
1387 init init_ainternmethpropdef
(
1388 n_doc
: nullable ADoc,
1389 n_kwredef
: nullable TKwredef,
1390 n_visibility
: nullable AVisibility,
1391 n_kwmeth
: nullable TKwmeth,
1392 n_methid
: nullable AMethid,
1393 n_signature
: nullable ASignature
1398 if n_doc
!= null then
1401 _n_kwredef
= n_kwredef
1402 if n_kwredef
!= null then
1403 n_kwredef
.parent
= self
1405 _n_visibility
= n_visibility
.as(not null)
1406 n_visibility
.parent
= self
1407 _n_kwmeth
= n_kwmeth
.as(not null)
1408 n_kwmeth
.parent
= self
1409 _n_methid
= n_methid
.as(not null)
1410 n_methid
.parent
= self
1411 _n_signature
= n_signature
.as(not null)
1412 n_signature
.parent
= self
1415 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1417 if _n_doc
== old_child
then
1418 if new_child
!= null then
1419 new_child
.parent
= self
1420 assert new_child
isa ADoc
1427 if _n_kwredef
== old_child
then
1428 if new_child
!= null then
1429 new_child
.parent
= self
1430 assert new_child
isa TKwredef
1431 _n_kwredef
= new_child
1437 if _n_visibility
== old_child
then
1438 if new_child
!= null then
1439 new_child
.parent
= self
1440 assert new_child
isa AVisibility
1441 _n_visibility
= new_child
1447 if _n_kwmeth
== old_child
then
1448 if new_child
!= null then
1449 new_child
.parent
= self
1450 assert new_child
isa TKwmeth
1451 _n_kwmeth
= new_child
1457 if _n_methid
== old_child
then
1458 if new_child
!= null then
1459 new_child
.parent
= self
1460 assert new_child
isa AMethid
1461 _n_methid
= new_child
1467 if _n_signature
== old_child
then
1468 if new_child
!= null then
1469 new_child
.parent
= self
1470 assert new_child
isa ASignature
1471 _n_signature
= new_child
1479 redef fun visit_all
(v
: Visitor)
1481 if _n_doc
!= null then
1482 v
.enter_visit
(_n_doc
.as(not null))
1484 if _n_kwredef
!= null then
1485 v
.enter_visit
(_n_kwredef
.as(not null))
1487 v
.enter_visit
(_n_visibility
)
1488 v
.enter_visit
(_n_kwmeth
)
1489 v
.enter_visit
(_n_methid
)
1490 v
.enter_visit
(_n_signature
)
1493 redef class AExternMethPropdef
1494 private init empty_init
do end
1496 init init_aexternmethpropdef
(
1497 n_doc
: nullable ADoc,
1498 n_kwredef
: nullable TKwredef,
1499 n_visibility
: nullable AVisibility,
1500 n_kwmeth
: nullable TKwmeth,
1501 n_methid
: nullable AMethid,
1502 n_signature
: nullable ASignature,
1503 n_extern
: nullable TString,
1504 n_extern_calls
: nullable AExternCalls,
1505 n_extern_code_block
: nullable AExternCodeBlock
1510 if n_doc
!= null then
1513 _n_kwredef
= n_kwredef
1514 if n_kwredef
!= null then
1515 n_kwredef
.parent
= self
1517 _n_visibility
= n_visibility
.as(not null)
1518 n_visibility
.parent
= self
1519 _n_kwmeth
= n_kwmeth
.as(not null)
1520 n_kwmeth
.parent
= self
1521 _n_methid
= n_methid
.as(not null)
1522 n_methid
.parent
= self
1523 _n_signature
= n_signature
.as(not null)
1524 n_signature
.parent
= self
1525 _n_extern
= n_extern
1526 if n_extern
!= null then
1527 n_extern
.parent
= self
1529 _n_extern_calls
= n_extern_calls
1530 if n_extern_calls
!= null then
1531 n_extern_calls
.parent
= self
1533 _n_extern_code_block
= n_extern_code_block
1534 if n_extern_code_block
!= null then
1535 n_extern_code_block
.parent
= self
1539 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1541 if _n_doc
== old_child
then
1542 if new_child
!= null then
1543 new_child
.parent
= self
1544 assert new_child
isa ADoc
1551 if _n_kwredef
== old_child
then
1552 if new_child
!= null then
1553 new_child
.parent
= self
1554 assert new_child
isa TKwredef
1555 _n_kwredef
= new_child
1561 if _n_visibility
== old_child
then
1562 if new_child
!= null then
1563 new_child
.parent
= self
1564 assert new_child
isa AVisibility
1565 _n_visibility
= new_child
1571 if _n_kwmeth
== old_child
then
1572 if new_child
!= null then
1573 new_child
.parent
= self
1574 assert new_child
isa TKwmeth
1575 _n_kwmeth
= new_child
1581 if _n_methid
== old_child
then
1582 if new_child
!= null then
1583 new_child
.parent
= self
1584 assert new_child
isa AMethid
1585 _n_methid
= new_child
1591 if _n_signature
== old_child
then
1592 if new_child
!= null then
1593 new_child
.parent
= self
1594 assert new_child
isa ASignature
1595 _n_signature
= new_child
1601 if _n_extern
== old_child
then
1602 if new_child
!= null then
1603 new_child
.parent
= self
1604 assert new_child
isa TString
1605 _n_extern
= new_child
1611 if _n_extern_calls
== old_child
then
1612 if new_child
!= null then
1613 new_child
.parent
= self
1614 assert new_child
isa AExternCalls
1615 _n_extern_calls
= new_child
1617 _n_extern_calls
= null
1621 if _n_extern_code_block
== old_child
then
1622 if new_child
!= null then
1623 new_child
.parent
= self
1624 assert new_child
isa AExternCodeBlock
1625 _n_extern_code_block
= new_child
1627 _n_extern_code_block
= null
1633 redef fun visit_all
(v
: Visitor)
1635 if _n_doc
!= null then
1636 v
.enter_visit
(_n_doc
.as(not null))
1638 if _n_kwredef
!= null then
1639 v
.enter_visit
(_n_kwredef
.as(not null))
1641 v
.enter_visit
(_n_visibility
)
1642 v
.enter_visit
(_n_kwmeth
)
1643 v
.enter_visit
(_n_methid
)
1644 v
.enter_visit
(_n_signature
)
1645 if _n_extern
!= null then
1646 v
.enter_visit
(_n_extern
.as(not null))
1648 if _n_extern_calls
!= null then
1649 v
.enter_visit
(_n_extern_calls
.as(not null))
1651 if _n_extern_code_block
!= null then
1652 v
.enter_visit
(_n_extern_code_block
.as(not null))
1656 redef class AConcreteMethPropdef
1657 private init empty_init
do end
1659 init init_aconcretemethpropdef
(
1660 n_doc
: nullable ADoc,
1661 n_kwredef
: nullable TKwredef,
1662 n_visibility
: nullable AVisibility,
1663 n_kwmeth
: nullable TKwmeth,
1664 n_methid
: nullable AMethid,
1665 n_signature
: nullable ASignature,
1666 n_block
: nullable AExpr
1671 if n_doc
!= null then
1674 _n_kwredef
= n_kwredef
1675 if n_kwredef
!= null then
1676 n_kwredef
.parent
= self
1678 _n_visibility
= n_visibility
.as(not null)
1679 n_visibility
.parent
= self
1680 _n_kwmeth
= n_kwmeth
.as(not null)
1681 n_kwmeth
.parent
= self
1682 _n_methid
= n_methid
.as(not null)
1683 n_methid
.parent
= self
1684 _n_signature
= n_signature
.as(not null)
1685 n_signature
.parent
= self
1687 if n_block
!= null then
1688 n_block
.parent
= self
1692 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1694 if _n_doc
== old_child
then
1695 if new_child
!= null then
1696 new_child
.parent
= self
1697 assert new_child
isa ADoc
1704 if _n_kwredef
== old_child
then
1705 if new_child
!= null then
1706 new_child
.parent
= self
1707 assert new_child
isa TKwredef
1708 _n_kwredef
= new_child
1714 if _n_visibility
== old_child
then
1715 if new_child
!= null then
1716 new_child
.parent
= self
1717 assert new_child
isa AVisibility
1718 _n_visibility
= new_child
1724 if _n_kwmeth
== old_child
then
1725 if new_child
!= null then
1726 new_child
.parent
= self
1727 assert new_child
isa TKwmeth
1728 _n_kwmeth
= new_child
1734 if _n_methid
== old_child
then
1735 if new_child
!= null then
1736 new_child
.parent
= self
1737 assert new_child
isa AMethid
1738 _n_methid
= new_child
1744 if _n_signature
== old_child
then
1745 if new_child
!= null then
1746 new_child
.parent
= self
1747 assert new_child
isa ASignature
1748 _n_signature
= new_child
1754 if _n_block
== old_child
then
1755 if new_child
!= null then
1756 new_child
.parent
= self
1757 assert new_child
isa AExpr
1758 _n_block
= new_child
1766 redef fun visit_all
(v
: Visitor)
1768 if _n_doc
!= null then
1769 v
.enter_visit
(_n_doc
.as(not null))
1771 if _n_kwredef
!= null then
1772 v
.enter_visit
(_n_kwredef
.as(not null))
1774 v
.enter_visit
(_n_visibility
)
1775 v
.enter_visit
(_n_kwmeth
)
1776 v
.enter_visit
(_n_methid
)
1777 v
.enter_visit
(_n_signature
)
1778 if _n_block
!= null then
1779 v
.enter_visit
(_n_block
.as(not null))
1783 redef class AConcreteInitPropdef
1784 private init empty_init
do end
1786 init init_aconcreteinitpropdef
(
1787 n_doc
: nullable ADoc,
1788 n_kwredef
: nullable TKwredef,
1789 n_visibility
: nullable AVisibility,
1790 n_kwinit
: nullable TKwinit,
1791 n_methid
: nullable AMethid,
1792 n_signature
: nullable ASignature,
1793 n_block
: nullable AExpr
1798 if n_doc
!= null then
1801 _n_kwredef
= n_kwredef
1802 if n_kwredef
!= null then
1803 n_kwredef
.parent
= self
1805 _n_visibility
= n_visibility
.as(not null)
1806 n_visibility
.parent
= self
1807 _n_kwinit
= n_kwinit
.as(not null)
1808 n_kwinit
.parent
= self
1809 _n_methid
= n_methid
1810 if n_methid
!= null then
1811 n_methid
.parent
= self
1813 _n_signature
= n_signature
.as(not null)
1814 n_signature
.parent
= self
1816 if n_block
!= null then
1817 n_block
.parent
= self
1821 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1823 if _n_doc
== old_child
then
1824 if new_child
!= null then
1825 new_child
.parent
= self
1826 assert new_child
isa ADoc
1833 if _n_kwredef
== old_child
then
1834 if new_child
!= null then
1835 new_child
.parent
= self
1836 assert new_child
isa TKwredef
1837 _n_kwredef
= new_child
1843 if _n_visibility
== old_child
then
1844 if new_child
!= null then
1845 new_child
.parent
= self
1846 assert new_child
isa AVisibility
1847 _n_visibility
= new_child
1853 if _n_kwinit
== old_child
then
1854 if new_child
!= null then
1855 new_child
.parent
= self
1856 assert new_child
isa TKwinit
1857 _n_kwinit
= new_child
1863 if _n_methid
== old_child
then
1864 if new_child
!= null then
1865 new_child
.parent
= self
1866 assert new_child
isa AMethid
1867 _n_methid
= new_child
1873 if _n_signature
== old_child
then
1874 if new_child
!= null then
1875 new_child
.parent
= self
1876 assert new_child
isa ASignature
1877 _n_signature
= new_child
1883 if _n_block
== old_child
then
1884 if new_child
!= null then
1885 new_child
.parent
= self
1886 assert new_child
isa AExpr
1887 _n_block
= new_child
1895 redef fun visit_all
(v
: Visitor)
1897 if _n_doc
!= null then
1898 v
.enter_visit
(_n_doc
.as(not null))
1900 if _n_kwredef
!= null then
1901 v
.enter_visit
(_n_kwredef
.as(not null))
1903 v
.enter_visit
(_n_visibility
)
1904 v
.enter_visit
(_n_kwinit
)
1905 if _n_methid
!= null then
1906 v
.enter_visit
(_n_methid
.as(not null))
1908 v
.enter_visit
(_n_signature
)
1909 if _n_block
!= null then
1910 v
.enter_visit
(_n_block
.as(not null))
1914 redef class AExternInitPropdef
1915 private init empty_init
do end
1917 init init_aexterninitpropdef
(
1918 n_doc
: nullable ADoc,
1919 n_kwredef
: nullable TKwredef,
1920 n_visibility
: nullable AVisibility,
1921 n_kwnew
: nullable TKwnew,
1922 n_methid
: nullable AMethid,
1923 n_signature
: nullable ASignature,
1924 n_extern
: nullable TString,
1925 n_extern_calls
: nullable AExternCalls,
1926 n_extern_code_block
: nullable AExternCodeBlock
1931 if n_doc
!= null then
1934 _n_kwredef
= n_kwredef
1935 if n_kwredef
!= null then
1936 n_kwredef
.parent
= self
1938 _n_visibility
= n_visibility
.as(not null)
1939 n_visibility
.parent
= self
1940 _n_kwnew
= n_kwnew
.as(not null)
1941 n_kwnew
.parent
= self
1942 _n_methid
= n_methid
1943 if n_methid
!= null then
1944 n_methid
.parent
= self
1946 _n_signature
= n_signature
.as(not null)
1947 n_signature
.parent
= self
1948 _n_extern
= n_extern
1949 if n_extern
!= null then
1950 n_extern
.parent
= self
1952 _n_extern_calls
= n_extern_calls
1953 if n_extern_calls
!= null then
1954 n_extern_calls
.parent
= self
1956 _n_extern_code_block
= n_extern_code_block
1957 if n_extern_code_block
!= null then
1958 n_extern_code_block
.parent
= self
1962 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1964 if _n_doc
== old_child
then
1965 if new_child
!= null then
1966 new_child
.parent
= self
1967 assert new_child
isa ADoc
1974 if _n_kwredef
== old_child
then
1975 if new_child
!= null then
1976 new_child
.parent
= self
1977 assert new_child
isa TKwredef
1978 _n_kwredef
= new_child
1984 if _n_visibility
== old_child
then
1985 if new_child
!= null then
1986 new_child
.parent
= self
1987 assert new_child
isa AVisibility
1988 _n_visibility
= new_child
1994 if _n_kwnew
== old_child
then
1995 if new_child
!= null then
1996 new_child
.parent
= self
1997 assert new_child
isa TKwnew
1998 _n_kwnew
= new_child
2004 if _n_methid
== old_child
then
2005 if new_child
!= null then
2006 new_child
.parent
= self
2007 assert new_child
isa AMethid
2008 _n_methid
= new_child
2014 if _n_signature
== old_child
then
2015 if new_child
!= null then
2016 new_child
.parent
= self
2017 assert new_child
isa ASignature
2018 _n_signature
= new_child
2024 if _n_extern
== old_child
then
2025 if new_child
!= null then
2026 new_child
.parent
= self
2027 assert new_child
isa TString
2028 _n_extern
= new_child
2034 if _n_extern_calls
== old_child
then
2035 if new_child
!= null then
2036 new_child
.parent
= self
2037 assert new_child
isa AExternCalls
2038 _n_extern_calls
= new_child
2040 _n_extern_calls
= null
2044 if _n_extern_code_block
== old_child
then
2045 if new_child
!= null then
2046 new_child
.parent
= self
2047 assert new_child
isa AExternCodeBlock
2048 _n_extern_code_block
= new_child
2050 _n_extern_code_block
= null
2056 redef fun visit_all
(v
: Visitor)
2058 if _n_doc
!= null then
2059 v
.enter_visit
(_n_doc
.as(not null))
2061 if _n_kwredef
!= null then
2062 v
.enter_visit
(_n_kwredef
.as(not null))
2064 v
.enter_visit
(_n_visibility
)
2065 v
.enter_visit
(_n_kwnew
)
2066 if _n_methid
!= null then
2067 v
.enter_visit
(_n_methid
.as(not null))
2069 v
.enter_visit
(_n_signature
)
2070 if _n_extern
!= null then
2071 v
.enter_visit
(_n_extern
.as(not null))
2073 if _n_extern_calls
!= null then
2074 v
.enter_visit
(_n_extern_calls
.as(not null))
2076 if _n_extern_code_block
!= null then
2077 v
.enter_visit
(_n_extern_code_block
.as(not null))
2081 redef class AMainMethPropdef
2082 private init empty_init
do end
2084 init init_amainmethpropdef
(
2085 n_kwredef
: nullable TKwredef,
2086 n_block
: nullable AExpr
2090 _n_kwredef
= n_kwredef
2091 if n_kwredef
!= null then
2092 n_kwredef
.parent
= self
2095 if n_block
!= null then
2096 n_block
.parent
= self
2100 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2102 if _n_kwredef
== old_child
then
2103 if new_child
!= null then
2104 new_child
.parent
= self
2105 assert new_child
isa TKwredef
2106 _n_kwredef
= new_child
2112 if _n_block
== old_child
then
2113 if new_child
!= null then
2114 new_child
.parent
= self
2115 assert new_child
isa AExpr
2116 _n_block
= new_child
2124 redef fun visit_all
(v
: Visitor)
2126 if _n_kwredef
!= null then
2127 v
.enter_visit
(_n_kwredef
.as(not null))
2129 if _n_block
!= null then
2130 v
.enter_visit
(_n_block
.as(not null))
2134 redef class ATypePropdef
2135 private init empty_init
do end
2137 init init_atypepropdef
(
2138 n_doc
: nullable ADoc,
2139 n_kwredef
: nullable TKwredef,
2140 n_visibility
: nullable AVisibility,
2141 n_kwtype
: nullable TKwtype,
2142 n_id
: nullable TClassid,
2143 n_type
: nullable AType
2148 if n_doc
!= null then
2151 _n_kwredef
= n_kwredef
2152 if n_kwredef
!= null then
2153 n_kwredef
.parent
= self
2155 _n_visibility
= n_visibility
.as(not null)
2156 n_visibility
.parent
= self
2157 _n_kwtype
= n_kwtype
.as(not null)
2158 n_kwtype
.parent
= self
2159 _n_id
= n_id
.as(not null)
2161 _n_type
= n_type
.as(not null)
2162 n_type
.parent
= self
2165 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2167 if _n_doc
== old_child
then
2168 if new_child
!= null then
2169 new_child
.parent
= self
2170 assert new_child
isa ADoc
2177 if _n_kwredef
== old_child
then
2178 if new_child
!= null then
2179 new_child
.parent
= self
2180 assert new_child
isa TKwredef
2181 _n_kwredef
= new_child
2187 if _n_visibility
== old_child
then
2188 if new_child
!= null then
2189 new_child
.parent
= self
2190 assert new_child
isa AVisibility
2191 _n_visibility
= new_child
2197 if _n_kwtype
== old_child
then
2198 if new_child
!= null then
2199 new_child
.parent
= self
2200 assert new_child
isa TKwtype
2201 _n_kwtype
= new_child
2207 if _n_id
== old_child
then
2208 if new_child
!= null then
2209 new_child
.parent
= self
2210 assert new_child
isa TClassid
2217 if _n_type
== old_child
then
2218 if new_child
!= null then
2219 new_child
.parent
= self
2220 assert new_child
isa AType
2229 redef fun visit_all
(v
: Visitor)
2231 if _n_doc
!= null then
2232 v
.enter_visit
(_n_doc
.as(not null))
2234 if _n_kwredef
!= null then
2235 v
.enter_visit
(_n_kwredef
.as(not null))
2237 v
.enter_visit
(_n_visibility
)
2238 v
.enter_visit
(_n_kwtype
)
2239 v
.enter_visit
(_n_id
)
2240 v
.enter_visit
(_n_type
)
2243 redef class AReadAble
2244 private init empty_init
do end
2246 init init_areadable
(
2247 n_kwredef
: nullable TKwredef,
2248 n_kwreadable
: nullable TKwreadable
2252 _n_kwredef
= n_kwredef
2253 if n_kwredef
!= null then
2254 n_kwredef
.parent
= self
2256 _n_kwreadable
= n_kwreadable
.as(not null)
2257 n_kwreadable
.parent
= self
2260 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2262 if _n_kwredef
== old_child
then
2263 if new_child
!= null then
2264 new_child
.parent
= self
2265 assert new_child
isa TKwredef
2266 _n_kwredef
= new_child
2272 if _n_kwreadable
== old_child
then
2273 if new_child
!= null then
2274 new_child
.parent
= self
2275 assert new_child
isa TKwreadable
2276 _n_kwreadable
= new_child
2284 redef fun visit_all
(v
: Visitor)
2286 if _n_kwredef
!= null then
2287 v
.enter_visit
(_n_kwredef
.as(not null))
2289 v
.enter_visit
(_n_kwreadable
)
2292 redef class AWriteAble
2293 private init empty_init
do end
2295 init init_awriteable
(
2296 n_kwredef
: nullable TKwredef,
2297 n_visibility
: nullable AVisibility,
2298 n_kwwritable
: nullable TKwwritable
2302 _n_kwredef
= n_kwredef
2303 if n_kwredef
!= null then
2304 n_kwredef
.parent
= self
2306 _n_visibility
= n_visibility
2307 if n_visibility
!= null then
2308 n_visibility
.parent
= self
2310 _n_kwwritable
= n_kwwritable
.as(not null)
2311 n_kwwritable
.parent
= self
2314 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2316 if _n_kwredef
== old_child
then
2317 if new_child
!= null then
2318 new_child
.parent
= self
2319 assert new_child
isa TKwredef
2320 _n_kwredef
= new_child
2326 if _n_visibility
== old_child
then
2327 if new_child
!= null then
2328 new_child
.parent
= self
2329 assert new_child
isa AVisibility
2330 _n_visibility
= new_child
2332 _n_visibility
= null
2336 if _n_kwwritable
== old_child
then
2337 if new_child
!= null then
2338 new_child
.parent
= self
2339 assert new_child
isa TKwwritable
2340 _n_kwwritable
= new_child
2348 redef fun visit_all
(v
: Visitor)
2350 if _n_kwredef
!= null then
2351 v
.enter_visit
(_n_kwredef
.as(not null))
2353 if _n_visibility
!= null then
2354 v
.enter_visit
(_n_visibility
.as(not null))
2356 v
.enter_visit
(_n_kwwritable
)
2359 redef class AIdMethid
2360 private init empty_init
do end
2362 init init_aidmethid
(
2367 _n_id
= n_id
.as(not null)
2371 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2373 if _n_id
== old_child
then
2374 if new_child
!= null then
2375 new_child
.parent
= self
2376 assert new_child
isa TId
2385 redef fun visit_all
(v
: Visitor)
2387 v
.enter_visit
(_n_id
)
2390 redef class APlusMethid
2391 private init empty_init
do end
2393 init init_aplusmethid
(
2394 n_plus
: nullable TPlus
2398 _n_plus
= n_plus
.as(not null)
2399 n_plus
.parent
= self
2402 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2404 if _n_plus
== old_child
then
2405 if new_child
!= null then
2406 new_child
.parent
= self
2407 assert new_child
isa TPlus
2416 redef fun visit_all
(v
: Visitor)
2418 v
.enter_visit
(_n_plus
)
2421 redef class AMinusMethid
2422 private init empty_init
do end
2424 init init_aminusmethid
(
2425 n_minus
: nullable TMinus
2429 _n_minus
= n_minus
.as(not null)
2430 n_minus
.parent
= self
2433 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2435 if _n_minus
== old_child
then
2436 if new_child
!= null then
2437 new_child
.parent
= self
2438 assert new_child
isa TMinus
2439 _n_minus
= new_child
2447 redef fun visit_all
(v
: Visitor)
2449 v
.enter_visit
(_n_minus
)
2452 redef class AStarMethid
2453 private init empty_init
do end
2455 init init_astarmethid
(
2456 n_star
: nullable TStar
2460 _n_star
= n_star
.as(not null)
2461 n_star
.parent
= self
2464 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2466 if _n_star
== old_child
then
2467 if new_child
!= null then
2468 new_child
.parent
= self
2469 assert new_child
isa TStar
2478 redef fun visit_all
(v
: Visitor)
2480 v
.enter_visit
(_n_star
)
2483 redef class ASlashMethid
2484 private init empty_init
do end
2486 init init_aslashmethid
(
2487 n_slash
: nullable TSlash
2491 _n_slash
= n_slash
.as(not null)
2492 n_slash
.parent
= self
2495 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2497 if _n_slash
== old_child
then
2498 if new_child
!= null then
2499 new_child
.parent
= self
2500 assert new_child
isa TSlash
2501 _n_slash
= new_child
2509 redef fun visit_all
(v
: Visitor)
2511 v
.enter_visit
(_n_slash
)
2514 redef class APercentMethid
2515 private init empty_init
do end
2517 init init_apercentmethid
(
2518 n_percent
: nullable TPercent
2522 _n_percent
= n_percent
.as(not null)
2523 n_percent
.parent
= self
2526 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2528 if _n_percent
== old_child
then
2529 if new_child
!= null then
2530 new_child
.parent
= self
2531 assert new_child
isa TPercent
2532 _n_percent
= new_child
2540 redef fun visit_all
(v
: Visitor)
2542 v
.enter_visit
(_n_percent
)
2545 redef class AEqMethid
2546 private init empty_init
do end
2548 init init_aeqmethid
(
2553 _n_eq
= n_eq
.as(not null)
2557 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2559 if _n_eq
== old_child
then
2560 if new_child
!= null then
2561 new_child
.parent
= self
2562 assert new_child
isa TEq
2571 redef fun visit_all
(v
: Visitor)
2573 v
.enter_visit
(_n_eq
)
2576 redef class ANeMethid
2577 private init empty_init
do end
2579 init init_anemethid
(
2584 _n_ne
= n_ne
.as(not null)
2588 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2590 if _n_ne
== old_child
then
2591 if new_child
!= null then
2592 new_child
.parent
= self
2593 assert new_child
isa TNe
2602 redef fun visit_all
(v
: Visitor)
2604 v
.enter_visit
(_n_ne
)
2607 redef class ALeMethid
2608 private init empty_init
do end
2610 init init_alemethid
(
2615 _n_le
= n_le
.as(not null)
2619 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2621 if _n_le
== old_child
then
2622 if new_child
!= null then
2623 new_child
.parent
= self
2624 assert new_child
isa TLe
2633 redef fun visit_all
(v
: Visitor)
2635 v
.enter_visit
(_n_le
)
2638 redef class AGeMethid
2639 private init empty_init
do end
2641 init init_agemethid
(
2646 _n_ge
= n_ge
.as(not null)
2650 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2652 if _n_ge
== old_child
then
2653 if new_child
!= null then
2654 new_child
.parent
= self
2655 assert new_child
isa TGe
2664 redef fun visit_all
(v
: Visitor)
2666 v
.enter_visit
(_n_ge
)
2669 redef class ALtMethid
2670 private init empty_init
do end
2672 init init_altmethid
(
2677 _n_lt
= n_lt
.as(not null)
2681 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2683 if _n_lt
== old_child
then
2684 if new_child
!= null then
2685 new_child
.parent
= self
2686 assert new_child
isa TLt
2695 redef fun visit_all
(v
: Visitor)
2697 v
.enter_visit
(_n_lt
)
2700 redef class AGtMethid
2701 private init empty_init
do end
2703 init init_agtmethid
(
2708 _n_gt
= n_gt
.as(not null)
2712 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2714 if _n_gt
== old_child
then
2715 if new_child
!= null then
2716 new_child
.parent
= self
2717 assert new_child
isa TGt
2726 redef fun visit_all
(v
: Visitor)
2728 v
.enter_visit
(_n_gt
)
2731 redef class ALlMethid
2732 private init empty_init
do end
2734 init init_allmethid
(
2739 _n_ll
= n_ll
.as(not null)
2743 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2745 if _n_ll
== old_child
then
2746 if new_child
!= null then
2747 new_child
.parent
= self
2748 assert new_child
isa TLl
2757 redef fun visit_all
(v
: Visitor)
2759 v
.enter_visit
(_n_ll
)
2762 redef class AGgMethid
2763 private init empty_init
do end
2765 init init_aggmethid
(
2770 _n_gg
= n_gg
.as(not null)
2774 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2776 if _n_gg
== old_child
then
2777 if new_child
!= null then
2778 new_child
.parent
= self
2779 assert new_child
isa TGg
2788 redef fun visit_all
(v
: Visitor)
2790 v
.enter_visit
(_n_gg
)
2793 redef class ABraMethid
2794 private init empty_init
do end
2796 init init_abramethid
(
2797 n_obra
: nullable TObra,
2798 n_cbra
: nullable TCbra
2802 _n_obra
= n_obra
.as(not null)
2803 n_obra
.parent
= self
2804 _n_cbra
= n_cbra
.as(not null)
2805 n_cbra
.parent
= self
2808 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2810 if _n_obra
== old_child
then
2811 if new_child
!= null then
2812 new_child
.parent
= self
2813 assert new_child
isa TObra
2820 if _n_cbra
== old_child
then
2821 if new_child
!= null then
2822 new_child
.parent
= self
2823 assert new_child
isa TCbra
2832 redef fun visit_all
(v
: Visitor)
2834 v
.enter_visit
(_n_obra
)
2835 v
.enter_visit
(_n_cbra
)
2838 redef class AStarshipMethid
2839 private init empty_init
do end
2841 init init_astarshipmethid
(
2842 n_starship
: nullable TStarship
2846 _n_starship
= n_starship
.as(not null)
2847 n_starship
.parent
= self
2850 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2852 if _n_starship
== old_child
then
2853 if new_child
!= null then
2854 new_child
.parent
= self
2855 assert new_child
isa TStarship
2856 _n_starship
= new_child
2864 redef fun visit_all
(v
: Visitor)
2866 v
.enter_visit
(_n_starship
)
2869 redef class AAssignMethid
2870 private init empty_init
do end
2872 init init_aassignmethid
(
2874 n_assign
: nullable TAssign
2878 _n_id
= n_id
.as(not null)
2880 _n_assign
= n_assign
.as(not null)
2881 n_assign
.parent
= self
2884 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2886 if _n_id
== old_child
then
2887 if new_child
!= null then
2888 new_child
.parent
= self
2889 assert new_child
isa TId
2896 if _n_assign
== old_child
then
2897 if new_child
!= null then
2898 new_child
.parent
= self
2899 assert new_child
isa TAssign
2900 _n_assign
= new_child
2908 redef fun visit_all
(v
: Visitor)
2910 v
.enter_visit
(_n_id
)
2911 v
.enter_visit
(_n_assign
)
2914 redef class ABraassignMethid
2915 private init empty_init
do end
2917 init init_abraassignmethid
(
2918 n_obra
: nullable TObra,
2919 n_cbra
: nullable TCbra,
2920 n_assign
: nullable TAssign
2924 _n_obra
= n_obra
.as(not null)
2925 n_obra
.parent
= self
2926 _n_cbra
= n_cbra
.as(not null)
2927 n_cbra
.parent
= self
2928 _n_assign
= n_assign
.as(not null)
2929 n_assign
.parent
= self
2932 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2934 if _n_obra
== old_child
then
2935 if new_child
!= null then
2936 new_child
.parent
= self
2937 assert new_child
isa TObra
2944 if _n_cbra
== old_child
then
2945 if new_child
!= null then
2946 new_child
.parent
= self
2947 assert new_child
isa TCbra
2954 if _n_assign
== old_child
then
2955 if new_child
!= null then
2956 new_child
.parent
= self
2957 assert new_child
isa TAssign
2958 _n_assign
= new_child
2966 redef fun visit_all
(v
: Visitor)
2968 v
.enter_visit
(_n_obra
)
2969 v
.enter_visit
(_n_cbra
)
2970 v
.enter_visit
(_n_assign
)
2973 redef class ASignature
2974 private init empty_init
do end
2976 init init_asignature
(
2977 n_opar
: nullable TOpar,
2978 n_params
: Collection[Object], # Should be Collection[AParam]
2979 n_cpar
: nullable TCpar,
2980 n_type
: nullable AType,
2981 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2986 if n_opar
!= null then
2987 n_opar
.parent
= self
2989 for n
in n_params
do
2995 if n_cpar
!= null then
2996 n_cpar
.parent
= self
2999 if n_type
!= null then
3000 n_type
.parent
= self
3002 for n
in n_closure_decls
do
3003 assert n
isa AClosureDecl
3004 _n_closure_decls
.add
(n
)
3009 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3011 if _n_opar
== old_child
then
3012 if new_child
!= null then
3013 new_child
.parent
= self
3014 assert new_child
isa TOpar
3021 for i
in [0.._n_params
.length
[ do
3022 if _n_params
[i
] == old_child
then
3023 if new_child
!= null then
3024 assert new_child
isa AParam
3025 _n_params
[i
] = new_child
3026 new_child
.parent
= self
3028 _n_params
.remove_at
(i
)
3033 if _n_cpar
== old_child
then
3034 if new_child
!= null then
3035 new_child
.parent
= self
3036 assert new_child
isa TCpar
3043 if _n_type
== old_child
then
3044 if new_child
!= null then
3045 new_child
.parent
= self
3046 assert new_child
isa AType
3053 for i
in [0.._n_closure_decls
.length
[ do
3054 if _n_closure_decls
[i
] == old_child
then
3055 if new_child
!= null then
3056 assert new_child
isa AClosureDecl
3057 _n_closure_decls
[i
] = new_child
3058 new_child
.parent
= self
3060 _n_closure_decls
.remove_at
(i
)
3067 redef fun visit_all
(v
: Visitor)
3069 if _n_opar
!= null then
3070 v
.enter_visit
(_n_opar
.as(not null))
3072 for n
in _n_params
do
3075 if _n_cpar
!= null then
3076 v
.enter_visit
(_n_cpar
.as(not null))
3078 if _n_type
!= null then
3079 v
.enter_visit
(_n_type
.as(not null))
3081 for n
in _n_closure_decls
do
3087 private init empty_init
do end
3091 n_type
: nullable AType,
3092 n_dotdotdot
: nullable TDotdotdot
3096 _n_id
= n_id
.as(not null)
3099 if n_type
!= null then
3100 n_type
.parent
= self
3102 _n_dotdotdot
= n_dotdotdot
3103 if n_dotdotdot
!= null then
3104 n_dotdotdot
.parent
= self
3108 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3110 if _n_id
== old_child
then
3111 if new_child
!= null then
3112 new_child
.parent
= self
3113 assert new_child
isa TId
3120 if _n_type
== old_child
then
3121 if new_child
!= null then
3122 new_child
.parent
= self
3123 assert new_child
isa AType
3130 if _n_dotdotdot
== old_child
then
3131 if new_child
!= null then
3132 new_child
.parent
= self
3133 assert new_child
isa TDotdotdot
3134 _n_dotdotdot
= new_child
3142 redef fun visit_all
(v
: Visitor)
3144 v
.enter_visit
(_n_id
)
3145 if _n_type
!= null then
3146 v
.enter_visit
(_n_type
.as(not null))
3148 if _n_dotdotdot
!= null then
3149 v
.enter_visit
(_n_dotdotdot
.as(not null))
3153 redef class AClosureDecl
3154 private init empty_init
do end
3156 init init_aclosuredecl
(
3157 n_kwbreak
: nullable TKwbreak,
3158 n_bang
: nullable TBang,
3160 n_signature
: nullable ASignature,
3161 n_expr
: nullable AExpr
3165 _n_kwbreak
= n_kwbreak
3166 if n_kwbreak
!= null then
3167 n_kwbreak
.parent
= self
3169 _n_bang
= n_bang
.as(not null)
3170 n_bang
.parent
= self
3171 _n_id
= n_id
.as(not null)
3173 _n_signature
= n_signature
.as(not null)
3174 n_signature
.parent
= self
3176 if n_expr
!= null then
3177 n_expr
.parent
= self
3181 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3183 if _n_kwbreak
== old_child
then
3184 if new_child
!= null then
3185 new_child
.parent
= self
3186 assert new_child
isa TKwbreak
3187 _n_kwbreak
= new_child
3193 if _n_bang
== old_child
then
3194 if new_child
!= null then
3195 new_child
.parent
= self
3196 assert new_child
isa TBang
3203 if _n_id
== old_child
then
3204 if new_child
!= null then
3205 new_child
.parent
= self
3206 assert new_child
isa TId
3213 if _n_signature
== old_child
then
3214 if new_child
!= null then
3215 new_child
.parent
= self
3216 assert new_child
isa ASignature
3217 _n_signature
= new_child
3223 if _n_expr
== old_child
then
3224 if new_child
!= null then
3225 new_child
.parent
= self
3226 assert new_child
isa AExpr
3235 redef fun visit_all
(v
: Visitor)
3237 if _n_kwbreak
!= null then
3238 v
.enter_visit
(_n_kwbreak
.as(not null))
3240 v
.enter_visit
(_n_bang
)
3241 v
.enter_visit
(_n_id
)
3242 v
.enter_visit
(_n_signature
)
3243 if _n_expr
!= null then
3244 v
.enter_visit
(_n_expr
.as(not null))
3249 private init empty_init
do end
3252 n_kwnullable
: nullable TKwnullable,
3253 n_id
: nullable TClassid,
3254 n_types
: Collection[Object] # Should be Collection[AType]
3258 _n_kwnullable
= n_kwnullable
3259 if n_kwnullable
!= null then
3260 n_kwnullable
.parent
= self
3262 _n_id
= n_id
.as(not null)
3271 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3273 if _n_kwnullable
== old_child
then
3274 if new_child
!= null then
3275 new_child
.parent
= self
3276 assert new_child
isa TKwnullable
3277 _n_kwnullable
= new_child
3279 _n_kwnullable
= null
3283 if _n_id
== old_child
then
3284 if new_child
!= null then
3285 new_child
.parent
= self
3286 assert new_child
isa TClassid
3293 for i
in [0.._n_types
.length
[ do
3294 if _n_types
[i
] == old_child
then
3295 if new_child
!= null then
3296 assert new_child
isa AType
3297 _n_types
[i
] = new_child
3298 new_child
.parent
= self
3300 _n_types
.remove_at
(i
)
3307 redef fun visit_all
(v
: Visitor)
3309 if _n_kwnullable
!= null then
3310 v
.enter_visit
(_n_kwnullable
.as(not null))
3312 v
.enter_visit
(_n_id
)
3313 for n
in _n_types
do
3319 private init empty_init
do end
3322 n_kwlabel
: nullable TKwlabel,
3327 _n_kwlabel
= n_kwlabel
.as(not null)
3328 n_kwlabel
.parent
= self
3329 _n_id
= n_id
.as(not null)
3333 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3335 if _n_kwlabel
== old_child
then
3336 if new_child
!= null then
3337 new_child
.parent
= self
3338 assert new_child
isa TKwlabel
3339 _n_kwlabel
= new_child
3345 if _n_id
== old_child
then
3346 if new_child
!= null then
3347 new_child
.parent
= self
3348 assert new_child
isa TId
3357 redef fun visit_all
(v
: Visitor)
3359 v
.enter_visit
(_n_kwlabel
)
3360 v
.enter_visit
(_n_id
)
3363 redef class ABlockExpr
3364 private init empty_init
do end
3366 init init_ablockexpr
(
3367 n_expr
: Collection[Object], # Should be Collection[AExpr]
3368 n_kwend
: nullable TKwend
3378 if n_kwend
!= null then
3379 n_kwend
.parent
= self
3383 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3385 for i
in [0.._n_expr
.length
[ do
3386 if _n_expr
[i
] == old_child
then
3387 if new_child
!= null then
3388 assert new_child
isa AExpr
3389 _n_expr
[i
] = new_child
3390 new_child
.parent
= self
3392 _n_expr
.remove_at
(i
)
3397 if _n_kwend
== old_child
then
3398 if new_child
!= null then
3399 new_child
.parent
= self
3400 assert new_child
isa TKwend
3401 _n_kwend
= new_child
3409 redef fun visit_all
(v
: Visitor)
3414 if _n_kwend
!= null then
3415 v
.enter_visit
(_n_kwend
.as(not null))
3419 redef class AVardeclExpr
3420 private init empty_init
do end
3422 init init_avardeclexpr
(
3423 n_kwvar
: nullable TKwvar,
3425 n_type
: nullable AType,
3426 n_assign
: nullable TAssign,
3427 n_expr
: nullable AExpr
3431 _n_kwvar
= n_kwvar
.as(not null)
3432 n_kwvar
.parent
= self
3433 _n_id
= n_id
.as(not null)
3436 if n_type
!= null then
3437 n_type
.parent
= self
3439 _n_assign
= n_assign
3440 if n_assign
!= null then
3441 n_assign
.parent
= self
3444 if n_expr
!= null then
3445 n_expr
.parent
= self
3449 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3451 if _n_kwvar
== old_child
then
3452 if new_child
!= null then
3453 new_child
.parent
= self
3454 assert new_child
isa TKwvar
3455 _n_kwvar
= new_child
3461 if _n_id
== old_child
then
3462 if new_child
!= null then
3463 new_child
.parent
= self
3464 assert new_child
isa TId
3471 if _n_type
== old_child
then
3472 if new_child
!= null then
3473 new_child
.parent
= self
3474 assert new_child
isa AType
3481 if _n_assign
== old_child
then
3482 if new_child
!= null then
3483 new_child
.parent
= self
3484 assert new_child
isa TAssign
3485 _n_assign
= new_child
3491 if _n_expr
== old_child
then
3492 if new_child
!= null then
3493 new_child
.parent
= self
3494 assert new_child
isa AExpr
3503 redef fun visit_all
(v
: Visitor)
3505 v
.enter_visit
(_n_kwvar
)
3506 v
.enter_visit
(_n_id
)
3507 if _n_type
!= null then
3508 v
.enter_visit
(_n_type
.as(not null))
3510 if _n_assign
!= null then
3511 v
.enter_visit
(_n_assign
.as(not null))
3513 if _n_expr
!= null then
3514 v
.enter_visit
(_n_expr
.as(not null))
3518 redef class AReturnExpr
3519 private init empty_init
do end
3521 init init_areturnexpr
(
3522 n_kwreturn
: nullable TKwreturn,
3523 n_expr
: nullable AExpr
3527 _n_kwreturn
= n_kwreturn
3528 if n_kwreturn
!= null then
3529 n_kwreturn
.parent
= self
3532 if n_expr
!= null then
3533 n_expr
.parent
= self
3537 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3539 if _n_kwreturn
== old_child
then
3540 if new_child
!= null then
3541 new_child
.parent
= self
3542 assert new_child
isa TKwreturn
3543 _n_kwreturn
= new_child
3549 if _n_expr
== old_child
then
3550 if new_child
!= null then
3551 new_child
.parent
= self
3552 assert new_child
isa AExpr
3561 redef fun visit_all
(v
: Visitor)
3563 if _n_kwreturn
!= null then
3564 v
.enter_visit
(_n_kwreturn
.as(not null))
3566 if _n_expr
!= null then
3567 v
.enter_visit
(_n_expr
.as(not null))
3571 redef class ABreakExpr
3572 private init empty_init
do end
3574 init init_abreakexpr
(
3575 n_kwbreak
: nullable TKwbreak,
3576 n_label
: nullable ALabel,
3577 n_expr
: nullable AExpr
3581 _n_kwbreak
= n_kwbreak
.as(not null)
3582 n_kwbreak
.parent
= self
3584 if n_label
!= null then
3585 n_label
.parent
= self
3588 if n_expr
!= null then
3589 n_expr
.parent
= self
3593 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3595 if _n_kwbreak
== old_child
then
3596 if new_child
!= null then
3597 new_child
.parent
= self
3598 assert new_child
isa TKwbreak
3599 _n_kwbreak
= new_child
3605 if _n_label
== old_child
then
3606 if new_child
!= null then
3607 new_child
.parent
= self
3608 assert new_child
isa ALabel
3609 _n_label
= new_child
3615 if _n_expr
== old_child
then
3616 if new_child
!= null then
3617 new_child
.parent
= self
3618 assert new_child
isa AExpr
3627 redef fun visit_all
(v
: Visitor)
3629 v
.enter_visit
(_n_kwbreak
)
3630 if _n_label
!= null then
3631 v
.enter_visit
(_n_label
.as(not null))
3633 if _n_expr
!= null then
3634 v
.enter_visit
(_n_expr
.as(not null))
3638 redef class AAbortExpr
3639 private init empty_init
do end
3641 init init_aabortexpr
(
3642 n_kwabort
: nullable TKwabort
3646 _n_kwabort
= n_kwabort
.as(not null)
3647 n_kwabort
.parent
= self
3650 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3652 if _n_kwabort
== old_child
then
3653 if new_child
!= null then
3654 new_child
.parent
= self
3655 assert new_child
isa TKwabort
3656 _n_kwabort
= new_child
3664 redef fun visit_all
(v
: Visitor)
3666 v
.enter_visit
(_n_kwabort
)
3669 redef class AContinueExpr
3670 private init empty_init
do end
3672 init init_acontinueexpr
(
3673 n_kwcontinue
: nullable TKwcontinue,
3674 n_label
: nullable ALabel,
3675 n_expr
: nullable AExpr
3679 _n_kwcontinue
= n_kwcontinue
3680 if n_kwcontinue
!= null then
3681 n_kwcontinue
.parent
= self
3684 if n_label
!= null then
3685 n_label
.parent
= self
3688 if n_expr
!= null then
3689 n_expr
.parent
= self
3693 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3695 if _n_kwcontinue
== old_child
then
3696 if new_child
!= null then
3697 new_child
.parent
= self
3698 assert new_child
isa TKwcontinue
3699 _n_kwcontinue
= new_child
3701 _n_kwcontinue
= null
3705 if _n_label
== old_child
then
3706 if new_child
!= null then
3707 new_child
.parent
= self
3708 assert new_child
isa ALabel
3709 _n_label
= new_child
3715 if _n_expr
== old_child
then
3716 if new_child
!= null then
3717 new_child
.parent
= self
3718 assert new_child
isa AExpr
3727 redef fun visit_all
(v
: Visitor)
3729 if _n_kwcontinue
!= null then
3730 v
.enter_visit
(_n_kwcontinue
.as(not null))
3732 if _n_label
!= null then
3733 v
.enter_visit
(_n_label
.as(not null))
3735 if _n_expr
!= null then
3736 v
.enter_visit
(_n_expr
.as(not null))
3741 private init empty_init
do end
3744 n_kwdo
: nullable TKwdo,
3745 n_block
: nullable AExpr,
3746 n_label
: nullable ALabel
3750 _n_kwdo
= n_kwdo
.as(not null)
3751 n_kwdo
.parent
= self
3753 if n_block
!= null then
3754 n_block
.parent
= self
3757 if n_label
!= null then
3758 n_label
.parent
= self
3762 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3764 if _n_kwdo
== old_child
then
3765 if new_child
!= null then
3766 new_child
.parent
= self
3767 assert new_child
isa TKwdo
3774 if _n_block
== old_child
then
3775 if new_child
!= null then
3776 new_child
.parent
= self
3777 assert new_child
isa AExpr
3778 _n_block
= new_child
3784 if _n_label
== old_child
then
3785 if new_child
!= null then
3786 new_child
.parent
= self
3787 assert new_child
isa ALabel
3788 _n_label
= new_child
3796 redef fun visit_all
(v
: Visitor)
3798 v
.enter_visit
(_n_kwdo
)
3799 if _n_block
!= null then
3800 v
.enter_visit
(_n_block
.as(not null))
3802 if _n_label
!= null then
3803 v
.enter_visit
(_n_label
.as(not null))
3808 private init empty_init
do end
3811 n_kwif
: nullable TKwif,
3812 n_expr
: nullable AExpr,
3813 n_then
: nullable AExpr,
3814 n_else
: nullable AExpr
3818 _n_kwif
= n_kwif
.as(not null)
3819 n_kwif
.parent
= self
3820 _n_expr
= n_expr
.as(not null)
3821 n_expr
.parent
= self
3823 if n_then
!= null then
3824 n_then
.parent
= self
3827 if n_else
!= null then
3828 n_else
.parent
= self
3832 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3834 if _n_kwif
== old_child
then
3835 if new_child
!= null then
3836 new_child
.parent
= self
3837 assert new_child
isa TKwif
3844 if _n_expr
== old_child
then
3845 if new_child
!= null then
3846 new_child
.parent
= self
3847 assert new_child
isa AExpr
3854 if _n_then
== old_child
then
3855 if new_child
!= null then
3856 new_child
.parent
= self
3857 assert new_child
isa AExpr
3864 if _n_else
== old_child
then
3865 if new_child
!= null then
3866 new_child
.parent
= self
3867 assert new_child
isa AExpr
3876 redef fun visit_all
(v
: Visitor)
3878 v
.enter_visit
(_n_kwif
)
3879 v
.enter_visit
(_n_expr
)
3880 if _n_then
!= null then
3881 v
.enter_visit
(_n_then
.as(not null))
3883 if _n_else
!= null then
3884 v
.enter_visit
(_n_else
.as(not null))
3888 redef class AIfexprExpr
3889 private init empty_init
do end
3891 init init_aifexprexpr
(
3892 n_kwif
: nullable TKwif,
3893 n_expr
: nullable AExpr,
3894 n_kwthen
: nullable TKwthen,
3895 n_then
: nullable AExpr,
3896 n_kwelse
: nullable TKwelse,
3897 n_else
: nullable AExpr
3901 _n_kwif
= n_kwif
.as(not null)
3902 n_kwif
.parent
= self
3903 _n_expr
= n_expr
.as(not null)
3904 n_expr
.parent
= self
3905 _n_kwthen
= n_kwthen
.as(not null)
3906 n_kwthen
.parent
= self
3907 _n_then
= n_then
.as(not null)
3908 n_then
.parent
= self
3909 _n_kwelse
= n_kwelse
.as(not null)
3910 n_kwelse
.parent
= self
3911 _n_else
= n_else
.as(not null)
3912 n_else
.parent
= self
3915 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3917 if _n_kwif
== old_child
then
3918 if new_child
!= null then
3919 new_child
.parent
= self
3920 assert new_child
isa TKwif
3927 if _n_expr
== old_child
then
3928 if new_child
!= null then
3929 new_child
.parent
= self
3930 assert new_child
isa AExpr
3937 if _n_kwthen
== old_child
then
3938 if new_child
!= null then
3939 new_child
.parent
= self
3940 assert new_child
isa TKwthen
3941 _n_kwthen
= new_child
3947 if _n_then
== old_child
then
3948 if new_child
!= null then
3949 new_child
.parent
= self
3950 assert new_child
isa AExpr
3957 if _n_kwelse
== old_child
then
3958 if new_child
!= null then
3959 new_child
.parent
= self
3960 assert new_child
isa TKwelse
3961 _n_kwelse
= new_child
3967 if _n_else
== old_child
then
3968 if new_child
!= null then
3969 new_child
.parent
= self
3970 assert new_child
isa AExpr
3979 redef fun visit_all
(v
: Visitor)
3981 v
.enter_visit
(_n_kwif
)
3982 v
.enter_visit
(_n_expr
)
3983 v
.enter_visit
(_n_kwthen
)
3984 v
.enter_visit
(_n_then
)
3985 v
.enter_visit
(_n_kwelse
)
3986 v
.enter_visit
(_n_else
)
3989 redef class AWhileExpr
3990 private init empty_init
do end
3992 init init_awhileexpr
(
3993 n_kwwhile
: nullable TKwwhile,
3994 n_expr
: nullable AExpr,
3995 n_kwdo
: nullable TKwdo,
3996 n_block
: nullable AExpr,
3997 n_label
: nullable ALabel
4001 _n_kwwhile
= n_kwwhile
.as(not null)
4002 n_kwwhile
.parent
= self
4003 _n_expr
= n_expr
.as(not null)
4004 n_expr
.parent
= self
4005 _n_kwdo
= n_kwdo
.as(not null)
4006 n_kwdo
.parent
= self
4008 if n_block
!= null then
4009 n_block
.parent
= self
4012 if n_label
!= null then
4013 n_label
.parent
= self
4017 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4019 if _n_kwwhile
== old_child
then
4020 if new_child
!= null then
4021 new_child
.parent
= self
4022 assert new_child
isa TKwwhile
4023 _n_kwwhile
= new_child
4029 if _n_expr
== old_child
then
4030 if new_child
!= null then
4031 new_child
.parent
= self
4032 assert new_child
isa AExpr
4039 if _n_kwdo
== old_child
then
4040 if new_child
!= null then
4041 new_child
.parent
= self
4042 assert new_child
isa TKwdo
4049 if _n_block
== old_child
then
4050 if new_child
!= null then
4051 new_child
.parent
= self
4052 assert new_child
isa AExpr
4053 _n_block
= new_child
4059 if _n_label
== old_child
then
4060 if new_child
!= null then
4061 new_child
.parent
= self
4062 assert new_child
isa ALabel
4063 _n_label
= new_child
4071 redef fun visit_all
(v
: Visitor)
4073 v
.enter_visit
(_n_kwwhile
)
4074 v
.enter_visit
(_n_expr
)
4075 v
.enter_visit
(_n_kwdo
)
4076 if _n_block
!= null then
4077 v
.enter_visit
(_n_block
.as(not null))
4079 if _n_label
!= null then
4080 v
.enter_visit
(_n_label
.as(not null))
4084 redef class ALoopExpr
4085 private init empty_init
do end
4087 init init_aloopexpr
(
4088 n_kwloop
: nullable TKwloop,
4089 n_block
: nullable AExpr,
4090 n_label
: nullable ALabel
4094 _n_kwloop
= n_kwloop
.as(not null)
4095 n_kwloop
.parent
= self
4097 if n_block
!= null then
4098 n_block
.parent
= self
4101 if n_label
!= null then
4102 n_label
.parent
= self
4106 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4108 if _n_kwloop
== old_child
then
4109 if new_child
!= null then
4110 new_child
.parent
= self
4111 assert new_child
isa TKwloop
4112 _n_kwloop
= new_child
4118 if _n_block
== old_child
then
4119 if new_child
!= null then
4120 new_child
.parent
= self
4121 assert new_child
isa AExpr
4122 _n_block
= new_child
4128 if _n_label
== old_child
then
4129 if new_child
!= null then
4130 new_child
.parent
= self
4131 assert new_child
isa ALabel
4132 _n_label
= new_child
4140 redef fun visit_all
(v
: Visitor)
4142 v
.enter_visit
(_n_kwloop
)
4143 if _n_block
!= null then
4144 v
.enter_visit
(_n_block
.as(not null))
4146 if _n_label
!= null then
4147 v
.enter_visit
(_n_label
.as(not null))
4151 redef class AForExpr
4152 private init empty_init
do end
4154 init init_aforexpr
(
4155 n_kwfor
: nullable TKwfor,
4156 n_ids
: Collection[Object], # Should be Collection[TId]
4157 n_expr
: nullable AExpr,
4158 n_kwdo
: nullable TKwdo,
4159 n_block
: nullable AExpr,
4160 n_label
: nullable ALabel
4164 _n_kwfor
= n_kwfor
.as(not null)
4165 n_kwfor
.parent
= self
4171 _n_expr
= n_expr
.as(not null)
4172 n_expr
.parent
= self
4173 _n_kwdo
= n_kwdo
.as(not null)
4174 n_kwdo
.parent
= self
4176 if n_block
!= null then
4177 n_block
.parent
= self
4180 if n_label
!= null then
4181 n_label
.parent
= self
4185 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4187 if _n_kwfor
== old_child
then
4188 if new_child
!= null then
4189 new_child
.parent
= self
4190 assert new_child
isa TKwfor
4191 _n_kwfor
= new_child
4197 for i
in [0.._n_ids
.length
[ do
4198 if _n_ids
[i
] == old_child
then
4199 if new_child
!= null then
4200 assert new_child
isa TId
4201 _n_ids
[i
] = new_child
4202 new_child
.parent
= self
4209 if _n_expr
== old_child
then
4210 if new_child
!= null then
4211 new_child
.parent
= self
4212 assert new_child
isa AExpr
4219 if _n_kwdo
== old_child
then
4220 if new_child
!= null then
4221 new_child
.parent
= self
4222 assert new_child
isa TKwdo
4229 if _n_block
== old_child
then
4230 if new_child
!= null then
4231 new_child
.parent
= self
4232 assert new_child
isa AExpr
4233 _n_block
= new_child
4239 if _n_label
== old_child
then
4240 if new_child
!= null then
4241 new_child
.parent
= self
4242 assert new_child
isa ALabel
4243 _n_label
= new_child
4251 redef fun visit_all
(v
: Visitor)
4253 v
.enter_visit
(_n_kwfor
)
4257 v
.enter_visit
(_n_expr
)
4258 v
.enter_visit
(_n_kwdo
)
4259 if _n_block
!= null then
4260 v
.enter_visit
(_n_block
.as(not null))
4262 if _n_label
!= null then
4263 v
.enter_visit
(_n_label
.as(not null))
4267 redef class AAssertExpr
4268 private init empty_init
do end
4270 init init_aassertexpr
(
4271 n_kwassert
: nullable TKwassert,
4273 n_expr
: nullable AExpr,
4274 n_else
: nullable AExpr
4278 _n_kwassert
= n_kwassert
.as(not null)
4279 n_kwassert
.parent
= self
4281 if n_id
!= null then
4284 _n_expr
= n_expr
.as(not null)
4285 n_expr
.parent
= self
4287 if n_else
!= null then
4288 n_else
.parent
= self
4292 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4294 if _n_kwassert
== old_child
then
4295 if new_child
!= null then
4296 new_child
.parent
= self
4297 assert new_child
isa TKwassert
4298 _n_kwassert
= new_child
4304 if _n_id
== old_child
then
4305 if new_child
!= null then
4306 new_child
.parent
= self
4307 assert new_child
isa TId
4314 if _n_expr
== old_child
then
4315 if new_child
!= null then
4316 new_child
.parent
= self
4317 assert new_child
isa AExpr
4324 if _n_else
== old_child
then
4325 if new_child
!= null then
4326 new_child
.parent
= self
4327 assert new_child
isa AExpr
4336 redef fun visit_all
(v
: Visitor)
4338 v
.enter_visit
(_n_kwassert
)
4339 if _n_id
!= null then
4340 v
.enter_visit
(_n_id
.as(not null))
4342 v
.enter_visit
(_n_expr
)
4343 if _n_else
!= null then
4344 v
.enter_visit
(_n_else
.as(not null))
4348 redef class AOnceExpr
4349 private init empty_init
do end
4351 init init_aonceexpr
(
4352 n_kwonce
: nullable TKwonce,
4353 n_expr
: nullable AExpr
4357 _n_kwonce
= n_kwonce
.as(not null)
4358 n_kwonce
.parent
= self
4359 _n_expr
= n_expr
.as(not null)
4360 n_expr
.parent
= self
4363 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4365 if _n_kwonce
== old_child
then
4366 if new_child
!= null then
4367 new_child
.parent
= self
4368 assert new_child
isa TKwonce
4369 _n_kwonce
= new_child
4375 if _n_expr
== old_child
then
4376 if new_child
!= null then
4377 new_child
.parent
= self
4378 assert new_child
isa AExpr
4387 redef fun visit_all
(v
: Visitor)
4389 v
.enter_visit
(_n_kwonce
)
4390 v
.enter_visit
(_n_expr
)
4393 redef class ASendExpr
4394 private init empty_init
do end
4396 init init_asendexpr
(
4397 n_expr
: nullable AExpr
4401 _n_expr
= n_expr
.as(not null)
4402 n_expr
.parent
= self
4405 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4407 if _n_expr
== old_child
then
4408 if new_child
!= null then
4409 new_child
.parent
= self
4410 assert new_child
isa AExpr
4419 redef fun visit_all
(v
: Visitor)
4421 v
.enter_visit
(_n_expr
)
4424 redef class ABinopExpr
4425 private init empty_init
do end
4427 init init_abinopexpr
(
4428 n_expr
: nullable AExpr,
4429 n_expr2
: nullable AExpr
4433 _n_expr
= n_expr
.as(not null)
4434 n_expr
.parent
= self
4435 _n_expr2
= n_expr2
.as(not null)
4436 n_expr2
.parent
= self
4439 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4441 if _n_expr
== old_child
then
4442 if new_child
!= null then
4443 new_child
.parent
= self
4444 assert new_child
isa AExpr
4451 if _n_expr2
== old_child
then
4452 if new_child
!= null then
4453 new_child
.parent
= self
4454 assert new_child
isa AExpr
4455 _n_expr2
= new_child
4463 redef fun visit_all
(v
: Visitor)
4465 v
.enter_visit
(_n_expr
)
4466 v
.enter_visit
(_n_expr2
)
4470 private init empty_init
do end
4473 n_expr
: nullable AExpr,
4474 n_expr2
: nullable AExpr
4478 _n_expr
= n_expr
.as(not null)
4479 n_expr
.parent
= self
4480 _n_expr2
= n_expr2
.as(not null)
4481 n_expr2
.parent
= self
4484 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4486 if _n_expr
== old_child
then
4487 if new_child
!= null then
4488 new_child
.parent
= self
4489 assert new_child
isa AExpr
4496 if _n_expr2
== old_child
then
4497 if new_child
!= null then
4498 new_child
.parent
= self
4499 assert new_child
isa AExpr
4500 _n_expr2
= new_child
4508 redef fun visit_all
(v
: Visitor)
4510 v
.enter_visit
(_n_expr
)
4511 v
.enter_visit
(_n_expr2
)
4514 redef class AAndExpr
4515 private init empty_init
do end
4517 init init_aandexpr
(
4518 n_expr
: nullable AExpr,
4519 n_expr2
: nullable AExpr
4523 _n_expr
= n_expr
.as(not null)
4524 n_expr
.parent
= self
4525 _n_expr2
= n_expr2
.as(not null)
4526 n_expr2
.parent
= self
4529 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4531 if _n_expr
== old_child
then
4532 if new_child
!= null then
4533 new_child
.parent
= self
4534 assert new_child
isa AExpr
4541 if _n_expr2
== old_child
then
4542 if new_child
!= null then
4543 new_child
.parent
= self
4544 assert new_child
isa AExpr
4545 _n_expr2
= new_child
4553 redef fun visit_all
(v
: Visitor)
4555 v
.enter_visit
(_n_expr
)
4556 v
.enter_visit
(_n_expr2
)
4559 redef class AOrElseExpr
4560 private init empty_init
do end
4562 init init_aorelseexpr
(
4563 n_expr
: nullable AExpr,
4564 n_expr2
: nullable AExpr
4568 _n_expr
= n_expr
.as(not null)
4569 n_expr
.parent
= self
4570 _n_expr2
= n_expr2
.as(not null)
4571 n_expr2
.parent
= self
4574 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4576 if _n_expr
== old_child
then
4577 if new_child
!= null then
4578 new_child
.parent
= self
4579 assert new_child
isa AExpr
4586 if _n_expr2
== old_child
then
4587 if new_child
!= null then
4588 new_child
.parent
= self
4589 assert new_child
isa AExpr
4590 _n_expr2
= new_child
4598 redef fun visit_all
(v
: Visitor)
4600 v
.enter_visit
(_n_expr
)
4601 v
.enter_visit
(_n_expr2
)
4604 redef class ANotExpr
4605 private init empty_init
do end
4607 init init_anotexpr
(
4608 n_kwnot
: nullable TKwnot,
4609 n_expr
: nullable AExpr
4613 _n_kwnot
= n_kwnot
.as(not null)
4614 n_kwnot
.parent
= self
4615 _n_expr
= n_expr
.as(not null)
4616 n_expr
.parent
= self
4619 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4621 if _n_kwnot
== old_child
then
4622 if new_child
!= null then
4623 new_child
.parent
= self
4624 assert new_child
isa TKwnot
4625 _n_kwnot
= new_child
4631 if _n_expr
== old_child
then
4632 if new_child
!= null then
4633 new_child
.parent
= self
4634 assert new_child
isa AExpr
4643 redef fun visit_all
(v
: Visitor)
4645 v
.enter_visit
(_n_kwnot
)
4646 v
.enter_visit
(_n_expr
)
4650 private init empty_init
do end
4653 n_expr
: nullable AExpr,
4654 n_expr2
: nullable AExpr
4658 _n_expr
= n_expr
.as(not null)
4659 n_expr
.parent
= self
4660 _n_expr2
= n_expr2
.as(not null)
4661 n_expr2
.parent
= self
4664 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4666 if _n_expr
== old_child
then
4667 if new_child
!= null then
4668 new_child
.parent
= self
4669 assert new_child
isa AExpr
4676 if _n_expr2
== old_child
then
4677 if new_child
!= null then
4678 new_child
.parent
= self
4679 assert new_child
isa AExpr
4680 _n_expr2
= new_child
4688 redef fun visit_all
(v
: Visitor)
4690 v
.enter_visit
(_n_expr
)
4691 v
.enter_visit
(_n_expr2
)
4695 private init empty_init
do end
4698 n_expr
: nullable AExpr,
4699 n_expr2
: nullable AExpr
4703 _n_expr
= n_expr
.as(not null)
4704 n_expr
.parent
= self
4705 _n_expr2
= n_expr2
.as(not null)
4706 n_expr2
.parent
= self
4709 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4711 if _n_expr
== old_child
then
4712 if new_child
!= null then
4713 new_child
.parent
= self
4714 assert new_child
isa AExpr
4721 if _n_expr2
== old_child
then
4722 if new_child
!= null then
4723 new_child
.parent
= self
4724 assert new_child
isa AExpr
4725 _n_expr2
= new_child
4733 redef fun visit_all
(v
: Visitor)
4735 v
.enter_visit
(_n_expr
)
4736 v
.enter_visit
(_n_expr2
)
4740 private init empty_init
do end
4743 n_expr
: nullable AExpr,
4744 n_expr2
: nullable AExpr
4748 _n_expr
= n_expr
.as(not null)
4749 n_expr
.parent
= self
4750 _n_expr2
= n_expr2
.as(not null)
4751 n_expr2
.parent
= self
4754 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4756 if _n_expr
== old_child
then
4757 if new_child
!= null then
4758 new_child
.parent
= self
4759 assert new_child
isa AExpr
4766 if _n_expr2
== old_child
then
4767 if new_child
!= null then
4768 new_child
.parent
= self
4769 assert new_child
isa AExpr
4770 _n_expr2
= new_child
4778 redef fun visit_all
(v
: Visitor)
4780 v
.enter_visit
(_n_expr
)
4781 v
.enter_visit
(_n_expr2
)
4785 private init empty_init
do end
4788 n_expr
: nullable AExpr,
4789 n_expr2
: nullable AExpr
4793 _n_expr
= n_expr
.as(not null)
4794 n_expr
.parent
= self
4795 _n_expr2
= n_expr2
.as(not null)
4796 n_expr2
.parent
= self
4799 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4801 if _n_expr
== old_child
then
4802 if new_child
!= null then
4803 new_child
.parent
= self
4804 assert new_child
isa AExpr
4811 if _n_expr2
== old_child
then
4812 if new_child
!= null then
4813 new_child
.parent
= self
4814 assert new_child
isa AExpr
4815 _n_expr2
= new_child
4823 redef fun visit_all
(v
: Visitor)
4825 v
.enter_visit
(_n_expr
)
4826 v
.enter_visit
(_n_expr2
)
4830 private init empty_init
do end
4833 n_expr
: nullable AExpr,
4834 n_expr2
: nullable AExpr
4838 _n_expr
= n_expr
.as(not null)
4839 n_expr
.parent
= self
4840 _n_expr2
= n_expr2
.as(not null)
4841 n_expr2
.parent
= self
4844 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4846 if _n_expr
== old_child
then
4847 if new_child
!= null then
4848 new_child
.parent
= self
4849 assert new_child
isa AExpr
4856 if _n_expr2
== old_child
then
4857 if new_child
!= null then
4858 new_child
.parent
= self
4859 assert new_child
isa AExpr
4860 _n_expr2
= new_child
4868 redef fun visit_all
(v
: Visitor)
4870 v
.enter_visit
(_n_expr
)
4871 v
.enter_visit
(_n_expr2
)
4875 private init empty_init
do end
4878 n_expr
: nullable AExpr,
4879 n_expr2
: nullable AExpr
4883 _n_expr
= n_expr
.as(not null)
4884 n_expr
.parent
= self
4885 _n_expr2
= n_expr2
.as(not null)
4886 n_expr2
.parent
= self
4889 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4891 if _n_expr
== old_child
then
4892 if new_child
!= null then
4893 new_child
.parent
= self
4894 assert new_child
isa AExpr
4901 if _n_expr2
== old_child
then
4902 if new_child
!= null then
4903 new_child
.parent
= self
4904 assert new_child
isa AExpr
4905 _n_expr2
= new_child
4913 redef fun visit_all
(v
: Visitor)
4915 v
.enter_visit
(_n_expr
)
4916 v
.enter_visit
(_n_expr2
)
4920 private init empty_init
do end
4923 n_expr
: nullable AExpr,
4924 n_expr2
: nullable AExpr
4928 _n_expr
= n_expr
.as(not null)
4929 n_expr
.parent
= self
4930 _n_expr2
= n_expr2
.as(not null)
4931 n_expr2
.parent
= self
4934 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4936 if _n_expr
== old_child
then
4937 if new_child
!= null then
4938 new_child
.parent
= self
4939 assert new_child
isa AExpr
4946 if _n_expr2
== old_child
then
4947 if new_child
!= null then
4948 new_child
.parent
= self
4949 assert new_child
isa AExpr
4950 _n_expr2
= new_child
4958 redef fun visit_all
(v
: Visitor)
4960 v
.enter_visit
(_n_expr
)
4961 v
.enter_visit
(_n_expr2
)
4965 private init empty_init
do end
4968 n_expr
: nullable AExpr,
4969 n_expr2
: nullable AExpr
4973 _n_expr
= n_expr
.as(not null)
4974 n_expr
.parent
= self
4975 _n_expr2
= n_expr2
.as(not null)
4976 n_expr2
.parent
= self
4979 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4981 if _n_expr
== old_child
then
4982 if new_child
!= null then
4983 new_child
.parent
= self
4984 assert new_child
isa AExpr
4991 if _n_expr2
== old_child
then
4992 if new_child
!= null then
4993 new_child
.parent
= self
4994 assert new_child
isa AExpr
4995 _n_expr2
= new_child
5003 redef fun visit_all
(v
: Visitor)
5005 v
.enter_visit
(_n_expr
)
5006 v
.enter_visit
(_n_expr2
)
5010 private init empty_init
do end
5013 n_expr
: nullable AExpr,
5014 n_expr2
: nullable AExpr
5018 _n_expr
= n_expr
.as(not null)
5019 n_expr
.parent
= self
5020 _n_expr2
= n_expr2
.as(not null)
5021 n_expr2
.parent
= self
5024 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5026 if _n_expr
== old_child
then
5027 if new_child
!= null then
5028 new_child
.parent
= self
5029 assert new_child
isa AExpr
5036 if _n_expr2
== old_child
then
5037 if new_child
!= null then
5038 new_child
.parent
= self
5039 assert new_child
isa AExpr
5040 _n_expr2
= new_child
5048 redef fun visit_all
(v
: Visitor)
5050 v
.enter_visit
(_n_expr
)
5051 v
.enter_visit
(_n_expr2
)
5054 redef class AIsaExpr
5055 private init empty_init
do end
5057 init init_aisaexpr
(
5058 n_expr
: nullable AExpr,
5059 n_type
: nullable AType
5063 _n_expr
= n_expr
.as(not null)
5064 n_expr
.parent
= self
5065 _n_type
= n_type
.as(not null)
5066 n_type
.parent
= self
5069 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5071 if _n_expr
== old_child
then
5072 if new_child
!= null then
5073 new_child
.parent
= self
5074 assert new_child
isa AExpr
5081 if _n_type
== old_child
then
5082 if new_child
!= null then
5083 new_child
.parent
= self
5084 assert new_child
isa AType
5093 redef fun visit_all
(v
: Visitor)
5095 v
.enter_visit
(_n_expr
)
5096 v
.enter_visit
(_n_type
)
5099 redef class APlusExpr
5100 private init empty_init
do end
5102 init init_aplusexpr
(
5103 n_expr
: nullable AExpr,
5104 n_expr2
: nullable AExpr
5108 _n_expr
= n_expr
.as(not null)
5109 n_expr
.parent
= self
5110 _n_expr2
= n_expr2
.as(not null)
5111 n_expr2
.parent
= self
5114 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5116 if _n_expr
== old_child
then
5117 if new_child
!= null then
5118 new_child
.parent
= self
5119 assert new_child
isa AExpr
5126 if _n_expr2
== old_child
then
5127 if new_child
!= null then
5128 new_child
.parent
= self
5129 assert new_child
isa AExpr
5130 _n_expr2
= new_child
5138 redef fun visit_all
(v
: Visitor)
5140 v
.enter_visit
(_n_expr
)
5141 v
.enter_visit
(_n_expr2
)
5144 redef class AMinusExpr
5145 private init empty_init
do end
5147 init init_aminusexpr
(
5148 n_expr
: nullable AExpr,
5149 n_expr2
: nullable AExpr
5153 _n_expr
= n_expr
.as(not null)
5154 n_expr
.parent
= self
5155 _n_expr2
= n_expr2
.as(not null)
5156 n_expr2
.parent
= self
5159 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5161 if _n_expr
== old_child
then
5162 if new_child
!= null then
5163 new_child
.parent
= self
5164 assert new_child
isa AExpr
5171 if _n_expr2
== old_child
then
5172 if new_child
!= null then
5173 new_child
.parent
= self
5174 assert new_child
isa AExpr
5175 _n_expr2
= new_child
5183 redef fun visit_all
(v
: Visitor)
5185 v
.enter_visit
(_n_expr
)
5186 v
.enter_visit
(_n_expr2
)
5189 redef class AStarshipExpr
5190 private init empty_init
do end
5192 init init_astarshipexpr
(
5193 n_expr
: nullable AExpr,
5194 n_expr2
: nullable AExpr
5198 _n_expr
= n_expr
.as(not null)
5199 n_expr
.parent
= self
5200 _n_expr2
= n_expr2
.as(not null)
5201 n_expr2
.parent
= self
5204 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5206 if _n_expr
== old_child
then
5207 if new_child
!= null then
5208 new_child
.parent
= self
5209 assert new_child
isa AExpr
5216 if _n_expr2
== old_child
then
5217 if new_child
!= null then
5218 new_child
.parent
= self
5219 assert new_child
isa AExpr
5220 _n_expr2
= new_child
5228 redef fun visit_all
(v
: Visitor)
5230 v
.enter_visit
(_n_expr
)
5231 v
.enter_visit
(_n_expr2
)
5234 redef class AStarExpr
5235 private init empty_init
do end
5237 init init_astarexpr
(
5238 n_expr
: nullable AExpr,
5239 n_expr2
: nullable AExpr
5243 _n_expr
= n_expr
.as(not null)
5244 n_expr
.parent
= self
5245 _n_expr2
= n_expr2
.as(not null)
5246 n_expr2
.parent
= self
5249 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5251 if _n_expr
== old_child
then
5252 if new_child
!= null then
5253 new_child
.parent
= self
5254 assert new_child
isa AExpr
5261 if _n_expr2
== old_child
then
5262 if new_child
!= null then
5263 new_child
.parent
= self
5264 assert new_child
isa AExpr
5265 _n_expr2
= new_child
5273 redef fun visit_all
(v
: Visitor)
5275 v
.enter_visit
(_n_expr
)
5276 v
.enter_visit
(_n_expr2
)
5279 redef class ASlashExpr
5280 private init empty_init
do end
5282 init init_aslashexpr
(
5283 n_expr
: nullable AExpr,
5284 n_expr2
: nullable AExpr
5288 _n_expr
= n_expr
.as(not null)
5289 n_expr
.parent
= self
5290 _n_expr2
= n_expr2
.as(not null)
5291 n_expr2
.parent
= self
5294 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5296 if _n_expr
== old_child
then
5297 if new_child
!= null then
5298 new_child
.parent
= self
5299 assert new_child
isa AExpr
5306 if _n_expr2
== old_child
then
5307 if new_child
!= null then
5308 new_child
.parent
= self
5309 assert new_child
isa AExpr
5310 _n_expr2
= new_child
5318 redef fun visit_all
(v
: Visitor)
5320 v
.enter_visit
(_n_expr
)
5321 v
.enter_visit
(_n_expr2
)
5324 redef class APercentExpr
5325 private init empty_init
do end
5327 init init_apercentexpr
(
5328 n_expr
: nullable AExpr,
5329 n_expr2
: nullable AExpr
5333 _n_expr
= n_expr
.as(not null)
5334 n_expr
.parent
= self
5335 _n_expr2
= n_expr2
.as(not null)
5336 n_expr2
.parent
= self
5339 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5341 if _n_expr
== old_child
then
5342 if new_child
!= null then
5343 new_child
.parent
= self
5344 assert new_child
isa AExpr
5351 if _n_expr2
== old_child
then
5352 if new_child
!= null then
5353 new_child
.parent
= self
5354 assert new_child
isa AExpr
5355 _n_expr2
= new_child
5363 redef fun visit_all
(v
: Visitor)
5365 v
.enter_visit
(_n_expr
)
5366 v
.enter_visit
(_n_expr2
)
5369 redef class AUminusExpr
5370 private init empty_init
do end
5372 init init_auminusexpr
(
5373 n_minus
: nullable TMinus,
5374 n_expr
: nullable AExpr
5378 _n_minus
= n_minus
.as(not null)
5379 n_minus
.parent
= self
5380 _n_expr
= n_expr
.as(not null)
5381 n_expr
.parent
= self
5384 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5386 if _n_minus
== old_child
then
5387 if new_child
!= null then
5388 new_child
.parent
= self
5389 assert new_child
isa TMinus
5390 _n_minus
= new_child
5396 if _n_expr
== old_child
then
5397 if new_child
!= null then
5398 new_child
.parent
= self
5399 assert new_child
isa AExpr
5408 redef fun visit_all
(v
: Visitor)
5410 v
.enter_visit
(_n_minus
)
5411 v
.enter_visit
(_n_expr
)
5414 redef class ANewExpr
5415 private init empty_init
do end
5417 init init_anewexpr
(
5418 n_kwnew
: nullable TKwnew,
5419 n_type
: nullable AType,
5421 n_args
: nullable AExprs
5425 _n_kwnew
= n_kwnew
.as(not null)
5426 n_kwnew
.parent
= self
5427 _n_type
= n_type
.as(not null)
5428 n_type
.parent
= self
5430 if n_id
!= null then
5433 _n_args
= n_args
.as(not null)
5434 n_args
.parent
= self
5437 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5439 if _n_kwnew
== old_child
then
5440 if new_child
!= null then
5441 new_child
.parent
= self
5442 assert new_child
isa TKwnew
5443 _n_kwnew
= new_child
5449 if _n_type
== old_child
then
5450 if new_child
!= null then
5451 new_child
.parent
= self
5452 assert new_child
isa AType
5459 if _n_id
== old_child
then
5460 if new_child
!= null then
5461 new_child
.parent
= self
5462 assert new_child
isa TId
5469 if _n_args
== old_child
then
5470 if new_child
!= null then
5471 new_child
.parent
= self
5472 assert new_child
isa AExprs
5481 redef fun visit_all
(v
: Visitor)
5483 v
.enter_visit
(_n_kwnew
)
5484 v
.enter_visit
(_n_type
)
5485 if _n_id
!= null then
5486 v
.enter_visit
(_n_id
.as(not null))
5488 v
.enter_visit
(_n_args
)
5491 redef class AAttrExpr
5492 private init empty_init
do end
5494 init init_aattrexpr
(
5495 n_expr
: nullable AExpr,
5496 n_id
: nullable TAttrid
5500 _n_expr
= n_expr
.as(not null)
5501 n_expr
.parent
= self
5502 _n_id
= n_id
.as(not null)
5506 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5508 if _n_expr
== old_child
then
5509 if new_child
!= null then
5510 new_child
.parent
= self
5511 assert new_child
isa AExpr
5518 if _n_id
== old_child
then
5519 if new_child
!= null then
5520 new_child
.parent
= self
5521 assert new_child
isa TAttrid
5530 redef fun visit_all
(v
: Visitor)
5532 v
.enter_visit
(_n_expr
)
5533 v
.enter_visit
(_n_id
)
5536 redef class AAttrAssignExpr
5537 private init empty_init
do end
5539 init init_aattrassignexpr
(
5540 n_expr
: nullable AExpr,
5541 n_id
: nullable TAttrid,
5542 n_assign
: nullable TAssign,
5543 n_value
: nullable AExpr
5547 _n_expr
= n_expr
.as(not null)
5548 n_expr
.parent
= self
5549 _n_id
= n_id
.as(not null)
5551 _n_assign
= n_assign
.as(not null)
5552 n_assign
.parent
= self
5553 _n_value
= n_value
.as(not null)
5554 n_value
.parent
= self
5557 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5559 if _n_expr
== old_child
then
5560 if new_child
!= null then
5561 new_child
.parent
= self
5562 assert new_child
isa AExpr
5569 if _n_id
== old_child
then
5570 if new_child
!= null then
5571 new_child
.parent
= self
5572 assert new_child
isa TAttrid
5579 if _n_assign
== old_child
then
5580 if new_child
!= null then
5581 new_child
.parent
= self
5582 assert new_child
isa TAssign
5583 _n_assign
= new_child
5589 if _n_value
== old_child
then
5590 if new_child
!= null then
5591 new_child
.parent
= self
5592 assert new_child
isa AExpr
5593 _n_value
= new_child
5601 redef fun visit_all
(v
: Visitor)
5603 v
.enter_visit
(_n_expr
)
5604 v
.enter_visit
(_n_id
)
5605 v
.enter_visit
(_n_assign
)
5606 v
.enter_visit
(_n_value
)
5609 redef class AAttrReassignExpr
5610 private init empty_init
do end
5612 init init_aattrreassignexpr
(
5613 n_expr
: nullable AExpr,
5614 n_id
: nullable TAttrid,
5615 n_assign_op
: nullable AAssignOp,
5616 n_value
: nullable AExpr
5620 _n_expr
= n_expr
.as(not null)
5621 n_expr
.parent
= self
5622 _n_id
= n_id
.as(not null)
5624 _n_assign_op
= n_assign_op
.as(not null)
5625 n_assign_op
.parent
= self
5626 _n_value
= n_value
.as(not null)
5627 n_value
.parent
= self
5630 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5632 if _n_expr
== old_child
then
5633 if new_child
!= null then
5634 new_child
.parent
= self
5635 assert new_child
isa AExpr
5642 if _n_id
== old_child
then
5643 if new_child
!= null then
5644 new_child
.parent
= self
5645 assert new_child
isa TAttrid
5652 if _n_assign_op
== old_child
then
5653 if new_child
!= null then
5654 new_child
.parent
= self
5655 assert new_child
isa AAssignOp
5656 _n_assign_op
= new_child
5662 if _n_value
== old_child
then
5663 if new_child
!= null then
5664 new_child
.parent
= self
5665 assert new_child
isa AExpr
5666 _n_value
= new_child
5674 redef fun visit_all
(v
: Visitor)
5676 v
.enter_visit
(_n_expr
)
5677 v
.enter_visit
(_n_id
)
5678 v
.enter_visit
(_n_assign_op
)
5679 v
.enter_visit
(_n_value
)
5682 redef class ACallExpr
5683 private init empty_init
do end
5685 init init_acallexpr
(
5686 n_expr
: nullable AExpr,
5688 n_args
: nullable AExprs,
5689 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5693 _n_expr
= n_expr
.as(not null)
5694 n_expr
.parent
= self
5695 _n_id
= n_id
.as(not null)
5697 _n_args
= n_args
.as(not null)
5698 n_args
.parent
= self
5699 for n
in n_closure_defs
do
5700 assert n
isa AClosureDef
5701 _n_closure_defs
.add
(n
)
5706 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5708 if _n_expr
== old_child
then
5709 if new_child
!= null then
5710 new_child
.parent
= self
5711 assert new_child
isa AExpr
5718 if _n_id
== old_child
then
5719 if new_child
!= null then
5720 new_child
.parent
= self
5721 assert new_child
isa TId
5728 if _n_args
== old_child
then
5729 if new_child
!= null then
5730 new_child
.parent
= self
5731 assert new_child
isa AExprs
5738 for i
in [0.._n_closure_defs
.length
[ do
5739 if _n_closure_defs
[i
] == old_child
then
5740 if new_child
!= null then
5741 assert new_child
isa AClosureDef
5742 _n_closure_defs
[i
] = new_child
5743 new_child
.parent
= self
5745 _n_closure_defs
.remove_at
(i
)
5752 redef fun visit_all
(v
: Visitor)
5754 v
.enter_visit
(_n_expr
)
5755 v
.enter_visit
(_n_id
)
5756 v
.enter_visit
(_n_args
)
5757 for n
in _n_closure_defs
do
5762 redef class ACallAssignExpr
5763 private init empty_init
do end
5765 init init_acallassignexpr
(
5766 n_expr
: nullable AExpr,
5768 n_args
: nullable AExprs,
5769 n_assign
: nullable TAssign,
5770 n_value
: nullable AExpr
5774 _n_expr
= n_expr
.as(not null)
5775 n_expr
.parent
= self
5776 _n_id
= n_id
.as(not null)
5778 _n_args
= n_args
.as(not null)
5779 n_args
.parent
= self
5780 _n_assign
= n_assign
.as(not null)
5781 n_assign
.parent
= self
5782 _n_value
= n_value
.as(not null)
5783 n_value
.parent
= self
5786 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5788 if _n_expr
== old_child
then
5789 if new_child
!= null then
5790 new_child
.parent
= self
5791 assert new_child
isa AExpr
5798 if _n_id
== old_child
then
5799 if new_child
!= null then
5800 new_child
.parent
= self
5801 assert new_child
isa TId
5808 if _n_args
== old_child
then
5809 if new_child
!= null then
5810 new_child
.parent
= self
5811 assert new_child
isa AExprs
5818 if _n_assign
== old_child
then
5819 if new_child
!= null then
5820 new_child
.parent
= self
5821 assert new_child
isa TAssign
5822 _n_assign
= new_child
5828 if _n_value
== old_child
then
5829 if new_child
!= null then
5830 new_child
.parent
= self
5831 assert new_child
isa AExpr
5832 _n_value
= new_child
5840 redef fun visit_all
(v
: Visitor)
5842 v
.enter_visit
(_n_expr
)
5843 v
.enter_visit
(_n_id
)
5844 v
.enter_visit
(_n_args
)
5845 v
.enter_visit
(_n_assign
)
5846 v
.enter_visit
(_n_value
)
5849 redef class ACallReassignExpr
5850 private init empty_init
do end
5852 init init_acallreassignexpr
(
5853 n_expr
: nullable AExpr,
5855 n_args
: nullable AExprs,
5856 n_assign_op
: nullable AAssignOp,
5857 n_value
: nullable AExpr
5861 _n_expr
= n_expr
.as(not null)
5862 n_expr
.parent
= self
5863 _n_id
= n_id
.as(not null)
5865 _n_args
= n_args
.as(not null)
5866 n_args
.parent
= self
5867 _n_assign_op
= n_assign_op
.as(not null)
5868 n_assign_op
.parent
= self
5869 _n_value
= n_value
.as(not null)
5870 n_value
.parent
= self
5873 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5875 if _n_expr
== old_child
then
5876 if new_child
!= null then
5877 new_child
.parent
= self
5878 assert new_child
isa AExpr
5885 if _n_id
== old_child
then
5886 if new_child
!= null then
5887 new_child
.parent
= self
5888 assert new_child
isa TId
5895 if _n_args
== old_child
then
5896 if new_child
!= null then
5897 new_child
.parent
= self
5898 assert new_child
isa AExprs
5905 if _n_assign_op
== old_child
then
5906 if new_child
!= null then
5907 new_child
.parent
= self
5908 assert new_child
isa AAssignOp
5909 _n_assign_op
= new_child
5915 if _n_value
== old_child
then
5916 if new_child
!= null then
5917 new_child
.parent
= self
5918 assert new_child
isa AExpr
5919 _n_value
= new_child
5927 redef fun visit_all
(v
: Visitor)
5929 v
.enter_visit
(_n_expr
)
5930 v
.enter_visit
(_n_id
)
5931 v
.enter_visit
(_n_args
)
5932 v
.enter_visit
(_n_assign_op
)
5933 v
.enter_visit
(_n_value
)
5936 redef class ASuperExpr
5937 private init empty_init
do end
5939 init init_asuperexpr
(
5940 n_qualified
: nullable AQualified,
5941 n_kwsuper
: nullable TKwsuper,
5942 n_args
: nullable AExprs
5946 _n_qualified
= n_qualified
5947 if n_qualified
!= null then
5948 n_qualified
.parent
= self
5950 _n_kwsuper
= n_kwsuper
.as(not null)
5951 n_kwsuper
.parent
= self
5952 _n_args
= n_args
.as(not null)
5953 n_args
.parent
= self
5956 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5958 if _n_qualified
== old_child
then
5959 if new_child
!= null then
5960 new_child
.parent
= self
5961 assert new_child
isa AQualified
5962 _n_qualified
= new_child
5968 if _n_kwsuper
== old_child
then
5969 if new_child
!= null then
5970 new_child
.parent
= self
5971 assert new_child
isa TKwsuper
5972 _n_kwsuper
= new_child
5978 if _n_args
== old_child
then
5979 if new_child
!= null then
5980 new_child
.parent
= self
5981 assert new_child
isa AExprs
5990 redef fun visit_all
(v
: Visitor)
5992 if _n_qualified
!= null then
5993 v
.enter_visit
(_n_qualified
.as(not null))
5995 v
.enter_visit
(_n_kwsuper
)
5996 v
.enter_visit
(_n_args
)
5999 redef class AInitExpr
6000 private init empty_init
do end
6002 init init_ainitexpr
(
6003 n_expr
: nullable AExpr,
6004 n_kwinit
: nullable TKwinit,
6005 n_args
: nullable AExprs
6009 _n_expr
= n_expr
.as(not null)
6010 n_expr
.parent
= self
6011 _n_kwinit
= n_kwinit
.as(not null)
6012 n_kwinit
.parent
= self
6013 _n_args
= n_args
.as(not null)
6014 n_args
.parent
= self
6017 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6019 if _n_expr
== old_child
then
6020 if new_child
!= null then
6021 new_child
.parent
= self
6022 assert new_child
isa AExpr
6029 if _n_kwinit
== old_child
then
6030 if new_child
!= null then
6031 new_child
.parent
= self
6032 assert new_child
isa TKwinit
6033 _n_kwinit
= new_child
6039 if _n_args
== old_child
then
6040 if new_child
!= null then
6041 new_child
.parent
= self
6042 assert new_child
isa AExprs
6051 redef fun visit_all
(v
: Visitor)
6053 v
.enter_visit
(_n_expr
)
6054 v
.enter_visit
(_n_kwinit
)
6055 v
.enter_visit
(_n_args
)
6058 redef class ABraExpr
6059 private init empty_init
do end
6061 init init_abraexpr
(
6062 n_expr
: nullable AExpr,
6063 n_args
: nullable AExprs,
6064 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6068 _n_expr
= n_expr
.as(not null)
6069 n_expr
.parent
= self
6070 _n_args
= n_args
.as(not null)
6071 n_args
.parent
= self
6072 for n
in n_closure_defs
do
6073 assert n
isa AClosureDef
6074 _n_closure_defs
.add
(n
)
6079 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6081 if _n_expr
== old_child
then
6082 if new_child
!= null then
6083 new_child
.parent
= self
6084 assert new_child
isa AExpr
6091 if _n_args
== old_child
then
6092 if new_child
!= null then
6093 new_child
.parent
= self
6094 assert new_child
isa AExprs
6101 for i
in [0.._n_closure_defs
.length
[ do
6102 if _n_closure_defs
[i
] == old_child
then
6103 if new_child
!= null then
6104 assert new_child
isa AClosureDef
6105 _n_closure_defs
[i
] = new_child
6106 new_child
.parent
= self
6108 _n_closure_defs
.remove_at
(i
)
6115 redef fun visit_all
(v
: Visitor)
6117 v
.enter_visit
(_n_expr
)
6118 v
.enter_visit
(_n_args
)
6119 for n
in _n_closure_defs
do
6124 redef class ABraAssignExpr
6125 private init empty_init
do end
6127 init init_abraassignexpr
(
6128 n_expr
: nullable AExpr,
6129 n_args
: nullable AExprs,
6130 n_assign
: nullable TAssign,
6131 n_value
: nullable AExpr
6135 _n_expr
= n_expr
.as(not null)
6136 n_expr
.parent
= self
6137 _n_args
= n_args
.as(not null)
6138 n_args
.parent
= self
6139 _n_assign
= n_assign
.as(not null)
6140 n_assign
.parent
= self
6141 _n_value
= n_value
.as(not null)
6142 n_value
.parent
= self
6145 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6147 if _n_expr
== old_child
then
6148 if new_child
!= null then
6149 new_child
.parent
= self
6150 assert new_child
isa AExpr
6157 if _n_args
== old_child
then
6158 if new_child
!= null then
6159 new_child
.parent
= self
6160 assert new_child
isa AExprs
6167 if _n_assign
== old_child
then
6168 if new_child
!= null then
6169 new_child
.parent
= self
6170 assert new_child
isa TAssign
6171 _n_assign
= new_child
6177 if _n_value
== old_child
then
6178 if new_child
!= null then
6179 new_child
.parent
= self
6180 assert new_child
isa AExpr
6181 _n_value
= new_child
6189 redef fun visit_all
(v
: Visitor)
6191 v
.enter_visit
(_n_expr
)
6192 v
.enter_visit
(_n_args
)
6193 v
.enter_visit
(_n_assign
)
6194 v
.enter_visit
(_n_value
)
6197 redef class ABraReassignExpr
6198 private init empty_init
do end
6200 init init_abrareassignexpr
(
6201 n_expr
: nullable AExpr,
6202 n_args
: nullable AExprs,
6203 n_assign_op
: nullable AAssignOp,
6204 n_value
: nullable AExpr
6208 _n_expr
= n_expr
.as(not null)
6209 n_expr
.parent
= self
6210 _n_args
= n_args
.as(not null)
6211 n_args
.parent
= self
6212 _n_assign_op
= n_assign_op
.as(not null)
6213 n_assign_op
.parent
= self
6214 _n_value
= n_value
.as(not null)
6215 n_value
.parent
= self
6218 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6220 if _n_expr
== old_child
then
6221 if new_child
!= null then
6222 new_child
.parent
= self
6223 assert new_child
isa AExpr
6230 if _n_args
== old_child
then
6231 if new_child
!= null then
6232 new_child
.parent
= self
6233 assert new_child
isa AExprs
6240 if _n_assign_op
== old_child
then
6241 if new_child
!= null then
6242 new_child
.parent
= self
6243 assert new_child
isa AAssignOp
6244 _n_assign_op
= new_child
6250 if _n_value
== old_child
then
6251 if new_child
!= null then
6252 new_child
.parent
= self
6253 assert new_child
isa AExpr
6254 _n_value
= new_child
6262 redef fun visit_all
(v
: Visitor)
6264 v
.enter_visit
(_n_expr
)
6265 v
.enter_visit
(_n_args
)
6266 v
.enter_visit
(_n_assign_op
)
6267 v
.enter_visit
(_n_value
)
6270 redef class AClosureCallExpr
6271 private init empty_init
do end
6273 init init_aclosurecallexpr
(
6275 n_args
: nullable AExprs,
6276 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6280 _n_id
= n_id
.as(not null)
6282 _n_args
= n_args
.as(not null)
6283 n_args
.parent
= self
6284 for n
in n_closure_defs
do
6285 assert n
isa AClosureDef
6286 _n_closure_defs
.add
(n
)
6291 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6293 if _n_id
== old_child
then
6294 if new_child
!= null then
6295 new_child
.parent
= self
6296 assert new_child
isa TId
6303 if _n_args
== old_child
then
6304 if new_child
!= null then
6305 new_child
.parent
= self
6306 assert new_child
isa AExprs
6313 for i
in [0.._n_closure_defs
.length
[ do
6314 if _n_closure_defs
[i
] == old_child
then
6315 if new_child
!= null then
6316 assert new_child
isa AClosureDef
6317 _n_closure_defs
[i
] = new_child
6318 new_child
.parent
= self
6320 _n_closure_defs
.remove_at
(i
)
6327 redef fun visit_all
(v
: Visitor)
6329 v
.enter_visit
(_n_id
)
6330 v
.enter_visit
(_n_args
)
6331 for n
in _n_closure_defs
do
6336 redef class AVarExpr
6337 private init empty_init
do end
6339 init init_avarexpr
(
6344 _n_id
= n_id
.as(not null)
6348 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6350 if _n_id
== old_child
then
6351 if new_child
!= null then
6352 new_child
.parent
= self
6353 assert new_child
isa TId
6362 redef fun visit_all
(v
: Visitor)
6364 v
.enter_visit
(_n_id
)
6367 redef class AVarAssignExpr
6368 private init empty_init
do end
6370 init init_avarassignexpr
(
6372 n_assign
: nullable TAssign,
6373 n_value
: nullable AExpr
6377 _n_id
= n_id
.as(not null)
6379 _n_assign
= n_assign
.as(not null)
6380 n_assign
.parent
= self
6381 _n_value
= n_value
.as(not null)
6382 n_value
.parent
= self
6385 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6387 if _n_id
== old_child
then
6388 if new_child
!= null then
6389 new_child
.parent
= self
6390 assert new_child
isa TId
6397 if _n_assign
== old_child
then
6398 if new_child
!= null then
6399 new_child
.parent
= self
6400 assert new_child
isa TAssign
6401 _n_assign
= new_child
6407 if _n_value
== old_child
then
6408 if new_child
!= null then
6409 new_child
.parent
= self
6410 assert new_child
isa AExpr
6411 _n_value
= new_child
6419 redef fun visit_all
(v
: Visitor)
6421 v
.enter_visit
(_n_id
)
6422 v
.enter_visit
(_n_assign
)
6423 v
.enter_visit
(_n_value
)
6426 redef class AVarReassignExpr
6427 private init empty_init
do end
6429 init init_avarreassignexpr
(
6431 n_assign_op
: nullable AAssignOp,
6432 n_value
: nullable AExpr
6436 _n_id
= n_id
.as(not null)
6438 _n_assign_op
= n_assign_op
.as(not null)
6439 n_assign_op
.parent
= self
6440 _n_value
= n_value
.as(not null)
6441 n_value
.parent
= self
6444 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6446 if _n_id
== old_child
then
6447 if new_child
!= null then
6448 new_child
.parent
= self
6449 assert new_child
isa TId
6456 if _n_assign_op
== old_child
then
6457 if new_child
!= null then
6458 new_child
.parent
= self
6459 assert new_child
isa AAssignOp
6460 _n_assign_op
= new_child
6466 if _n_value
== old_child
then
6467 if new_child
!= null then
6468 new_child
.parent
= self
6469 assert new_child
isa AExpr
6470 _n_value
= new_child
6478 redef fun visit_all
(v
: Visitor)
6480 v
.enter_visit
(_n_id
)
6481 v
.enter_visit
(_n_assign_op
)
6482 v
.enter_visit
(_n_value
)
6485 redef class ARangeExpr
6486 private init empty_init
do end
6488 init init_arangeexpr
(
6489 n_expr
: nullable AExpr,
6490 n_expr2
: nullable AExpr
6494 _n_expr
= n_expr
.as(not null)
6495 n_expr
.parent
= self
6496 _n_expr2
= n_expr2
.as(not null)
6497 n_expr2
.parent
= self
6500 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6502 if _n_expr
== old_child
then
6503 if new_child
!= null then
6504 new_child
.parent
= self
6505 assert new_child
isa AExpr
6512 if _n_expr2
== old_child
then
6513 if new_child
!= null then
6514 new_child
.parent
= self
6515 assert new_child
isa AExpr
6516 _n_expr2
= new_child
6524 redef fun visit_all
(v
: Visitor)
6526 v
.enter_visit
(_n_expr
)
6527 v
.enter_visit
(_n_expr2
)
6530 redef class ACrangeExpr
6531 private init empty_init
do end
6533 init init_acrangeexpr
(
6534 n_obra
: nullable TObra,
6535 n_expr
: nullable AExpr,
6536 n_expr2
: nullable AExpr,
6537 n_cbra
: nullable TCbra
6541 _n_obra
= n_obra
.as(not null)
6542 n_obra
.parent
= self
6543 _n_expr
= n_expr
.as(not null)
6544 n_expr
.parent
= self
6545 _n_expr2
= n_expr2
.as(not null)
6546 n_expr2
.parent
= self
6547 _n_cbra
= n_cbra
.as(not null)
6548 n_cbra
.parent
= self
6551 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6553 if _n_obra
== old_child
then
6554 if new_child
!= null then
6555 new_child
.parent
= self
6556 assert new_child
isa TObra
6563 if _n_expr
== old_child
then
6564 if new_child
!= null then
6565 new_child
.parent
= self
6566 assert new_child
isa AExpr
6573 if _n_expr2
== old_child
then
6574 if new_child
!= null then
6575 new_child
.parent
= self
6576 assert new_child
isa AExpr
6577 _n_expr2
= new_child
6583 if _n_cbra
== old_child
then
6584 if new_child
!= null then
6585 new_child
.parent
= self
6586 assert new_child
isa TCbra
6595 redef fun visit_all
(v
: Visitor)
6597 v
.enter_visit
(_n_obra
)
6598 v
.enter_visit
(_n_expr
)
6599 v
.enter_visit
(_n_expr2
)
6600 v
.enter_visit
(_n_cbra
)
6603 redef class AOrangeExpr
6604 private init empty_init
do end
6606 init init_aorangeexpr
(
6607 n_obra
: nullable TObra,
6608 n_expr
: nullable AExpr,
6609 n_expr2
: nullable AExpr,
6610 n_cbra
: nullable TObra
6614 _n_obra
= n_obra
.as(not null)
6615 n_obra
.parent
= self
6616 _n_expr
= n_expr
.as(not null)
6617 n_expr
.parent
= self
6618 _n_expr2
= n_expr2
.as(not null)
6619 n_expr2
.parent
= self
6620 _n_cbra
= n_cbra
.as(not null)
6621 n_cbra
.parent
= self
6624 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6626 if _n_obra
== old_child
then
6627 if new_child
!= null then
6628 new_child
.parent
= self
6629 assert new_child
isa TObra
6636 if _n_expr
== old_child
then
6637 if new_child
!= null then
6638 new_child
.parent
= self
6639 assert new_child
isa AExpr
6646 if _n_expr2
== old_child
then
6647 if new_child
!= null then
6648 new_child
.parent
= self
6649 assert new_child
isa AExpr
6650 _n_expr2
= new_child
6656 if _n_cbra
== old_child
then
6657 if new_child
!= null then
6658 new_child
.parent
= self
6659 assert new_child
isa TObra
6668 redef fun visit_all
(v
: Visitor)
6670 v
.enter_visit
(_n_obra
)
6671 v
.enter_visit
(_n_expr
)
6672 v
.enter_visit
(_n_expr2
)
6673 v
.enter_visit
(_n_cbra
)
6676 redef class AArrayExpr
6677 private init empty_init
do end
6679 init init_aarrayexpr
(
6680 n_exprs
: nullable AExprs
6684 _n_exprs
= n_exprs
.as(not null)
6685 n_exprs
.parent
= self
6688 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6690 if _n_exprs
== old_child
then
6691 if new_child
!= null then
6692 new_child
.parent
= self
6693 assert new_child
isa AExprs
6694 _n_exprs
= new_child
6702 redef fun visit_all
(v
: Visitor)
6704 v
.enter_visit
(_n_exprs
)
6707 redef class ASelfExpr
6708 private init empty_init
do end
6710 init init_aselfexpr
(
6711 n_kwself
: nullable TKwself
6715 _n_kwself
= n_kwself
.as(not null)
6716 n_kwself
.parent
= self
6719 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6721 if _n_kwself
== old_child
then
6722 if new_child
!= null then
6723 new_child
.parent
= self
6724 assert new_child
isa TKwself
6725 _n_kwself
= new_child
6733 redef fun visit_all
(v
: Visitor)
6735 v
.enter_visit
(_n_kwself
)
6738 redef class AImplicitSelfExpr
6739 private init empty_init
do end
6741 init init_aimplicitselfexpr
6746 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6750 redef fun visit_all
(v
: Visitor)
6754 redef class ATrueExpr
6755 private init empty_init
do end
6757 init init_atrueexpr
(
6758 n_kwtrue
: nullable TKwtrue
6762 _n_kwtrue
= n_kwtrue
.as(not null)
6763 n_kwtrue
.parent
= self
6766 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6768 if _n_kwtrue
== old_child
then
6769 if new_child
!= null then
6770 new_child
.parent
= self
6771 assert new_child
isa TKwtrue
6772 _n_kwtrue
= new_child
6780 redef fun visit_all
(v
: Visitor)
6782 v
.enter_visit
(_n_kwtrue
)
6785 redef class AFalseExpr
6786 private init empty_init
do end
6788 init init_afalseexpr
(
6789 n_kwfalse
: nullable TKwfalse
6793 _n_kwfalse
= n_kwfalse
.as(not null)
6794 n_kwfalse
.parent
= self
6797 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6799 if _n_kwfalse
== old_child
then
6800 if new_child
!= null then
6801 new_child
.parent
= self
6802 assert new_child
isa TKwfalse
6803 _n_kwfalse
= new_child
6811 redef fun visit_all
(v
: Visitor)
6813 v
.enter_visit
(_n_kwfalse
)
6816 redef class ANullExpr
6817 private init empty_init
do end
6819 init init_anullexpr
(
6820 n_kwnull
: nullable TKwnull
6824 _n_kwnull
= n_kwnull
.as(not null)
6825 n_kwnull
.parent
= self
6828 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6830 if _n_kwnull
== old_child
then
6831 if new_child
!= null then
6832 new_child
.parent
= self
6833 assert new_child
isa TKwnull
6834 _n_kwnull
= new_child
6842 redef fun visit_all
(v
: Visitor)
6844 v
.enter_visit
(_n_kwnull
)
6847 redef class AIntExpr
6848 private init empty_init
do end
6850 init init_aintexpr
(
6851 n_number
: nullable TNumber
6855 _n_number
= n_number
.as(not null)
6856 n_number
.parent
= self
6859 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6861 if _n_number
== old_child
then
6862 if new_child
!= null then
6863 new_child
.parent
= self
6864 assert new_child
isa TNumber
6865 _n_number
= new_child
6873 redef fun visit_all
(v
: Visitor)
6875 v
.enter_visit
(_n_number
)
6878 redef class AFloatExpr
6879 private init empty_init
do end
6881 init init_afloatexpr
(
6882 n_float
: nullable TFloat
6886 _n_float
= n_float
.as(not null)
6887 n_float
.parent
= self
6890 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6892 if _n_float
== old_child
then
6893 if new_child
!= null then
6894 new_child
.parent
= self
6895 assert new_child
isa TFloat
6896 _n_float
= new_child
6904 redef fun visit_all
(v
: Visitor)
6906 v
.enter_visit
(_n_float
)
6909 redef class ACharExpr
6910 private init empty_init
do end
6912 init init_acharexpr
(
6913 n_char
: nullable TChar
6917 _n_char
= n_char
.as(not null)
6918 n_char
.parent
= self
6921 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6923 if _n_char
== old_child
then
6924 if new_child
!= null then
6925 new_child
.parent
= self
6926 assert new_child
isa TChar
6935 redef fun visit_all
(v
: Visitor)
6937 v
.enter_visit
(_n_char
)
6940 redef class AStringExpr
6941 private init empty_init
do end
6943 init init_astringexpr
(
6944 n_string
: nullable TString
6948 _n_string
= n_string
.as(not null)
6949 n_string
.parent
= self
6952 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6954 if _n_string
== old_child
then
6955 if new_child
!= null then
6956 new_child
.parent
= self
6957 assert new_child
isa TString
6958 _n_string
= new_child
6966 redef fun visit_all
(v
: Visitor)
6968 v
.enter_visit
(_n_string
)
6971 redef class AStartStringExpr
6972 private init empty_init
do end
6974 init init_astartstringexpr
(
6975 n_string
: nullable TStartString
6979 _n_string
= n_string
.as(not null)
6980 n_string
.parent
= self
6983 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6985 if _n_string
== old_child
then
6986 if new_child
!= null then
6987 new_child
.parent
= self
6988 assert new_child
isa TStartString
6989 _n_string
= new_child
6997 redef fun visit_all
(v
: Visitor)
6999 v
.enter_visit
(_n_string
)
7002 redef class AMidStringExpr
7003 private init empty_init
do end
7005 init init_amidstringexpr
(
7006 n_string
: nullable TMidString
7010 _n_string
= n_string
.as(not null)
7011 n_string
.parent
= self
7014 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7016 if _n_string
== old_child
then
7017 if new_child
!= null then
7018 new_child
.parent
= self
7019 assert new_child
isa TMidString
7020 _n_string
= new_child
7028 redef fun visit_all
(v
: Visitor)
7030 v
.enter_visit
(_n_string
)
7033 redef class AEndStringExpr
7034 private init empty_init
do end
7036 init init_aendstringexpr
(
7037 n_string
: nullable TEndString
7041 _n_string
= n_string
.as(not null)
7042 n_string
.parent
= self
7045 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7047 if _n_string
== old_child
then
7048 if new_child
!= null then
7049 new_child
.parent
= self
7050 assert new_child
isa TEndString
7051 _n_string
= new_child
7059 redef fun visit_all
(v
: Visitor)
7061 v
.enter_visit
(_n_string
)
7064 redef class ASuperstringExpr
7065 private init empty_init
do end
7067 init init_asuperstringexpr
(
7068 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7079 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7081 for i
in [0.._n_exprs
.length
[ do
7082 if _n_exprs
[i
] == old_child
then
7083 if new_child
!= null then
7084 assert new_child
isa AExpr
7085 _n_exprs
[i
] = new_child
7086 new_child
.parent
= self
7088 _n_exprs
.remove_at
(i
)
7095 redef fun visit_all
(v
: Visitor)
7097 for n
in _n_exprs
do
7102 redef class AParExpr
7103 private init empty_init
do end
7105 init init_aparexpr
(
7106 n_opar
: nullable TOpar,
7107 n_expr
: nullable AExpr,
7108 n_cpar
: nullable TCpar
7112 _n_opar
= n_opar
.as(not null)
7113 n_opar
.parent
= self
7114 _n_expr
= n_expr
.as(not null)
7115 n_expr
.parent
= self
7116 _n_cpar
= n_cpar
.as(not null)
7117 n_cpar
.parent
= self
7120 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7122 if _n_opar
== old_child
then
7123 if new_child
!= null then
7124 new_child
.parent
= self
7125 assert new_child
isa TOpar
7132 if _n_expr
== old_child
then
7133 if new_child
!= null then
7134 new_child
.parent
= self
7135 assert new_child
isa AExpr
7142 if _n_cpar
== old_child
then
7143 if new_child
!= null then
7144 new_child
.parent
= self
7145 assert new_child
isa TCpar
7154 redef fun visit_all
(v
: Visitor)
7156 v
.enter_visit
(_n_opar
)
7157 v
.enter_visit
(_n_expr
)
7158 v
.enter_visit
(_n_cpar
)
7161 redef class AAsCastExpr
7162 private init empty_init
do end
7164 init init_aascastexpr
(
7165 n_expr
: nullable AExpr,
7166 n_kwas
: nullable TKwas,
7167 n_opar
: nullable TOpar,
7168 n_type
: nullable AType,
7169 n_cpar
: nullable TCpar
7173 _n_expr
= n_expr
.as(not null)
7174 n_expr
.parent
= self
7175 _n_kwas
= n_kwas
.as(not null)
7176 n_kwas
.parent
= self
7177 _n_opar
= n_opar
.as(not null)
7178 n_opar
.parent
= self
7179 _n_type
= n_type
.as(not null)
7180 n_type
.parent
= self
7181 _n_cpar
= n_cpar
.as(not null)
7182 n_cpar
.parent
= self
7185 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7187 if _n_expr
== old_child
then
7188 if new_child
!= null then
7189 new_child
.parent
= self
7190 assert new_child
isa AExpr
7197 if _n_kwas
== old_child
then
7198 if new_child
!= null then
7199 new_child
.parent
= self
7200 assert new_child
isa TKwas
7207 if _n_opar
== old_child
then
7208 if new_child
!= null then
7209 new_child
.parent
= self
7210 assert new_child
isa TOpar
7217 if _n_type
== old_child
then
7218 if new_child
!= null then
7219 new_child
.parent
= self
7220 assert new_child
isa AType
7227 if _n_cpar
== old_child
then
7228 if new_child
!= null then
7229 new_child
.parent
= self
7230 assert new_child
isa TCpar
7239 redef fun visit_all
(v
: Visitor)
7241 v
.enter_visit
(_n_expr
)
7242 v
.enter_visit
(_n_kwas
)
7243 v
.enter_visit
(_n_opar
)
7244 v
.enter_visit
(_n_type
)
7245 v
.enter_visit
(_n_cpar
)
7248 redef class AAsNotnullExpr
7249 private init empty_init
do end
7251 init init_aasnotnullexpr
(
7252 n_expr
: nullable AExpr,
7253 n_kwas
: nullable TKwas,
7254 n_opar
: nullable TOpar,
7255 n_kwnot
: nullable TKwnot,
7256 n_kwnull
: nullable TKwnull,
7257 n_cpar
: nullable TCpar
7261 _n_expr
= n_expr
.as(not null)
7262 n_expr
.parent
= self
7263 _n_kwas
= n_kwas
.as(not null)
7264 n_kwas
.parent
= self
7265 _n_opar
= n_opar
.as(not null)
7266 n_opar
.parent
= self
7267 _n_kwnot
= n_kwnot
.as(not null)
7268 n_kwnot
.parent
= self
7269 _n_kwnull
= n_kwnull
.as(not null)
7270 n_kwnull
.parent
= self
7271 _n_cpar
= n_cpar
.as(not null)
7272 n_cpar
.parent
= self
7275 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7277 if _n_expr
== old_child
then
7278 if new_child
!= null then
7279 new_child
.parent
= self
7280 assert new_child
isa AExpr
7287 if _n_kwas
== old_child
then
7288 if new_child
!= null then
7289 new_child
.parent
= self
7290 assert new_child
isa TKwas
7297 if _n_opar
== old_child
then
7298 if new_child
!= null then
7299 new_child
.parent
= self
7300 assert new_child
isa TOpar
7307 if _n_kwnot
== old_child
then
7308 if new_child
!= null then
7309 new_child
.parent
= self
7310 assert new_child
isa TKwnot
7311 _n_kwnot
= new_child
7317 if _n_kwnull
== old_child
then
7318 if new_child
!= null then
7319 new_child
.parent
= self
7320 assert new_child
isa TKwnull
7321 _n_kwnull
= new_child
7327 if _n_cpar
== old_child
then
7328 if new_child
!= null then
7329 new_child
.parent
= self
7330 assert new_child
isa TCpar
7339 redef fun visit_all
(v
: Visitor)
7341 v
.enter_visit
(_n_expr
)
7342 v
.enter_visit
(_n_kwas
)
7343 v
.enter_visit
(_n_opar
)
7344 v
.enter_visit
(_n_kwnot
)
7345 v
.enter_visit
(_n_kwnull
)
7346 v
.enter_visit
(_n_cpar
)
7349 redef class AIssetAttrExpr
7350 private init empty_init
do end
7352 init init_aissetattrexpr
(
7353 n_kwisset
: nullable TKwisset,
7354 n_expr
: nullable AExpr,
7355 n_id
: nullable TAttrid
7359 _n_kwisset
= n_kwisset
.as(not null)
7360 n_kwisset
.parent
= self
7361 _n_expr
= n_expr
.as(not null)
7362 n_expr
.parent
= self
7363 _n_id
= n_id
.as(not null)
7367 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7369 if _n_kwisset
== old_child
then
7370 if new_child
!= null then
7371 new_child
.parent
= self
7372 assert new_child
isa TKwisset
7373 _n_kwisset
= new_child
7379 if _n_expr
== old_child
then
7380 if new_child
!= null then
7381 new_child
.parent
= self
7382 assert new_child
isa AExpr
7389 if _n_id
== old_child
then
7390 if new_child
!= null then
7391 new_child
.parent
= self
7392 assert new_child
isa TAttrid
7401 redef fun visit_all
(v
: Visitor)
7403 v
.enter_visit
(_n_kwisset
)
7404 v
.enter_visit
(_n_expr
)
7405 v
.enter_visit
(_n_id
)
7408 redef class ADebugTypeExpr
7409 private init empty_init
do end
7411 init init_adebugtypeexpr
(
7412 n_kwdebug
: nullable TKwdebug,
7413 n_kwtype
: nullable TKwtype,
7414 n_expr
: nullable AExpr,
7415 n_type
: nullable AType
7419 _n_kwdebug
= n_kwdebug
.as(not null)
7420 n_kwdebug
.parent
= self
7421 _n_kwtype
= n_kwtype
.as(not null)
7422 n_kwtype
.parent
= self
7423 _n_expr
= n_expr
.as(not null)
7424 n_expr
.parent
= self
7425 _n_type
= n_type
.as(not null)
7426 n_type
.parent
= self
7429 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7431 if _n_kwdebug
== old_child
then
7432 if new_child
!= null then
7433 new_child
.parent
= self
7434 assert new_child
isa TKwdebug
7435 _n_kwdebug
= new_child
7441 if _n_kwtype
== old_child
then
7442 if new_child
!= null then
7443 new_child
.parent
= self
7444 assert new_child
isa TKwtype
7445 _n_kwtype
= new_child
7451 if _n_expr
== old_child
then
7452 if new_child
!= null then
7453 new_child
.parent
= self
7454 assert new_child
isa AExpr
7461 if _n_type
== old_child
then
7462 if new_child
!= null then
7463 new_child
.parent
= self
7464 assert new_child
isa AType
7473 redef fun visit_all
(v
: Visitor)
7475 v
.enter_visit
(_n_kwdebug
)
7476 v
.enter_visit
(_n_kwtype
)
7477 v
.enter_visit
(_n_expr
)
7478 v
.enter_visit
(_n_type
)
7481 redef class AListExprs
7482 private init empty_init
do end
7484 init init_alistexprs
(
7485 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7496 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7498 for i
in [0.._n_exprs
.length
[ do
7499 if _n_exprs
[i
] == old_child
then
7500 if new_child
!= null then
7501 assert new_child
isa AExpr
7502 _n_exprs
[i
] = new_child
7503 new_child
.parent
= self
7505 _n_exprs
.remove_at
(i
)
7512 redef fun visit_all
(v
: Visitor)
7514 for n
in _n_exprs
do
7519 redef class AParExprs
7520 private init empty_init
do end
7522 init init_aparexprs
(
7523 n_opar
: nullable TOpar,
7524 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7525 n_cpar
: nullable TCpar
7529 _n_opar
= n_opar
.as(not null)
7530 n_opar
.parent
= self
7536 _n_cpar
= n_cpar
.as(not null)
7537 n_cpar
.parent
= self
7540 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7542 if _n_opar
== old_child
then
7543 if new_child
!= null then
7544 new_child
.parent
= self
7545 assert new_child
isa TOpar
7552 for i
in [0.._n_exprs
.length
[ do
7553 if _n_exprs
[i
] == old_child
then
7554 if new_child
!= null then
7555 assert new_child
isa AExpr
7556 _n_exprs
[i
] = new_child
7557 new_child
.parent
= self
7559 _n_exprs
.remove_at
(i
)
7564 if _n_cpar
== old_child
then
7565 if new_child
!= null then
7566 new_child
.parent
= self
7567 assert new_child
isa TCpar
7576 redef fun visit_all
(v
: Visitor)
7578 v
.enter_visit
(_n_opar
)
7579 for n
in _n_exprs
do
7582 v
.enter_visit
(_n_cpar
)
7585 redef class ABraExprs
7586 private init empty_init
do end
7588 init init_abraexprs
(
7589 n_obra
: nullable TObra,
7590 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7591 n_cbra
: nullable TCbra
7595 _n_obra
= n_obra
.as(not null)
7596 n_obra
.parent
= self
7602 _n_cbra
= n_cbra
.as(not null)
7603 n_cbra
.parent
= self
7606 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7608 if _n_obra
== old_child
then
7609 if new_child
!= null then
7610 new_child
.parent
= self
7611 assert new_child
isa TObra
7618 for i
in [0.._n_exprs
.length
[ do
7619 if _n_exprs
[i
] == old_child
then
7620 if new_child
!= null then
7621 assert new_child
isa AExpr
7622 _n_exprs
[i
] = new_child
7623 new_child
.parent
= self
7625 _n_exprs
.remove_at
(i
)
7630 if _n_cbra
== old_child
then
7631 if new_child
!= null then
7632 new_child
.parent
= self
7633 assert new_child
isa TCbra
7642 redef fun visit_all
(v
: Visitor)
7644 v
.enter_visit
(_n_obra
)
7645 for n
in _n_exprs
do
7648 v
.enter_visit
(_n_cbra
)
7651 redef class APlusAssignOp
7652 private init empty_init
do end
7654 init init_aplusassignop
(
7655 n_pluseq
: nullable TPluseq
7659 _n_pluseq
= n_pluseq
.as(not null)
7660 n_pluseq
.parent
= self
7663 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7665 if _n_pluseq
== old_child
then
7666 if new_child
!= null then
7667 new_child
.parent
= self
7668 assert new_child
isa TPluseq
7669 _n_pluseq
= new_child
7677 redef fun visit_all
(v
: Visitor)
7679 v
.enter_visit
(_n_pluseq
)
7682 redef class AMinusAssignOp
7683 private init empty_init
do end
7685 init init_aminusassignop
(
7686 n_minuseq
: nullable TMinuseq
7690 _n_minuseq
= n_minuseq
.as(not null)
7691 n_minuseq
.parent
= self
7694 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7696 if _n_minuseq
== old_child
then
7697 if new_child
!= null then
7698 new_child
.parent
= self
7699 assert new_child
isa TMinuseq
7700 _n_minuseq
= new_child
7708 redef fun visit_all
(v
: Visitor)
7710 v
.enter_visit
(_n_minuseq
)
7713 redef class AClosureDef
7714 private init empty_init
do end
7716 init init_aclosuredef
(
7717 n_bang
: nullable TBang,
7718 n_id
: nullable AClosureId,
7719 n_ids
: Collection[Object], # Should be Collection[TId]
7720 n_kwdo
: nullable TKwdo,
7721 n_expr
: nullable AExpr,
7722 n_label
: nullable ALabel
7726 _n_bang
= n_bang
.as(not null)
7727 n_bang
.parent
= self
7728 _n_id
= n_id
.as(not null)
7736 if n_kwdo
!= null then
7737 n_kwdo
.parent
= self
7740 if n_expr
!= null then
7741 n_expr
.parent
= self
7744 if n_label
!= null then
7745 n_label
.parent
= self
7749 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7751 if _n_bang
== old_child
then
7752 if new_child
!= null then
7753 new_child
.parent
= self
7754 assert new_child
isa TBang
7761 if _n_id
== old_child
then
7762 if new_child
!= null then
7763 new_child
.parent
= self
7764 assert new_child
isa AClosureId
7771 for i
in [0.._n_ids
.length
[ do
7772 if _n_ids
[i
] == old_child
then
7773 if new_child
!= null then
7774 assert new_child
isa TId
7775 _n_ids
[i
] = new_child
7776 new_child
.parent
= self
7783 if _n_kwdo
== old_child
then
7784 if new_child
!= null then
7785 new_child
.parent
= self
7786 assert new_child
isa TKwdo
7793 if _n_expr
== old_child
then
7794 if new_child
!= null then
7795 new_child
.parent
= self
7796 assert new_child
isa AExpr
7803 if _n_label
== old_child
then
7804 if new_child
!= null then
7805 new_child
.parent
= self
7806 assert new_child
isa ALabel
7807 _n_label
= new_child
7815 redef fun visit_all
(v
: Visitor)
7817 v
.enter_visit
(_n_bang
)
7818 v
.enter_visit
(_n_id
)
7822 if _n_kwdo
!= null then
7823 v
.enter_visit
(_n_kwdo
.as(not null))
7825 if _n_expr
!= null then
7826 v
.enter_visit
(_n_expr
.as(not null))
7828 if _n_label
!= null then
7829 v
.enter_visit
(_n_label
.as(not null))
7833 redef class ASimpleClosureId
7834 private init empty_init
do end
7836 init init_asimpleclosureid
(
7841 _n_id
= n_id
.as(not null)
7845 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7847 if _n_id
== old_child
then
7848 if new_child
!= null then
7849 new_child
.parent
= self
7850 assert new_child
isa TId
7859 redef fun visit_all
(v
: Visitor)
7861 v
.enter_visit
(_n_id
)
7864 redef class ABreakClosureId
7865 private init empty_init
do end
7867 init init_abreakclosureid
(
7868 n_kwbreak
: nullable TKwbreak
7872 _n_kwbreak
= n_kwbreak
.as(not null)
7873 n_kwbreak
.parent
= self
7876 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7878 if _n_kwbreak
== old_child
then
7879 if new_child
!= null then
7880 new_child
.parent
= self
7881 assert new_child
isa TKwbreak
7882 _n_kwbreak
= new_child
7890 redef fun visit_all
(v
: Visitor)
7892 v
.enter_visit
(_n_kwbreak
)
7895 redef class AModuleName
7896 private init empty_init
do end
7898 init init_amodulename
(
7899 n_quad
: nullable TQuad,
7900 n_path
: Collection[Object], # Should be Collection[TId]
7906 if n_quad
!= null then
7907 n_quad
.parent
= self
7914 _n_id
= n_id
.as(not null)
7918 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7920 if _n_quad
== old_child
then
7921 if new_child
!= null then
7922 new_child
.parent
= self
7923 assert new_child
isa TQuad
7930 for i
in [0.._n_path
.length
[ do
7931 if _n_path
[i
] == old_child
then
7932 if new_child
!= null then
7933 assert new_child
isa TId
7934 _n_path
[i
] = new_child
7935 new_child
.parent
= self
7937 _n_path
.remove_at
(i
)
7942 if _n_id
== old_child
then
7943 if new_child
!= null then
7944 new_child
.parent
= self
7945 assert new_child
isa TId
7954 redef fun visit_all
(v
: Visitor)
7956 if _n_quad
!= null then
7957 v
.enter_visit
(_n_quad
.as(not null))
7962 v
.enter_visit
(_n_id
)
7965 redef class AExternCalls
7966 private init empty_init
do end
7968 init init_aexterncalls
(
7969 n_kwimport
: nullable TKwimport,
7970 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7974 _n_kwimport
= n_kwimport
.as(not null)
7975 n_kwimport
.parent
= self
7976 for n
in n_extern_calls
do
7977 assert n
isa AExternCall
7978 _n_extern_calls
.add
(n
)
7983 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7985 if _n_kwimport
== old_child
then
7986 if new_child
!= null then
7987 new_child
.parent
= self
7988 assert new_child
isa TKwimport
7989 _n_kwimport
= new_child
7995 for i
in [0.._n_extern_calls
.length
[ do
7996 if _n_extern_calls
[i
] == old_child
then
7997 if new_child
!= null then
7998 assert new_child
isa AExternCall
7999 _n_extern_calls
[i
] = new_child
8000 new_child
.parent
= self
8002 _n_extern_calls
.remove_at
(i
)
8009 redef fun visit_all
(v
: Visitor)
8011 v
.enter_visit
(_n_kwimport
)
8012 for n
in _n_extern_calls
do
8017 redef class AExternCall
8018 private init empty_init
do end
8020 init init_aexterncall
8025 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8029 redef fun visit_all
(v
: Visitor)
8033 redef class ASuperExternCall
8034 private init empty_init
do end
8036 init init_asuperexterncall
(
8037 n_kwsuper
: nullable TKwsuper
8041 _n_kwsuper
= n_kwsuper
.as(not null)
8042 n_kwsuper
.parent
= self
8045 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8047 if _n_kwsuper
== old_child
then
8048 if new_child
!= null then
8049 new_child
.parent
= self
8050 assert new_child
isa TKwsuper
8051 _n_kwsuper
= new_child
8059 redef fun visit_all
(v
: Visitor)
8061 v
.enter_visit
(_n_kwsuper
)
8064 redef class ALocalPropExternCall
8065 private init empty_init
do end
8067 init init_alocalpropexterncall
(
8068 n_methid
: nullable AMethid
8072 _n_methid
= n_methid
.as(not null)
8073 n_methid
.parent
= self
8076 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8078 if _n_methid
== old_child
then
8079 if new_child
!= null then
8080 new_child
.parent
= self
8081 assert new_child
isa AMethid
8082 _n_methid
= new_child
8090 redef fun visit_all
(v
: Visitor)
8092 v
.enter_visit
(_n_methid
)
8095 redef class AFullPropExternCall
8096 private init empty_init
do end
8098 init init_afullpropexterncall
(
8099 n_classid
: nullable TClassid,
8100 n_quad
: nullable TQuad,
8101 n_methid
: nullable AMethid
8105 _n_classid
= n_classid
.as(not null)
8106 n_classid
.parent
= self
8108 if n_quad
!= null then
8109 n_quad
.parent
= self
8111 _n_methid
= n_methid
.as(not null)
8112 n_methid
.parent
= self
8115 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8117 if _n_classid
== old_child
then
8118 if new_child
!= null then
8119 new_child
.parent
= self
8120 assert new_child
isa TClassid
8121 _n_classid
= new_child
8127 if _n_quad
== old_child
then
8128 if new_child
!= null then
8129 new_child
.parent
= self
8130 assert new_child
isa TQuad
8137 if _n_methid
== old_child
then
8138 if new_child
!= null then
8139 new_child
.parent
= self
8140 assert new_child
isa AMethid
8141 _n_methid
= new_child
8149 redef fun visit_all
(v
: Visitor)
8151 v
.enter_visit
(_n_classid
)
8152 if _n_quad
!= null then
8153 v
.enter_visit
(_n_quad
.as(not null))
8155 v
.enter_visit
(_n_methid
)
8158 redef class AInitPropExternCall
8159 private init empty_init
do end
8161 init init_ainitpropexterncall
(
8162 n_classid
: nullable TClassid
8166 _n_classid
= n_classid
.as(not null)
8167 n_classid
.parent
= self
8170 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8172 if _n_classid
== old_child
then
8173 if new_child
!= null then
8174 new_child
.parent
= self
8175 assert new_child
isa TClassid
8176 _n_classid
= new_child
8184 redef fun visit_all
(v
: Visitor)
8186 v
.enter_visit
(_n_classid
)
8189 redef class ACastAsExternCall
8190 private init empty_init
do end
8192 init init_acastasexterncall
(
8193 n_from_type
: nullable AType,
8194 n_kwas
: nullable TKwas,
8195 n_to_type
: nullable AType
8199 _n_from_type
= n_from_type
.as(not null)
8200 n_from_type
.parent
= self
8201 _n_kwas
= n_kwas
.as(not null)
8202 n_kwas
.parent
= self
8203 _n_to_type
= n_to_type
.as(not null)
8204 n_to_type
.parent
= self
8207 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8209 if _n_from_type
== old_child
then
8210 if new_child
!= null then
8211 new_child
.parent
= self
8212 assert new_child
isa AType
8213 _n_from_type
= new_child
8219 if _n_kwas
== old_child
then
8220 if new_child
!= null then
8221 new_child
.parent
= self
8222 assert new_child
isa TKwas
8229 if _n_to_type
== old_child
then
8230 if new_child
!= null then
8231 new_child
.parent
= self
8232 assert new_child
isa AType
8233 _n_to_type
= new_child
8241 redef fun visit_all
(v
: Visitor)
8243 v
.enter_visit
(_n_from_type
)
8244 v
.enter_visit
(_n_kwas
)
8245 v
.enter_visit
(_n_to_type
)
8248 redef class AAsNullableExternCall
8249 private init empty_init
do end
8251 init init_aasnullableexterncall
(
8252 n_type
: nullable AType,
8253 n_kwas
: nullable TKwas,
8254 n_kwnullable
: nullable TKwnullable
8258 _n_type
= n_type
.as(not null)
8259 n_type
.parent
= self
8260 _n_kwas
= n_kwas
.as(not null)
8261 n_kwas
.parent
= self
8262 _n_kwnullable
= n_kwnullable
.as(not null)
8263 n_kwnullable
.parent
= self
8266 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8268 if _n_type
== old_child
then
8269 if new_child
!= null then
8270 new_child
.parent
= self
8271 assert new_child
isa AType
8278 if _n_kwas
== old_child
then
8279 if new_child
!= null then
8280 new_child
.parent
= self
8281 assert new_child
isa TKwas
8288 if _n_kwnullable
== old_child
then
8289 if new_child
!= null then
8290 new_child
.parent
= self
8291 assert new_child
isa TKwnullable
8292 _n_kwnullable
= new_child
8300 redef fun visit_all
(v
: Visitor)
8302 v
.enter_visit
(_n_type
)
8303 v
.enter_visit
(_n_kwas
)
8304 v
.enter_visit
(_n_kwnullable
)
8307 redef class AAsNotNullableExternCall
8308 private init empty_init
do end
8310 init init_aasnotnullableexterncall
(
8311 n_type
: nullable AType,
8312 n_kwas
: nullable TKwas,
8313 n_kwnot
: nullable TKwnot,
8314 n_kwnullable
: nullable TKwnullable
8318 _n_type
= n_type
.as(not null)
8319 n_type
.parent
= self
8320 _n_kwas
= n_kwas
.as(not null)
8321 n_kwas
.parent
= self
8322 _n_kwnot
= n_kwnot
.as(not null)
8323 n_kwnot
.parent
= self
8324 _n_kwnullable
= n_kwnullable
.as(not null)
8325 n_kwnullable
.parent
= self
8328 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8330 if _n_type
== old_child
then
8331 if new_child
!= null then
8332 new_child
.parent
= self
8333 assert new_child
isa AType
8340 if _n_kwas
== old_child
then
8341 if new_child
!= null then
8342 new_child
.parent
= self
8343 assert new_child
isa TKwas
8350 if _n_kwnot
== old_child
then
8351 if new_child
!= null then
8352 new_child
.parent
= self
8353 assert new_child
isa TKwnot
8354 _n_kwnot
= new_child
8360 if _n_kwnullable
== old_child
then
8361 if new_child
!= null then
8362 new_child
.parent
= self
8363 assert new_child
isa TKwnullable
8364 _n_kwnullable
= new_child
8372 redef fun visit_all
(v
: Visitor)
8374 v
.enter_visit
(_n_type
)
8375 v
.enter_visit
(_n_kwas
)
8376 v
.enter_visit
(_n_kwnot
)
8377 v
.enter_visit
(_n_kwnullable
)
8380 redef class AInLanguage
8381 private init empty_init
do end
8383 init init_ainlanguage
(
8384 n_kwin
: nullable TKwin,
8385 n_string
: nullable TString
8389 _n_kwin
= n_kwin
.as(not null)
8390 n_kwin
.parent
= self
8391 _n_string
= n_string
.as(not null)
8392 n_string
.parent
= self
8395 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8397 if _n_kwin
== old_child
then
8398 if new_child
!= null then
8399 new_child
.parent
= self
8400 assert new_child
isa TKwin
8407 if _n_string
== old_child
then
8408 if new_child
!= null then
8409 new_child
.parent
= self
8410 assert new_child
isa TString
8411 _n_string
= new_child
8419 redef fun visit_all
(v
: Visitor)
8421 v
.enter_visit
(_n_kwin
)
8422 v
.enter_visit
(_n_string
)
8425 redef class AExternCodeBlock
8426 private init empty_init
do end
8428 init init_aexterncodeblock
(
8429 n_in_language
: nullable AInLanguage,
8430 n_extern_code_segment
: nullable TExternCodeSegment
8434 _n_in_language
= n_in_language
8435 if n_in_language
!= null then
8436 n_in_language
.parent
= self
8438 _n_extern_code_segment
= n_extern_code_segment
.as(not null)
8439 n_extern_code_segment
.parent
= self
8442 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8444 if _n_in_language
== old_child
then
8445 if new_child
!= null then
8446 new_child
.parent
= self
8447 assert new_child
isa AInLanguage
8448 _n_in_language
= new_child
8450 _n_in_language
= null
8454 if _n_extern_code_segment
== old_child
then
8455 if new_child
!= null then
8456 new_child
.parent
= self
8457 assert new_child
isa TExternCodeSegment
8458 _n_extern_code_segment
= new_child
8466 redef fun visit_all
(v
: Visitor)
8468 if _n_in_language
!= null then
8469 v
.enter_visit
(_n_in_language
.as(not null))
8471 v
.enter_visit
(_n_extern_code_segment
)
8474 redef class AQualified
8475 private init empty_init
do end
8477 init init_aqualified
(
8478 n_id
: Collection[Object], # Should be Collection[TId]
8479 n_classid
: nullable TClassid
8488 _n_classid
= n_classid
8489 if n_classid
!= null then
8490 n_classid
.parent
= self
8494 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8496 for i
in [0.._n_id
.length
[ do
8497 if _n_id
[i
] == old_child
then
8498 if new_child
!= null then
8499 assert new_child
isa TId
8500 _n_id
[i
] = new_child
8501 new_child
.parent
= self
8508 if _n_classid
== old_child
then
8509 if new_child
!= null then
8510 new_child
.parent
= self
8511 assert new_child
isa TClassid
8512 _n_classid
= new_child
8520 redef fun visit_all
(v
: Visitor)
8525 if _n_classid
!= null then
8526 v
.enter_visit
(_n_classid
.as(not null))
8531 private init empty_init
do end
8534 n_comment
: Collection[Object] # Should be Collection[TComment]
8538 for n
in n_comment
do
8539 assert n
isa TComment
8545 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8547 for i
in [0.._n_comment
.length
[ do
8548 if _n_comment
[i
] == old_child
then
8549 if new_child
!= null then
8550 assert new_child
isa TComment
8551 _n_comment
[i
] = new_child
8552 new_child
.parent
= self
8554 _n_comment
.remove_at
(i
)
8561 redef fun visit_all
(v
: Visitor)
8563 for n
in _n_comment
do
8570 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8572 if _n_base
== old_child
then
8573 if new_child
== null then
8575 new_child
.parent
= self
8576 assert new_child
isa AModule
8579 old_child
.parent
= null
8584 redef fun visit_all
(v
: Visitor)
8586 if _n_base
!= null then
8587 v
.enter_visit
(_n_base
.as(not null))
8589 v
.enter_visit
(_n_eof
)