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_kwspecial
: nullable TKwspecial,
951 n_kwsuper
: nullable TKwsuper,
952 n_type
: nullable AType
956 _n_kwspecial
= n_kwspecial
957 if n_kwspecial
!= null then
958 n_kwspecial
.parent
= self
960 _n_kwsuper
= n_kwsuper
961 if n_kwsuper
!= null then
962 n_kwsuper
.parent
= self
964 _n_type
= n_type
.as(not null)
968 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
970 if _n_kwspecial
== old_child
then
971 if new_child
!= null then
972 new_child
.parent
= self
973 assert new_child
isa TKwspecial
974 _n_kwspecial
= new_child
980 if _n_kwsuper
== old_child
then
981 if new_child
!= null then
982 new_child
.parent
= self
983 assert new_child
isa TKwsuper
984 _n_kwsuper
= new_child
990 if _n_type
== old_child
then
991 if new_child
!= null then
992 new_child
.parent
= self
993 assert new_child
isa AType
1002 redef fun visit_all
(v
: Visitor)
1004 if _n_kwspecial
!= null then
1005 v
.enter_visit
(_n_kwspecial
.as(not null))
1007 if _n_kwsuper
!= null then
1008 v
.enter_visit
(_n_kwsuper
.as(not null))
1010 v
.enter_visit
(_n_type
)
1013 redef class AAttrPropdef
1014 private init empty_init
do end
1016 init init_aattrpropdef
(
1017 n_doc
: nullable ADoc,
1018 n_readable
: nullable AAble,
1019 n_writable
: nullable AAble,
1020 n_kwredef
: nullable TKwredef,
1021 n_visibility
: nullable AVisibility,
1022 n_kwvar
: nullable TKwvar,
1023 n_id
: nullable TAttrid,
1024 n_id2
: nullable TId,
1025 n_type
: nullable AType,
1026 n_expr
: nullable AExpr
1031 if n_doc
!= null then
1034 _n_readable
= n_readable
1035 if n_readable
!= null then
1036 n_readable
.parent
= self
1038 _n_writable
= n_writable
1039 if n_writable
!= null then
1040 n_writable
.parent
= self
1042 _n_kwredef
= n_kwredef
1043 if n_kwredef
!= null then
1044 n_kwredef
.parent
= self
1046 _n_visibility
= n_visibility
.as(not null)
1047 n_visibility
.parent
= self
1048 _n_kwvar
= n_kwvar
.as(not null)
1049 n_kwvar
.parent
= self
1051 if n_id
!= null then
1055 if n_id2
!= null then
1059 if n_type
!= null then
1060 n_type
.parent
= self
1063 if n_expr
!= null then
1064 n_expr
.parent
= self
1068 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1070 if _n_doc
== old_child
then
1071 if new_child
!= null then
1072 new_child
.parent
= self
1073 assert new_child
isa ADoc
1080 if _n_readable
== old_child
then
1081 if new_child
!= null then
1082 new_child
.parent
= self
1083 assert new_child
isa AAble
1084 _n_readable
= new_child
1090 if _n_writable
== old_child
then
1091 if new_child
!= null then
1092 new_child
.parent
= self
1093 assert new_child
isa AAble
1094 _n_writable
= new_child
1100 if _n_kwredef
== old_child
then
1101 if new_child
!= null then
1102 new_child
.parent
= self
1103 assert new_child
isa TKwredef
1104 _n_kwredef
= new_child
1110 if _n_visibility
== old_child
then
1111 if new_child
!= null then
1112 new_child
.parent
= self
1113 assert new_child
isa AVisibility
1114 _n_visibility
= new_child
1120 if _n_kwvar
== old_child
then
1121 if new_child
!= null then
1122 new_child
.parent
= self
1123 assert new_child
isa TKwvar
1124 _n_kwvar
= new_child
1130 if _n_id
== old_child
then
1131 if new_child
!= null then
1132 new_child
.parent
= self
1133 assert new_child
isa TAttrid
1140 if _n_id2
== old_child
then
1141 if new_child
!= null then
1142 new_child
.parent
= self
1143 assert new_child
isa TId
1150 if _n_type
== old_child
then
1151 if new_child
!= null then
1152 new_child
.parent
= self
1153 assert new_child
isa AType
1160 if _n_expr
== old_child
then
1161 if new_child
!= null then
1162 new_child
.parent
= self
1163 assert new_child
isa AExpr
1172 redef fun visit_all
(v
: Visitor)
1174 if _n_doc
!= null then
1175 v
.enter_visit
(_n_doc
.as(not null))
1177 if _n_readable
!= null then
1178 v
.enter_visit
(_n_readable
.as(not null))
1180 if _n_writable
!= null then
1181 v
.enter_visit
(_n_writable
.as(not null))
1183 if _n_kwredef
!= null then
1184 v
.enter_visit
(_n_kwredef
.as(not null))
1186 v
.enter_visit
(_n_visibility
)
1187 v
.enter_visit
(_n_kwvar
)
1188 if _n_id
!= null then
1189 v
.enter_visit
(_n_id
.as(not null))
1191 if _n_id2
!= null then
1192 v
.enter_visit
(_n_id2
.as(not null))
1194 if _n_type
!= null then
1195 v
.enter_visit
(_n_type
.as(not null))
1197 if _n_expr
!= null then
1198 v
.enter_visit
(_n_expr
.as(not null))
1202 redef class AMethPropdef
1203 private init empty_init
do end
1205 init init_amethpropdef
(
1206 n_doc
: nullable ADoc,
1207 n_kwredef
: nullable TKwredef,
1208 n_visibility
: nullable AVisibility,
1209 n_methid
: nullable AMethid,
1210 n_signature
: nullable ASignature
1215 if n_doc
!= null then
1218 _n_kwredef
= n_kwredef
1219 if n_kwredef
!= null then
1220 n_kwredef
.parent
= self
1222 _n_visibility
= n_visibility
.as(not null)
1223 n_visibility
.parent
= self
1224 _n_methid
= n_methid
.as(not null)
1225 n_methid
.parent
= self
1226 _n_signature
= n_signature
.as(not null)
1227 n_signature
.parent
= self
1230 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1232 if _n_doc
== old_child
then
1233 if new_child
!= null then
1234 new_child
.parent
= self
1235 assert new_child
isa ADoc
1242 if _n_kwredef
== old_child
then
1243 if new_child
!= null then
1244 new_child
.parent
= self
1245 assert new_child
isa TKwredef
1246 _n_kwredef
= new_child
1252 if _n_visibility
== old_child
then
1253 if new_child
!= null then
1254 new_child
.parent
= self
1255 assert new_child
isa AVisibility
1256 _n_visibility
= new_child
1262 if _n_methid
== old_child
then
1263 if new_child
!= null then
1264 new_child
.parent
= self
1265 assert new_child
isa AMethid
1266 _n_methid
= new_child
1272 if _n_signature
== old_child
then
1273 if new_child
!= null then
1274 new_child
.parent
= self
1275 assert new_child
isa ASignature
1276 _n_signature
= new_child
1284 redef fun visit_all
(v
: Visitor)
1286 if _n_doc
!= null then
1287 v
.enter_visit
(_n_doc
.as(not null))
1289 if _n_kwredef
!= null then
1290 v
.enter_visit
(_n_kwredef
.as(not null))
1292 v
.enter_visit
(_n_visibility
)
1293 v
.enter_visit
(_n_methid
)
1294 v
.enter_visit
(_n_signature
)
1297 redef class ADeferredMethPropdef
1298 private init empty_init
do end
1300 init init_adeferredmethpropdef
(
1301 n_doc
: nullable ADoc,
1302 n_kwredef
: nullable TKwredef,
1303 n_visibility
: nullable AVisibility,
1304 n_kwmeth
: nullable TKwmeth,
1305 n_methid
: nullable AMethid,
1306 n_signature
: nullable ASignature
1311 if n_doc
!= null then
1314 _n_kwredef
= n_kwredef
1315 if n_kwredef
!= null then
1316 n_kwredef
.parent
= self
1318 _n_visibility
= n_visibility
.as(not null)
1319 n_visibility
.parent
= self
1320 _n_kwmeth
= n_kwmeth
.as(not null)
1321 n_kwmeth
.parent
= self
1322 _n_methid
= n_methid
.as(not null)
1323 n_methid
.parent
= self
1324 _n_signature
= n_signature
.as(not null)
1325 n_signature
.parent
= self
1328 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1330 if _n_doc
== old_child
then
1331 if new_child
!= null then
1332 new_child
.parent
= self
1333 assert new_child
isa ADoc
1340 if _n_kwredef
== old_child
then
1341 if new_child
!= null then
1342 new_child
.parent
= self
1343 assert new_child
isa TKwredef
1344 _n_kwredef
= new_child
1350 if _n_visibility
== old_child
then
1351 if new_child
!= null then
1352 new_child
.parent
= self
1353 assert new_child
isa AVisibility
1354 _n_visibility
= new_child
1360 if _n_kwmeth
== old_child
then
1361 if new_child
!= null then
1362 new_child
.parent
= self
1363 assert new_child
isa TKwmeth
1364 _n_kwmeth
= new_child
1370 if _n_methid
== old_child
then
1371 if new_child
!= null then
1372 new_child
.parent
= self
1373 assert new_child
isa AMethid
1374 _n_methid
= new_child
1380 if _n_signature
== old_child
then
1381 if new_child
!= null then
1382 new_child
.parent
= self
1383 assert new_child
isa ASignature
1384 _n_signature
= new_child
1392 redef fun visit_all
(v
: Visitor)
1394 if _n_doc
!= null then
1395 v
.enter_visit
(_n_doc
.as(not null))
1397 if _n_kwredef
!= null then
1398 v
.enter_visit
(_n_kwredef
.as(not null))
1400 v
.enter_visit
(_n_visibility
)
1401 v
.enter_visit
(_n_kwmeth
)
1402 v
.enter_visit
(_n_methid
)
1403 v
.enter_visit
(_n_signature
)
1406 redef class AInternMethPropdef
1407 private init empty_init
do end
1409 init init_ainternmethpropdef
(
1410 n_doc
: nullable ADoc,
1411 n_kwredef
: nullable TKwredef,
1412 n_visibility
: nullable AVisibility,
1413 n_kwmeth
: nullable TKwmeth,
1414 n_methid
: nullable AMethid,
1415 n_signature
: nullable ASignature
1420 if n_doc
!= null then
1423 _n_kwredef
= n_kwredef
1424 if n_kwredef
!= null then
1425 n_kwredef
.parent
= self
1427 _n_visibility
= n_visibility
.as(not null)
1428 n_visibility
.parent
= self
1429 _n_kwmeth
= n_kwmeth
.as(not null)
1430 n_kwmeth
.parent
= self
1431 _n_methid
= n_methid
.as(not null)
1432 n_methid
.parent
= self
1433 _n_signature
= n_signature
.as(not null)
1434 n_signature
.parent
= self
1437 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1439 if _n_doc
== old_child
then
1440 if new_child
!= null then
1441 new_child
.parent
= self
1442 assert new_child
isa ADoc
1449 if _n_kwredef
== old_child
then
1450 if new_child
!= null then
1451 new_child
.parent
= self
1452 assert new_child
isa TKwredef
1453 _n_kwredef
= new_child
1459 if _n_visibility
== old_child
then
1460 if new_child
!= null then
1461 new_child
.parent
= self
1462 assert new_child
isa AVisibility
1463 _n_visibility
= new_child
1469 if _n_kwmeth
== old_child
then
1470 if new_child
!= null then
1471 new_child
.parent
= self
1472 assert new_child
isa TKwmeth
1473 _n_kwmeth
= new_child
1479 if _n_methid
== old_child
then
1480 if new_child
!= null then
1481 new_child
.parent
= self
1482 assert new_child
isa AMethid
1483 _n_methid
= new_child
1489 if _n_signature
== old_child
then
1490 if new_child
!= null then
1491 new_child
.parent
= self
1492 assert new_child
isa ASignature
1493 _n_signature
= new_child
1501 redef fun visit_all
(v
: Visitor)
1503 if _n_doc
!= null then
1504 v
.enter_visit
(_n_doc
.as(not null))
1506 if _n_kwredef
!= null then
1507 v
.enter_visit
(_n_kwredef
.as(not null))
1509 v
.enter_visit
(_n_visibility
)
1510 v
.enter_visit
(_n_kwmeth
)
1511 v
.enter_visit
(_n_methid
)
1512 v
.enter_visit
(_n_signature
)
1515 redef class AExternMethPropdef
1516 private init empty_init
do end
1518 init init_aexternmethpropdef
(
1519 n_doc
: nullable ADoc,
1520 n_kwredef
: nullable TKwredef,
1521 n_visibility
: nullable AVisibility,
1522 n_kwmeth
: nullable TKwmeth,
1523 n_methid
: nullable AMethid,
1524 n_signature
: nullable ASignature,
1525 n_extern
: nullable TString,
1526 n_extern_calls
: nullable AExternCalls,
1527 n_extern_code_block
: nullable AExternCodeBlock
1532 if n_doc
!= null then
1535 _n_kwredef
= n_kwredef
1536 if n_kwredef
!= null then
1537 n_kwredef
.parent
= self
1539 _n_visibility
= n_visibility
.as(not null)
1540 n_visibility
.parent
= self
1541 _n_kwmeth
= n_kwmeth
.as(not null)
1542 n_kwmeth
.parent
= self
1543 _n_methid
= n_methid
.as(not null)
1544 n_methid
.parent
= self
1545 _n_signature
= n_signature
.as(not null)
1546 n_signature
.parent
= self
1547 _n_extern
= n_extern
1548 if n_extern
!= null then
1549 n_extern
.parent
= self
1551 _n_extern_calls
= n_extern_calls
1552 if n_extern_calls
!= null then
1553 n_extern_calls
.parent
= self
1555 _n_extern_code_block
= n_extern_code_block
1556 if n_extern_code_block
!= null then
1557 n_extern_code_block
.parent
= self
1561 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1563 if _n_doc
== old_child
then
1564 if new_child
!= null then
1565 new_child
.parent
= self
1566 assert new_child
isa ADoc
1573 if _n_kwredef
== old_child
then
1574 if new_child
!= null then
1575 new_child
.parent
= self
1576 assert new_child
isa TKwredef
1577 _n_kwredef
= new_child
1583 if _n_visibility
== old_child
then
1584 if new_child
!= null then
1585 new_child
.parent
= self
1586 assert new_child
isa AVisibility
1587 _n_visibility
= new_child
1593 if _n_kwmeth
== old_child
then
1594 if new_child
!= null then
1595 new_child
.parent
= self
1596 assert new_child
isa TKwmeth
1597 _n_kwmeth
= new_child
1603 if _n_methid
== old_child
then
1604 if new_child
!= null then
1605 new_child
.parent
= self
1606 assert new_child
isa AMethid
1607 _n_methid
= new_child
1613 if _n_signature
== old_child
then
1614 if new_child
!= null then
1615 new_child
.parent
= self
1616 assert new_child
isa ASignature
1617 _n_signature
= new_child
1623 if _n_extern
== old_child
then
1624 if new_child
!= null then
1625 new_child
.parent
= self
1626 assert new_child
isa TString
1627 _n_extern
= new_child
1633 if _n_extern_calls
== old_child
then
1634 if new_child
!= null then
1635 new_child
.parent
= self
1636 assert new_child
isa AExternCalls
1637 _n_extern_calls
= new_child
1639 _n_extern_calls
= null
1643 if _n_extern_code_block
== old_child
then
1644 if new_child
!= null then
1645 new_child
.parent
= self
1646 assert new_child
isa AExternCodeBlock
1647 _n_extern_code_block
= new_child
1649 _n_extern_code_block
= null
1655 redef fun visit_all
(v
: Visitor)
1657 if _n_doc
!= null then
1658 v
.enter_visit
(_n_doc
.as(not null))
1660 if _n_kwredef
!= null then
1661 v
.enter_visit
(_n_kwredef
.as(not null))
1663 v
.enter_visit
(_n_visibility
)
1664 v
.enter_visit
(_n_kwmeth
)
1665 v
.enter_visit
(_n_methid
)
1666 v
.enter_visit
(_n_signature
)
1667 if _n_extern
!= null then
1668 v
.enter_visit
(_n_extern
.as(not null))
1670 if _n_extern_calls
!= null then
1671 v
.enter_visit
(_n_extern_calls
.as(not null))
1673 if _n_extern_code_block
!= null then
1674 v
.enter_visit
(_n_extern_code_block
.as(not null))
1678 redef class AConcreteMethPropdef
1679 private init empty_init
do end
1681 init init_aconcretemethpropdef
(
1682 n_doc
: nullable ADoc,
1683 n_kwredef
: nullable TKwredef,
1684 n_visibility
: nullable AVisibility,
1685 n_kwmeth
: nullable TKwmeth,
1686 n_methid
: nullable AMethid,
1687 n_signature
: nullable ASignature,
1688 n_block
: nullable AExpr
1693 if n_doc
!= null then
1696 _n_kwredef
= n_kwredef
1697 if n_kwredef
!= null then
1698 n_kwredef
.parent
= self
1700 _n_visibility
= n_visibility
.as(not null)
1701 n_visibility
.parent
= self
1702 _n_kwmeth
= n_kwmeth
.as(not null)
1703 n_kwmeth
.parent
= self
1704 _n_methid
= n_methid
.as(not null)
1705 n_methid
.parent
= self
1706 _n_signature
= n_signature
.as(not null)
1707 n_signature
.parent
= self
1709 if n_block
!= null then
1710 n_block
.parent
= self
1714 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1716 if _n_doc
== old_child
then
1717 if new_child
!= null then
1718 new_child
.parent
= self
1719 assert new_child
isa ADoc
1726 if _n_kwredef
== old_child
then
1727 if new_child
!= null then
1728 new_child
.parent
= self
1729 assert new_child
isa TKwredef
1730 _n_kwredef
= new_child
1736 if _n_visibility
== old_child
then
1737 if new_child
!= null then
1738 new_child
.parent
= self
1739 assert new_child
isa AVisibility
1740 _n_visibility
= new_child
1746 if _n_kwmeth
== old_child
then
1747 if new_child
!= null then
1748 new_child
.parent
= self
1749 assert new_child
isa TKwmeth
1750 _n_kwmeth
= new_child
1756 if _n_methid
== old_child
then
1757 if new_child
!= null then
1758 new_child
.parent
= self
1759 assert new_child
isa AMethid
1760 _n_methid
= new_child
1766 if _n_signature
== old_child
then
1767 if new_child
!= null then
1768 new_child
.parent
= self
1769 assert new_child
isa ASignature
1770 _n_signature
= new_child
1776 if _n_block
== old_child
then
1777 if new_child
!= null then
1778 new_child
.parent
= self
1779 assert new_child
isa AExpr
1780 _n_block
= new_child
1788 redef fun visit_all
(v
: Visitor)
1790 if _n_doc
!= null then
1791 v
.enter_visit
(_n_doc
.as(not null))
1793 if _n_kwredef
!= null then
1794 v
.enter_visit
(_n_kwredef
.as(not null))
1796 v
.enter_visit
(_n_visibility
)
1797 v
.enter_visit
(_n_kwmeth
)
1798 v
.enter_visit
(_n_methid
)
1799 v
.enter_visit
(_n_signature
)
1800 if _n_block
!= null then
1801 v
.enter_visit
(_n_block
.as(not null))
1805 redef class AConcreteInitPropdef
1806 private init empty_init
do end
1808 init init_aconcreteinitpropdef
(
1809 n_doc
: nullable ADoc,
1810 n_kwredef
: nullable TKwredef,
1811 n_visibility
: nullable AVisibility,
1812 n_kwinit
: nullable TKwinit,
1813 n_methid
: nullable AMethid,
1814 n_signature
: nullable ASignature,
1815 n_block
: nullable AExpr
1820 if n_doc
!= null then
1823 _n_kwredef
= n_kwredef
1824 if n_kwredef
!= null then
1825 n_kwredef
.parent
= self
1827 _n_visibility
= n_visibility
.as(not null)
1828 n_visibility
.parent
= self
1829 _n_kwinit
= n_kwinit
.as(not null)
1830 n_kwinit
.parent
= self
1831 _n_methid
= n_methid
1832 if n_methid
!= null then
1833 n_methid
.parent
= self
1835 _n_signature
= n_signature
.as(not null)
1836 n_signature
.parent
= self
1838 if n_block
!= null then
1839 n_block
.parent
= self
1843 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1845 if _n_doc
== old_child
then
1846 if new_child
!= null then
1847 new_child
.parent
= self
1848 assert new_child
isa ADoc
1855 if _n_kwredef
== old_child
then
1856 if new_child
!= null then
1857 new_child
.parent
= self
1858 assert new_child
isa TKwredef
1859 _n_kwredef
= new_child
1865 if _n_visibility
== old_child
then
1866 if new_child
!= null then
1867 new_child
.parent
= self
1868 assert new_child
isa AVisibility
1869 _n_visibility
= new_child
1875 if _n_kwinit
== old_child
then
1876 if new_child
!= null then
1877 new_child
.parent
= self
1878 assert new_child
isa TKwinit
1879 _n_kwinit
= new_child
1885 if _n_methid
== old_child
then
1886 if new_child
!= null then
1887 new_child
.parent
= self
1888 assert new_child
isa AMethid
1889 _n_methid
= new_child
1895 if _n_signature
== old_child
then
1896 if new_child
!= null then
1897 new_child
.parent
= self
1898 assert new_child
isa ASignature
1899 _n_signature
= new_child
1905 if _n_block
== old_child
then
1906 if new_child
!= null then
1907 new_child
.parent
= self
1908 assert new_child
isa AExpr
1909 _n_block
= new_child
1917 redef fun visit_all
(v
: Visitor)
1919 if _n_doc
!= null then
1920 v
.enter_visit
(_n_doc
.as(not null))
1922 if _n_kwredef
!= null then
1923 v
.enter_visit
(_n_kwredef
.as(not null))
1925 v
.enter_visit
(_n_visibility
)
1926 v
.enter_visit
(_n_kwinit
)
1927 if _n_methid
!= null then
1928 v
.enter_visit
(_n_methid
.as(not null))
1930 v
.enter_visit
(_n_signature
)
1931 if _n_block
!= null then
1932 v
.enter_visit
(_n_block
.as(not null))
1936 redef class AExternInitPropdef
1937 private init empty_init
do end
1939 init init_aexterninitpropdef
(
1940 n_doc
: nullable ADoc,
1941 n_kwredef
: nullable TKwredef,
1942 n_visibility
: nullable AVisibility,
1943 n_kwnew
: nullable TKwnew,
1944 n_methid
: nullable AMethid,
1945 n_signature
: nullable ASignature,
1946 n_extern
: nullable TString,
1947 n_extern_calls
: nullable AExternCalls,
1948 n_extern_code_block
: nullable AExternCodeBlock
1953 if n_doc
!= null then
1956 _n_kwredef
= n_kwredef
1957 if n_kwredef
!= null then
1958 n_kwredef
.parent
= self
1960 _n_visibility
= n_visibility
.as(not null)
1961 n_visibility
.parent
= self
1962 _n_kwnew
= n_kwnew
.as(not null)
1963 n_kwnew
.parent
= self
1964 _n_methid
= n_methid
1965 if n_methid
!= null then
1966 n_methid
.parent
= self
1968 _n_signature
= n_signature
.as(not null)
1969 n_signature
.parent
= self
1970 _n_extern
= n_extern
1971 if n_extern
!= null then
1972 n_extern
.parent
= self
1974 _n_extern_calls
= n_extern_calls
1975 if n_extern_calls
!= null then
1976 n_extern_calls
.parent
= self
1978 _n_extern_code_block
= n_extern_code_block
1979 if n_extern_code_block
!= null then
1980 n_extern_code_block
.parent
= self
1984 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1986 if _n_doc
== old_child
then
1987 if new_child
!= null then
1988 new_child
.parent
= self
1989 assert new_child
isa ADoc
1996 if _n_kwredef
== old_child
then
1997 if new_child
!= null then
1998 new_child
.parent
= self
1999 assert new_child
isa TKwredef
2000 _n_kwredef
= new_child
2006 if _n_visibility
== old_child
then
2007 if new_child
!= null then
2008 new_child
.parent
= self
2009 assert new_child
isa AVisibility
2010 _n_visibility
= new_child
2016 if _n_kwnew
== old_child
then
2017 if new_child
!= null then
2018 new_child
.parent
= self
2019 assert new_child
isa TKwnew
2020 _n_kwnew
= new_child
2026 if _n_methid
== old_child
then
2027 if new_child
!= null then
2028 new_child
.parent
= self
2029 assert new_child
isa AMethid
2030 _n_methid
= new_child
2036 if _n_signature
== old_child
then
2037 if new_child
!= null then
2038 new_child
.parent
= self
2039 assert new_child
isa ASignature
2040 _n_signature
= new_child
2046 if _n_extern
== old_child
then
2047 if new_child
!= null then
2048 new_child
.parent
= self
2049 assert new_child
isa TString
2050 _n_extern
= new_child
2056 if _n_extern_calls
== old_child
then
2057 if new_child
!= null then
2058 new_child
.parent
= self
2059 assert new_child
isa AExternCalls
2060 _n_extern_calls
= new_child
2062 _n_extern_calls
= null
2066 if _n_extern_code_block
== old_child
then
2067 if new_child
!= null then
2068 new_child
.parent
= self
2069 assert new_child
isa AExternCodeBlock
2070 _n_extern_code_block
= new_child
2072 _n_extern_code_block
= null
2078 redef fun visit_all
(v
: Visitor)
2080 if _n_doc
!= null then
2081 v
.enter_visit
(_n_doc
.as(not null))
2083 if _n_kwredef
!= null then
2084 v
.enter_visit
(_n_kwredef
.as(not null))
2086 v
.enter_visit
(_n_visibility
)
2087 v
.enter_visit
(_n_kwnew
)
2088 if _n_methid
!= null then
2089 v
.enter_visit
(_n_methid
.as(not null))
2091 v
.enter_visit
(_n_signature
)
2092 if _n_extern
!= null then
2093 v
.enter_visit
(_n_extern
.as(not null))
2095 if _n_extern_calls
!= null then
2096 v
.enter_visit
(_n_extern_calls
.as(not null))
2098 if _n_extern_code_block
!= null then
2099 v
.enter_visit
(_n_extern_code_block
.as(not null))
2103 redef class AMainMethPropdef
2104 private init empty_init
do end
2106 init init_amainmethpropdef
(
2107 n_kwredef
: nullable TKwredef,
2108 n_block
: nullable AExpr
2112 _n_kwredef
= n_kwredef
2113 if n_kwredef
!= null then
2114 n_kwredef
.parent
= self
2117 if n_block
!= null then
2118 n_block
.parent
= self
2122 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2124 if _n_kwredef
== old_child
then
2125 if new_child
!= null then
2126 new_child
.parent
= self
2127 assert new_child
isa TKwredef
2128 _n_kwredef
= new_child
2134 if _n_block
== old_child
then
2135 if new_child
!= null then
2136 new_child
.parent
= self
2137 assert new_child
isa AExpr
2138 _n_block
= new_child
2146 redef fun visit_all
(v
: Visitor)
2148 if _n_kwredef
!= null then
2149 v
.enter_visit
(_n_kwredef
.as(not null))
2151 if _n_block
!= null then
2152 v
.enter_visit
(_n_block
.as(not null))
2156 redef class ATypePropdef
2157 private init empty_init
do end
2159 init init_atypepropdef
(
2160 n_doc
: nullable ADoc,
2161 n_kwredef
: nullable TKwredef,
2162 n_visibility
: nullable AVisibility,
2163 n_kwtype
: nullable TKwtype,
2164 n_id
: nullable TClassid,
2165 n_type
: nullable AType
2170 if n_doc
!= null then
2173 _n_kwredef
= n_kwredef
2174 if n_kwredef
!= null then
2175 n_kwredef
.parent
= self
2177 _n_visibility
= n_visibility
.as(not null)
2178 n_visibility
.parent
= self
2179 _n_kwtype
= n_kwtype
.as(not null)
2180 n_kwtype
.parent
= self
2181 _n_id
= n_id
.as(not null)
2183 _n_type
= n_type
.as(not null)
2184 n_type
.parent
= self
2187 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2189 if _n_doc
== old_child
then
2190 if new_child
!= null then
2191 new_child
.parent
= self
2192 assert new_child
isa ADoc
2199 if _n_kwredef
== old_child
then
2200 if new_child
!= null then
2201 new_child
.parent
= self
2202 assert new_child
isa TKwredef
2203 _n_kwredef
= new_child
2209 if _n_visibility
== old_child
then
2210 if new_child
!= null then
2211 new_child
.parent
= self
2212 assert new_child
isa AVisibility
2213 _n_visibility
= new_child
2219 if _n_kwtype
== old_child
then
2220 if new_child
!= null then
2221 new_child
.parent
= self
2222 assert new_child
isa TKwtype
2223 _n_kwtype
= new_child
2229 if _n_id
== old_child
then
2230 if new_child
!= null then
2231 new_child
.parent
= self
2232 assert new_child
isa TClassid
2239 if _n_type
== old_child
then
2240 if new_child
!= null then
2241 new_child
.parent
= self
2242 assert new_child
isa AType
2251 redef fun visit_all
(v
: Visitor)
2253 if _n_doc
!= null then
2254 v
.enter_visit
(_n_doc
.as(not null))
2256 if _n_kwredef
!= null then
2257 v
.enter_visit
(_n_kwredef
.as(not null))
2259 v
.enter_visit
(_n_visibility
)
2260 v
.enter_visit
(_n_kwtype
)
2261 v
.enter_visit
(_n_id
)
2262 v
.enter_visit
(_n_type
)
2265 redef class AReadAble
2266 private init empty_init
do end
2268 init init_areadable
(
2269 n_kwredef
: nullable TKwredef,
2270 n_kwreadable
: nullable TKwreadable
2274 _n_kwredef
= n_kwredef
2275 if n_kwredef
!= null then
2276 n_kwredef
.parent
= self
2278 _n_kwreadable
= n_kwreadable
.as(not null)
2279 n_kwreadable
.parent
= self
2282 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2284 if _n_kwredef
== old_child
then
2285 if new_child
!= null then
2286 new_child
.parent
= self
2287 assert new_child
isa TKwredef
2288 _n_kwredef
= new_child
2294 if _n_kwreadable
== old_child
then
2295 if new_child
!= null then
2296 new_child
.parent
= self
2297 assert new_child
isa TKwreadable
2298 _n_kwreadable
= new_child
2306 redef fun visit_all
(v
: Visitor)
2308 if _n_kwredef
!= null then
2309 v
.enter_visit
(_n_kwredef
.as(not null))
2311 v
.enter_visit
(_n_kwreadable
)
2314 redef class AWriteAble
2315 private init empty_init
do end
2317 init init_awriteable
(
2318 n_kwredef
: nullable TKwredef,
2319 n_visibility
: nullable AVisibility,
2320 n_kwwritable
: nullable TKwwritable
2324 _n_kwredef
= n_kwredef
2325 if n_kwredef
!= null then
2326 n_kwredef
.parent
= self
2328 _n_visibility
= n_visibility
2329 if n_visibility
!= null then
2330 n_visibility
.parent
= self
2332 _n_kwwritable
= n_kwwritable
.as(not null)
2333 n_kwwritable
.parent
= self
2336 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2338 if _n_kwredef
== old_child
then
2339 if new_child
!= null then
2340 new_child
.parent
= self
2341 assert new_child
isa TKwredef
2342 _n_kwredef
= new_child
2348 if _n_visibility
== old_child
then
2349 if new_child
!= null then
2350 new_child
.parent
= self
2351 assert new_child
isa AVisibility
2352 _n_visibility
= new_child
2354 _n_visibility
= null
2358 if _n_kwwritable
== old_child
then
2359 if new_child
!= null then
2360 new_child
.parent
= self
2361 assert new_child
isa TKwwritable
2362 _n_kwwritable
= new_child
2370 redef fun visit_all
(v
: Visitor)
2372 if _n_kwredef
!= null then
2373 v
.enter_visit
(_n_kwredef
.as(not null))
2375 if _n_visibility
!= null then
2376 v
.enter_visit
(_n_visibility
.as(not null))
2378 v
.enter_visit
(_n_kwwritable
)
2381 redef class AIdMethid
2382 private init empty_init
do end
2384 init init_aidmethid
(
2389 _n_id
= n_id
.as(not null)
2393 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2395 if _n_id
== old_child
then
2396 if new_child
!= null then
2397 new_child
.parent
= self
2398 assert new_child
isa TId
2407 redef fun visit_all
(v
: Visitor)
2409 v
.enter_visit
(_n_id
)
2412 redef class APlusMethid
2413 private init empty_init
do end
2415 init init_aplusmethid
(
2416 n_plus
: nullable TPlus
2420 _n_plus
= n_plus
.as(not null)
2421 n_plus
.parent
= self
2424 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2426 if _n_plus
== old_child
then
2427 if new_child
!= null then
2428 new_child
.parent
= self
2429 assert new_child
isa TPlus
2438 redef fun visit_all
(v
: Visitor)
2440 v
.enter_visit
(_n_plus
)
2443 redef class AMinusMethid
2444 private init empty_init
do end
2446 init init_aminusmethid
(
2447 n_minus
: nullable TMinus
2451 _n_minus
= n_minus
.as(not null)
2452 n_minus
.parent
= self
2455 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2457 if _n_minus
== old_child
then
2458 if new_child
!= null then
2459 new_child
.parent
= self
2460 assert new_child
isa TMinus
2461 _n_minus
= new_child
2469 redef fun visit_all
(v
: Visitor)
2471 v
.enter_visit
(_n_minus
)
2474 redef class AStarMethid
2475 private init empty_init
do end
2477 init init_astarmethid
(
2478 n_star
: nullable TStar
2482 _n_star
= n_star
.as(not null)
2483 n_star
.parent
= self
2486 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2488 if _n_star
== old_child
then
2489 if new_child
!= null then
2490 new_child
.parent
= self
2491 assert new_child
isa TStar
2500 redef fun visit_all
(v
: Visitor)
2502 v
.enter_visit
(_n_star
)
2505 redef class ASlashMethid
2506 private init empty_init
do end
2508 init init_aslashmethid
(
2509 n_slash
: nullable TSlash
2513 _n_slash
= n_slash
.as(not null)
2514 n_slash
.parent
= self
2517 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2519 if _n_slash
== old_child
then
2520 if new_child
!= null then
2521 new_child
.parent
= self
2522 assert new_child
isa TSlash
2523 _n_slash
= new_child
2531 redef fun visit_all
(v
: Visitor)
2533 v
.enter_visit
(_n_slash
)
2536 redef class APercentMethid
2537 private init empty_init
do end
2539 init init_apercentmethid
(
2540 n_percent
: nullable TPercent
2544 _n_percent
= n_percent
.as(not null)
2545 n_percent
.parent
= self
2548 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2550 if _n_percent
== old_child
then
2551 if new_child
!= null then
2552 new_child
.parent
= self
2553 assert new_child
isa TPercent
2554 _n_percent
= new_child
2562 redef fun visit_all
(v
: Visitor)
2564 v
.enter_visit
(_n_percent
)
2567 redef class AEqMethid
2568 private init empty_init
do end
2570 init init_aeqmethid
(
2575 _n_eq
= n_eq
.as(not null)
2579 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2581 if _n_eq
== old_child
then
2582 if new_child
!= null then
2583 new_child
.parent
= self
2584 assert new_child
isa TEq
2593 redef fun visit_all
(v
: Visitor)
2595 v
.enter_visit
(_n_eq
)
2598 redef class ANeMethid
2599 private init empty_init
do end
2601 init init_anemethid
(
2606 _n_ne
= n_ne
.as(not null)
2610 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2612 if _n_ne
== old_child
then
2613 if new_child
!= null then
2614 new_child
.parent
= self
2615 assert new_child
isa TNe
2624 redef fun visit_all
(v
: Visitor)
2626 v
.enter_visit
(_n_ne
)
2629 redef class ALeMethid
2630 private init empty_init
do end
2632 init init_alemethid
(
2637 _n_le
= n_le
.as(not null)
2641 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2643 if _n_le
== old_child
then
2644 if new_child
!= null then
2645 new_child
.parent
= self
2646 assert new_child
isa TLe
2655 redef fun visit_all
(v
: Visitor)
2657 v
.enter_visit
(_n_le
)
2660 redef class AGeMethid
2661 private init empty_init
do end
2663 init init_agemethid
(
2668 _n_ge
= n_ge
.as(not null)
2672 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2674 if _n_ge
== old_child
then
2675 if new_child
!= null then
2676 new_child
.parent
= self
2677 assert new_child
isa TGe
2686 redef fun visit_all
(v
: Visitor)
2688 v
.enter_visit
(_n_ge
)
2691 redef class ALtMethid
2692 private init empty_init
do end
2694 init init_altmethid
(
2699 _n_lt
= n_lt
.as(not null)
2703 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2705 if _n_lt
== old_child
then
2706 if new_child
!= null then
2707 new_child
.parent
= self
2708 assert new_child
isa TLt
2717 redef fun visit_all
(v
: Visitor)
2719 v
.enter_visit
(_n_lt
)
2722 redef class AGtMethid
2723 private init empty_init
do end
2725 init init_agtmethid
(
2730 _n_gt
= n_gt
.as(not null)
2734 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2736 if _n_gt
== old_child
then
2737 if new_child
!= null then
2738 new_child
.parent
= self
2739 assert new_child
isa TGt
2748 redef fun visit_all
(v
: Visitor)
2750 v
.enter_visit
(_n_gt
)
2753 redef class ALlMethid
2754 private init empty_init
do end
2756 init init_allmethid
(
2761 _n_ll
= n_ll
.as(not null)
2765 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2767 if _n_ll
== old_child
then
2768 if new_child
!= null then
2769 new_child
.parent
= self
2770 assert new_child
isa TLl
2779 redef fun visit_all
(v
: Visitor)
2781 v
.enter_visit
(_n_ll
)
2784 redef class AGgMethid
2785 private init empty_init
do end
2787 init init_aggmethid
(
2792 _n_gg
= n_gg
.as(not null)
2796 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2798 if _n_gg
== old_child
then
2799 if new_child
!= null then
2800 new_child
.parent
= self
2801 assert new_child
isa TGg
2810 redef fun visit_all
(v
: Visitor)
2812 v
.enter_visit
(_n_gg
)
2815 redef class ABraMethid
2816 private init empty_init
do end
2818 init init_abramethid
(
2819 n_obra
: nullable TObra,
2820 n_cbra
: nullable TCbra
2824 _n_obra
= n_obra
.as(not null)
2825 n_obra
.parent
= self
2826 _n_cbra
= n_cbra
.as(not null)
2827 n_cbra
.parent
= self
2830 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2832 if _n_obra
== old_child
then
2833 if new_child
!= null then
2834 new_child
.parent
= self
2835 assert new_child
isa TObra
2842 if _n_cbra
== old_child
then
2843 if new_child
!= null then
2844 new_child
.parent
= self
2845 assert new_child
isa TCbra
2854 redef fun visit_all
(v
: Visitor)
2856 v
.enter_visit
(_n_obra
)
2857 v
.enter_visit
(_n_cbra
)
2860 redef class AStarshipMethid
2861 private init empty_init
do end
2863 init init_astarshipmethid
(
2864 n_starship
: nullable TStarship
2868 _n_starship
= n_starship
.as(not null)
2869 n_starship
.parent
= self
2872 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2874 if _n_starship
== old_child
then
2875 if new_child
!= null then
2876 new_child
.parent
= self
2877 assert new_child
isa TStarship
2878 _n_starship
= new_child
2886 redef fun visit_all
(v
: Visitor)
2888 v
.enter_visit
(_n_starship
)
2891 redef class AAssignMethid
2892 private init empty_init
do end
2894 init init_aassignmethid
(
2896 n_assign
: nullable TAssign
2900 _n_id
= n_id
.as(not null)
2902 _n_assign
= n_assign
.as(not null)
2903 n_assign
.parent
= self
2906 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2908 if _n_id
== old_child
then
2909 if new_child
!= null then
2910 new_child
.parent
= self
2911 assert new_child
isa TId
2918 if _n_assign
== old_child
then
2919 if new_child
!= null then
2920 new_child
.parent
= self
2921 assert new_child
isa TAssign
2922 _n_assign
= new_child
2930 redef fun visit_all
(v
: Visitor)
2932 v
.enter_visit
(_n_id
)
2933 v
.enter_visit
(_n_assign
)
2936 redef class ABraassignMethid
2937 private init empty_init
do end
2939 init init_abraassignmethid
(
2940 n_obra
: nullable TObra,
2941 n_cbra
: nullable TCbra,
2942 n_assign
: nullable TAssign
2946 _n_obra
= n_obra
.as(not null)
2947 n_obra
.parent
= self
2948 _n_cbra
= n_cbra
.as(not null)
2949 n_cbra
.parent
= self
2950 _n_assign
= n_assign
.as(not null)
2951 n_assign
.parent
= self
2954 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2956 if _n_obra
== old_child
then
2957 if new_child
!= null then
2958 new_child
.parent
= self
2959 assert new_child
isa TObra
2966 if _n_cbra
== old_child
then
2967 if new_child
!= null then
2968 new_child
.parent
= self
2969 assert new_child
isa TCbra
2976 if _n_assign
== old_child
then
2977 if new_child
!= null then
2978 new_child
.parent
= self
2979 assert new_child
isa TAssign
2980 _n_assign
= new_child
2988 redef fun visit_all
(v
: Visitor)
2990 v
.enter_visit
(_n_obra
)
2991 v
.enter_visit
(_n_cbra
)
2992 v
.enter_visit
(_n_assign
)
2995 redef class ASignature
2996 private init empty_init
do end
2998 init init_asignature
(
2999 n_opar
: nullable TOpar,
3000 n_params
: Collection[Object], # Should be Collection[AParam]
3001 n_cpar
: nullable TCpar,
3002 n_type
: nullable AType,
3003 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
3008 if n_opar
!= null then
3009 n_opar
.parent
= self
3011 for n
in n_params
do
3017 if n_cpar
!= null then
3018 n_cpar
.parent
= self
3021 if n_type
!= null then
3022 n_type
.parent
= self
3024 for n
in n_closure_decls
do
3025 assert n
isa AClosureDecl
3026 _n_closure_decls
.add
(n
)
3031 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3033 if _n_opar
== old_child
then
3034 if new_child
!= null then
3035 new_child
.parent
= self
3036 assert new_child
isa TOpar
3043 for i
in [0.._n_params
.length
[ do
3044 if _n_params
[i
] == old_child
then
3045 if new_child
!= null then
3046 assert new_child
isa AParam
3047 _n_params
[i
] = new_child
3048 new_child
.parent
= self
3050 _n_params
.remove_at
(i
)
3055 if _n_cpar
== old_child
then
3056 if new_child
!= null then
3057 new_child
.parent
= self
3058 assert new_child
isa TCpar
3065 if _n_type
== old_child
then
3066 if new_child
!= null then
3067 new_child
.parent
= self
3068 assert new_child
isa AType
3075 for i
in [0.._n_closure_decls
.length
[ do
3076 if _n_closure_decls
[i
] == old_child
then
3077 if new_child
!= null then
3078 assert new_child
isa AClosureDecl
3079 _n_closure_decls
[i
] = new_child
3080 new_child
.parent
= self
3082 _n_closure_decls
.remove_at
(i
)
3089 redef fun visit_all
(v
: Visitor)
3091 if _n_opar
!= null then
3092 v
.enter_visit
(_n_opar
.as(not null))
3094 for n
in _n_params
do
3097 if _n_cpar
!= null then
3098 v
.enter_visit
(_n_cpar
.as(not null))
3100 if _n_type
!= null then
3101 v
.enter_visit
(_n_type
.as(not null))
3103 for n
in _n_closure_decls
do
3109 private init empty_init
do end
3113 n_type
: nullable AType,
3114 n_dotdotdot
: nullable TDotdotdot
3118 _n_id
= n_id
.as(not null)
3121 if n_type
!= null then
3122 n_type
.parent
= self
3124 _n_dotdotdot
= n_dotdotdot
3125 if n_dotdotdot
!= null then
3126 n_dotdotdot
.parent
= self
3130 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3132 if _n_id
== old_child
then
3133 if new_child
!= null then
3134 new_child
.parent
= self
3135 assert new_child
isa TId
3142 if _n_type
== old_child
then
3143 if new_child
!= null then
3144 new_child
.parent
= self
3145 assert new_child
isa AType
3152 if _n_dotdotdot
== old_child
then
3153 if new_child
!= null then
3154 new_child
.parent
= self
3155 assert new_child
isa TDotdotdot
3156 _n_dotdotdot
= new_child
3164 redef fun visit_all
(v
: Visitor)
3166 v
.enter_visit
(_n_id
)
3167 if _n_type
!= null then
3168 v
.enter_visit
(_n_type
.as(not null))
3170 if _n_dotdotdot
!= null then
3171 v
.enter_visit
(_n_dotdotdot
.as(not null))
3175 redef class AClosureDecl
3176 private init empty_init
do end
3178 init init_aclosuredecl
(
3179 n_kwbreak
: nullable TKwbreak,
3180 n_bang
: nullable TBang,
3182 n_signature
: nullable ASignature,
3183 n_expr
: nullable AExpr
3187 _n_kwbreak
= n_kwbreak
3188 if n_kwbreak
!= null then
3189 n_kwbreak
.parent
= self
3191 _n_bang
= n_bang
.as(not null)
3192 n_bang
.parent
= self
3193 _n_id
= n_id
.as(not null)
3195 _n_signature
= n_signature
.as(not null)
3196 n_signature
.parent
= self
3198 if n_expr
!= null then
3199 n_expr
.parent
= self
3203 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3205 if _n_kwbreak
== old_child
then
3206 if new_child
!= null then
3207 new_child
.parent
= self
3208 assert new_child
isa TKwbreak
3209 _n_kwbreak
= new_child
3215 if _n_bang
== old_child
then
3216 if new_child
!= null then
3217 new_child
.parent
= self
3218 assert new_child
isa TBang
3225 if _n_id
== old_child
then
3226 if new_child
!= null then
3227 new_child
.parent
= self
3228 assert new_child
isa TId
3235 if _n_signature
== old_child
then
3236 if new_child
!= null then
3237 new_child
.parent
= self
3238 assert new_child
isa ASignature
3239 _n_signature
= new_child
3245 if _n_expr
== old_child
then
3246 if new_child
!= null then
3247 new_child
.parent
= self
3248 assert new_child
isa AExpr
3257 redef fun visit_all
(v
: Visitor)
3259 if _n_kwbreak
!= null then
3260 v
.enter_visit
(_n_kwbreak
.as(not null))
3262 v
.enter_visit
(_n_bang
)
3263 v
.enter_visit
(_n_id
)
3264 v
.enter_visit
(_n_signature
)
3265 if _n_expr
!= null then
3266 v
.enter_visit
(_n_expr
.as(not null))
3271 private init empty_init
do end
3274 n_kwnullable
: nullable TKwnullable,
3275 n_id
: nullable TClassid,
3276 n_types
: Collection[Object] # Should be Collection[AType]
3280 _n_kwnullable
= n_kwnullable
3281 if n_kwnullable
!= null then
3282 n_kwnullable
.parent
= self
3284 _n_id
= n_id
.as(not null)
3293 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3295 if _n_kwnullable
== old_child
then
3296 if new_child
!= null then
3297 new_child
.parent
= self
3298 assert new_child
isa TKwnullable
3299 _n_kwnullable
= new_child
3301 _n_kwnullable
= null
3305 if _n_id
== old_child
then
3306 if new_child
!= null then
3307 new_child
.parent
= self
3308 assert new_child
isa TClassid
3315 for i
in [0.._n_types
.length
[ do
3316 if _n_types
[i
] == old_child
then
3317 if new_child
!= null then
3318 assert new_child
isa AType
3319 _n_types
[i
] = new_child
3320 new_child
.parent
= self
3322 _n_types
.remove_at
(i
)
3329 redef fun visit_all
(v
: Visitor)
3331 if _n_kwnullable
!= null then
3332 v
.enter_visit
(_n_kwnullable
.as(not null))
3334 v
.enter_visit
(_n_id
)
3335 for n
in _n_types
do
3341 private init empty_init
do end
3344 n_kwlabel
: nullable TKwlabel,
3349 _n_kwlabel
= n_kwlabel
.as(not null)
3350 n_kwlabel
.parent
= self
3351 _n_id
= n_id
.as(not null)
3355 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3357 if _n_kwlabel
== old_child
then
3358 if new_child
!= null then
3359 new_child
.parent
= self
3360 assert new_child
isa TKwlabel
3361 _n_kwlabel
= new_child
3367 if _n_id
== old_child
then
3368 if new_child
!= null then
3369 new_child
.parent
= self
3370 assert new_child
isa TId
3379 redef fun visit_all
(v
: Visitor)
3381 v
.enter_visit
(_n_kwlabel
)
3382 v
.enter_visit
(_n_id
)
3385 redef class ABlockExpr
3386 private init empty_init
do end
3388 init init_ablockexpr
(
3389 n_expr
: Collection[Object], # Should be Collection[AExpr]
3390 n_kwend
: nullable TKwend
3400 if n_kwend
!= null then
3401 n_kwend
.parent
= self
3405 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3407 for i
in [0.._n_expr
.length
[ do
3408 if _n_expr
[i
] == old_child
then
3409 if new_child
!= null then
3410 assert new_child
isa AExpr
3411 _n_expr
[i
] = new_child
3412 new_child
.parent
= self
3414 _n_expr
.remove_at
(i
)
3419 if _n_kwend
== old_child
then
3420 if new_child
!= null then
3421 new_child
.parent
= self
3422 assert new_child
isa TKwend
3423 _n_kwend
= new_child
3431 redef fun visit_all
(v
: Visitor)
3436 if _n_kwend
!= null then
3437 v
.enter_visit
(_n_kwend
.as(not null))
3441 redef class AVardeclExpr
3442 private init empty_init
do end
3444 init init_avardeclexpr
(
3445 n_kwvar
: nullable TKwvar,
3447 n_type
: nullable AType,
3448 n_assign
: nullable TAssign,
3449 n_expr
: nullable AExpr
3453 _n_kwvar
= n_kwvar
.as(not null)
3454 n_kwvar
.parent
= self
3455 _n_id
= n_id
.as(not null)
3458 if n_type
!= null then
3459 n_type
.parent
= self
3461 _n_assign
= n_assign
3462 if n_assign
!= null then
3463 n_assign
.parent
= self
3466 if n_expr
!= null then
3467 n_expr
.parent
= self
3471 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3473 if _n_kwvar
== old_child
then
3474 if new_child
!= null then
3475 new_child
.parent
= self
3476 assert new_child
isa TKwvar
3477 _n_kwvar
= new_child
3483 if _n_id
== old_child
then
3484 if new_child
!= null then
3485 new_child
.parent
= self
3486 assert new_child
isa TId
3493 if _n_type
== old_child
then
3494 if new_child
!= null then
3495 new_child
.parent
= self
3496 assert new_child
isa AType
3503 if _n_assign
== old_child
then
3504 if new_child
!= null then
3505 new_child
.parent
= self
3506 assert new_child
isa TAssign
3507 _n_assign
= new_child
3513 if _n_expr
== old_child
then
3514 if new_child
!= null then
3515 new_child
.parent
= self
3516 assert new_child
isa AExpr
3525 redef fun visit_all
(v
: Visitor)
3527 v
.enter_visit
(_n_kwvar
)
3528 v
.enter_visit
(_n_id
)
3529 if _n_type
!= null then
3530 v
.enter_visit
(_n_type
.as(not null))
3532 if _n_assign
!= null then
3533 v
.enter_visit
(_n_assign
.as(not null))
3535 if _n_expr
!= null then
3536 v
.enter_visit
(_n_expr
.as(not null))
3540 redef class AReturnExpr
3541 private init empty_init
do end
3543 init init_areturnexpr
(
3544 n_kwreturn
: nullable TKwreturn,
3545 n_expr
: nullable AExpr
3549 _n_kwreturn
= n_kwreturn
3550 if n_kwreturn
!= null then
3551 n_kwreturn
.parent
= self
3554 if n_expr
!= null then
3555 n_expr
.parent
= self
3559 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3561 if _n_kwreturn
== old_child
then
3562 if new_child
!= null then
3563 new_child
.parent
= self
3564 assert new_child
isa TKwreturn
3565 _n_kwreturn
= new_child
3571 if _n_expr
== old_child
then
3572 if new_child
!= null then
3573 new_child
.parent
= self
3574 assert new_child
isa AExpr
3583 redef fun visit_all
(v
: Visitor)
3585 if _n_kwreturn
!= null then
3586 v
.enter_visit
(_n_kwreturn
.as(not null))
3588 if _n_expr
!= null then
3589 v
.enter_visit
(_n_expr
.as(not null))
3593 redef class ABreakExpr
3594 private init empty_init
do end
3596 init init_abreakexpr
(
3597 n_kwbreak
: nullable TKwbreak,
3598 n_label
: nullable ALabel,
3599 n_expr
: nullable AExpr
3603 _n_kwbreak
= n_kwbreak
.as(not null)
3604 n_kwbreak
.parent
= self
3606 if n_label
!= null then
3607 n_label
.parent
= self
3610 if n_expr
!= null then
3611 n_expr
.parent
= self
3615 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3617 if _n_kwbreak
== old_child
then
3618 if new_child
!= null then
3619 new_child
.parent
= self
3620 assert new_child
isa TKwbreak
3621 _n_kwbreak
= new_child
3627 if _n_label
== old_child
then
3628 if new_child
!= null then
3629 new_child
.parent
= self
3630 assert new_child
isa ALabel
3631 _n_label
= new_child
3637 if _n_expr
== old_child
then
3638 if new_child
!= null then
3639 new_child
.parent
= self
3640 assert new_child
isa AExpr
3649 redef fun visit_all
(v
: Visitor)
3651 v
.enter_visit
(_n_kwbreak
)
3652 if _n_label
!= null then
3653 v
.enter_visit
(_n_label
.as(not null))
3655 if _n_expr
!= null then
3656 v
.enter_visit
(_n_expr
.as(not null))
3660 redef class AAbortExpr
3661 private init empty_init
do end
3663 init init_aabortexpr
(
3664 n_kwabort
: nullable TKwabort
3668 _n_kwabort
= n_kwabort
.as(not null)
3669 n_kwabort
.parent
= self
3672 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3674 if _n_kwabort
== old_child
then
3675 if new_child
!= null then
3676 new_child
.parent
= self
3677 assert new_child
isa TKwabort
3678 _n_kwabort
= new_child
3686 redef fun visit_all
(v
: Visitor)
3688 v
.enter_visit
(_n_kwabort
)
3691 redef class AContinueExpr
3692 private init empty_init
do end
3694 init init_acontinueexpr
(
3695 n_kwcontinue
: nullable TKwcontinue,
3696 n_label
: nullable ALabel,
3697 n_expr
: nullable AExpr
3701 _n_kwcontinue
= n_kwcontinue
3702 if n_kwcontinue
!= null then
3703 n_kwcontinue
.parent
= self
3706 if n_label
!= null then
3707 n_label
.parent
= self
3710 if n_expr
!= null then
3711 n_expr
.parent
= self
3715 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3717 if _n_kwcontinue
== old_child
then
3718 if new_child
!= null then
3719 new_child
.parent
= self
3720 assert new_child
isa TKwcontinue
3721 _n_kwcontinue
= new_child
3723 _n_kwcontinue
= null
3727 if _n_label
== old_child
then
3728 if new_child
!= null then
3729 new_child
.parent
= self
3730 assert new_child
isa ALabel
3731 _n_label
= new_child
3737 if _n_expr
== old_child
then
3738 if new_child
!= null then
3739 new_child
.parent
= self
3740 assert new_child
isa AExpr
3749 redef fun visit_all
(v
: Visitor)
3751 if _n_kwcontinue
!= null then
3752 v
.enter_visit
(_n_kwcontinue
.as(not null))
3754 if _n_label
!= null then
3755 v
.enter_visit
(_n_label
.as(not null))
3757 if _n_expr
!= null then
3758 v
.enter_visit
(_n_expr
.as(not null))
3763 private init empty_init
do end
3766 n_kwdo
: nullable TKwdo,
3767 n_block
: nullable AExpr,
3768 n_label
: nullable ALabel
3772 _n_kwdo
= n_kwdo
.as(not null)
3773 n_kwdo
.parent
= self
3775 if n_block
!= null then
3776 n_block
.parent
= self
3779 if n_label
!= null then
3780 n_label
.parent
= self
3784 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3786 if _n_kwdo
== old_child
then
3787 if new_child
!= null then
3788 new_child
.parent
= self
3789 assert new_child
isa TKwdo
3796 if _n_block
== old_child
then
3797 if new_child
!= null then
3798 new_child
.parent
= self
3799 assert new_child
isa AExpr
3800 _n_block
= new_child
3806 if _n_label
== old_child
then
3807 if new_child
!= null then
3808 new_child
.parent
= self
3809 assert new_child
isa ALabel
3810 _n_label
= new_child
3818 redef fun visit_all
(v
: Visitor)
3820 v
.enter_visit
(_n_kwdo
)
3821 if _n_block
!= null then
3822 v
.enter_visit
(_n_block
.as(not null))
3824 if _n_label
!= null then
3825 v
.enter_visit
(_n_label
.as(not null))
3830 private init empty_init
do end
3833 n_kwif
: nullable TKwif,
3834 n_expr
: nullable AExpr,
3835 n_then
: nullable AExpr,
3836 n_else
: nullable AExpr
3840 _n_kwif
= n_kwif
.as(not null)
3841 n_kwif
.parent
= self
3842 _n_expr
= n_expr
.as(not null)
3843 n_expr
.parent
= self
3845 if n_then
!= null then
3846 n_then
.parent
= self
3849 if n_else
!= null then
3850 n_else
.parent
= self
3854 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3856 if _n_kwif
== old_child
then
3857 if new_child
!= null then
3858 new_child
.parent
= self
3859 assert new_child
isa TKwif
3866 if _n_expr
== old_child
then
3867 if new_child
!= null then
3868 new_child
.parent
= self
3869 assert new_child
isa AExpr
3876 if _n_then
== old_child
then
3877 if new_child
!= null then
3878 new_child
.parent
= self
3879 assert new_child
isa AExpr
3886 if _n_else
== old_child
then
3887 if new_child
!= null then
3888 new_child
.parent
= self
3889 assert new_child
isa AExpr
3898 redef fun visit_all
(v
: Visitor)
3900 v
.enter_visit
(_n_kwif
)
3901 v
.enter_visit
(_n_expr
)
3902 if _n_then
!= null then
3903 v
.enter_visit
(_n_then
.as(not null))
3905 if _n_else
!= null then
3906 v
.enter_visit
(_n_else
.as(not null))
3910 redef class AIfexprExpr
3911 private init empty_init
do end
3913 init init_aifexprexpr
(
3914 n_kwif
: nullable TKwif,
3915 n_expr
: nullable AExpr,
3916 n_kwthen
: nullable TKwthen,
3917 n_then
: nullable AExpr,
3918 n_kwelse
: nullable TKwelse,
3919 n_else
: nullable AExpr
3923 _n_kwif
= n_kwif
.as(not null)
3924 n_kwif
.parent
= self
3925 _n_expr
= n_expr
.as(not null)
3926 n_expr
.parent
= self
3927 _n_kwthen
= n_kwthen
.as(not null)
3928 n_kwthen
.parent
= self
3929 _n_then
= n_then
.as(not null)
3930 n_then
.parent
= self
3931 _n_kwelse
= n_kwelse
.as(not null)
3932 n_kwelse
.parent
= self
3933 _n_else
= n_else
.as(not null)
3934 n_else
.parent
= self
3937 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3939 if _n_kwif
== old_child
then
3940 if new_child
!= null then
3941 new_child
.parent
= self
3942 assert new_child
isa TKwif
3949 if _n_expr
== old_child
then
3950 if new_child
!= null then
3951 new_child
.parent
= self
3952 assert new_child
isa AExpr
3959 if _n_kwthen
== old_child
then
3960 if new_child
!= null then
3961 new_child
.parent
= self
3962 assert new_child
isa TKwthen
3963 _n_kwthen
= new_child
3969 if _n_then
== old_child
then
3970 if new_child
!= null then
3971 new_child
.parent
= self
3972 assert new_child
isa AExpr
3979 if _n_kwelse
== old_child
then
3980 if new_child
!= null then
3981 new_child
.parent
= self
3982 assert new_child
isa TKwelse
3983 _n_kwelse
= new_child
3989 if _n_else
== old_child
then
3990 if new_child
!= null then
3991 new_child
.parent
= self
3992 assert new_child
isa AExpr
4001 redef fun visit_all
(v
: Visitor)
4003 v
.enter_visit
(_n_kwif
)
4004 v
.enter_visit
(_n_expr
)
4005 v
.enter_visit
(_n_kwthen
)
4006 v
.enter_visit
(_n_then
)
4007 v
.enter_visit
(_n_kwelse
)
4008 v
.enter_visit
(_n_else
)
4011 redef class AWhileExpr
4012 private init empty_init
do end
4014 init init_awhileexpr
(
4015 n_kwwhile
: nullable TKwwhile,
4016 n_expr
: nullable AExpr,
4017 n_kwdo
: nullable TKwdo,
4018 n_block
: nullable AExpr,
4019 n_label
: nullable ALabel
4023 _n_kwwhile
= n_kwwhile
.as(not null)
4024 n_kwwhile
.parent
= self
4025 _n_expr
= n_expr
.as(not null)
4026 n_expr
.parent
= self
4027 _n_kwdo
= n_kwdo
.as(not null)
4028 n_kwdo
.parent
= self
4030 if n_block
!= null then
4031 n_block
.parent
= self
4034 if n_label
!= null then
4035 n_label
.parent
= self
4039 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4041 if _n_kwwhile
== old_child
then
4042 if new_child
!= null then
4043 new_child
.parent
= self
4044 assert new_child
isa TKwwhile
4045 _n_kwwhile
= new_child
4051 if _n_expr
== old_child
then
4052 if new_child
!= null then
4053 new_child
.parent
= self
4054 assert new_child
isa AExpr
4061 if _n_kwdo
== old_child
then
4062 if new_child
!= null then
4063 new_child
.parent
= self
4064 assert new_child
isa TKwdo
4071 if _n_block
== old_child
then
4072 if new_child
!= null then
4073 new_child
.parent
= self
4074 assert new_child
isa AExpr
4075 _n_block
= new_child
4081 if _n_label
== old_child
then
4082 if new_child
!= null then
4083 new_child
.parent
= self
4084 assert new_child
isa ALabel
4085 _n_label
= new_child
4093 redef fun visit_all
(v
: Visitor)
4095 v
.enter_visit
(_n_kwwhile
)
4096 v
.enter_visit
(_n_expr
)
4097 v
.enter_visit
(_n_kwdo
)
4098 if _n_block
!= null then
4099 v
.enter_visit
(_n_block
.as(not null))
4101 if _n_label
!= null then
4102 v
.enter_visit
(_n_label
.as(not null))
4106 redef class ALoopExpr
4107 private init empty_init
do end
4109 init init_aloopexpr
(
4110 n_kwloop
: nullable TKwloop,
4111 n_block
: nullable AExpr,
4112 n_label
: nullable ALabel
4116 _n_kwloop
= n_kwloop
.as(not null)
4117 n_kwloop
.parent
= self
4119 if n_block
!= null then
4120 n_block
.parent
= self
4123 if n_label
!= null then
4124 n_label
.parent
= self
4128 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4130 if _n_kwloop
== old_child
then
4131 if new_child
!= null then
4132 new_child
.parent
= self
4133 assert new_child
isa TKwloop
4134 _n_kwloop
= new_child
4140 if _n_block
== old_child
then
4141 if new_child
!= null then
4142 new_child
.parent
= self
4143 assert new_child
isa AExpr
4144 _n_block
= new_child
4150 if _n_label
== old_child
then
4151 if new_child
!= null then
4152 new_child
.parent
= self
4153 assert new_child
isa ALabel
4154 _n_label
= new_child
4162 redef fun visit_all
(v
: Visitor)
4164 v
.enter_visit
(_n_kwloop
)
4165 if _n_block
!= null then
4166 v
.enter_visit
(_n_block
.as(not null))
4168 if _n_label
!= null then
4169 v
.enter_visit
(_n_label
.as(not null))
4173 redef class AForExpr
4174 private init empty_init
do end
4176 init init_aforexpr
(
4177 n_kwfor
: nullable TKwfor,
4178 n_ids
: Collection[Object], # Should be Collection[TId]
4179 n_expr
: nullable AExpr,
4180 n_kwdo
: nullable TKwdo,
4181 n_block
: nullable AExpr,
4182 n_label
: nullable ALabel
4186 _n_kwfor
= n_kwfor
.as(not null)
4187 n_kwfor
.parent
= self
4193 _n_expr
= n_expr
.as(not null)
4194 n_expr
.parent
= self
4195 _n_kwdo
= n_kwdo
.as(not null)
4196 n_kwdo
.parent
= self
4198 if n_block
!= null then
4199 n_block
.parent
= self
4202 if n_label
!= null then
4203 n_label
.parent
= self
4207 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4209 if _n_kwfor
== old_child
then
4210 if new_child
!= null then
4211 new_child
.parent
= self
4212 assert new_child
isa TKwfor
4213 _n_kwfor
= new_child
4219 for i
in [0.._n_ids
.length
[ do
4220 if _n_ids
[i
] == old_child
then
4221 if new_child
!= null then
4222 assert new_child
isa TId
4223 _n_ids
[i
] = new_child
4224 new_child
.parent
= self
4231 if _n_expr
== old_child
then
4232 if new_child
!= null then
4233 new_child
.parent
= self
4234 assert new_child
isa AExpr
4241 if _n_kwdo
== old_child
then
4242 if new_child
!= null then
4243 new_child
.parent
= self
4244 assert new_child
isa TKwdo
4251 if _n_block
== old_child
then
4252 if new_child
!= null then
4253 new_child
.parent
= self
4254 assert new_child
isa AExpr
4255 _n_block
= new_child
4261 if _n_label
== old_child
then
4262 if new_child
!= null then
4263 new_child
.parent
= self
4264 assert new_child
isa ALabel
4265 _n_label
= new_child
4273 redef fun visit_all
(v
: Visitor)
4275 v
.enter_visit
(_n_kwfor
)
4279 v
.enter_visit
(_n_expr
)
4280 v
.enter_visit
(_n_kwdo
)
4281 if _n_block
!= null then
4282 v
.enter_visit
(_n_block
.as(not null))
4284 if _n_label
!= null then
4285 v
.enter_visit
(_n_label
.as(not null))
4289 redef class AAssertExpr
4290 private init empty_init
do end
4292 init init_aassertexpr
(
4293 n_kwassert
: nullable TKwassert,
4295 n_expr
: nullable AExpr,
4296 n_else
: nullable AExpr
4300 _n_kwassert
= n_kwassert
.as(not null)
4301 n_kwassert
.parent
= self
4303 if n_id
!= null then
4306 _n_expr
= n_expr
.as(not null)
4307 n_expr
.parent
= self
4309 if n_else
!= null then
4310 n_else
.parent
= self
4314 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4316 if _n_kwassert
== old_child
then
4317 if new_child
!= null then
4318 new_child
.parent
= self
4319 assert new_child
isa TKwassert
4320 _n_kwassert
= new_child
4326 if _n_id
== old_child
then
4327 if new_child
!= null then
4328 new_child
.parent
= self
4329 assert new_child
isa TId
4336 if _n_expr
== old_child
then
4337 if new_child
!= null then
4338 new_child
.parent
= self
4339 assert new_child
isa AExpr
4346 if _n_else
== old_child
then
4347 if new_child
!= null then
4348 new_child
.parent
= self
4349 assert new_child
isa AExpr
4358 redef fun visit_all
(v
: Visitor)
4360 v
.enter_visit
(_n_kwassert
)
4361 if _n_id
!= null then
4362 v
.enter_visit
(_n_id
.as(not null))
4364 v
.enter_visit
(_n_expr
)
4365 if _n_else
!= null then
4366 v
.enter_visit
(_n_else
.as(not null))
4370 redef class AOnceExpr
4371 private init empty_init
do end
4373 init init_aonceexpr
(
4374 n_kwonce
: nullable TKwonce,
4375 n_expr
: nullable AExpr
4379 _n_kwonce
= n_kwonce
.as(not null)
4380 n_kwonce
.parent
= self
4381 _n_expr
= n_expr
.as(not null)
4382 n_expr
.parent
= self
4385 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4387 if _n_kwonce
== old_child
then
4388 if new_child
!= null then
4389 new_child
.parent
= self
4390 assert new_child
isa TKwonce
4391 _n_kwonce
= new_child
4397 if _n_expr
== old_child
then
4398 if new_child
!= null then
4399 new_child
.parent
= self
4400 assert new_child
isa AExpr
4409 redef fun visit_all
(v
: Visitor)
4411 v
.enter_visit
(_n_kwonce
)
4412 v
.enter_visit
(_n_expr
)
4415 redef class ASendExpr
4416 private init empty_init
do end
4418 init init_asendexpr
(
4419 n_expr
: nullable AExpr
4423 _n_expr
= n_expr
.as(not null)
4424 n_expr
.parent
= self
4427 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4429 if _n_expr
== old_child
then
4430 if new_child
!= null then
4431 new_child
.parent
= self
4432 assert new_child
isa AExpr
4441 redef fun visit_all
(v
: Visitor)
4443 v
.enter_visit
(_n_expr
)
4446 redef class ABinopExpr
4447 private init empty_init
do end
4449 init init_abinopexpr
(
4450 n_expr
: nullable AExpr,
4451 n_expr2
: nullable AExpr
4455 _n_expr
= n_expr
.as(not null)
4456 n_expr
.parent
= self
4457 _n_expr2
= n_expr2
.as(not null)
4458 n_expr2
.parent
= self
4461 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4463 if _n_expr
== old_child
then
4464 if new_child
!= null then
4465 new_child
.parent
= self
4466 assert new_child
isa AExpr
4473 if _n_expr2
== old_child
then
4474 if new_child
!= null then
4475 new_child
.parent
= self
4476 assert new_child
isa AExpr
4477 _n_expr2
= new_child
4485 redef fun visit_all
(v
: Visitor)
4487 v
.enter_visit
(_n_expr
)
4488 v
.enter_visit
(_n_expr2
)
4492 private init empty_init
do end
4495 n_expr
: nullable AExpr,
4496 n_expr2
: nullable AExpr
4500 _n_expr
= n_expr
.as(not null)
4501 n_expr
.parent
= self
4502 _n_expr2
= n_expr2
.as(not null)
4503 n_expr2
.parent
= self
4506 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4508 if _n_expr
== old_child
then
4509 if new_child
!= null then
4510 new_child
.parent
= self
4511 assert new_child
isa AExpr
4518 if _n_expr2
== old_child
then
4519 if new_child
!= null then
4520 new_child
.parent
= self
4521 assert new_child
isa AExpr
4522 _n_expr2
= new_child
4530 redef fun visit_all
(v
: Visitor)
4532 v
.enter_visit
(_n_expr
)
4533 v
.enter_visit
(_n_expr2
)
4536 redef class AAndExpr
4537 private init empty_init
do end
4539 init init_aandexpr
(
4540 n_expr
: nullable AExpr,
4541 n_expr2
: nullable AExpr
4545 _n_expr
= n_expr
.as(not null)
4546 n_expr
.parent
= self
4547 _n_expr2
= n_expr2
.as(not null)
4548 n_expr2
.parent
= self
4551 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4553 if _n_expr
== old_child
then
4554 if new_child
!= null then
4555 new_child
.parent
= self
4556 assert new_child
isa AExpr
4563 if _n_expr2
== old_child
then
4564 if new_child
!= null then
4565 new_child
.parent
= self
4566 assert new_child
isa AExpr
4567 _n_expr2
= new_child
4575 redef fun visit_all
(v
: Visitor)
4577 v
.enter_visit
(_n_expr
)
4578 v
.enter_visit
(_n_expr2
)
4581 redef class AOrElseExpr
4582 private init empty_init
do end
4584 init init_aorelseexpr
(
4585 n_expr
: nullable AExpr,
4586 n_expr2
: nullable AExpr
4590 _n_expr
= n_expr
.as(not null)
4591 n_expr
.parent
= self
4592 _n_expr2
= n_expr2
.as(not null)
4593 n_expr2
.parent
= self
4596 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4598 if _n_expr
== old_child
then
4599 if new_child
!= null then
4600 new_child
.parent
= self
4601 assert new_child
isa AExpr
4608 if _n_expr2
== old_child
then
4609 if new_child
!= null then
4610 new_child
.parent
= self
4611 assert new_child
isa AExpr
4612 _n_expr2
= new_child
4620 redef fun visit_all
(v
: Visitor)
4622 v
.enter_visit
(_n_expr
)
4623 v
.enter_visit
(_n_expr2
)
4626 redef class ANotExpr
4627 private init empty_init
do end
4629 init init_anotexpr
(
4630 n_kwnot
: nullable TKwnot,
4631 n_expr
: nullable AExpr
4635 _n_kwnot
= n_kwnot
.as(not null)
4636 n_kwnot
.parent
= self
4637 _n_expr
= n_expr
.as(not null)
4638 n_expr
.parent
= self
4641 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4643 if _n_kwnot
== old_child
then
4644 if new_child
!= null then
4645 new_child
.parent
= self
4646 assert new_child
isa TKwnot
4647 _n_kwnot
= new_child
4653 if _n_expr
== old_child
then
4654 if new_child
!= null then
4655 new_child
.parent
= self
4656 assert new_child
isa AExpr
4665 redef fun visit_all
(v
: Visitor)
4667 v
.enter_visit
(_n_kwnot
)
4668 v
.enter_visit
(_n_expr
)
4672 private init empty_init
do end
4675 n_expr
: nullable AExpr,
4676 n_expr2
: nullable AExpr
4680 _n_expr
= n_expr
.as(not null)
4681 n_expr
.parent
= self
4682 _n_expr2
= n_expr2
.as(not null)
4683 n_expr2
.parent
= self
4686 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4688 if _n_expr
== old_child
then
4689 if new_child
!= null then
4690 new_child
.parent
= self
4691 assert new_child
isa AExpr
4698 if _n_expr2
== old_child
then
4699 if new_child
!= null then
4700 new_child
.parent
= self
4701 assert new_child
isa AExpr
4702 _n_expr2
= new_child
4710 redef fun visit_all
(v
: Visitor)
4712 v
.enter_visit
(_n_expr
)
4713 v
.enter_visit
(_n_expr2
)
4717 private init empty_init
do end
4720 n_expr
: nullable AExpr,
4721 n_expr2
: nullable AExpr
4725 _n_expr
= n_expr
.as(not null)
4726 n_expr
.parent
= self
4727 _n_expr2
= n_expr2
.as(not null)
4728 n_expr2
.parent
= self
4731 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4733 if _n_expr
== old_child
then
4734 if new_child
!= null then
4735 new_child
.parent
= self
4736 assert new_child
isa AExpr
4743 if _n_expr2
== old_child
then
4744 if new_child
!= null then
4745 new_child
.parent
= self
4746 assert new_child
isa AExpr
4747 _n_expr2
= new_child
4755 redef fun visit_all
(v
: Visitor)
4757 v
.enter_visit
(_n_expr
)
4758 v
.enter_visit
(_n_expr2
)
4762 private init empty_init
do end
4765 n_expr
: nullable AExpr,
4766 n_expr2
: nullable AExpr
4770 _n_expr
= n_expr
.as(not null)
4771 n_expr
.parent
= self
4772 _n_expr2
= n_expr2
.as(not null)
4773 n_expr2
.parent
= self
4776 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4778 if _n_expr
== old_child
then
4779 if new_child
!= null then
4780 new_child
.parent
= self
4781 assert new_child
isa AExpr
4788 if _n_expr2
== old_child
then
4789 if new_child
!= null then
4790 new_child
.parent
= self
4791 assert new_child
isa AExpr
4792 _n_expr2
= new_child
4800 redef fun visit_all
(v
: Visitor)
4802 v
.enter_visit
(_n_expr
)
4803 v
.enter_visit
(_n_expr2
)
4807 private init empty_init
do end
4810 n_expr
: nullable AExpr,
4811 n_expr2
: nullable AExpr
4815 _n_expr
= n_expr
.as(not null)
4816 n_expr
.parent
= self
4817 _n_expr2
= n_expr2
.as(not null)
4818 n_expr2
.parent
= self
4821 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4823 if _n_expr
== old_child
then
4824 if new_child
!= null then
4825 new_child
.parent
= self
4826 assert new_child
isa AExpr
4833 if _n_expr2
== old_child
then
4834 if new_child
!= null then
4835 new_child
.parent
= self
4836 assert new_child
isa AExpr
4837 _n_expr2
= new_child
4845 redef fun visit_all
(v
: Visitor)
4847 v
.enter_visit
(_n_expr
)
4848 v
.enter_visit
(_n_expr2
)
4852 private init empty_init
do end
4855 n_expr
: nullable AExpr,
4856 n_expr2
: nullable AExpr
4860 _n_expr
= n_expr
.as(not null)
4861 n_expr
.parent
= self
4862 _n_expr2
= n_expr2
.as(not null)
4863 n_expr2
.parent
= self
4866 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4868 if _n_expr
== old_child
then
4869 if new_child
!= null then
4870 new_child
.parent
= self
4871 assert new_child
isa AExpr
4878 if _n_expr2
== old_child
then
4879 if new_child
!= null then
4880 new_child
.parent
= self
4881 assert new_child
isa AExpr
4882 _n_expr2
= new_child
4890 redef fun visit_all
(v
: Visitor)
4892 v
.enter_visit
(_n_expr
)
4893 v
.enter_visit
(_n_expr2
)
4897 private init empty_init
do end
4900 n_expr
: nullable AExpr,
4901 n_expr2
: nullable AExpr
4905 _n_expr
= n_expr
.as(not null)
4906 n_expr
.parent
= self
4907 _n_expr2
= n_expr2
.as(not null)
4908 n_expr2
.parent
= self
4911 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4913 if _n_expr
== old_child
then
4914 if new_child
!= null then
4915 new_child
.parent
= self
4916 assert new_child
isa AExpr
4923 if _n_expr2
== old_child
then
4924 if new_child
!= null then
4925 new_child
.parent
= self
4926 assert new_child
isa AExpr
4927 _n_expr2
= new_child
4935 redef fun visit_all
(v
: Visitor)
4937 v
.enter_visit
(_n_expr
)
4938 v
.enter_visit
(_n_expr2
)
4942 private init empty_init
do end
4945 n_expr
: nullable AExpr,
4946 n_expr2
: nullable AExpr
4950 _n_expr
= n_expr
.as(not null)
4951 n_expr
.parent
= self
4952 _n_expr2
= n_expr2
.as(not null)
4953 n_expr2
.parent
= self
4956 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4958 if _n_expr
== old_child
then
4959 if new_child
!= null then
4960 new_child
.parent
= self
4961 assert new_child
isa AExpr
4968 if _n_expr2
== old_child
then
4969 if new_child
!= null then
4970 new_child
.parent
= self
4971 assert new_child
isa AExpr
4972 _n_expr2
= new_child
4980 redef fun visit_all
(v
: Visitor)
4982 v
.enter_visit
(_n_expr
)
4983 v
.enter_visit
(_n_expr2
)
4987 private init empty_init
do end
4990 n_expr
: nullable AExpr,
4991 n_expr2
: nullable AExpr
4995 _n_expr
= n_expr
.as(not null)
4996 n_expr
.parent
= self
4997 _n_expr2
= n_expr2
.as(not null)
4998 n_expr2
.parent
= self
5001 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5003 if _n_expr
== old_child
then
5004 if new_child
!= null then
5005 new_child
.parent
= self
5006 assert new_child
isa AExpr
5013 if _n_expr2
== old_child
then
5014 if new_child
!= null then
5015 new_child
.parent
= self
5016 assert new_child
isa AExpr
5017 _n_expr2
= new_child
5025 redef fun visit_all
(v
: Visitor)
5027 v
.enter_visit
(_n_expr
)
5028 v
.enter_visit
(_n_expr2
)
5032 private init empty_init
do end
5035 n_expr
: nullable AExpr,
5036 n_expr2
: nullable AExpr
5040 _n_expr
= n_expr
.as(not null)
5041 n_expr
.parent
= self
5042 _n_expr2
= n_expr2
.as(not null)
5043 n_expr2
.parent
= self
5046 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5048 if _n_expr
== old_child
then
5049 if new_child
!= null then
5050 new_child
.parent
= self
5051 assert new_child
isa AExpr
5058 if _n_expr2
== old_child
then
5059 if new_child
!= null then
5060 new_child
.parent
= self
5061 assert new_child
isa AExpr
5062 _n_expr2
= new_child
5070 redef fun visit_all
(v
: Visitor)
5072 v
.enter_visit
(_n_expr
)
5073 v
.enter_visit
(_n_expr2
)
5076 redef class AIsaExpr
5077 private init empty_init
do end
5079 init init_aisaexpr
(
5080 n_expr
: nullable AExpr,
5081 n_type
: nullable AType
5085 _n_expr
= n_expr
.as(not null)
5086 n_expr
.parent
= self
5087 _n_type
= n_type
.as(not null)
5088 n_type
.parent
= self
5091 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5093 if _n_expr
== old_child
then
5094 if new_child
!= null then
5095 new_child
.parent
= self
5096 assert new_child
isa AExpr
5103 if _n_type
== old_child
then
5104 if new_child
!= null then
5105 new_child
.parent
= self
5106 assert new_child
isa AType
5115 redef fun visit_all
(v
: Visitor)
5117 v
.enter_visit
(_n_expr
)
5118 v
.enter_visit
(_n_type
)
5121 redef class APlusExpr
5122 private init empty_init
do end
5124 init init_aplusexpr
(
5125 n_expr
: nullable AExpr,
5126 n_expr2
: nullable AExpr
5130 _n_expr
= n_expr
.as(not null)
5131 n_expr
.parent
= self
5132 _n_expr2
= n_expr2
.as(not null)
5133 n_expr2
.parent
= self
5136 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5138 if _n_expr
== old_child
then
5139 if new_child
!= null then
5140 new_child
.parent
= self
5141 assert new_child
isa AExpr
5148 if _n_expr2
== old_child
then
5149 if new_child
!= null then
5150 new_child
.parent
= self
5151 assert new_child
isa AExpr
5152 _n_expr2
= new_child
5160 redef fun visit_all
(v
: Visitor)
5162 v
.enter_visit
(_n_expr
)
5163 v
.enter_visit
(_n_expr2
)
5166 redef class AMinusExpr
5167 private init empty_init
do end
5169 init init_aminusexpr
(
5170 n_expr
: nullable AExpr,
5171 n_expr2
: nullable AExpr
5175 _n_expr
= n_expr
.as(not null)
5176 n_expr
.parent
= self
5177 _n_expr2
= n_expr2
.as(not null)
5178 n_expr2
.parent
= self
5181 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5183 if _n_expr
== old_child
then
5184 if new_child
!= null then
5185 new_child
.parent
= self
5186 assert new_child
isa AExpr
5193 if _n_expr2
== old_child
then
5194 if new_child
!= null then
5195 new_child
.parent
= self
5196 assert new_child
isa AExpr
5197 _n_expr2
= new_child
5205 redef fun visit_all
(v
: Visitor)
5207 v
.enter_visit
(_n_expr
)
5208 v
.enter_visit
(_n_expr2
)
5211 redef class AStarshipExpr
5212 private init empty_init
do end
5214 init init_astarshipexpr
(
5215 n_expr
: nullable AExpr,
5216 n_expr2
: nullable AExpr
5220 _n_expr
= n_expr
.as(not null)
5221 n_expr
.parent
= self
5222 _n_expr2
= n_expr2
.as(not null)
5223 n_expr2
.parent
= self
5226 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5228 if _n_expr
== old_child
then
5229 if new_child
!= null then
5230 new_child
.parent
= self
5231 assert new_child
isa AExpr
5238 if _n_expr2
== old_child
then
5239 if new_child
!= null then
5240 new_child
.parent
= self
5241 assert new_child
isa AExpr
5242 _n_expr2
= new_child
5250 redef fun visit_all
(v
: Visitor)
5252 v
.enter_visit
(_n_expr
)
5253 v
.enter_visit
(_n_expr2
)
5256 redef class AStarExpr
5257 private init empty_init
do end
5259 init init_astarexpr
(
5260 n_expr
: nullable AExpr,
5261 n_expr2
: nullable AExpr
5265 _n_expr
= n_expr
.as(not null)
5266 n_expr
.parent
= self
5267 _n_expr2
= n_expr2
.as(not null)
5268 n_expr2
.parent
= self
5271 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5273 if _n_expr
== old_child
then
5274 if new_child
!= null then
5275 new_child
.parent
= self
5276 assert new_child
isa AExpr
5283 if _n_expr2
== old_child
then
5284 if new_child
!= null then
5285 new_child
.parent
= self
5286 assert new_child
isa AExpr
5287 _n_expr2
= new_child
5295 redef fun visit_all
(v
: Visitor)
5297 v
.enter_visit
(_n_expr
)
5298 v
.enter_visit
(_n_expr2
)
5301 redef class ASlashExpr
5302 private init empty_init
do end
5304 init init_aslashexpr
(
5305 n_expr
: nullable AExpr,
5306 n_expr2
: nullable AExpr
5310 _n_expr
= n_expr
.as(not null)
5311 n_expr
.parent
= self
5312 _n_expr2
= n_expr2
.as(not null)
5313 n_expr2
.parent
= self
5316 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5318 if _n_expr
== old_child
then
5319 if new_child
!= null then
5320 new_child
.parent
= self
5321 assert new_child
isa AExpr
5328 if _n_expr2
== old_child
then
5329 if new_child
!= null then
5330 new_child
.parent
= self
5331 assert new_child
isa AExpr
5332 _n_expr2
= new_child
5340 redef fun visit_all
(v
: Visitor)
5342 v
.enter_visit
(_n_expr
)
5343 v
.enter_visit
(_n_expr2
)
5346 redef class APercentExpr
5347 private init empty_init
do end
5349 init init_apercentexpr
(
5350 n_expr
: nullable AExpr,
5351 n_expr2
: nullable AExpr
5355 _n_expr
= n_expr
.as(not null)
5356 n_expr
.parent
= self
5357 _n_expr2
= n_expr2
.as(not null)
5358 n_expr2
.parent
= self
5361 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5363 if _n_expr
== old_child
then
5364 if new_child
!= null then
5365 new_child
.parent
= self
5366 assert new_child
isa AExpr
5373 if _n_expr2
== old_child
then
5374 if new_child
!= null then
5375 new_child
.parent
= self
5376 assert new_child
isa AExpr
5377 _n_expr2
= new_child
5385 redef fun visit_all
(v
: Visitor)
5387 v
.enter_visit
(_n_expr
)
5388 v
.enter_visit
(_n_expr2
)
5391 redef class AUminusExpr
5392 private init empty_init
do end
5394 init init_auminusexpr
(
5395 n_minus
: nullable TMinus,
5396 n_expr
: nullable AExpr
5400 _n_minus
= n_minus
.as(not null)
5401 n_minus
.parent
= self
5402 _n_expr
= n_expr
.as(not null)
5403 n_expr
.parent
= self
5406 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5408 if _n_minus
== old_child
then
5409 if new_child
!= null then
5410 new_child
.parent
= self
5411 assert new_child
isa TMinus
5412 _n_minus
= new_child
5418 if _n_expr
== old_child
then
5419 if new_child
!= null then
5420 new_child
.parent
= self
5421 assert new_child
isa AExpr
5430 redef fun visit_all
(v
: Visitor)
5432 v
.enter_visit
(_n_minus
)
5433 v
.enter_visit
(_n_expr
)
5436 redef class ANewExpr
5437 private init empty_init
do end
5439 init init_anewexpr
(
5440 n_kwnew
: nullable TKwnew,
5441 n_type
: nullable AType,
5443 n_args
: nullable AExprs
5447 _n_kwnew
= n_kwnew
.as(not null)
5448 n_kwnew
.parent
= self
5449 _n_type
= n_type
.as(not null)
5450 n_type
.parent
= self
5452 if n_id
!= null then
5455 _n_args
= n_args
.as(not null)
5456 n_args
.parent
= self
5459 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5461 if _n_kwnew
== old_child
then
5462 if new_child
!= null then
5463 new_child
.parent
= self
5464 assert new_child
isa TKwnew
5465 _n_kwnew
= new_child
5471 if _n_type
== old_child
then
5472 if new_child
!= null then
5473 new_child
.parent
= self
5474 assert new_child
isa AType
5481 if _n_id
== old_child
then
5482 if new_child
!= null then
5483 new_child
.parent
= self
5484 assert new_child
isa TId
5491 if _n_args
== old_child
then
5492 if new_child
!= null then
5493 new_child
.parent
= self
5494 assert new_child
isa AExprs
5503 redef fun visit_all
(v
: Visitor)
5505 v
.enter_visit
(_n_kwnew
)
5506 v
.enter_visit
(_n_type
)
5507 if _n_id
!= null then
5508 v
.enter_visit
(_n_id
.as(not null))
5510 v
.enter_visit
(_n_args
)
5513 redef class AAttrExpr
5514 private init empty_init
do end
5516 init init_aattrexpr
(
5517 n_expr
: nullable AExpr,
5518 n_id
: nullable TAttrid
5522 _n_expr
= n_expr
.as(not null)
5523 n_expr
.parent
= self
5524 _n_id
= n_id
.as(not null)
5528 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5530 if _n_expr
== old_child
then
5531 if new_child
!= null then
5532 new_child
.parent
= self
5533 assert new_child
isa AExpr
5540 if _n_id
== old_child
then
5541 if new_child
!= null then
5542 new_child
.parent
= self
5543 assert new_child
isa TAttrid
5552 redef fun visit_all
(v
: Visitor)
5554 v
.enter_visit
(_n_expr
)
5555 v
.enter_visit
(_n_id
)
5558 redef class AAttrAssignExpr
5559 private init empty_init
do end
5561 init init_aattrassignexpr
(
5562 n_expr
: nullable AExpr,
5563 n_id
: nullable TAttrid,
5564 n_assign
: nullable TAssign,
5565 n_value
: nullable AExpr
5569 _n_expr
= n_expr
.as(not null)
5570 n_expr
.parent
= self
5571 _n_id
= n_id
.as(not null)
5573 _n_assign
= n_assign
.as(not null)
5574 n_assign
.parent
= self
5575 _n_value
= n_value
.as(not null)
5576 n_value
.parent
= self
5579 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5581 if _n_expr
== old_child
then
5582 if new_child
!= null then
5583 new_child
.parent
= self
5584 assert new_child
isa AExpr
5591 if _n_id
== old_child
then
5592 if new_child
!= null then
5593 new_child
.parent
= self
5594 assert new_child
isa TAttrid
5601 if _n_assign
== old_child
then
5602 if new_child
!= null then
5603 new_child
.parent
= self
5604 assert new_child
isa TAssign
5605 _n_assign
= new_child
5611 if _n_value
== old_child
then
5612 if new_child
!= null then
5613 new_child
.parent
= self
5614 assert new_child
isa AExpr
5615 _n_value
= new_child
5623 redef fun visit_all
(v
: Visitor)
5625 v
.enter_visit
(_n_expr
)
5626 v
.enter_visit
(_n_id
)
5627 v
.enter_visit
(_n_assign
)
5628 v
.enter_visit
(_n_value
)
5631 redef class AAttrReassignExpr
5632 private init empty_init
do end
5634 init init_aattrreassignexpr
(
5635 n_expr
: nullable AExpr,
5636 n_id
: nullable TAttrid,
5637 n_assign_op
: nullable AAssignOp,
5638 n_value
: nullable AExpr
5642 _n_expr
= n_expr
.as(not null)
5643 n_expr
.parent
= self
5644 _n_id
= n_id
.as(not null)
5646 _n_assign_op
= n_assign_op
.as(not null)
5647 n_assign_op
.parent
= self
5648 _n_value
= n_value
.as(not null)
5649 n_value
.parent
= self
5652 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5654 if _n_expr
== old_child
then
5655 if new_child
!= null then
5656 new_child
.parent
= self
5657 assert new_child
isa AExpr
5664 if _n_id
== old_child
then
5665 if new_child
!= null then
5666 new_child
.parent
= self
5667 assert new_child
isa TAttrid
5674 if _n_assign_op
== old_child
then
5675 if new_child
!= null then
5676 new_child
.parent
= self
5677 assert new_child
isa AAssignOp
5678 _n_assign_op
= new_child
5684 if _n_value
== old_child
then
5685 if new_child
!= null then
5686 new_child
.parent
= self
5687 assert new_child
isa AExpr
5688 _n_value
= new_child
5696 redef fun visit_all
(v
: Visitor)
5698 v
.enter_visit
(_n_expr
)
5699 v
.enter_visit
(_n_id
)
5700 v
.enter_visit
(_n_assign_op
)
5701 v
.enter_visit
(_n_value
)
5704 redef class ACallExpr
5705 private init empty_init
do end
5707 init init_acallexpr
(
5708 n_expr
: nullable AExpr,
5710 n_args
: nullable AExprs,
5711 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5715 _n_expr
= n_expr
.as(not null)
5716 n_expr
.parent
= self
5717 _n_id
= n_id
.as(not null)
5719 _n_args
= n_args
.as(not null)
5720 n_args
.parent
= self
5721 for n
in n_closure_defs
do
5722 assert n
isa AClosureDef
5723 _n_closure_defs
.add
(n
)
5728 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5730 if _n_expr
== old_child
then
5731 if new_child
!= null then
5732 new_child
.parent
= self
5733 assert new_child
isa AExpr
5740 if _n_id
== old_child
then
5741 if new_child
!= null then
5742 new_child
.parent
= self
5743 assert new_child
isa TId
5750 if _n_args
== old_child
then
5751 if new_child
!= null then
5752 new_child
.parent
= self
5753 assert new_child
isa AExprs
5760 for i
in [0.._n_closure_defs
.length
[ do
5761 if _n_closure_defs
[i
] == old_child
then
5762 if new_child
!= null then
5763 assert new_child
isa AClosureDef
5764 _n_closure_defs
[i
] = new_child
5765 new_child
.parent
= self
5767 _n_closure_defs
.remove_at
(i
)
5774 redef fun visit_all
(v
: Visitor)
5776 v
.enter_visit
(_n_expr
)
5777 v
.enter_visit
(_n_id
)
5778 v
.enter_visit
(_n_args
)
5779 for n
in _n_closure_defs
do
5784 redef class ACallAssignExpr
5785 private init empty_init
do end
5787 init init_acallassignexpr
(
5788 n_expr
: nullable AExpr,
5790 n_args
: nullable AExprs,
5791 n_assign
: nullable TAssign,
5792 n_value
: nullable AExpr
5796 _n_expr
= n_expr
.as(not null)
5797 n_expr
.parent
= self
5798 _n_id
= n_id
.as(not null)
5800 _n_args
= n_args
.as(not null)
5801 n_args
.parent
= self
5802 _n_assign
= n_assign
.as(not null)
5803 n_assign
.parent
= self
5804 _n_value
= n_value
.as(not null)
5805 n_value
.parent
= self
5808 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5810 if _n_expr
== old_child
then
5811 if new_child
!= null then
5812 new_child
.parent
= self
5813 assert new_child
isa AExpr
5820 if _n_id
== old_child
then
5821 if new_child
!= null then
5822 new_child
.parent
= self
5823 assert new_child
isa TId
5830 if _n_args
== old_child
then
5831 if new_child
!= null then
5832 new_child
.parent
= self
5833 assert new_child
isa AExprs
5840 if _n_assign
== old_child
then
5841 if new_child
!= null then
5842 new_child
.parent
= self
5843 assert new_child
isa TAssign
5844 _n_assign
= new_child
5850 if _n_value
== old_child
then
5851 if new_child
!= null then
5852 new_child
.parent
= self
5853 assert new_child
isa AExpr
5854 _n_value
= new_child
5862 redef fun visit_all
(v
: Visitor)
5864 v
.enter_visit
(_n_expr
)
5865 v
.enter_visit
(_n_id
)
5866 v
.enter_visit
(_n_args
)
5867 v
.enter_visit
(_n_assign
)
5868 v
.enter_visit
(_n_value
)
5871 redef class ACallReassignExpr
5872 private init empty_init
do end
5874 init init_acallreassignexpr
(
5875 n_expr
: nullable AExpr,
5877 n_args
: nullable AExprs,
5878 n_assign_op
: nullable AAssignOp,
5879 n_value
: nullable AExpr
5883 _n_expr
= n_expr
.as(not null)
5884 n_expr
.parent
= self
5885 _n_id
= n_id
.as(not null)
5887 _n_args
= n_args
.as(not null)
5888 n_args
.parent
= self
5889 _n_assign_op
= n_assign_op
.as(not null)
5890 n_assign_op
.parent
= self
5891 _n_value
= n_value
.as(not null)
5892 n_value
.parent
= self
5895 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5897 if _n_expr
== old_child
then
5898 if new_child
!= null then
5899 new_child
.parent
= self
5900 assert new_child
isa AExpr
5907 if _n_id
== old_child
then
5908 if new_child
!= null then
5909 new_child
.parent
= self
5910 assert new_child
isa TId
5917 if _n_args
== old_child
then
5918 if new_child
!= null then
5919 new_child
.parent
= self
5920 assert new_child
isa AExprs
5927 if _n_assign_op
== old_child
then
5928 if new_child
!= null then
5929 new_child
.parent
= self
5930 assert new_child
isa AAssignOp
5931 _n_assign_op
= new_child
5937 if _n_value
== old_child
then
5938 if new_child
!= null then
5939 new_child
.parent
= self
5940 assert new_child
isa AExpr
5941 _n_value
= new_child
5949 redef fun visit_all
(v
: Visitor)
5951 v
.enter_visit
(_n_expr
)
5952 v
.enter_visit
(_n_id
)
5953 v
.enter_visit
(_n_args
)
5954 v
.enter_visit
(_n_assign_op
)
5955 v
.enter_visit
(_n_value
)
5958 redef class ASuperExpr
5959 private init empty_init
do end
5961 init init_asuperexpr
(
5962 n_qualified
: nullable AQualified,
5963 n_kwsuper
: nullable TKwsuper,
5964 n_args
: nullable AExprs
5968 _n_qualified
= n_qualified
5969 if n_qualified
!= null then
5970 n_qualified
.parent
= self
5972 _n_kwsuper
= n_kwsuper
.as(not null)
5973 n_kwsuper
.parent
= self
5974 _n_args
= n_args
.as(not null)
5975 n_args
.parent
= self
5978 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5980 if _n_qualified
== old_child
then
5981 if new_child
!= null then
5982 new_child
.parent
= self
5983 assert new_child
isa AQualified
5984 _n_qualified
= new_child
5990 if _n_kwsuper
== old_child
then
5991 if new_child
!= null then
5992 new_child
.parent
= self
5993 assert new_child
isa TKwsuper
5994 _n_kwsuper
= new_child
6000 if _n_args
== old_child
then
6001 if new_child
!= null then
6002 new_child
.parent
= self
6003 assert new_child
isa AExprs
6012 redef fun visit_all
(v
: Visitor)
6014 if _n_qualified
!= null then
6015 v
.enter_visit
(_n_qualified
.as(not null))
6017 v
.enter_visit
(_n_kwsuper
)
6018 v
.enter_visit
(_n_args
)
6021 redef class AInitExpr
6022 private init empty_init
do end
6024 init init_ainitexpr
(
6025 n_expr
: nullable AExpr,
6026 n_kwinit
: nullable TKwinit,
6027 n_args
: nullable AExprs
6031 _n_expr
= n_expr
.as(not null)
6032 n_expr
.parent
= self
6033 _n_kwinit
= n_kwinit
.as(not null)
6034 n_kwinit
.parent
= self
6035 _n_args
= n_args
.as(not null)
6036 n_args
.parent
= self
6039 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6041 if _n_expr
== old_child
then
6042 if new_child
!= null then
6043 new_child
.parent
= self
6044 assert new_child
isa AExpr
6051 if _n_kwinit
== old_child
then
6052 if new_child
!= null then
6053 new_child
.parent
= self
6054 assert new_child
isa TKwinit
6055 _n_kwinit
= new_child
6061 if _n_args
== old_child
then
6062 if new_child
!= null then
6063 new_child
.parent
= self
6064 assert new_child
isa AExprs
6073 redef fun visit_all
(v
: Visitor)
6075 v
.enter_visit
(_n_expr
)
6076 v
.enter_visit
(_n_kwinit
)
6077 v
.enter_visit
(_n_args
)
6080 redef class ABraExpr
6081 private init empty_init
do end
6083 init init_abraexpr
(
6084 n_expr
: nullable AExpr,
6085 n_args
: nullable AExprs,
6086 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6090 _n_expr
= n_expr
.as(not null)
6091 n_expr
.parent
= self
6092 _n_args
= n_args
.as(not null)
6093 n_args
.parent
= self
6094 for n
in n_closure_defs
do
6095 assert n
isa AClosureDef
6096 _n_closure_defs
.add
(n
)
6101 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6103 if _n_expr
== old_child
then
6104 if new_child
!= null then
6105 new_child
.parent
= self
6106 assert new_child
isa AExpr
6113 if _n_args
== old_child
then
6114 if new_child
!= null then
6115 new_child
.parent
= self
6116 assert new_child
isa AExprs
6123 for i
in [0.._n_closure_defs
.length
[ do
6124 if _n_closure_defs
[i
] == old_child
then
6125 if new_child
!= null then
6126 assert new_child
isa AClosureDef
6127 _n_closure_defs
[i
] = new_child
6128 new_child
.parent
= self
6130 _n_closure_defs
.remove_at
(i
)
6137 redef fun visit_all
(v
: Visitor)
6139 v
.enter_visit
(_n_expr
)
6140 v
.enter_visit
(_n_args
)
6141 for n
in _n_closure_defs
do
6146 redef class ABraAssignExpr
6147 private init empty_init
do end
6149 init init_abraassignexpr
(
6150 n_expr
: nullable AExpr,
6151 n_args
: nullable AExprs,
6152 n_assign
: nullable TAssign,
6153 n_value
: nullable AExpr
6157 _n_expr
= n_expr
.as(not null)
6158 n_expr
.parent
= self
6159 _n_args
= n_args
.as(not null)
6160 n_args
.parent
= self
6161 _n_assign
= n_assign
.as(not null)
6162 n_assign
.parent
= self
6163 _n_value
= n_value
.as(not null)
6164 n_value
.parent
= self
6167 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6169 if _n_expr
== old_child
then
6170 if new_child
!= null then
6171 new_child
.parent
= self
6172 assert new_child
isa AExpr
6179 if _n_args
== old_child
then
6180 if new_child
!= null then
6181 new_child
.parent
= self
6182 assert new_child
isa AExprs
6189 if _n_assign
== old_child
then
6190 if new_child
!= null then
6191 new_child
.parent
= self
6192 assert new_child
isa TAssign
6193 _n_assign
= new_child
6199 if _n_value
== old_child
then
6200 if new_child
!= null then
6201 new_child
.parent
= self
6202 assert new_child
isa AExpr
6203 _n_value
= new_child
6211 redef fun visit_all
(v
: Visitor)
6213 v
.enter_visit
(_n_expr
)
6214 v
.enter_visit
(_n_args
)
6215 v
.enter_visit
(_n_assign
)
6216 v
.enter_visit
(_n_value
)
6219 redef class ABraReassignExpr
6220 private init empty_init
do end
6222 init init_abrareassignexpr
(
6223 n_expr
: nullable AExpr,
6224 n_args
: nullable AExprs,
6225 n_assign_op
: nullable AAssignOp,
6226 n_value
: nullable AExpr
6230 _n_expr
= n_expr
.as(not null)
6231 n_expr
.parent
= self
6232 _n_args
= n_args
.as(not null)
6233 n_args
.parent
= self
6234 _n_assign_op
= n_assign_op
.as(not null)
6235 n_assign_op
.parent
= self
6236 _n_value
= n_value
.as(not null)
6237 n_value
.parent
= self
6240 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6242 if _n_expr
== old_child
then
6243 if new_child
!= null then
6244 new_child
.parent
= self
6245 assert new_child
isa AExpr
6252 if _n_args
== old_child
then
6253 if new_child
!= null then
6254 new_child
.parent
= self
6255 assert new_child
isa AExprs
6262 if _n_assign_op
== old_child
then
6263 if new_child
!= null then
6264 new_child
.parent
= self
6265 assert new_child
isa AAssignOp
6266 _n_assign_op
= new_child
6272 if _n_value
== old_child
then
6273 if new_child
!= null then
6274 new_child
.parent
= self
6275 assert new_child
isa AExpr
6276 _n_value
= new_child
6284 redef fun visit_all
(v
: Visitor)
6286 v
.enter_visit
(_n_expr
)
6287 v
.enter_visit
(_n_args
)
6288 v
.enter_visit
(_n_assign_op
)
6289 v
.enter_visit
(_n_value
)
6292 redef class AClosureCallExpr
6293 private init empty_init
do end
6295 init init_aclosurecallexpr
(
6297 n_args
: nullable AExprs,
6298 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
6302 _n_id
= n_id
.as(not null)
6304 _n_args
= n_args
.as(not null)
6305 n_args
.parent
= self
6306 for n
in n_closure_defs
do
6307 assert n
isa AClosureDef
6308 _n_closure_defs
.add
(n
)
6313 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6315 if _n_id
== old_child
then
6316 if new_child
!= null then
6317 new_child
.parent
= self
6318 assert new_child
isa TId
6325 if _n_args
== old_child
then
6326 if new_child
!= null then
6327 new_child
.parent
= self
6328 assert new_child
isa AExprs
6335 for i
in [0.._n_closure_defs
.length
[ do
6336 if _n_closure_defs
[i
] == old_child
then
6337 if new_child
!= null then
6338 assert new_child
isa AClosureDef
6339 _n_closure_defs
[i
] = new_child
6340 new_child
.parent
= self
6342 _n_closure_defs
.remove_at
(i
)
6349 redef fun visit_all
(v
: Visitor)
6351 v
.enter_visit
(_n_id
)
6352 v
.enter_visit
(_n_args
)
6353 for n
in _n_closure_defs
do
6358 redef class AVarExpr
6359 private init empty_init
do end
6361 init init_avarexpr
(
6366 _n_id
= n_id
.as(not null)
6370 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6372 if _n_id
== old_child
then
6373 if new_child
!= null then
6374 new_child
.parent
= self
6375 assert new_child
isa TId
6384 redef fun visit_all
(v
: Visitor)
6386 v
.enter_visit
(_n_id
)
6389 redef class AVarAssignExpr
6390 private init empty_init
do end
6392 init init_avarassignexpr
(
6394 n_assign
: nullable TAssign,
6395 n_value
: nullable AExpr
6399 _n_id
= n_id
.as(not null)
6401 _n_assign
= n_assign
.as(not null)
6402 n_assign
.parent
= self
6403 _n_value
= n_value
.as(not null)
6404 n_value
.parent
= self
6407 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6409 if _n_id
== old_child
then
6410 if new_child
!= null then
6411 new_child
.parent
= self
6412 assert new_child
isa TId
6419 if _n_assign
== old_child
then
6420 if new_child
!= null then
6421 new_child
.parent
= self
6422 assert new_child
isa TAssign
6423 _n_assign
= new_child
6429 if _n_value
== old_child
then
6430 if new_child
!= null then
6431 new_child
.parent
= self
6432 assert new_child
isa AExpr
6433 _n_value
= new_child
6441 redef fun visit_all
(v
: Visitor)
6443 v
.enter_visit
(_n_id
)
6444 v
.enter_visit
(_n_assign
)
6445 v
.enter_visit
(_n_value
)
6448 redef class AVarReassignExpr
6449 private init empty_init
do end
6451 init init_avarreassignexpr
(
6453 n_assign_op
: nullable AAssignOp,
6454 n_value
: nullable AExpr
6458 _n_id
= n_id
.as(not null)
6460 _n_assign_op
= n_assign_op
.as(not null)
6461 n_assign_op
.parent
= self
6462 _n_value
= n_value
.as(not null)
6463 n_value
.parent
= self
6466 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6468 if _n_id
== old_child
then
6469 if new_child
!= null then
6470 new_child
.parent
= self
6471 assert new_child
isa TId
6478 if _n_assign_op
== old_child
then
6479 if new_child
!= null then
6480 new_child
.parent
= self
6481 assert new_child
isa AAssignOp
6482 _n_assign_op
= new_child
6488 if _n_value
== old_child
then
6489 if new_child
!= null then
6490 new_child
.parent
= self
6491 assert new_child
isa AExpr
6492 _n_value
= new_child
6500 redef fun visit_all
(v
: Visitor)
6502 v
.enter_visit
(_n_id
)
6503 v
.enter_visit
(_n_assign_op
)
6504 v
.enter_visit
(_n_value
)
6507 redef class ARangeExpr
6508 private init empty_init
do end
6510 init init_arangeexpr
(
6511 n_expr
: nullable AExpr,
6512 n_expr2
: nullable AExpr
6516 _n_expr
= n_expr
.as(not null)
6517 n_expr
.parent
= self
6518 _n_expr2
= n_expr2
.as(not null)
6519 n_expr2
.parent
= self
6522 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6524 if _n_expr
== old_child
then
6525 if new_child
!= null then
6526 new_child
.parent
= self
6527 assert new_child
isa AExpr
6534 if _n_expr2
== old_child
then
6535 if new_child
!= null then
6536 new_child
.parent
= self
6537 assert new_child
isa AExpr
6538 _n_expr2
= new_child
6546 redef fun visit_all
(v
: Visitor)
6548 v
.enter_visit
(_n_expr
)
6549 v
.enter_visit
(_n_expr2
)
6552 redef class ACrangeExpr
6553 private init empty_init
do end
6555 init init_acrangeexpr
(
6556 n_obra
: nullable TObra,
6557 n_expr
: nullable AExpr,
6558 n_expr2
: nullable AExpr,
6559 n_cbra
: nullable TCbra
6563 _n_obra
= n_obra
.as(not null)
6564 n_obra
.parent
= self
6565 _n_expr
= n_expr
.as(not null)
6566 n_expr
.parent
= self
6567 _n_expr2
= n_expr2
.as(not null)
6568 n_expr2
.parent
= self
6569 _n_cbra
= n_cbra
.as(not null)
6570 n_cbra
.parent
= self
6573 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6575 if _n_obra
== old_child
then
6576 if new_child
!= null then
6577 new_child
.parent
= self
6578 assert new_child
isa TObra
6585 if _n_expr
== old_child
then
6586 if new_child
!= null then
6587 new_child
.parent
= self
6588 assert new_child
isa AExpr
6595 if _n_expr2
== old_child
then
6596 if new_child
!= null then
6597 new_child
.parent
= self
6598 assert new_child
isa AExpr
6599 _n_expr2
= new_child
6605 if _n_cbra
== old_child
then
6606 if new_child
!= null then
6607 new_child
.parent
= self
6608 assert new_child
isa TCbra
6617 redef fun visit_all
(v
: Visitor)
6619 v
.enter_visit
(_n_obra
)
6620 v
.enter_visit
(_n_expr
)
6621 v
.enter_visit
(_n_expr2
)
6622 v
.enter_visit
(_n_cbra
)
6625 redef class AOrangeExpr
6626 private init empty_init
do end
6628 init init_aorangeexpr
(
6629 n_obra
: nullable TObra,
6630 n_expr
: nullable AExpr,
6631 n_expr2
: nullable AExpr,
6632 n_cbra
: nullable TObra
6636 _n_obra
= n_obra
.as(not null)
6637 n_obra
.parent
= self
6638 _n_expr
= n_expr
.as(not null)
6639 n_expr
.parent
= self
6640 _n_expr2
= n_expr2
.as(not null)
6641 n_expr2
.parent
= self
6642 _n_cbra
= n_cbra
.as(not null)
6643 n_cbra
.parent
= self
6646 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6648 if _n_obra
== old_child
then
6649 if new_child
!= null then
6650 new_child
.parent
= self
6651 assert new_child
isa TObra
6658 if _n_expr
== old_child
then
6659 if new_child
!= null then
6660 new_child
.parent
= self
6661 assert new_child
isa AExpr
6668 if _n_expr2
== old_child
then
6669 if new_child
!= null then
6670 new_child
.parent
= self
6671 assert new_child
isa AExpr
6672 _n_expr2
= new_child
6678 if _n_cbra
== old_child
then
6679 if new_child
!= null then
6680 new_child
.parent
= self
6681 assert new_child
isa TObra
6690 redef fun visit_all
(v
: Visitor)
6692 v
.enter_visit
(_n_obra
)
6693 v
.enter_visit
(_n_expr
)
6694 v
.enter_visit
(_n_expr2
)
6695 v
.enter_visit
(_n_cbra
)
6698 redef class AArrayExpr
6699 private init empty_init
do end
6701 init init_aarrayexpr
(
6702 n_exprs
: nullable AExprs
6706 _n_exprs
= n_exprs
.as(not null)
6707 n_exprs
.parent
= self
6710 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6712 if _n_exprs
== old_child
then
6713 if new_child
!= null then
6714 new_child
.parent
= self
6715 assert new_child
isa AExprs
6716 _n_exprs
= new_child
6724 redef fun visit_all
(v
: Visitor)
6726 v
.enter_visit
(_n_exprs
)
6729 redef class ASelfExpr
6730 private init empty_init
do end
6732 init init_aselfexpr
(
6733 n_kwself
: nullable TKwself
6737 _n_kwself
= n_kwself
.as(not null)
6738 n_kwself
.parent
= self
6741 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6743 if _n_kwself
== old_child
then
6744 if new_child
!= null then
6745 new_child
.parent
= self
6746 assert new_child
isa TKwself
6747 _n_kwself
= new_child
6755 redef fun visit_all
(v
: Visitor)
6757 v
.enter_visit
(_n_kwself
)
6760 redef class AImplicitSelfExpr
6761 private init empty_init
do end
6763 init init_aimplicitselfexpr
6768 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6772 redef fun visit_all
(v
: Visitor)
6776 redef class ATrueExpr
6777 private init empty_init
do end
6779 init init_atrueexpr
(
6780 n_kwtrue
: nullable TKwtrue
6784 _n_kwtrue
= n_kwtrue
.as(not null)
6785 n_kwtrue
.parent
= self
6788 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6790 if _n_kwtrue
== old_child
then
6791 if new_child
!= null then
6792 new_child
.parent
= self
6793 assert new_child
isa TKwtrue
6794 _n_kwtrue
= new_child
6802 redef fun visit_all
(v
: Visitor)
6804 v
.enter_visit
(_n_kwtrue
)
6807 redef class AFalseExpr
6808 private init empty_init
do end
6810 init init_afalseexpr
(
6811 n_kwfalse
: nullable TKwfalse
6815 _n_kwfalse
= n_kwfalse
.as(not null)
6816 n_kwfalse
.parent
= self
6819 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6821 if _n_kwfalse
== old_child
then
6822 if new_child
!= null then
6823 new_child
.parent
= self
6824 assert new_child
isa TKwfalse
6825 _n_kwfalse
= new_child
6833 redef fun visit_all
(v
: Visitor)
6835 v
.enter_visit
(_n_kwfalse
)
6838 redef class ANullExpr
6839 private init empty_init
do end
6841 init init_anullexpr
(
6842 n_kwnull
: nullable TKwnull
6846 _n_kwnull
= n_kwnull
.as(not null)
6847 n_kwnull
.parent
= self
6850 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6852 if _n_kwnull
== old_child
then
6853 if new_child
!= null then
6854 new_child
.parent
= self
6855 assert new_child
isa TKwnull
6856 _n_kwnull
= new_child
6864 redef fun visit_all
(v
: Visitor)
6866 v
.enter_visit
(_n_kwnull
)
6869 redef class AIntExpr
6870 private init empty_init
do end
6872 init init_aintexpr
(
6873 n_number
: nullable TNumber
6877 _n_number
= n_number
.as(not null)
6878 n_number
.parent
= self
6881 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6883 if _n_number
== old_child
then
6884 if new_child
!= null then
6885 new_child
.parent
= self
6886 assert new_child
isa TNumber
6887 _n_number
= new_child
6895 redef fun visit_all
(v
: Visitor)
6897 v
.enter_visit
(_n_number
)
6900 redef class AFloatExpr
6901 private init empty_init
do end
6903 init init_afloatexpr
(
6904 n_float
: nullable TFloat
6908 _n_float
= n_float
.as(not null)
6909 n_float
.parent
= self
6912 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6914 if _n_float
== old_child
then
6915 if new_child
!= null then
6916 new_child
.parent
= self
6917 assert new_child
isa TFloat
6918 _n_float
= new_child
6926 redef fun visit_all
(v
: Visitor)
6928 v
.enter_visit
(_n_float
)
6931 redef class ACharExpr
6932 private init empty_init
do end
6934 init init_acharexpr
(
6935 n_char
: nullable TChar
6939 _n_char
= n_char
.as(not null)
6940 n_char
.parent
= self
6943 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6945 if _n_char
== old_child
then
6946 if new_child
!= null then
6947 new_child
.parent
= self
6948 assert new_child
isa TChar
6957 redef fun visit_all
(v
: Visitor)
6959 v
.enter_visit
(_n_char
)
6962 redef class AStringExpr
6963 private init empty_init
do end
6965 init init_astringexpr
(
6966 n_string
: nullable TString
6970 _n_string
= n_string
.as(not null)
6971 n_string
.parent
= self
6974 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6976 if _n_string
== old_child
then
6977 if new_child
!= null then
6978 new_child
.parent
= self
6979 assert new_child
isa TString
6980 _n_string
= new_child
6988 redef fun visit_all
(v
: Visitor)
6990 v
.enter_visit
(_n_string
)
6993 redef class AStartStringExpr
6994 private init empty_init
do end
6996 init init_astartstringexpr
(
6997 n_string
: nullable TStartString
7001 _n_string
= n_string
.as(not null)
7002 n_string
.parent
= self
7005 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7007 if _n_string
== old_child
then
7008 if new_child
!= null then
7009 new_child
.parent
= self
7010 assert new_child
isa TStartString
7011 _n_string
= new_child
7019 redef fun visit_all
(v
: Visitor)
7021 v
.enter_visit
(_n_string
)
7024 redef class AMidStringExpr
7025 private init empty_init
do end
7027 init init_amidstringexpr
(
7028 n_string
: nullable TMidString
7032 _n_string
= n_string
.as(not null)
7033 n_string
.parent
= self
7036 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7038 if _n_string
== old_child
then
7039 if new_child
!= null then
7040 new_child
.parent
= self
7041 assert new_child
isa TMidString
7042 _n_string
= new_child
7050 redef fun visit_all
(v
: Visitor)
7052 v
.enter_visit
(_n_string
)
7055 redef class AEndStringExpr
7056 private init empty_init
do end
7058 init init_aendstringexpr
(
7059 n_string
: nullable TEndString
7063 _n_string
= n_string
.as(not null)
7064 n_string
.parent
= self
7067 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7069 if _n_string
== old_child
then
7070 if new_child
!= null then
7071 new_child
.parent
= self
7072 assert new_child
isa TEndString
7073 _n_string
= new_child
7081 redef fun visit_all
(v
: Visitor)
7083 v
.enter_visit
(_n_string
)
7086 redef class ASuperstringExpr
7087 private init empty_init
do end
7089 init init_asuperstringexpr
(
7090 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7101 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7103 for i
in [0.._n_exprs
.length
[ do
7104 if _n_exprs
[i
] == old_child
then
7105 if new_child
!= null then
7106 assert new_child
isa AExpr
7107 _n_exprs
[i
] = new_child
7108 new_child
.parent
= self
7110 _n_exprs
.remove_at
(i
)
7117 redef fun visit_all
(v
: Visitor)
7119 for n
in _n_exprs
do
7124 redef class AParExpr
7125 private init empty_init
do end
7127 init init_aparexpr
(
7128 n_opar
: nullable TOpar,
7129 n_expr
: nullable AExpr,
7130 n_cpar
: nullable TCpar
7134 _n_opar
= n_opar
.as(not null)
7135 n_opar
.parent
= self
7136 _n_expr
= n_expr
.as(not null)
7137 n_expr
.parent
= self
7138 _n_cpar
= n_cpar
.as(not null)
7139 n_cpar
.parent
= self
7142 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7144 if _n_opar
== old_child
then
7145 if new_child
!= null then
7146 new_child
.parent
= self
7147 assert new_child
isa TOpar
7154 if _n_expr
== old_child
then
7155 if new_child
!= null then
7156 new_child
.parent
= self
7157 assert new_child
isa AExpr
7164 if _n_cpar
== old_child
then
7165 if new_child
!= null then
7166 new_child
.parent
= self
7167 assert new_child
isa TCpar
7176 redef fun visit_all
(v
: Visitor)
7178 v
.enter_visit
(_n_opar
)
7179 v
.enter_visit
(_n_expr
)
7180 v
.enter_visit
(_n_cpar
)
7183 redef class AAsCastExpr
7184 private init empty_init
do end
7186 init init_aascastexpr
(
7187 n_expr
: nullable AExpr,
7188 n_kwas
: nullable TKwas,
7189 n_opar
: nullable TOpar,
7190 n_type
: nullable AType,
7191 n_cpar
: nullable TCpar
7195 _n_expr
= n_expr
.as(not null)
7196 n_expr
.parent
= self
7197 _n_kwas
= n_kwas
.as(not null)
7198 n_kwas
.parent
= self
7199 _n_opar
= n_opar
.as(not null)
7200 n_opar
.parent
= self
7201 _n_type
= n_type
.as(not null)
7202 n_type
.parent
= self
7203 _n_cpar
= n_cpar
.as(not null)
7204 n_cpar
.parent
= self
7207 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7209 if _n_expr
== old_child
then
7210 if new_child
!= null then
7211 new_child
.parent
= self
7212 assert new_child
isa AExpr
7219 if _n_kwas
== old_child
then
7220 if new_child
!= null then
7221 new_child
.parent
= self
7222 assert new_child
isa TKwas
7229 if _n_opar
== old_child
then
7230 if new_child
!= null then
7231 new_child
.parent
= self
7232 assert new_child
isa TOpar
7239 if _n_type
== old_child
then
7240 if new_child
!= null then
7241 new_child
.parent
= self
7242 assert new_child
isa AType
7249 if _n_cpar
== old_child
then
7250 if new_child
!= null then
7251 new_child
.parent
= self
7252 assert new_child
isa TCpar
7261 redef fun visit_all
(v
: Visitor)
7263 v
.enter_visit
(_n_expr
)
7264 v
.enter_visit
(_n_kwas
)
7265 v
.enter_visit
(_n_opar
)
7266 v
.enter_visit
(_n_type
)
7267 v
.enter_visit
(_n_cpar
)
7270 redef class AAsNotnullExpr
7271 private init empty_init
do end
7273 init init_aasnotnullexpr
(
7274 n_expr
: nullable AExpr,
7275 n_kwas
: nullable TKwas,
7276 n_opar
: nullable TOpar,
7277 n_kwnot
: nullable TKwnot,
7278 n_kwnull
: nullable TKwnull,
7279 n_cpar
: nullable TCpar
7283 _n_expr
= n_expr
.as(not null)
7284 n_expr
.parent
= self
7285 _n_kwas
= n_kwas
.as(not null)
7286 n_kwas
.parent
= self
7287 _n_opar
= n_opar
.as(not null)
7288 n_opar
.parent
= self
7289 _n_kwnot
= n_kwnot
.as(not null)
7290 n_kwnot
.parent
= self
7291 _n_kwnull
= n_kwnull
.as(not null)
7292 n_kwnull
.parent
= self
7293 _n_cpar
= n_cpar
.as(not null)
7294 n_cpar
.parent
= self
7297 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7299 if _n_expr
== old_child
then
7300 if new_child
!= null then
7301 new_child
.parent
= self
7302 assert new_child
isa AExpr
7309 if _n_kwas
== old_child
then
7310 if new_child
!= null then
7311 new_child
.parent
= self
7312 assert new_child
isa TKwas
7319 if _n_opar
== old_child
then
7320 if new_child
!= null then
7321 new_child
.parent
= self
7322 assert new_child
isa TOpar
7329 if _n_kwnot
== old_child
then
7330 if new_child
!= null then
7331 new_child
.parent
= self
7332 assert new_child
isa TKwnot
7333 _n_kwnot
= new_child
7339 if _n_kwnull
== old_child
then
7340 if new_child
!= null then
7341 new_child
.parent
= self
7342 assert new_child
isa TKwnull
7343 _n_kwnull
= new_child
7349 if _n_cpar
== old_child
then
7350 if new_child
!= null then
7351 new_child
.parent
= self
7352 assert new_child
isa TCpar
7361 redef fun visit_all
(v
: Visitor)
7363 v
.enter_visit
(_n_expr
)
7364 v
.enter_visit
(_n_kwas
)
7365 v
.enter_visit
(_n_opar
)
7366 v
.enter_visit
(_n_kwnot
)
7367 v
.enter_visit
(_n_kwnull
)
7368 v
.enter_visit
(_n_cpar
)
7371 redef class AIssetAttrExpr
7372 private init empty_init
do end
7374 init init_aissetattrexpr
(
7375 n_kwisset
: nullable TKwisset,
7376 n_expr
: nullable AExpr,
7377 n_id
: nullable TAttrid
7381 _n_kwisset
= n_kwisset
.as(not null)
7382 n_kwisset
.parent
= self
7383 _n_expr
= n_expr
.as(not null)
7384 n_expr
.parent
= self
7385 _n_id
= n_id
.as(not null)
7389 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7391 if _n_kwisset
== old_child
then
7392 if new_child
!= null then
7393 new_child
.parent
= self
7394 assert new_child
isa TKwisset
7395 _n_kwisset
= new_child
7401 if _n_expr
== old_child
then
7402 if new_child
!= null then
7403 new_child
.parent
= self
7404 assert new_child
isa AExpr
7411 if _n_id
== old_child
then
7412 if new_child
!= null then
7413 new_child
.parent
= self
7414 assert new_child
isa TAttrid
7423 redef fun visit_all
(v
: Visitor)
7425 v
.enter_visit
(_n_kwisset
)
7426 v
.enter_visit
(_n_expr
)
7427 v
.enter_visit
(_n_id
)
7430 redef class ADebugTypeExpr
7431 private init empty_init
do end
7433 init init_adebugtypeexpr
(
7434 n_kwdebug
: nullable TKwdebug,
7435 n_kwtype
: nullable TKwtype,
7436 n_expr
: nullable AExpr,
7437 n_type
: nullable AType
7441 _n_kwdebug
= n_kwdebug
.as(not null)
7442 n_kwdebug
.parent
= self
7443 _n_kwtype
= n_kwtype
.as(not null)
7444 n_kwtype
.parent
= self
7445 _n_expr
= n_expr
.as(not null)
7446 n_expr
.parent
= self
7447 _n_type
= n_type
.as(not null)
7448 n_type
.parent
= self
7451 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7453 if _n_kwdebug
== old_child
then
7454 if new_child
!= null then
7455 new_child
.parent
= self
7456 assert new_child
isa TKwdebug
7457 _n_kwdebug
= new_child
7463 if _n_kwtype
== old_child
then
7464 if new_child
!= null then
7465 new_child
.parent
= self
7466 assert new_child
isa TKwtype
7467 _n_kwtype
= new_child
7473 if _n_expr
== old_child
then
7474 if new_child
!= null then
7475 new_child
.parent
= self
7476 assert new_child
isa AExpr
7483 if _n_type
== old_child
then
7484 if new_child
!= null then
7485 new_child
.parent
= self
7486 assert new_child
isa AType
7495 redef fun visit_all
(v
: Visitor)
7497 v
.enter_visit
(_n_kwdebug
)
7498 v
.enter_visit
(_n_kwtype
)
7499 v
.enter_visit
(_n_expr
)
7500 v
.enter_visit
(_n_type
)
7503 redef class AListExprs
7504 private init empty_init
do end
7506 init init_alistexprs
(
7507 n_exprs
: Collection[Object] # Should be Collection[AExpr]
7518 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7520 for i
in [0.._n_exprs
.length
[ do
7521 if _n_exprs
[i
] == old_child
then
7522 if new_child
!= null then
7523 assert new_child
isa AExpr
7524 _n_exprs
[i
] = new_child
7525 new_child
.parent
= self
7527 _n_exprs
.remove_at
(i
)
7534 redef fun visit_all
(v
: Visitor)
7536 for n
in _n_exprs
do
7541 redef class AParExprs
7542 private init empty_init
do end
7544 init init_aparexprs
(
7545 n_opar
: nullable TOpar,
7546 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7547 n_cpar
: nullable TCpar
7551 _n_opar
= n_opar
.as(not null)
7552 n_opar
.parent
= self
7558 _n_cpar
= n_cpar
.as(not null)
7559 n_cpar
.parent
= self
7562 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7564 if _n_opar
== old_child
then
7565 if new_child
!= null then
7566 new_child
.parent
= self
7567 assert new_child
isa TOpar
7574 for i
in [0.._n_exprs
.length
[ do
7575 if _n_exprs
[i
] == old_child
then
7576 if new_child
!= null then
7577 assert new_child
isa AExpr
7578 _n_exprs
[i
] = new_child
7579 new_child
.parent
= self
7581 _n_exprs
.remove_at
(i
)
7586 if _n_cpar
== old_child
then
7587 if new_child
!= null then
7588 new_child
.parent
= self
7589 assert new_child
isa TCpar
7598 redef fun visit_all
(v
: Visitor)
7600 v
.enter_visit
(_n_opar
)
7601 for n
in _n_exprs
do
7604 v
.enter_visit
(_n_cpar
)
7607 redef class ABraExprs
7608 private init empty_init
do end
7610 init init_abraexprs
(
7611 n_obra
: nullable TObra,
7612 n_exprs
: Collection[Object], # Should be Collection[AExpr]
7613 n_cbra
: nullable TCbra
7617 _n_obra
= n_obra
.as(not null)
7618 n_obra
.parent
= self
7624 _n_cbra
= n_cbra
.as(not null)
7625 n_cbra
.parent
= self
7628 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7630 if _n_obra
== old_child
then
7631 if new_child
!= null then
7632 new_child
.parent
= self
7633 assert new_child
isa TObra
7640 for i
in [0.._n_exprs
.length
[ do
7641 if _n_exprs
[i
] == old_child
then
7642 if new_child
!= null then
7643 assert new_child
isa AExpr
7644 _n_exprs
[i
] = new_child
7645 new_child
.parent
= self
7647 _n_exprs
.remove_at
(i
)
7652 if _n_cbra
== old_child
then
7653 if new_child
!= null then
7654 new_child
.parent
= self
7655 assert new_child
isa TCbra
7664 redef fun visit_all
(v
: Visitor)
7666 v
.enter_visit
(_n_obra
)
7667 for n
in _n_exprs
do
7670 v
.enter_visit
(_n_cbra
)
7673 redef class APlusAssignOp
7674 private init empty_init
do end
7676 init init_aplusassignop
(
7677 n_pluseq
: nullable TPluseq
7681 _n_pluseq
= n_pluseq
.as(not null)
7682 n_pluseq
.parent
= self
7685 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7687 if _n_pluseq
== old_child
then
7688 if new_child
!= null then
7689 new_child
.parent
= self
7690 assert new_child
isa TPluseq
7691 _n_pluseq
= new_child
7699 redef fun visit_all
(v
: Visitor)
7701 v
.enter_visit
(_n_pluseq
)
7704 redef class AMinusAssignOp
7705 private init empty_init
do end
7707 init init_aminusassignop
(
7708 n_minuseq
: nullable TMinuseq
7712 _n_minuseq
= n_minuseq
.as(not null)
7713 n_minuseq
.parent
= self
7716 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7718 if _n_minuseq
== old_child
then
7719 if new_child
!= null then
7720 new_child
.parent
= self
7721 assert new_child
isa TMinuseq
7722 _n_minuseq
= new_child
7730 redef fun visit_all
(v
: Visitor)
7732 v
.enter_visit
(_n_minuseq
)
7735 redef class AClosureDef
7736 private init empty_init
do end
7738 init init_aclosuredef
(
7739 n_bang
: nullable TBang,
7740 n_id
: nullable AClosureId,
7741 n_ids
: Collection[Object], # Should be Collection[TId]
7742 n_kwdo
: nullable TKwdo,
7743 n_expr
: nullable AExpr,
7744 n_label
: nullable ALabel
7748 _n_bang
= n_bang
.as(not null)
7749 n_bang
.parent
= self
7750 _n_id
= n_id
.as(not null)
7758 if n_kwdo
!= null then
7759 n_kwdo
.parent
= self
7762 if n_expr
!= null then
7763 n_expr
.parent
= self
7766 if n_label
!= null then
7767 n_label
.parent
= self
7771 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7773 if _n_bang
== old_child
then
7774 if new_child
!= null then
7775 new_child
.parent
= self
7776 assert new_child
isa TBang
7783 if _n_id
== old_child
then
7784 if new_child
!= null then
7785 new_child
.parent
= self
7786 assert new_child
isa AClosureId
7793 for i
in [0.._n_ids
.length
[ do
7794 if _n_ids
[i
] == old_child
then
7795 if new_child
!= null then
7796 assert new_child
isa TId
7797 _n_ids
[i
] = new_child
7798 new_child
.parent
= self
7805 if _n_kwdo
== old_child
then
7806 if new_child
!= null then
7807 new_child
.parent
= self
7808 assert new_child
isa TKwdo
7815 if _n_expr
== old_child
then
7816 if new_child
!= null then
7817 new_child
.parent
= self
7818 assert new_child
isa AExpr
7825 if _n_label
== old_child
then
7826 if new_child
!= null then
7827 new_child
.parent
= self
7828 assert new_child
isa ALabel
7829 _n_label
= new_child
7837 redef fun visit_all
(v
: Visitor)
7839 v
.enter_visit
(_n_bang
)
7840 v
.enter_visit
(_n_id
)
7844 if _n_kwdo
!= null then
7845 v
.enter_visit
(_n_kwdo
.as(not null))
7847 if _n_expr
!= null then
7848 v
.enter_visit
(_n_expr
.as(not null))
7850 if _n_label
!= null then
7851 v
.enter_visit
(_n_label
.as(not null))
7855 redef class ASimpleClosureId
7856 private init empty_init
do end
7858 init init_asimpleclosureid
(
7863 _n_id
= n_id
.as(not null)
7867 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7869 if _n_id
== old_child
then
7870 if new_child
!= null then
7871 new_child
.parent
= self
7872 assert new_child
isa TId
7881 redef fun visit_all
(v
: Visitor)
7883 v
.enter_visit
(_n_id
)
7886 redef class ABreakClosureId
7887 private init empty_init
do end
7889 init init_abreakclosureid
(
7890 n_kwbreak
: nullable TKwbreak
7894 _n_kwbreak
= n_kwbreak
.as(not null)
7895 n_kwbreak
.parent
= self
7898 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7900 if _n_kwbreak
== old_child
then
7901 if new_child
!= null then
7902 new_child
.parent
= self
7903 assert new_child
isa TKwbreak
7904 _n_kwbreak
= new_child
7912 redef fun visit_all
(v
: Visitor)
7914 v
.enter_visit
(_n_kwbreak
)
7917 redef class AModuleName
7918 private init empty_init
do end
7920 init init_amodulename
(
7921 n_quad
: nullable TQuad,
7922 n_path
: Collection[Object], # Should be Collection[TId]
7928 if n_quad
!= null then
7929 n_quad
.parent
= self
7936 _n_id
= n_id
.as(not null)
7940 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7942 if _n_quad
== old_child
then
7943 if new_child
!= null then
7944 new_child
.parent
= self
7945 assert new_child
isa TQuad
7952 for i
in [0.._n_path
.length
[ do
7953 if _n_path
[i
] == old_child
then
7954 if new_child
!= null then
7955 assert new_child
isa TId
7956 _n_path
[i
] = new_child
7957 new_child
.parent
= self
7959 _n_path
.remove_at
(i
)
7964 if _n_id
== old_child
then
7965 if new_child
!= null then
7966 new_child
.parent
= self
7967 assert new_child
isa TId
7976 redef fun visit_all
(v
: Visitor)
7978 if _n_quad
!= null then
7979 v
.enter_visit
(_n_quad
.as(not null))
7984 v
.enter_visit
(_n_id
)
7987 redef class AExternCalls
7988 private init empty_init
do end
7990 init init_aexterncalls
(
7991 n_kwimport
: nullable TKwimport,
7992 n_extern_calls
: Collection[Object] # Should be Collection[AExternCall]
7996 _n_kwimport
= n_kwimport
.as(not null)
7997 n_kwimport
.parent
= self
7998 for n
in n_extern_calls
do
7999 assert n
isa AExternCall
8000 _n_extern_calls
.add
(n
)
8005 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8007 if _n_kwimport
== old_child
then
8008 if new_child
!= null then
8009 new_child
.parent
= self
8010 assert new_child
isa TKwimport
8011 _n_kwimport
= new_child
8017 for i
in [0.._n_extern_calls
.length
[ do
8018 if _n_extern_calls
[i
] == old_child
then
8019 if new_child
!= null then
8020 assert new_child
isa AExternCall
8021 _n_extern_calls
[i
] = new_child
8022 new_child
.parent
= self
8024 _n_extern_calls
.remove_at
(i
)
8031 redef fun visit_all
(v
: Visitor)
8033 v
.enter_visit
(_n_kwimport
)
8034 for n
in _n_extern_calls
do
8039 redef class AExternCall
8040 private init empty_init
do end
8042 init init_aexterncall
8047 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8051 redef fun visit_all
(v
: Visitor)
8055 redef class ASuperExternCall
8056 private init empty_init
do end
8058 init init_asuperexterncall
(
8059 n_kwsuper
: nullable TKwsuper
8063 _n_kwsuper
= n_kwsuper
.as(not null)
8064 n_kwsuper
.parent
= self
8067 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8069 if _n_kwsuper
== old_child
then
8070 if new_child
!= null then
8071 new_child
.parent
= self
8072 assert new_child
isa TKwsuper
8073 _n_kwsuper
= new_child
8081 redef fun visit_all
(v
: Visitor)
8083 v
.enter_visit
(_n_kwsuper
)
8086 redef class ALocalPropExternCall
8087 private init empty_init
do end
8089 init init_alocalpropexterncall
(
8090 n_methid
: nullable AMethid
8094 _n_methid
= n_methid
.as(not null)
8095 n_methid
.parent
= self
8098 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8100 if _n_methid
== old_child
then
8101 if new_child
!= null then
8102 new_child
.parent
= self
8103 assert new_child
isa AMethid
8104 _n_methid
= new_child
8112 redef fun visit_all
(v
: Visitor)
8114 v
.enter_visit
(_n_methid
)
8117 redef class AFullPropExternCall
8118 private init empty_init
do end
8120 init init_afullpropexterncall
(
8121 n_classid
: nullable TClassid,
8122 n_quad
: nullable TQuad,
8123 n_methid
: nullable AMethid
8127 _n_classid
= n_classid
.as(not null)
8128 n_classid
.parent
= self
8130 if n_quad
!= null then
8131 n_quad
.parent
= self
8133 _n_methid
= n_methid
.as(not null)
8134 n_methid
.parent
= self
8137 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8139 if _n_classid
== old_child
then
8140 if new_child
!= null then
8141 new_child
.parent
= self
8142 assert new_child
isa TClassid
8143 _n_classid
= new_child
8149 if _n_quad
== old_child
then
8150 if new_child
!= null then
8151 new_child
.parent
= self
8152 assert new_child
isa TQuad
8159 if _n_methid
== old_child
then
8160 if new_child
!= null then
8161 new_child
.parent
= self
8162 assert new_child
isa AMethid
8163 _n_methid
= new_child
8171 redef fun visit_all
(v
: Visitor)
8173 v
.enter_visit
(_n_classid
)
8174 if _n_quad
!= null then
8175 v
.enter_visit
(_n_quad
.as(not null))
8177 v
.enter_visit
(_n_methid
)
8180 redef class AInitPropExternCall
8181 private init empty_init
do end
8183 init init_ainitpropexterncall
(
8184 n_classid
: nullable TClassid
8188 _n_classid
= n_classid
.as(not null)
8189 n_classid
.parent
= self
8192 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8194 if _n_classid
== old_child
then
8195 if new_child
!= null then
8196 new_child
.parent
= self
8197 assert new_child
isa TClassid
8198 _n_classid
= new_child
8206 redef fun visit_all
(v
: Visitor)
8208 v
.enter_visit
(_n_classid
)
8211 redef class ACastAsExternCall
8212 private init empty_init
do end
8214 init init_acastasexterncall
(
8215 n_from_type
: nullable AType,
8216 n_kwas
: nullable TKwas,
8217 n_to_type
: nullable AType
8221 _n_from_type
= n_from_type
.as(not null)
8222 n_from_type
.parent
= self
8223 _n_kwas
= n_kwas
.as(not null)
8224 n_kwas
.parent
= self
8225 _n_to_type
= n_to_type
.as(not null)
8226 n_to_type
.parent
= self
8229 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8231 if _n_from_type
== old_child
then
8232 if new_child
!= null then
8233 new_child
.parent
= self
8234 assert new_child
isa AType
8235 _n_from_type
= new_child
8241 if _n_kwas
== old_child
then
8242 if new_child
!= null then
8243 new_child
.parent
= self
8244 assert new_child
isa TKwas
8251 if _n_to_type
== old_child
then
8252 if new_child
!= null then
8253 new_child
.parent
= self
8254 assert new_child
isa AType
8255 _n_to_type
= new_child
8263 redef fun visit_all
(v
: Visitor)
8265 v
.enter_visit
(_n_from_type
)
8266 v
.enter_visit
(_n_kwas
)
8267 v
.enter_visit
(_n_to_type
)
8270 redef class AAsNullableExternCall
8271 private init empty_init
do end
8273 init init_aasnullableexterncall
(
8274 n_type
: nullable AType,
8275 n_kwas
: nullable TKwas,
8276 n_kwnullable
: nullable TKwnullable
8280 _n_type
= n_type
.as(not null)
8281 n_type
.parent
= self
8282 _n_kwas
= n_kwas
.as(not null)
8283 n_kwas
.parent
= self
8284 _n_kwnullable
= n_kwnullable
.as(not null)
8285 n_kwnullable
.parent
= self
8288 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8290 if _n_type
== old_child
then
8291 if new_child
!= null then
8292 new_child
.parent
= self
8293 assert new_child
isa AType
8300 if _n_kwas
== old_child
then
8301 if new_child
!= null then
8302 new_child
.parent
= self
8303 assert new_child
isa TKwas
8310 if _n_kwnullable
== old_child
then
8311 if new_child
!= null then
8312 new_child
.parent
= self
8313 assert new_child
isa TKwnullable
8314 _n_kwnullable
= new_child
8322 redef fun visit_all
(v
: Visitor)
8324 v
.enter_visit
(_n_type
)
8325 v
.enter_visit
(_n_kwas
)
8326 v
.enter_visit
(_n_kwnullable
)
8329 redef class AAsNotNullableExternCall
8330 private init empty_init
do end
8332 init init_aasnotnullableexterncall
(
8333 n_type
: nullable AType,
8334 n_kwas
: nullable TKwas,
8335 n_kwnot
: nullable TKwnot,
8336 n_kwnullable
: nullable TKwnullable
8340 _n_type
= n_type
.as(not null)
8341 n_type
.parent
= self
8342 _n_kwas
= n_kwas
.as(not null)
8343 n_kwas
.parent
= self
8344 _n_kwnot
= n_kwnot
.as(not null)
8345 n_kwnot
.parent
= self
8346 _n_kwnullable
= n_kwnullable
.as(not null)
8347 n_kwnullable
.parent
= self
8350 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8352 if _n_type
== old_child
then
8353 if new_child
!= null then
8354 new_child
.parent
= self
8355 assert new_child
isa AType
8362 if _n_kwas
== old_child
then
8363 if new_child
!= null then
8364 new_child
.parent
= self
8365 assert new_child
isa TKwas
8372 if _n_kwnot
== old_child
then
8373 if new_child
!= null then
8374 new_child
.parent
= self
8375 assert new_child
isa TKwnot
8376 _n_kwnot
= new_child
8382 if _n_kwnullable
== old_child
then
8383 if new_child
!= null then
8384 new_child
.parent
= self
8385 assert new_child
isa TKwnullable
8386 _n_kwnullable
= new_child
8394 redef fun visit_all
(v
: Visitor)
8396 v
.enter_visit
(_n_type
)
8397 v
.enter_visit
(_n_kwas
)
8398 v
.enter_visit
(_n_kwnot
)
8399 v
.enter_visit
(_n_kwnullable
)
8402 redef class AInLanguage
8403 private init empty_init
do end
8405 init init_ainlanguage
(
8406 n_kwin
: nullable TKwin,
8407 n_string
: nullable TString
8411 _n_kwin
= n_kwin
.as(not null)
8412 n_kwin
.parent
= self
8413 _n_string
= n_string
.as(not null)
8414 n_string
.parent
= self
8417 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8419 if _n_kwin
== old_child
then
8420 if new_child
!= null then
8421 new_child
.parent
= self
8422 assert new_child
isa TKwin
8429 if _n_string
== old_child
then
8430 if new_child
!= null then
8431 new_child
.parent
= self
8432 assert new_child
isa TString
8433 _n_string
= new_child
8441 redef fun visit_all
(v
: Visitor)
8443 v
.enter_visit
(_n_kwin
)
8444 v
.enter_visit
(_n_string
)
8447 redef class AExternCodeBlock
8448 private init empty_init
do end
8450 init init_aexterncodeblock
(
8451 n_in_language
: nullable AInLanguage,
8452 n_extern_code_segment
: nullable TExternCodeSegment
8456 _n_in_language
= n_in_language
8457 if n_in_language
!= null then
8458 n_in_language
.parent
= self
8460 _n_extern_code_segment
= n_extern_code_segment
.as(not null)
8461 n_extern_code_segment
.parent
= self
8464 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8466 if _n_in_language
== old_child
then
8467 if new_child
!= null then
8468 new_child
.parent
= self
8469 assert new_child
isa AInLanguage
8470 _n_in_language
= new_child
8472 _n_in_language
= null
8476 if _n_extern_code_segment
== old_child
then
8477 if new_child
!= null then
8478 new_child
.parent
= self
8479 assert new_child
isa TExternCodeSegment
8480 _n_extern_code_segment
= new_child
8488 redef fun visit_all
(v
: Visitor)
8490 if _n_in_language
!= null then
8491 v
.enter_visit
(_n_in_language
.as(not null))
8493 v
.enter_visit
(_n_extern_code_segment
)
8496 redef class AQualified
8497 private init empty_init
do end
8499 init init_aqualified
(
8500 n_id
: Collection[Object], # Should be Collection[TId]
8501 n_classid
: nullable TClassid
8510 _n_classid
= n_classid
8511 if n_classid
!= null then
8512 n_classid
.parent
= self
8516 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8518 for i
in [0.._n_id
.length
[ do
8519 if _n_id
[i
] == old_child
then
8520 if new_child
!= null then
8521 assert new_child
isa TId
8522 _n_id
[i
] = new_child
8523 new_child
.parent
= self
8530 if _n_classid
== old_child
then
8531 if new_child
!= null then
8532 new_child
.parent
= self
8533 assert new_child
isa TClassid
8534 _n_classid
= new_child
8542 redef fun visit_all
(v
: Visitor)
8547 if _n_classid
!= null then
8548 v
.enter_visit
(_n_classid
.as(not null))
8553 private init empty_init
do end
8556 n_comment
: Collection[Object] # Should be Collection[TComment]
8560 for n
in n_comment
do
8561 assert n
isa TComment
8567 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8569 for i
in [0.._n_comment
.length
[ do
8570 if _n_comment
[i
] == old_child
then
8571 if new_child
!= null then
8572 assert new_child
isa TComment
8573 _n_comment
[i
] = new_child
8574 new_child
.parent
= self
8576 _n_comment
.remove_at
(i
)
8583 redef fun visit_all
(v
: Visitor)
8585 for n
in _n_comment
do
8592 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
8594 if _n_base
== old_child
then
8595 if new_child
== null then
8597 new_child
.parent
= self
8598 assert new_child
isa AModule
8601 old_child
.parent
= null
8606 redef fun visit_all
(v
: Visitor)
8608 if _n_base
!= null then
8609 v
.enter_visit
(_n_base
.as(not null))
8611 v
.enter_visit
(_n_eof
)