1 # Production AST nodes full definition.
2 # This file was generated by SableCC (http://www.sablecc.org/).
6 intrude import parser_nodes
9 # Parent of the node in the AST
10 readable writable var _parent
: nullable ANode
12 # Remove a child from the AST
13 fun remove_child
(child
: ANode)
15 replace_child
(child
, null)
18 # Replace a child with an other node in the AST
19 fun replace_child
(old_child
: ANode, new_child
: nullable ANode) is abstract
21 # Replace itself with an other node in the AST
22 fun replace_with
(node
: ANode)
24 if (_parent
!= null) then
25 _parent
.replace_child
(self, node
)
29 # Visit all nodes in order.
30 # Thus, call "v.visit(e)" for each node e
31 fun visit_all
(v
: Visitor) is abstract
35 redef fun visit_all
(v
: Visitor) do end
36 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode) do end
40 redef fun replace_with
(n
: ANode)
48 # Abstract standard visitor
50 # What the visitor do when a node is visited
51 # Concrete visitors should redefine this method.
52 protected fun visit
(e
: nullable ANode) is abstract
54 # Ask the visitor to visit a given node.
55 # Usually automatically called by visit_all* methods.
56 # This methos should not be redefined
57 fun enter_visit
(e
: nullable ANode)
59 var old
= _current_node
65 # The current visited node
66 readable var _current_node
: nullable ANode = null
70 private init empty_init
do end
73 n_packagedecl
: nullable APackagedecl,
74 n_imports
: Collection[Object], # Should be Collection[AImport]
75 n_classdefs
: Collection[Object] # Should be Collection[AClassdef]
79 _n_packagedecl
= n_packagedecl
80 if n_packagedecl
!= null then
81 n_packagedecl
.parent
= self
88 for n
in n_classdefs
do
89 assert n
isa AClassdef
95 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
97 if _n_packagedecl
== old_child
then
98 if new_child
!= null then
99 new_child
.parent
= self
100 assert new_child
isa APackagedecl
101 _n_packagedecl
= new_child
103 _n_packagedecl
= null
107 for i
in [0.._n_imports
.length
[ do
108 if _n_imports
[i
] == old_child
then
109 if new_child
!= null then
110 assert new_child
isa AImport
111 _n_imports
[i
] = new_child
112 new_child
.parent
= self
114 _n_imports
.remove_at
(i
)
119 for i
in [0.._n_classdefs
.length
[ do
120 if _n_classdefs
[i
] == old_child
then
121 if new_child
!= null then
122 assert new_child
isa AClassdef
123 _n_classdefs
[i
] = new_child
124 new_child
.parent
= self
126 _n_classdefs
.remove_at
(i
)
133 redef fun visit_all
(v
: Visitor)
135 if _n_packagedecl
!= null then
136 v
.enter_visit
(_n_packagedecl
.as(not null))
138 for n
in _n_imports
do
141 for n
in _n_classdefs
do
146 redef class APackagedecl
147 private init empty_init
do end
149 init init_apackagedecl
(
150 n_doc
: nullable ADoc,
151 n_kwpackage
: nullable TKwpackage,
157 if n_doc
!= null then
160 _n_kwpackage
= n_kwpackage
.as(not null)
161 n_kwpackage
.parent
= self
162 _n_id
= n_id
.as(not null)
166 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
168 if _n_doc
== old_child
then
169 if new_child
!= null then
170 new_child
.parent
= self
171 assert new_child
isa ADoc
178 if _n_kwpackage
== old_child
then
179 if new_child
!= null then
180 new_child
.parent
= self
181 assert new_child
isa TKwpackage
182 _n_kwpackage
= new_child
188 if _n_id
== old_child
then
189 if new_child
!= null then
190 new_child
.parent
= self
191 assert new_child
isa TId
200 redef fun visit_all
(v
: Visitor)
202 if _n_doc
!= null then
203 v
.enter_visit
(_n_doc
.as(not null))
205 v
.enter_visit
(_n_kwpackage
)
209 redef class AStdImport
210 private init empty_init
do end
212 init init_astdimport
(
213 n_visibility
: nullable AVisibility,
214 n_kwimport
: nullable TKwimport,
219 _n_visibility
= n_visibility
.as(not null)
220 n_visibility
.parent
= self
221 _n_kwimport
= n_kwimport
.as(not null)
222 n_kwimport
.parent
= self
223 _n_id
= n_id
.as(not null)
227 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
229 if _n_visibility
== old_child
then
230 if new_child
!= null then
231 new_child
.parent
= self
232 assert new_child
isa AVisibility
233 _n_visibility
= new_child
239 if _n_kwimport
== old_child
then
240 if new_child
!= null then
241 new_child
.parent
= self
242 assert new_child
isa TKwimport
243 _n_kwimport
= new_child
249 if _n_id
== old_child
then
250 if new_child
!= null then
251 new_child
.parent
= self
252 assert new_child
isa TId
261 redef fun visit_all
(v
: Visitor)
263 v
.enter_visit
(_n_visibility
)
264 v
.enter_visit
(_n_kwimport
)
268 redef class ANoImport
269 private init empty_init
do end
271 init init_anoimport
(
272 n_visibility
: nullable AVisibility,
273 n_kwimport
: nullable TKwimport,
274 n_kwend
: nullable TKwend
278 _n_visibility
= n_visibility
.as(not null)
279 n_visibility
.parent
= self
280 _n_kwimport
= n_kwimport
.as(not null)
281 n_kwimport
.parent
= self
282 _n_kwend
= n_kwend
.as(not null)
283 n_kwend
.parent
= self
286 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
288 if _n_visibility
== old_child
then
289 if new_child
!= null then
290 new_child
.parent
= self
291 assert new_child
isa AVisibility
292 _n_visibility
= new_child
298 if _n_kwimport
== old_child
then
299 if new_child
!= null then
300 new_child
.parent
= self
301 assert new_child
isa TKwimport
302 _n_kwimport
= new_child
308 if _n_kwend
== old_child
then
309 if new_child
!= null then
310 new_child
.parent
= self
311 assert new_child
isa TKwend
320 redef fun visit_all
(v
: Visitor)
322 v
.enter_visit
(_n_visibility
)
323 v
.enter_visit
(_n_kwimport
)
324 v
.enter_visit
(_n_kwend
)
327 redef class APublicVisibility
328 private init empty_init
do end
330 init init_apublicvisibility
335 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
339 redef fun visit_all
(v
: Visitor)
343 redef class APrivateVisibility
344 private init empty_init
do end
346 init init_aprivatevisibility
(
347 n_kwprivate
: nullable TKwprivate
351 _n_kwprivate
= n_kwprivate
.as(not null)
352 n_kwprivate
.parent
= self
355 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
357 if _n_kwprivate
== old_child
then
358 if new_child
!= null then
359 new_child
.parent
= self
360 assert new_child
isa TKwprivate
361 _n_kwprivate
= new_child
369 redef fun visit_all
(v
: Visitor)
371 v
.enter_visit
(_n_kwprivate
)
374 redef class AProtectedVisibility
375 private init empty_init
do end
377 init init_aprotectedvisibility
(
378 n_kwprotected
: nullable TKwprotected
382 _n_kwprotected
= n_kwprotected
.as(not null)
383 n_kwprotected
.parent
= self
386 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
388 if _n_kwprotected
== old_child
then
389 if new_child
!= null then
390 new_child
.parent
= self
391 assert new_child
isa TKwprotected
392 _n_kwprotected
= new_child
400 redef fun visit_all
(v
: Visitor)
402 v
.enter_visit
(_n_kwprotected
)
405 redef class AIntrudeVisibility
406 private init empty_init
do end
408 init init_aintrudevisibility
(
409 n_kwintrude
: nullable TKwintrude
413 _n_kwintrude
= n_kwintrude
.as(not null)
414 n_kwintrude
.parent
= self
417 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
419 if _n_kwintrude
== old_child
then
420 if new_child
!= null then
421 new_child
.parent
= self
422 assert new_child
isa TKwintrude
423 _n_kwintrude
= new_child
431 redef fun visit_all
(v
: Visitor)
433 v
.enter_visit
(_n_kwintrude
)
436 redef class AStdClassdef
437 private init empty_init
do end
439 init init_astdclassdef
(
440 n_doc
: nullable ADoc,
441 n_kwredef
: nullable TKwredef,
442 n_visibility
: nullable AVisibility,
443 n_classkind
: nullable AClasskind,
444 n_id
: nullable TClassid,
445 n_formaldefs
: Collection[Object], # Should be Collection[AFormaldef]
446 n_superclasses
: Collection[Object], # Should be Collection[ASuperclass]
447 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
452 if n_doc
!= null then
455 _n_kwredef
= n_kwredef
456 if n_kwredef
!= null then
457 n_kwredef
.parent
= self
459 _n_visibility
= n_visibility
.as(not null)
460 n_visibility
.parent
= self
461 _n_classkind
= n_classkind
.as(not null)
462 n_classkind
.parent
= self
467 for n
in n_formaldefs
do
468 assert n
isa AFormaldef
472 for n
in n_superclasses
do
473 assert n
isa ASuperclass
474 _n_superclasses
.add
(n
)
477 for n
in n_propdefs
do
478 assert n
isa APropdef
484 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
486 if _n_doc
== old_child
then
487 if new_child
!= null then
488 new_child
.parent
= self
489 assert new_child
isa ADoc
496 if _n_kwredef
== old_child
then
497 if new_child
!= null then
498 new_child
.parent
= self
499 assert new_child
isa TKwredef
500 _n_kwredef
= new_child
506 if _n_visibility
== old_child
then
507 if new_child
!= null then
508 new_child
.parent
= self
509 assert new_child
isa AVisibility
510 _n_visibility
= new_child
516 if _n_classkind
== old_child
then
517 if new_child
!= null then
518 new_child
.parent
= self
519 assert new_child
isa AClasskind
520 _n_classkind
= new_child
526 if _n_id
== old_child
then
527 if new_child
!= null then
528 new_child
.parent
= self
529 assert new_child
isa TClassid
536 for i
in [0.._n_formaldefs
.length
[ do
537 if _n_formaldefs
[i
] == old_child
then
538 if new_child
!= null then
539 assert new_child
isa AFormaldef
540 _n_formaldefs
[i
] = new_child
541 new_child
.parent
= self
543 _n_formaldefs
.remove_at
(i
)
548 for i
in [0.._n_superclasses
.length
[ do
549 if _n_superclasses
[i
] == old_child
then
550 if new_child
!= null then
551 assert new_child
isa ASuperclass
552 _n_superclasses
[i
] = new_child
553 new_child
.parent
= self
555 _n_superclasses
.remove_at
(i
)
560 for i
in [0.._n_propdefs
.length
[ do
561 if _n_propdefs
[i
] == old_child
then
562 if new_child
!= null then
563 assert new_child
isa APropdef
564 _n_propdefs
[i
] = new_child
565 new_child
.parent
= self
567 _n_propdefs
.remove_at
(i
)
574 redef fun visit_all
(v
: Visitor)
576 if _n_doc
!= null then
577 v
.enter_visit
(_n_doc
.as(not null))
579 if _n_kwredef
!= null then
580 v
.enter_visit
(_n_kwredef
.as(not null))
582 v
.enter_visit
(_n_visibility
)
583 v
.enter_visit
(_n_classkind
)
584 if _n_id
!= null then
585 v
.enter_visit
(_n_id
.as(not null))
587 for n
in _n_formaldefs
do
590 for n
in _n_superclasses
do
593 for n
in _n_propdefs
do
598 redef class ATopClassdef
599 private init empty_init
do end
601 init init_atopclassdef
(
602 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
606 for n
in n_propdefs
do
607 assert n
isa APropdef
613 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
615 for i
in [0.._n_propdefs
.length
[ do
616 if _n_propdefs
[i
] == old_child
then
617 if new_child
!= null then
618 assert new_child
isa APropdef
619 _n_propdefs
[i
] = new_child
620 new_child
.parent
= self
622 _n_propdefs
.remove_at
(i
)
629 redef fun visit_all
(v
: Visitor)
631 for n
in _n_propdefs
do
636 redef class AMainClassdef
637 private init empty_init
do end
639 init init_amainclassdef
(
640 n_propdefs
: Collection[Object] # Should be Collection[APropdef]
644 for n
in n_propdefs
do
645 assert n
isa APropdef
651 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
653 for i
in [0.._n_propdefs
.length
[ do
654 if _n_propdefs
[i
] == old_child
then
655 if new_child
!= null then
656 assert new_child
isa APropdef
657 _n_propdefs
[i
] = new_child
658 new_child
.parent
= self
660 _n_propdefs
.remove_at
(i
)
667 redef fun visit_all
(v
: Visitor)
669 for n
in _n_propdefs
do
674 redef class AConcreteClasskind
675 private init empty_init
do end
677 init init_aconcreteclasskind
(
678 n_kwclass
: nullable TKwclass
682 _n_kwclass
= n_kwclass
.as(not null)
683 n_kwclass
.parent
= self
686 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
688 if _n_kwclass
== old_child
then
689 if new_child
!= null then
690 new_child
.parent
= self
691 assert new_child
isa TKwclass
692 _n_kwclass
= new_child
700 redef fun visit_all
(v
: Visitor)
702 v
.enter_visit
(_n_kwclass
)
705 redef class AAbstractClasskind
706 private init empty_init
do end
708 init init_aabstractclasskind
(
709 n_kwabstract
: nullable TKwabstract,
710 n_kwclass
: nullable TKwclass
714 _n_kwabstract
= n_kwabstract
.as(not null)
715 n_kwabstract
.parent
= self
716 _n_kwclass
= n_kwclass
.as(not null)
717 n_kwclass
.parent
= self
720 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
722 if _n_kwabstract
== old_child
then
723 if new_child
!= null then
724 new_child
.parent
= self
725 assert new_child
isa TKwabstract
726 _n_kwabstract
= new_child
732 if _n_kwclass
== old_child
then
733 if new_child
!= null then
734 new_child
.parent
= self
735 assert new_child
isa TKwclass
736 _n_kwclass
= new_child
744 redef fun visit_all
(v
: Visitor)
746 v
.enter_visit
(_n_kwabstract
)
747 v
.enter_visit
(_n_kwclass
)
750 redef class AInterfaceClasskind
751 private init empty_init
do end
753 init init_ainterfaceclasskind
(
754 n_kwinterface
: nullable TKwinterface
758 _n_kwinterface
= n_kwinterface
.as(not null)
759 n_kwinterface
.parent
= self
762 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
764 if _n_kwinterface
== old_child
then
765 if new_child
!= null then
766 new_child
.parent
= self
767 assert new_child
isa TKwinterface
768 _n_kwinterface
= new_child
776 redef fun visit_all
(v
: Visitor)
778 v
.enter_visit
(_n_kwinterface
)
781 redef class AUniversalClasskind
782 private init empty_init
do end
784 init init_auniversalclasskind
(
785 n_kwuniversal
: nullable TKwuniversal
789 _n_kwuniversal
= n_kwuniversal
.as(not null)
790 n_kwuniversal
.parent
= self
793 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
795 if _n_kwuniversal
== old_child
then
796 if new_child
!= null then
797 new_child
.parent
= self
798 assert new_child
isa TKwuniversal
799 _n_kwuniversal
= new_child
807 redef fun visit_all
(v
: Visitor)
809 v
.enter_visit
(_n_kwuniversal
)
812 redef class AFormaldef
813 private init empty_init
do end
815 init init_aformaldef
(
816 n_id
: nullable TClassid,
817 n_type
: nullable AType
821 _n_id
= n_id
.as(not null)
824 if n_type
!= null then
829 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
831 if _n_id
== old_child
then
832 if new_child
!= null then
833 new_child
.parent
= self
834 assert new_child
isa TClassid
841 if _n_type
== old_child
then
842 if new_child
!= null then
843 new_child
.parent
= self
844 assert new_child
isa AType
853 redef fun visit_all
(v
: Visitor)
856 if _n_type
!= null then
857 v
.enter_visit
(_n_type
.as(not null))
861 redef class ASuperclass
862 private init empty_init
do end
864 init init_asuperclass
(
865 n_kwspecial
: nullable TKwspecial,
866 n_kwsuper
: nullable TKwsuper,
867 n_type
: nullable AType
871 _n_kwspecial
= n_kwspecial
872 if n_kwspecial
!= null then
873 n_kwspecial
.parent
= self
875 _n_kwsuper
= n_kwsuper
876 if n_kwsuper
!= null then
877 n_kwsuper
.parent
= self
879 _n_type
= n_type
.as(not null)
883 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
885 if _n_kwspecial
== old_child
then
886 if new_child
!= null then
887 new_child
.parent
= self
888 assert new_child
isa TKwspecial
889 _n_kwspecial
= new_child
895 if _n_kwsuper
== old_child
then
896 if new_child
!= null then
897 new_child
.parent
= self
898 assert new_child
isa TKwsuper
899 _n_kwsuper
= new_child
905 if _n_type
== old_child
then
906 if new_child
!= null then
907 new_child
.parent
= self
908 assert new_child
isa AType
917 redef fun visit_all
(v
: Visitor)
919 if _n_kwspecial
!= null then
920 v
.enter_visit
(_n_kwspecial
.as(not null))
922 if _n_kwsuper
!= null then
923 v
.enter_visit
(_n_kwsuper
.as(not null))
925 v
.enter_visit
(_n_type
)
928 redef class AAttrPropdef
929 private init empty_init
do end
931 init init_aattrpropdef
(
932 n_doc
: nullable ADoc,
933 n_readable
: nullable AAble,
934 n_writable
: nullable AAble,
935 n_kwredef
: nullable TKwredef,
936 n_visibility
: nullable AVisibility,
937 n_kwvar
: nullable TKwvar,
938 n_id
: nullable TAttrid,
939 n_type
: nullable AType,
940 n_expr
: nullable AExpr
945 if n_doc
!= null then
948 _n_readable
= n_readable
949 if n_readable
!= null then
950 n_readable
.parent
= self
952 _n_writable
= n_writable
953 if n_writable
!= null then
954 n_writable
.parent
= self
956 _n_kwredef
= n_kwredef
957 if n_kwredef
!= null then
958 n_kwredef
.parent
= self
960 _n_visibility
= n_visibility
.as(not null)
961 n_visibility
.parent
= self
962 _n_kwvar
= n_kwvar
.as(not null)
963 n_kwvar
.parent
= self
964 _n_id
= n_id
.as(not null)
967 if n_type
!= null then
971 if n_expr
!= null then
976 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
978 if _n_doc
== old_child
then
979 if new_child
!= null then
980 new_child
.parent
= self
981 assert new_child
isa ADoc
988 if _n_readable
== old_child
then
989 if new_child
!= null then
990 new_child
.parent
= self
991 assert new_child
isa AAble
992 _n_readable
= new_child
998 if _n_writable
== old_child
then
999 if new_child
!= null then
1000 new_child
.parent
= self
1001 assert new_child
isa AAble
1002 _n_writable
= new_child
1008 if _n_kwredef
== old_child
then
1009 if new_child
!= null then
1010 new_child
.parent
= self
1011 assert new_child
isa TKwredef
1012 _n_kwredef
= new_child
1018 if _n_visibility
== old_child
then
1019 if new_child
!= null then
1020 new_child
.parent
= self
1021 assert new_child
isa AVisibility
1022 _n_visibility
= new_child
1028 if _n_kwvar
== old_child
then
1029 if new_child
!= null then
1030 new_child
.parent
= self
1031 assert new_child
isa TKwvar
1032 _n_kwvar
= new_child
1038 if _n_id
== old_child
then
1039 if new_child
!= null then
1040 new_child
.parent
= self
1041 assert new_child
isa TAttrid
1048 if _n_type
== old_child
then
1049 if new_child
!= null then
1050 new_child
.parent
= self
1051 assert new_child
isa AType
1058 if _n_expr
== old_child
then
1059 if new_child
!= null then
1060 new_child
.parent
= self
1061 assert new_child
isa AExpr
1070 redef fun visit_all
(v
: Visitor)
1072 if _n_doc
!= null then
1073 v
.enter_visit
(_n_doc
.as(not null))
1075 if _n_readable
!= null then
1076 v
.enter_visit
(_n_readable
.as(not null))
1078 if _n_writable
!= null then
1079 v
.enter_visit
(_n_writable
.as(not null))
1081 if _n_kwredef
!= null then
1082 v
.enter_visit
(_n_kwredef
.as(not null))
1084 v
.enter_visit
(_n_visibility
)
1085 v
.enter_visit
(_n_kwvar
)
1086 v
.enter_visit
(_n_id
)
1087 if _n_type
!= null then
1088 v
.enter_visit
(_n_type
.as(not null))
1090 if _n_expr
!= null then
1091 v
.enter_visit
(_n_expr
.as(not null))
1095 redef class AMethPropdef
1096 private init empty_init
do end
1098 init init_amethpropdef
(
1099 n_doc
: nullable ADoc,
1100 n_kwredef
: nullable TKwredef,
1101 n_visibility
: nullable AVisibility,
1102 n_methid
: nullable AMethid,
1103 n_signature
: nullable ASignature
1108 if n_doc
!= null then
1111 _n_kwredef
= n_kwredef
1112 if n_kwredef
!= null then
1113 n_kwredef
.parent
= self
1115 _n_visibility
= n_visibility
.as(not null)
1116 n_visibility
.parent
= self
1117 _n_methid
= n_methid
.as(not null)
1118 n_methid
.parent
= self
1119 _n_signature
= n_signature
.as(not null)
1120 n_signature
.parent
= self
1123 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1125 if _n_doc
== old_child
then
1126 if new_child
!= null then
1127 new_child
.parent
= self
1128 assert new_child
isa ADoc
1135 if _n_kwredef
== old_child
then
1136 if new_child
!= null then
1137 new_child
.parent
= self
1138 assert new_child
isa TKwredef
1139 _n_kwredef
= new_child
1145 if _n_visibility
== old_child
then
1146 if new_child
!= null then
1147 new_child
.parent
= self
1148 assert new_child
isa AVisibility
1149 _n_visibility
= new_child
1155 if _n_methid
== old_child
then
1156 if new_child
!= null then
1157 new_child
.parent
= self
1158 assert new_child
isa AMethid
1159 _n_methid
= new_child
1165 if _n_signature
== old_child
then
1166 if new_child
!= null then
1167 new_child
.parent
= self
1168 assert new_child
isa ASignature
1169 _n_signature
= new_child
1177 redef fun visit_all
(v
: Visitor)
1179 if _n_doc
!= null then
1180 v
.enter_visit
(_n_doc
.as(not null))
1182 if _n_kwredef
!= null then
1183 v
.enter_visit
(_n_kwredef
.as(not null))
1185 v
.enter_visit
(_n_visibility
)
1186 v
.enter_visit
(_n_methid
)
1187 v
.enter_visit
(_n_signature
)
1190 redef class ADeferredMethPropdef
1191 private init empty_init
do end
1193 init init_adeferredmethpropdef
(
1194 n_doc
: nullable ADoc,
1195 n_kwredef
: nullable TKwredef,
1196 n_visibility
: nullable AVisibility,
1197 n_kwmeth
: nullable TKwmeth,
1198 n_methid
: nullable AMethid,
1199 n_signature
: nullable ASignature
1204 if n_doc
!= null then
1207 _n_kwredef
= n_kwredef
1208 if n_kwredef
!= null then
1209 n_kwredef
.parent
= self
1211 _n_visibility
= n_visibility
.as(not null)
1212 n_visibility
.parent
= self
1213 _n_kwmeth
= n_kwmeth
.as(not null)
1214 n_kwmeth
.parent
= self
1215 _n_methid
= n_methid
.as(not null)
1216 n_methid
.parent
= self
1217 _n_signature
= n_signature
.as(not null)
1218 n_signature
.parent
= self
1221 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1223 if _n_doc
== old_child
then
1224 if new_child
!= null then
1225 new_child
.parent
= self
1226 assert new_child
isa ADoc
1233 if _n_kwredef
== old_child
then
1234 if new_child
!= null then
1235 new_child
.parent
= self
1236 assert new_child
isa TKwredef
1237 _n_kwredef
= new_child
1243 if _n_visibility
== old_child
then
1244 if new_child
!= null then
1245 new_child
.parent
= self
1246 assert new_child
isa AVisibility
1247 _n_visibility
= new_child
1253 if _n_kwmeth
== old_child
then
1254 if new_child
!= null then
1255 new_child
.parent
= self
1256 assert new_child
isa TKwmeth
1257 _n_kwmeth
= new_child
1263 if _n_methid
== old_child
then
1264 if new_child
!= null then
1265 new_child
.parent
= self
1266 assert new_child
isa AMethid
1267 _n_methid
= new_child
1273 if _n_signature
== old_child
then
1274 if new_child
!= null then
1275 new_child
.parent
= self
1276 assert new_child
isa ASignature
1277 _n_signature
= new_child
1285 redef fun visit_all
(v
: Visitor)
1287 if _n_doc
!= null then
1288 v
.enter_visit
(_n_doc
.as(not null))
1290 if _n_kwredef
!= null then
1291 v
.enter_visit
(_n_kwredef
.as(not null))
1293 v
.enter_visit
(_n_visibility
)
1294 v
.enter_visit
(_n_kwmeth
)
1295 v
.enter_visit
(_n_methid
)
1296 v
.enter_visit
(_n_signature
)
1299 redef class AInternMethPropdef
1300 private init empty_init
do end
1302 init init_ainternmethpropdef
(
1303 n_doc
: nullable ADoc,
1304 n_kwredef
: nullable TKwredef,
1305 n_visibility
: nullable AVisibility,
1306 n_kwmeth
: nullable TKwmeth,
1307 n_methid
: nullable AMethid,
1308 n_signature
: nullable ASignature
1313 if n_doc
!= null then
1316 _n_kwredef
= n_kwredef
1317 if n_kwredef
!= null then
1318 n_kwredef
.parent
= self
1320 _n_visibility
= n_visibility
.as(not null)
1321 n_visibility
.parent
= self
1322 _n_kwmeth
= n_kwmeth
.as(not null)
1323 n_kwmeth
.parent
= self
1324 _n_methid
= n_methid
.as(not null)
1325 n_methid
.parent
= self
1326 _n_signature
= n_signature
.as(not null)
1327 n_signature
.parent
= self
1330 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1332 if _n_doc
== old_child
then
1333 if new_child
!= null then
1334 new_child
.parent
= self
1335 assert new_child
isa ADoc
1342 if _n_kwredef
== old_child
then
1343 if new_child
!= null then
1344 new_child
.parent
= self
1345 assert new_child
isa TKwredef
1346 _n_kwredef
= new_child
1352 if _n_visibility
== old_child
then
1353 if new_child
!= null then
1354 new_child
.parent
= self
1355 assert new_child
isa AVisibility
1356 _n_visibility
= new_child
1362 if _n_kwmeth
== old_child
then
1363 if new_child
!= null then
1364 new_child
.parent
= self
1365 assert new_child
isa TKwmeth
1366 _n_kwmeth
= new_child
1372 if _n_methid
== old_child
then
1373 if new_child
!= null then
1374 new_child
.parent
= self
1375 assert new_child
isa AMethid
1376 _n_methid
= new_child
1382 if _n_signature
== old_child
then
1383 if new_child
!= null then
1384 new_child
.parent
= self
1385 assert new_child
isa ASignature
1386 _n_signature
= new_child
1394 redef fun visit_all
(v
: Visitor)
1396 if _n_doc
!= null then
1397 v
.enter_visit
(_n_doc
.as(not null))
1399 if _n_kwredef
!= null then
1400 v
.enter_visit
(_n_kwredef
.as(not null))
1402 v
.enter_visit
(_n_visibility
)
1403 v
.enter_visit
(_n_kwmeth
)
1404 v
.enter_visit
(_n_methid
)
1405 v
.enter_visit
(_n_signature
)
1408 redef class AExternMethPropdef
1409 private init empty_init
do end
1411 init init_aexternmethpropdef
(
1412 n_doc
: nullable ADoc,
1413 n_kwredef
: nullable TKwredef,
1414 n_visibility
: nullable AVisibility,
1415 n_kwmeth
: nullable TKwmeth,
1416 n_methid
: nullable AMethid,
1417 n_signature
: nullable ASignature,
1418 n_extern
: nullable TString
1423 if n_doc
!= null then
1426 _n_kwredef
= n_kwredef
1427 if n_kwredef
!= null then
1428 n_kwredef
.parent
= self
1430 _n_visibility
= n_visibility
.as(not null)
1431 n_visibility
.parent
= self
1432 _n_kwmeth
= n_kwmeth
.as(not null)
1433 n_kwmeth
.parent
= self
1434 _n_methid
= n_methid
.as(not null)
1435 n_methid
.parent
= self
1436 _n_signature
= n_signature
.as(not null)
1437 n_signature
.parent
= self
1438 _n_extern
= n_extern
1439 if n_extern
!= null then
1440 n_extern
.parent
= self
1444 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1446 if _n_doc
== old_child
then
1447 if new_child
!= null then
1448 new_child
.parent
= self
1449 assert new_child
isa ADoc
1456 if _n_kwredef
== old_child
then
1457 if new_child
!= null then
1458 new_child
.parent
= self
1459 assert new_child
isa TKwredef
1460 _n_kwredef
= new_child
1466 if _n_visibility
== old_child
then
1467 if new_child
!= null then
1468 new_child
.parent
= self
1469 assert new_child
isa AVisibility
1470 _n_visibility
= new_child
1476 if _n_kwmeth
== old_child
then
1477 if new_child
!= null then
1478 new_child
.parent
= self
1479 assert new_child
isa TKwmeth
1480 _n_kwmeth
= new_child
1486 if _n_methid
== old_child
then
1487 if new_child
!= null then
1488 new_child
.parent
= self
1489 assert new_child
isa AMethid
1490 _n_methid
= new_child
1496 if _n_signature
== old_child
then
1497 if new_child
!= null then
1498 new_child
.parent
= self
1499 assert new_child
isa ASignature
1500 _n_signature
= new_child
1506 if _n_extern
== old_child
then
1507 if new_child
!= null then
1508 new_child
.parent
= self
1509 assert new_child
isa TString
1510 _n_extern
= new_child
1518 redef fun visit_all
(v
: Visitor)
1520 if _n_doc
!= null then
1521 v
.enter_visit
(_n_doc
.as(not null))
1523 if _n_kwredef
!= null then
1524 v
.enter_visit
(_n_kwredef
.as(not null))
1526 v
.enter_visit
(_n_visibility
)
1527 v
.enter_visit
(_n_kwmeth
)
1528 v
.enter_visit
(_n_methid
)
1529 v
.enter_visit
(_n_signature
)
1530 if _n_extern
!= null then
1531 v
.enter_visit
(_n_extern
.as(not null))
1535 redef class AConcreteMethPropdef
1536 private init empty_init
do end
1538 init init_aconcretemethpropdef
(
1539 n_doc
: nullable ADoc,
1540 n_kwredef
: nullable TKwredef,
1541 n_visibility
: nullable AVisibility,
1542 n_kwmeth
: nullable TKwmeth,
1543 n_methid
: nullable AMethid,
1544 n_signature
: nullable ASignature,
1545 n_block
: nullable AExpr
1550 if n_doc
!= null then
1553 _n_kwredef
= n_kwredef
1554 if n_kwredef
!= null then
1555 n_kwredef
.parent
= self
1557 _n_visibility
= n_visibility
.as(not null)
1558 n_visibility
.parent
= self
1559 _n_kwmeth
= n_kwmeth
.as(not null)
1560 n_kwmeth
.parent
= self
1561 _n_methid
= n_methid
.as(not null)
1562 n_methid
.parent
= self
1563 _n_signature
= n_signature
.as(not null)
1564 n_signature
.parent
= self
1566 if n_block
!= null then
1567 n_block
.parent
= self
1571 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1573 if _n_doc
== old_child
then
1574 if new_child
!= null then
1575 new_child
.parent
= self
1576 assert new_child
isa ADoc
1583 if _n_kwredef
== old_child
then
1584 if new_child
!= null then
1585 new_child
.parent
= self
1586 assert new_child
isa TKwredef
1587 _n_kwredef
= new_child
1593 if _n_visibility
== old_child
then
1594 if new_child
!= null then
1595 new_child
.parent
= self
1596 assert new_child
isa AVisibility
1597 _n_visibility
= new_child
1603 if _n_kwmeth
== old_child
then
1604 if new_child
!= null then
1605 new_child
.parent
= self
1606 assert new_child
isa TKwmeth
1607 _n_kwmeth
= new_child
1613 if _n_methid
== old_child
then
1614 if new_child
!= null then
1615 new_child
.parent
= self
1616 assert new_child
isa AMethid
1617 _n_methid
= new_child
1623 if _n_signature
== old_child
then
1624 if new_child
!= null then
1625 new_child
.parent
= self
1626 assert new_child
isa ASignature
1627 _n_signature
= new_child
1633 if _n_block
== old_child
then
1634 if new_child
!= null then
1635 new_child
.parent
= self
1636 assert new_child
isa AExpr
1637 _n_block
= new_child
1645 redef fun visit_all
(v
: Visitor)
1647 if _n_doc
!= null then
1648 v
.enter_visit
(_n_doc
.as(not null))
1650 if _n_kwredef
!= null then
1651 v
.enter_visit
(_n_kwredef
.as(not null))
1653 v
.enter_visit
(_n_visibility
)
1654 v
.enter_visit
(_n_kwmeth
)
1655 v
.enter_visit
(_n_methid
)
1656 v
.enter_visit
(_n_signature
)
1657 if _n_block
!= null then
1658 v
.enter_visit
(_n_block
.as(not null))
1662 redef class AConcreteInitPropdef
1663 private init empty_init
do end
1665 init init_aconcreteinitpropdef
(
1666 n_doc
: nullable ADoc,
1667 n_kwredef
: nullable TKwredef,
1668 n_visibility
: nullable AVisibility,
1669 n_kwinit
: nullable TKwinit,
1670 n_methid
: nullable AMethid,
1671 n_signature
: nullable ASignature,
1672 n_block
: nullable AExpr
1677 if n_doc
!= null then
1680 _n_kwredef
= n_kwredef
1681 if n_kwredef
!= null then
1682 n_kwredef
.parent
= self
1684 _n_visibility
= n_visibility
.as(not null)
1685 n_visibility
.parent
= self
1686 _n_kwinit
= n_kwinit
.as(not null)
1687 n_kwinit
.parent
= self
1688 _n_methid
= n_methid
1689 if n_methid
!= null then
1690 n_methid
.parent
= self
1692 _n_signature
= n_signature
.as(not null)
1693 n_signature
.parent
= self
1695 if n_block
!= null then
1696 n_block
.parent
= self
1700 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1702 if _n_doc
== old_child
then
1703 if new_child
!= null then
1704 new_child
.parent
= self
1705 assert new_child
isa ADoc
1712 if _n_kwredef
== old_child
then
1713 if new_child
!= null then
1714 new_child
.parent
= self
1715 assert new_child
isa TKwredef
1716 _n_kwredef
= new_child
1722 if _n_visibility
== old_child
then
1723 if new_child
!= null then
1724 new_child
.parent
= self
1725 assert new_child
isa AVisibility
1726 _n_visibility
= new_child
1732 if _n_kwinit
== old_child
then
1733 if new_child
!= null then
1734 new_child
.parent
= self
1735 assert new_child
isa TKwinit
1736 _n_kwinit
= new_child
1742 if _n_methid
== old_child
then
1743 if new_child
!= null then
1744 new_child
.parent
= self
1745 assert new_child
isa AMethid
1746 _n_methid
= new_child
1752 if _n_signature
== old_child
then
1753 if new_child
!= null then
1754 new_child
.parent
= self
1755 assert new_child
isa ASignature
1756 _n_signature
= new_child
1762 if _n_block
== old_child
then
1763 if new_child
!= null then
1764 new_child
.parent
= self
1765 assert new_child
isa AExpr
1766 _n_block
= new_child
1774 redef fun visit_all
(v
: Visitor)
1776 if _n_doc
!= null then
1777 v
.enter_visit
(_n_doc
.as(not null))
1779 if _n_kwredef
!= null then
1780 v
.enter_visit
(_n_kwredef
.as(not null))
1782 v
.enter_visit
(_n_visibility
)
1783 v
.enter_visit
(_n_kwinit
)
1784 if _n_methid
!= null then
1785 v
.enter_visit
(_n_methid
.as(not null))
1787 v
.enter_visit
(_n_signature
)
1788 if _n_block
!= null then
1789 v
.enter_visit
(_n_block
.as(not null))
1793 redef class AMainMethPropdef
1794 private init empty_init
do end
1796 init init_amainmethpropdef
(
1797 n_kwredef
: nullable TKwredef,
1798 n_block
: nullable AExpr
1802 _n_kwredef
= n_kwredef
1803 if n_kwredef
!= null then
1804 n_kwredef
.parent
= self
1807 if n_block
!= null then
1808 n_block
.parent
= self
1812 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1814 if _n_kwredef
== old_child
then
1815 if new_child
!= null then
1816 new_child
.parent
= self
1817 assert new_child
isa TKwredef
1818 _n_kwredef
= new_child
1824 if _n_block
== old_child
then
1825 if new_child
!= null then
1826 new_child
.parent
= self
1827 assert new_child
isa AExpr
1828 _n_block
= new_child
1836 redef fun visit_all
(v
: Visitor)
1838 if _n_kwredef
!= null then
1839 v
.enter_visit
(_n_kwredef
.as(not null))
1841 if _n_block
!= null then
1842 v
.enter_visit
(_n_block
.as(not null))
1846 redef class ATypePropdef
1847 private init empty_init
do end
1849 init init_atypepropdef
(
1850 n_doc
: nullable ADoc,
1851 n_kwredef
: nullable TKwredef,
1852 n_visibility
: nullable AVisibility,
1853 n_kwtype
: nullable TKwtype,
1854 n_id
: nullable TClassid,
1855 n_type
: nullable AType
1860 if n_doc
!= null then
1863 _n_kwredef
= n_kwredef
1864 if n_kwredef
!= null then
1865 n_kwredef
.parent
= self
1867 _n_visibility
= n_visibility
.as(not null)
1868 n_visibility
.parent
= self
1869 _n_kwtype
= n_kwtype
.as(not null)
1870 n_kwtype
.parent
= self
1871 _n_id
= n_id
.as(not null)
1873 _n_type
= n_type
.as(not null)
1874 n_type
.parent
= self
1877 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1879 if _n_doc
== old_child
then
1880 if new_child
!= null then
1881 new_child
.parent
= self
1882 assert new_child
isa ADoc
1889 if _n_kwredef
== old_child
then
1890 if new_child
!= null then
1891 new_child
.parent
= self
1892 assert new_child
isa TKwredef
1893 _n_kwredef
= new_child
1899 if _n_visibility
== old_child
then
1900 if new_child
!= null then
1901 new_child
.parent
= self
1902 assert new_child
isa AVisibility
1903 _n_visibility
= new_child
1909 if _n_kwtype
== old_child
then
1910 if new_child
!= null then
1911 new_child
.parent
= self
1912 assert new_child
isa TKwtype
1913 _n_kwtype
= new_child
1919 if _n_id
== old_child
then
1920 if new_child
!= null then
1921 new_child
.parent
= self
1922 assert new_child
isa TClassid
1929 if _n_type
== old_child
then
1930 if new_child
!= null then
1931 new_child
.parent
= self
1932 assert new_child
isa AType
1941 redef fun visit_all
(v
: Visitor)
1943 if _n_doc
!= null then
1944 v
.enter_visit
(_n_doc
.as(not null))
1946 if _n_kwredef
!= null then
1947 v
.enter_visit
(_n_kwredef
.as(not null))
1949 v
.enter_visit
(_n_visibility
)
1950 v
.enter_visit
(_n_kwtype
)
1951 v
.enter_visit
(_n_id
)
1952 v
.enter_visit
(_n_type
)
1955 redef class AReadAble
1956 private init empty_init
do end
1958 init init_areadable
(
1959 n_kwredef
: nullable TKwredef,
1960 n_kwreadable
: nullable TKwreadable
1964 _n_kwredef
= n_kwredef
1965 if n_kwredef
!= null then
1966 n_kwredef
.parent
= self
1968 _n_kwreadable
= n_kwreadable
.as(not null)
1969 n_kwreadable
.parent
= self
1972 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
1974 if _n_kwredef
== old_child
then
1975 if new_child
!= null then
1976 new_child
.parent
= self
1977 assert new_child
isa TKwredef
1978 _n_kwredef
= new_child
1984 if _n_kwreadable
== old_child
then
1985 if new_child
!= null then
1986 new_child
.parent
= self
1987 assert new_child
isa TKwreadable
1988 _n_kwreadable
= new_child
1996 redef fun visit_all
(v
: Visitor)
1998 if _n_kwredef
!= null then
1999 v
.enter_visit
(_n_kwredef
.as(not null))
2001 v
.enter_visit
(_n_kwreadable
)
2004 redef class AWriteAble
2005 private init empty_init
do end
2007 init init_awriteable
(
2008 n_kwredef
: nullable TKwredef,
2009 n_kwwritable
: nullable TKwwritable
2013 _n_kwredef
= n_kwredef
2014 if n_kwredef
!= null then
2015 n_kwredef
.parent
= self
2017 _n_kwwritable
= n_kwwritable
.as(not null)
2018 n_kwwritable
.parent
= self
2021 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2023 if _n_kwredef
== old_child
then
2024 if new_child
!= null then
2025 new_child
.parent
= self
2026 assert new_child
isa TKwredef
2027 _n_kwredef
= new_child
2033 if _n_kwwritable
== old_child
then
2034 if new_child
!= null then
2035 new_child
.parent
= self
2036 assert new_child
isa TKwwritable
2037 _n_kwwritable
= new_child
2045 redef fun visit_all
(v
: Visitor)
2047 if _n_kwredef
!= null then
2048 v
.enter_visit
(_n_kwredef
.as(not null))
2050 v
.enter_visit
(_n_kwwritable
)
2053 redef class AIdMethid
2054 private init empty_init
do end
2056 init init_aidmethid
(
2061 _n_id
= n_id
.as(not null)
2065 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2067 if _n_id
== old_child
then
2068 if new_child
!= null then
2069 new_child
.parent
= self
2070 assert new_child
isa TId
2079 redef fun visit_all
(v
: Visitor)
2081 v
.enter_visit
(_n_id
)
2084 redef class APlusMethid
2085 private init empty_init
do end
2087 init init_aplusmethid
(
2088 n_plus
: nullable TPlus
2092 _n_plus
= n_plus
.as(not null)
2093 n_plus
.parent
= self
2096 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2098 if _n_plus
== old_child
then
2099 if new_child
!= null then
2100 new_child
.parent
= self
2101 assert new_child
isa TPlus
2110 redef fun visit_all
(v
: Visitor)
2112 v
.enter_visit
(_n_plus
)
2115 redef class AMinusMethid
2116 private init empty_init
do end
2118 init init_aminusmethid
(
2119 n_minus
: nullable TMinus
2123 _n_minus
= n_minus
.as(not null)
2124 n_minus
.parent
= self
2127 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2129 if _n_minus
== old_child
then
2130 if new_child
!= null then
2131 new_child
.parent
= self
2132 assert new_child
isa TMinus
2133 _n_minus
= new_child
2141 redef fun visit_all
(v
: Visitor)
2143 v
.enter_visit
(_n_minus
)
2146 redef class AStarMethid
2147 private init empty_init
do end
2149 init init_astarmethid
(
2150 n_star
: nullable TStar
2154 _n_star
= n_star
.as(not null)
2155 n_star
.parent
= self
2158 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2160 if _n_star
== old_child
then
2161 if new_child
!= null then
2162 new_child
.parent
= self
2163 assert new_child
isa TStar
2172 redef fun visit_all
(v
: Visitor)
2174 v
.enter_visit
(_n_star
)
2177 redef class ASlashMethid
2178 private init empty_init
do end
2180 init init_aslashmethid
(
2181 n_slash
: nullable TSlash
2185 _n_slash
= n_slash
.as(not null)
2186 n_slash
.parent
= self
2189 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2191 if _n_slash
== old_child
then
2192 if new_child
!= null then
2193 new_child
.parent
= self
2194 assert new_child
isa TSlash
2195 _n_slash
= new_child
2203 redef fun visit_all
(v
: Visitor)
2205 v
.enter_visit
(_n_slash
)
2208 redef class APercentMethid
2209 private init empty_init
do end
2211 init init_apercentmethid
(
2212 n_percent
: nullable TPercent
2216 _n_percent
= n_percent
.as(not null)
2217 n_percent
.parent
= self
2220 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2222 if _n_percent
== old_child
then
2223 if new_child
!= null then
2224 new_child
.parent
= self
2225 assert new_child
isa TPercent
2226 _n_percent
= new_child
2234 redef fun visit_all
(v
: Visitor)
2236 v
.enter_visit
(_n_percent
)
2239 redef class AEqMethid
2240 private init empty_init
do end
2242 init init_aeqmethid
(
2247 _n_eq
= n_eq
.as(not null)
2251 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2253 if _n_eq
== old_child
then
2254 if new_child
!= null then
2255 new_child
.parent
= self
2256 assert new_child
isa TEq
2265 redef fun visit_all
(v
: Visitor)
2267 v
.enter_visit
(_n_eq
)
2270 redef class ANeMethid
2271 private init empty_init
do end
2273 init init_anemethid
(
2278 _n_ne
= n_ne
.as(not null)
2282 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2284 if _n_ne
== old_child
then
2285 if new_child
!= null then
2286 new_child
.parent
= self
2287 assert new_child
isa TNe
2296 redef fun visit_all
(v
: Visitor)
2298 v
.enter_visit
(_n_ne
)
2301 redef class ALeMethid
2302 private init empty_init
do end
2304 init init_alemethid
(
2309 _n_le
= n_le
.as(not null)
2313 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2315 if _n_le
== old_child
then
2316 if new_child
!= null then
2317 new_child
.parent
= self
2318 assert new_child
isa TLe
2327 redef fun visit_all
(v
: Visitor)
2329 v
.enter_visit
(_n_le
)
2332 redef class AGeMethid
2333 private init empty_init
do end
2335 init init_agemethid
(
2340 _n_ge
= n_ge
.as(not null)
2344 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2346 if _n_ge
== old_child
then
2347 if new_child
!= null then
2348 new_child
.parent
= self
2349 assert new_child
isa TGe
2358 redef fun visit_all
(v
: Visitor)
2360 v
.enter_visit
(_n_ge
)
2363 redef class ALtMethid
2364 private init empty_init
do end
2366 init init_altmethid
(
2371 _n_lt
= n_lt
.as(not null)
2375 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2377 if _n_lt
== old_child
then
2378 if new_child
!= null then
2379 new_child
.parent
= self
2380 assert new_child
isa TLt
2389 redef fun visit_all
(v
: Visitor)
2391 v
.enter_visit
(_n_lt
)
2394 redef class AGtMethid
2395 private init empty_init
do end
2397 init init_agtmethid
(
2402 _n_gt
= n_gt
.as(not null)
2406 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2408 if _n_gt
== old_child
then
2409 if new_child
!= null then
2410 new_child
.parent
= self
2411 assert new_child
isa TGt
2420 redef fun visit_all
(v
: Visitor)
2422 v
.enter_visit
(_n_gt
)
2425 redef class ABraMethid
2426 private init empty_init
do end
2428 init init_abramethid
(
2429 n_obra
: nullable TObra,
2430 n_cbra
: nullable TCbra
2434 _n_obra
= n_obra
.as(not null)
2435 n_obra
.parent
= self
2436 _n_cbra
= n_cbra
.as(not null)
2437 n_cbra
.parent
= self
2440 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2442 if _n_obra
== old_child
then
2443 if new_child
!= null then
2444 new_child
.parent
= self
2445 assert new_child
isa TObra
2452 if _n_cbra
== old_child
then
2453 if new_child
!= null then
2454 new_child
.parent
= self
2455 assert new_child
isa TCbra
2464 redef fun visit_all
(v
: Visitor)
2466 v
.enter_visit
(_n_obra
)
2467 v
.enter_visit
(_n_cbra
)
2470 redef class AStarshipMethid
2471 private init empty_init
do end
2473 init init_astarshipmethid
(
2474 n_starship
: nullable TStarship
2478 _n_starship
= n_starship
.as(not null)
2479 n_starship
.parent
= self
2482 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2484 if _n_starship
== old_child
then
2485 if new_child
!= null then
2486 new_child
.parent
= self
2487 assert new_child
isa TStarship
2488 _n_starship
= new_child
2496 redef fun visit_all
(v
: Visitor)
2498 v
.enter_visit
(_n_starship
)
2501 redef class AAssignMethid
2502 private init empty_init
do end
2504 init init_aassignmethid
(
2506 n_assign
: nullable TAssign
2510 _n_id
= n_id
.as(not null)
2512 _n_assign
= n_assign
.as(not null)
2513 n_assign
.parent
= self
2516 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2518 if _n_id
== old_child
then
2519 if new_child
!= null then
2520 new_child
.parent
= self
2521 assert new_child
isa TId
2528 if _n_assign
== old_child
then
2529 if new_child
!= null then
2530 new_child
.parent
= self
2531 assert new_child
isa TAssign
2532 _n_assign
= new_child
2540 redef fun visit_all
(v
: Visitor)
2542 v
.enter_visit
(_n_id
)
2543 v
.enter_visit
(_n_assign
)
2546 redef class ABraassignMethid
2547 private init empty_init
do end
2549 init init_abraassignmethid
(
2550 n_obra
: nullable TObra,
2551 n_cbra
: nullable TCbra,
2552 n_assign
: nullable TAssign
2556 _n_obra
= n_obra
.as(not null)
2557 n_obra
.parent
= self
2558 _n_cbra
= n_cbra
.as(not null)
2559 n_cbra
.parent
= self
2560 _n_assign
= n_assign
.as(not null)
2561 n_assign
.parent
= self
2564 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2566 if _n_obra
== old_child
then
2567 if new_child
!= null then
2568 new_child
.parent
= self
2569 assert new_child
isa TObra
2576 if _n_cbra
== old_child
then
2577 if new_child
!= null then
2578 new_child
.parent
= self
2579 assert new_child
isa TCbra
2586 if _n_assign
== old_child
then
2587 if new_child
!= null then
2588 new_child
.parent
= self
2589 assert new_child
isa TAssign
2590 _n_assign
= new_child
2598 redef fun visit_all
(v
: Visitor)
2600 v
.enter_visit
(_n_obra
)
2601 v
.enter_visit
(_n_cbra
)
2602 v
.enter_visit
(_n_assign
)
2605 redef class ASignature
2606 private init empty_init
do end
2608 init init_asignature
(
2609 n_params
: Collection[Object], # Should be Collection[AParam]
2610 n_type
: nullable AType,
2611 n_closure_decls
: Collection[Object] # Should be Collection[AClosureDecl]
2615 for n
in n_params
do
2621 if n_type
!= null then
2622 n_type
.parent
= self
2624 for n
in n_closure_decls
do
2625 assert n
isa AClosureDecl
2626 _n_closure_decls
.add
(n
)
2631 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2633 for i
in [0.._n_params
.length
[ do
2634 if _n_params
[i
] == old_child
then
2635 if new_child
!= null then
2636 assert new_child
isa AParam
2637 _n_params
[i
] = new_child
2638 new_child
.parent
= self
2640 _n_params
.remove_at
(i
)
2645 if _n_type
== old_child
then
2646 if new_child
!= null then
2647 new_child
.parent
= self
2648 assert new_child
isa AType
2655 for i
in [0.._n_closure_decls
.length
[ do
2656 if _n_closure_decls
[i
] == old_child
then
2657 if new_child
!= null then
2658 assert new_child
isa AClosureDecl
2659 _n_closure_decls
[i
] = new_child
2660 new_child
.parent
= self
2662 _n_closure_decls
.remove_at
(i
)
2669 redef fun visit_all
(v
: Visitor)
2671 for n
in _n_params
do
2674 if _n_type
!= null then
2675 v
.enter_visit
(_n_type
.as(not null))
2677 for n
in _n_closure_decls
do
2683 private init empty_init
do end
2687 n_type
: nullable AType,
2688 n_dotdotdot
: nullable TDotdotdot
2692 _n_id
= n_id
.as(not null)
2695 if n_type
!= null then
2696 n_type
.parent
= self
2698 _n_dotdotdot
= n_dotdotdot
2699 if n_dotdotdot
!= null then
2700 n_dotdotdot
.parent
= self
2704 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2706 if _n_id
== old_child
then
2707 if new_child
!= null then
2708 new_child
.parent
= self
2709 assert new_child
isa TId
2716 if _n_type
== old_child
then
2717 if new_child
!= null then
2718 new_child
.parent
= self
2719 assert new_child
isa AType
2726 if _n_dotdotdot
== old_child
then
2727 if new_child
!= null then
2728 new_child
.parent
= self
2729 assert new_child
isa TDotdotdot
2730 _n_dotdotdot
= new_child
2738 redef fun visit_all
(v
: Visitor)
2740 v
.enter_visit
(_n_id
)
2741 if _n_type
!= null then
2742 v
.enter_visit
(_n_type
.as(not null))
2744 if _n_dotdotdot
!= null then
2745 v
.enter_visit
(_n_dotdotdot
.as(not null))
2749 redef class AClosureDecl
2750 private init empty_init
do end
2752 init init_aclosuredecl
(
2753 n_kwbreak
: nullable TKwbreak,
2754 n_bang
: nullable TBang,
2756 n_signature
: nullable ASignature,
2757 n_expr
: nullable AExpr
2761 _n_kwbreak
= n_kwbreak
2762 if n_kwbreak
!= null then
2763 n_kwbreak
.parent
= self
2765 _n_bang
= n_bang
.as(not null)
2766 n_bang
.parent
= self
2767 _n_id
= n_id
.as(not null)
2769 _n_signature
= n_signature
.as(not null)
2770 n_signature
.parent
= self
2772 if n_expr
!= null then
2773 n_expr
.parent
= self
2777 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2779 if _n_kwbreak
== old_child
then
2780 if new_child
!= null then
2781 new_child
.parent
= self
2782 assert new_child
isa TKwbreak
2783 _n_kwbreak
= new_child
2789 if _n_bang
== old_child
then
2790 if new_child
!= null then
2791 new_child
.parent
= self
2792 assert new_child
isa TBang
2799 if _n_id
== old_child
then
2800 if new_child
!= null then
2801 new_child
.parent
= self
2802 assert new_child
isa TId
2809 if _n_signature
== old_child
then
2810 if new_child
!= null then
2811 new_child
.parent
= self
2812 assert new_child
isa ASignature
2813 _n_signature
= new_child
2819 if _n_expr
== old_child
then
2820 if new_child
!= null then
2821 new_child
.parent
= self
2822 assert new_child
isa AExpr
2831 redef fun visit_all
(v
: Visitor)
2833 if _n_kwbreak
!= null then
2834 v
.enter_visit
(_n_kwbreak
.as(not null))
2836 v
.enter_visit
(_n_bang
)
2837 v
.enter_visit
(_n_id
)
2838 v
.enter_visit
(_n_signature
)
2839 if _n_expr
!= null then
2840 v
.enter_visit
(_n_expr
.as(not null))
2845 private init empty_init
do end
2848 n_kwnullable
: nullable TKwnullable,
2849 n_id
: nullable TClassid,
2850 n_types
: Collection[Object] # Should be Collection[AType]
2854 _n_kwnullable
= n_kwnullable
2855 if n_kwnullable
!= null then
2856 n_kwnullable
.parent
= self
2858 _n_id
= n_id
.as(not null)
2867 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2869 if _n_kwnullable
== old_child
then
2870 if new_child
!= null then
2871 new_child
.parent
= self
2872 assert new_child
isa TKwnullable
2873 _n_kwnullable
= new_child
2875 _n_kwnullable
= null
2879 if _n_id
== old_child
then
2880 if new_child
!= null then
2881 new_child
.parent
= self
2882 assert new_child
isa TClassid
2889 for i
in [0.._n_types
.length
[ do
2890 if _n_types
[i
] == old_child
then
2891 if new_child
!= null then
2892 assert new_child
isa AType
2893 _n_types
[i
] = new_child
2894 new_child
.parent
= self
2896 _n_types
.remove_at
(i
)
2903 redef fun visit_all
(v
: Visitor)
2905 if _n_kwnullable
!= null then
2906 v
.enter_visit
(_n_kwnullable
.as(not null))
2908 v
.enter_visit
(_n_id
)
2909 for n
in _n_types
do
2915 private init empty_init
do end
2918 n_kwlabel
: nullable TKwlabel,
2923 _n_kwlabel
= n_kwlabel
.as(not null)
2924 n_kwlabel
.parent
= self
2925 _n_id
= n_id
.as(not null)
2929 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2931 if _n_kwlabel
== old_child
then
2932 if new_child
!= null then
2933 new_child
.parent
= self
2934 assert new_child
isa TKwlabel
2935 _n_kwlabel
= new_child
2941 if _n_id
== old_child
then
2942 if new_child
!= null then
2943 new_child
.parent
= self
2944 assert new_child
isa TId
2953 redef fun visit_all
(v
: Visitor)
2955 v
.enter_visit
(_n_kwlabel
)
2956 v
.enter_visit
(_n_id
)
2959 redef class ABlockExpr
2960 private init empty_init
do end
2962 init init_ablockexpr
(
2963 n_expr
: Collection[Object] # Should be Collection[AExpr]
2974 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
2976 for i
in [0.._n_expr
.length
[ do
2977 if _n_expr
[i
] == old_child
then
2978 if new_child
!= null then
2979 assert new_child
isa AExpr
2980 _n_expr
[i
] = new_child
2981 new_child
.parent
= self
2983 _n_expr
.remove_at
(i
)
2990 redef fun visit_all
(v
: Visitor)
2997 redef class AVardeclExpr
2998 private init empty_init
do end
3000 init init_avardeclexpr
(
3001 n_kwvar
: nullable TKwvar,
3003 n_type
: nullable AType,
3004 n_assign
: nullable TAssign,
3005 n_expr
: nullable AExpr
3009 _n_kwvar
= n_kwvar
.as(not null)
3010 n_kwvar
.parent
= self
3011 _n_id
= n_id
.as(not null)
3014 if n_type
!= null then
3015 n_type
.parent
= self
3017 _n_assign
= n_assign
3018 if n_assign
!= null then
3019 n_assign
.parent
= self
3022 if n_expr
!= null then
3023 n_expr
.parent
= self
3027 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3029 if _n_kwvar
== old_child
then
3030 if new_child
!= null then
3031 new_child
.parent
= self
3032 assert new_child
isa TKwvar
3033 _n_kwvar
= new_child
3039 if _n_id
== old_child
then
3040 if new_child
!= null then
3041 new_child
.parent
= self
3042 assert new_child
isa TId
3049 if _n_type
== old_child
then
3050 if new_child
!= null then
3051 new_child
.parent
= self
3052 assert new_child
isa AType
3059 if _n_assign
== old_child
then
3060 if new_child
!= null then
3061 new_child
.parent
= self
3062 assert new_child
isa TAssign
3063 _n_assign
= new_child
3069 if _n_expr
== old_child
then
3070 if new_child
!= null then
3071 new_child
.parent
= self
3072 assert new_child
isa AExpr
3081 redef fun visit_all
(v
: Visitor)
3083 v
.enter_visit
(_n_kwvar
)
3084 v
.enter_visit
(_n_id
)
3085 if _n_type
!= null then
3086 v
.enter_visit
(_n_type
.as(not null))
3088 if _n_assign
!= null then
3089 v
.enter_visit
(_n_assign
.as(not null))
3091 if _n_expr
!= null then
3092 v
.enter_visit
(_n_expr
.as(not null))
3096 redef class AReturnExpr
3097 private init empty_init
do end
3099 init init_areturnexpr
(
3100 n_kwreturn
: nullable TKwreturn,
3101 n_expr
: nullable AExpr
3105 _n_kwreturn
= n_kwreturn
3106 if n_kwreturn
!= null then
3107 n_kwreturn
.parent
= self
3110 if n_expr
!= null then
3111 n_expr
.parent
= self
3115 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3117 if _n_kwreturn
== old_child
then
3118 if new_child
!= null then
3119 new_child
.parent
= self
3120 assert new_child
isa TKwreturn
3121 _n_kwreturn
= new_child
3127 if _n_expr
== old_child
then
3128 if new_child
!= null then
3129 new_child
.parent
= self
3130 assert new_child
isa AExpr
3139 redef fun visit_all
(v
: Visitor)
3141 if _n_kwreturn
!= null then
3142 v
.enter_visit
(_n_kwreturn
.as(not null))
3144 if _n_expr
!= null then
3145 v
.enter_visit
(_n_expr
.as(not null))
3149 redef class ABreakExpr
3150 private init empty_init
do end
3152 init init_abreakexpr
(
3153 n_kwbreak
: nullable TKwbreak,
3154 n_label
: nullable ALabel,
3155 n_expr
: nullable AExpr
3159 _n_kwbreak
= n_kwbreak
.as(not null)
3160 n_kwbreak
.parent
= self
3162 if n_label
!= null then
3163 n_label
.parent
= self
3166 if n_expr
!= null then
3167 n_expr
.parent
= self
3171 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3173 if _n_kwbreak
== old_child
then
3174 if new_child
!= null then
3175 new_child
.parent
= self
3176 assert new_child
isa TKwbreak
3177 _n_kwbreak
= new_child
3183 if _n_label
== old_child
then
3184 if new_child
!= null then
3185 new_child
.parent
= self
3186 assert new_child
isa ALabel
3187 _n_label
= new_child
3193 if _n_expr
== old_child
then
3194 if new_child
!= null then
3195 new_child
.parent
= self
3196 assert new_child
isa AExpr
3205 redef fun visit_all
(v
: Visitor)
3207 v
.enter_visit
(_n_kwbreak
)
3208 if _n_label
!= null then
3209 v
.enter_visit
(_n_label
.as(not null))
3211 if _n_expr
!= null then
3212 v
.enter_visit
(_n_expr
.as(not null))
3216 redef class AAbortExpr
3217 private init empty_init
do end
3219 init init_aabortexpr
(
3220 n_kwabort
: nullable TKwabort
3224 _n_kwabort
= n_kwabort
.as(not null)
3225 n_kwabort
.parent
= self
3228 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3230 if _n_kwabort
== old_child
then
3231 if new_child
!= null then
3232 new_child
.parent
= self
3233 assert new_child
isa TKwabort
3234 _n_kwabort
= new_child
3242 redef fun visit_all
(v
: Visitor)
3244 v
.enter_visit
(_n_kwabort
)
3247 redef class AContinueExpr
3248 private init empty_init
do end
3250 init init_acontinueexpr
(
3251 n_kwcontinue
: nullable TKwcontinue,
3252 n_label
: nullable ALabel,
3253 n_expr
: nullable AExpr
3257 _n_kwcontinue
= n_kwcontinue
3258 if n_kwcontinue
!= null then
3259 n_kwcontinue
.parent
= self
3262 if n_label
!= null then
3263 n_label
.parent
= self
3266 if n_expr
!= null then
3267 n_expr
.parent
= self
3271 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3273 if _n_kwcontinue
== old_child
then
3274 if new_child
!= null then
3275 new_child
.parent
= self
3276 assert new_child
isa TKwcontinue
3277 _n_kwcontinue
= new_child
3279 _n_kwcontinue
= null
3283 if _n_label
== old_child
then
3284 if new_child
!= null then
3285 new_child
.parent
= self
3286 assert new_child
isa ALabel
3287 _n_label
= new_child
3293 if _n_expr
== old_child
then
3294 if new_child
!= null then
3295 new_child
.parent
= self
3296 assert new_child
isa AExpr
3305 redef fun visit_all
(v
: Visitor)
3307 if _n_kwcontinue
!= null then
3308 v
.enter_visit
(_n_kwcontinue
.as(not null))
3310 if _n_label
!= null then
3311 v
.enter_visit
(_n_label
.as(not null))
3313 if _n_expr
!= null then
3314 v
.enter_visit
(_n_expr
.as(not null))
3319 private init empty_init
do end
3322 n_kwdo
: nullable TKwdo,
3323 n_block
: nullable AExpr,
3324 n_label
: nullable ALabel
3328 _n_kwdo
= n_kwdo
.as(not null)
3329 n_kwdo
.parent
= self
3331 if n_block
!= null then
3332 n_block
.parent
= self
3335 if n_label
!= null then
3336 n_label
.parent
= self
3340 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3342 if _n_kwdo
== old_child
then
3343 if new_child
!= null then
3344 new_child
.parent
= self
3345 assert new_child
isa TKwdo
3352 if _n_block
== old_child
then
3353 if new_child
!= null then
3354 new_child
.parent
= self
3355 assert new_child
isa AExpr
3356 _n_block
= new_child
3362 if _n_label
== old_child
then
3363 if new_child
!= null then
3364 new_child
.parent
= self
3365 assert new_child
isa ALabel
3366 _n_label
= new_child
3374 redef fun visit_all
(v
: Visitor)
3376 v
.enter_visit
(_n_kwdo
)
3377 if _n_block
!= null then
3378 v
.enter_visit
(_n_block
.as(not null))
3380 if _n_label
!= null then
3381 v
.enter_visit
(_n_label
.as(not null))
3386 private init empty_init
do end
3389 n_kwif
: nullable TKwif,
3390 n_expr
: nullable AExpr,
3391 n_then
: nullable AExpr,
3392 n_else
: nullable AExpr
3396 _n_kwif
= n_kwif
.as(not null)
3397 n_kwif
.parent
= self
3398 _n_expr
= n_expr
.as(not null)
3399 n_expr
.parent
= self
3401 if n_then
!= null then
3402 n_then
.parent
= self
3405 if n_else
!= null then
3406 n_else
.parent
= self
3410 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3412 if _n_kwif
== old_child
then
3413 if new_child
!= null then
3414 new_child
.parent
= self
3415 assert new_child
isa TKwif
3422 if _n_expr
== old_child
then
3423 if new_child
!= null then
3424 new_child
.parent
= self
3425 assert new_child
isa AExpr
3432 if _n_then
== old_child
then
3433 if new_child
!= null then
3434 new_child
.parent
= self
3435 assert new_child
isa AExpr
3442 if _n_else
== old_child
then
3443 if new_child
!= null then
3444 new_child
.parent
= self
3445 assert new_child
isa AExpr
3454 redef fun visit_all
(v
: Visitor)
3456 v
.enter_visit
(_n_kwif
)
3457 v
.enter_visit
(_n_expr
)
3458 if _n_then
!= null then
3459 v
.enter_visit
(_n_then
.as(not null))
3461 if _n_else
!= null then
3462 v
.enter_visit
(_n_else
.as(not null))
3466 redef class AIfexprExpr
3467 private init empty_init
do end
3469 init init_aifexprexpr
(
3470 n_kwif
: nullable TKwif,
3471 n_expr
: nullable AExpr,
3472 n_kwthen
: nullable TKwthen,
3473 n_then
: nullable AExpr,
3474 n_kwelse
: nullable TKwelse,
3475 n_else
: nullable AExpr
3479 _n_kwif
= n_kwif
.as(not null)
3480 n_kwif
.parent
= self
3481 _n_expr
= n_expr
.as(not null)
3482 n_expr
.parent
= self
3483 _n_kwthen
= n_kwthen
.as(not null)
3484 n_kwthen
.parent
= self
3485 _n_then
= n_then
.as(not null)
3486 n_then
.parent
= self
3487 _n_kwelse
= n_kwelse
.as(not null)
3488 n_kwelse
.parent
= self
3489 _n_else
= n_else
.as(not null)
3490 n_else
.parent
= self
3493 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3495 if _n_kwif
== old_child
then
3496 if new_child
!= null then
3497 new_child
.parent
= self
3498 assert new_child
isa TKwif
3505 if _n_expr
== old_child
then
3506 if new_child
!= null then
3507 new_child
.parent
= self
3508 assert new_child
isa AExpr
3515 if _n_kwthen
== old_child
then
3516 if new_child
!= null then
3517 new_child
.parent
= self
3518 assert new_child
isa TKwthen
3519 _n_kwthen
= new_child
3525 if _n_then
== old_child
then
3526 if new_child
!= null then
3527 new_child
.parent
= self
3528 assert new_child
isa AExpr
3535 if _n_kwelse
== old_child
then
3536 if new_child
!= null then
3537 new_child
.parent
= self
3538 assert new_child
isa TKwelse
3539 _n_kwelse
= new_child
3545 if _n_else
== old_child
then
3546 if new_child
!= null then
3547 new_child
.parent
= self
3548 assert new_child
isa AExpr
3557 redef fun visit_all
(v
: Visitor)
3559 v
.enter_visit
(_n_kwif
)
3560 v
.enter_visit
(_n_expr
)
3561 v
.enter_visit
(_n_kwthen
)
3562 v
.enter_visit
(_n_then
)
3563 v
.enter_visit
(_n_kwelse
)
3564 v
.enter_visit
(_n_else
)
3567 redef class AWhileExpr
3568 private init empty_init
do end
3570 init init_awhileexpr
(
3571 n_kwwhile
: nullable TKwwhile,
3572 n_expr
: nullable AExpr,
3573 n_kwdo
: nullable TKwdo,
3574 n_block
: nullable AExpr,
3575 n_label
: nullable ALabel
3579 _n_kwwhile
= n_kwwhile
.as(not null)
3580 n_kwwhile
.parent
= self
3581 _n_expr
= n_expr
.as(not null)
3582 n_expr
.parent
= self
3583 _n_kwdo
= n_kwdo
.as(not null)
3584 n_kwdo
.parent
= self
3586 if n_block
!= null then
3587 n_block
.parent
= self
3590 if n_label
!= null then
3591 n_label
.parent
= self
3595 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3597 if _n_kwwhile
== old_child
then
3598 if new_child
!= null then
3599 new_child
.parent
= self
3600 assert new_child
isa TKwwhile
3601 _n_kwwhile
= new_child
3607 if _n_expr
== old_child
then
3608 if new_child
!= null then
3609 new_child
.parent
= self
3610 assert new_child
isa AExpr
3617 if _n_kwdo
== old_child
then
3618 if new_child
!= null then
3619 new_child
.parent
= self
3620 assert new_child
isa TKwdo
3627 if _n_block
== old_child
then
3628 if new_child
!= null then
3629 new_child
.parent
= self
3630 assert new_child
isa AExpr
3631 _n_block
= new_child
3637 if _n_label
== old_child
then
3638 if new_child
!= null then
3639 new_child
.parent
= self
3640 assert new_child
isa ALabel
3641 _n_label
= new_child
3649 redef fun visit_all
(v
: Visitor)
3651 v
.enter_visit
(_n_kwwhile
)
3652 v
.enter_visit
(_n_expr
)
3653 v
.enter_visit
(_n_kwdo
)
3654 if _n_block
!= null then
3655 v
.enter_visit
(_n_block
.as(not null))
3657 if _n_label
!= null then
3658 v
.enter_visit
(_n_label
.as(not null))
3662 redef class ALoopExpr
3663 private init empty_init
do end
3665 init init_aloopexpr
(
3666 n_kwloop
: nullable TKwloop,
3667 n_block
: nullable AExpr,
3668 n_label
: nullable ALabel
3672 _n_kwloop
= n_kwloop
.as(not null)
3673 n_kwloop
.parent
= self
3675 if n_block
!= null then
3676 n_block
.parent
= self
3679 if n_label
!= null then
3680 n_label
.parent
= self
3684 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3686 if _n_kwloop
== old_child
then
3687 if new_child
!= null then
3688 new_child
.parent
= self
3689 assert new_child
isa TKwloop
3690 _n_kwloop
= new_child
3696 if _n_block
== old_child
then
3697 if new_child
!= null then
3698 new_child
.parent
= self
3699 assert new_child
isa AExpr
3700 _n_block
= new_child
3706 if _n_label
== old_child
then
3707 if new_child
!= null then
3708 new_child
.parent
= self
3709 assert new_child
isa ALabel
3710 _n_label
= new_child
3718 redef fun visit_all
(v
: Visitor)
3720 v
.enter_visit
(_n_kwloop
)
3721 if _n_block
!= null then
3722 v
.enter_visit
(_n_block
.as(not null))
3724 if _n_label
!= null then
3725 v
.enter_visit
(_n_label
.as(not null))
3729 redef class AForExpr
3730 private init empty_init
do end
3732 init init_aforexpr
(
3733 n_kwfor
: nullable TKwfor,
3735 n_expr
: nullable AExpr,
3736 n_kwdo
: nullable TKwdo,
3737 n_block
: nullable AExpr,
3738 n_label
: nullable ALabel
3742 _n_kwfor
= n_kwfor
.as(not null)
3743 n_kwfor
.parent
= self
3744 _n_id
= n_id
.as(not null)
3746 _n_expr
= n_expr
.as(not null)
3747 n_expr
.parent
= self
3748 _n_kwdo
= n_kwdo
.as(not null)
3749 n_kwdo
.parent
= self
3751 if n_block
!= null then
3752 n_block
.parent
= self
3755 if n_label
!= null then
3756 n_label
.parent
= self
3760 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3762 if _n_kwfor
== old_child
then
3763 if new_child
!= null then
3764 new_child
.parent
= self
3765 assert new_child
isa TKwfor
3766 _n_kwfor
= new_child
3772 if _n_id
== old_child
then
3773 if new_child
!= null then
3774 new_child
.parent
= self
3775 assert new_child
isa TId
3782 if _n_expr
== old_child
then
3783 if new_child
!= null then
3784 new_child
.parent
= self
3785 assert new_child
isa AExpr
3792 if _n_kwdo
== old_child
then
3793 if new_child
!= null then
3794 new_child
.parent
= self
3795 assert new_child
isa TKwdo
3802 if _n_block
== old_child
then
3803 if new_child
!= null then
3804 new_child
.parent
= self
3805 assert new_child
isa AExpr
3806 _n_block
= new_child
3812 if _n_label
== old_child
then
3813 if new_child
!= null then
3814 new_child
.parent
= self
3815 assert new_child
isa ALabel
3816 _n_label
= new_child
3824 redef fun visit_all
(v
: Visitor)
3826 v
.enter_visit
(_n_kwfor
)
3827 v
.enter_visit
(_n_id
)
3828 v
.enter_visit
(_n_expr
)
3829 v
.enter_visit
(_n_kwdo
)
3830 if _n_block
!= null then
3831 v
.enter_visit
(_n_block
.as(not null))
3833 if _n_label
!= null then
3834 v
.enter_visit
(_n_label
.as(not null))
3838 redef class AAssertExpr
3839 private init empty_init
do end
3841 init init_aassertexpr
(
3842 n_kwassert
: nullable TKwassert,
3844 n_expr
: nullable AExpr,
3845 n_else
: nullable AExpr
3849 _n_kwassert
= n_kwassert
.as(not null)
3850 n_kwassert
.parent
= self
3852 if n_id
!= null then
3855 _n_expr
= n_expr
.as(not null)
3856 n_expr
.parent
= self
3858 if n_else
!= null then
3859 n_else
.parent
= self
3863 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3865 if _n_kwassert
== old_child
then
3866 if new_child
!= null then
3867 new_child
.parent
= self
3868 assert new_child
isa TKwassert
3869 _n_kwassert
= new_child
3875 if _n_id
== old_child
then
3876 if new_child
!= null then
3877 new_child
.parent
= self
3878 assert new_child
isa TId
3885 if _n_expr
== old_child
then
3886 if new_child
!= null then
3887 new_child
.parent
= self
3888 assert new_child
isa AExpr
3895 if _n_else
== old_child
then
3896 if new_child
!= null then
3897 new_child
.parent
= self
3898 assert new_child
isa AExpr
3907 redef fun visit_all
(v
: Visitor)
3909 v
.enter_visit
(_n_kwassert
)
3910 if _n_id
!= null then
3911 v
.enter_visit
(_n_id
.as(not null))
3913 v
.enter_visit
(_n_expr
)
3914 if _n_else
!= null then
3915 v
.enter_visit
(_n_else
.as(not null))
3919 redef class AOnceExpr
3920 private init empty_init
do end
3922 init init_aonceexpr
(
3923 n_kwonce
: nullable TKwonce,
3924 n_expr
: nullable AExpr
3928 _n_kwonce
= n_kwonce
.as(not null)
3929 n_kwonce
.parent
= self
3930 _n_expr
= n_expr
.as(not null)
3931 n_expr
.parent
= self
3934 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3936 if _n_kwonce
== old_child
then
3937 if new_child
!= null then
3938 new_child
.parent
= self
3939 assert new_child
isa TKwonce
3940 _n_kwonce
= new_child
3946 if _n_expr
== old_child
then
3947 if new_child
!= null then
3948 new_child
.parent
= self
3949 assert new_child
isa AExpr
3958 redef fun visit_all
(v
: Visitor)
3960 v
.enter_visit
(_n_kwonce
)
3961 v
.enter_visit
(_n_expr
)
3964 redef class ASendExpr
3965 private init empty_init
do end
3967 init init_asendexpr
(
3968 n_expr
: nullable AExpr
3972 _n_expr
= n_expr
.as(not null)
3973 n_expr
.parent
= self
3976 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
3978 if _n_expr
== old_child
then
3979 if new_child
!= null then
3980 new_child
.parent
= self
3981 assert new_child
isa AExpr
3990 redef fun visit_all
(v
: Visitor)
3992 v
.enter_visit
(_n_expr
)
3995 redef class ABinopExpr
3996 private init empty_init
do end
3998 init init_abinopexpr
(
3999 n_expr
: nullable AExpr,
4000 n_expr2
: nullable AExpr
4004 _n_expr
= n_expr
.as(not null)
4005 n_expr
.parent
= self
4006 _n_expr2
= n_expr2
.as(not null)
4007 n_expr2
.parent
= self
4010 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4012 if _n_expr
== old_child
then
4013 if new_child
!= null then
4014 new_child
.parent
= self
4015 assert new_child
isa AExpr
4022 if _n_expr2
== old_child
then
4023 if new_child
!= null then
4024 new_child
.parent
= self
4025 assert new_child
isa AExpr
4026 _n_expr2
= new_child
4034 redef fun visit_all
(v
: Visitor)
4036 v
.enter_visit
(_n_expr
)
4037 v
.enter_visit
(_n_expr2
)
4041 private init empty_init
do end
4044 n_expr
: nullable AExpr,
4045 n_expr2
: nullable AExpr
4049 _n_expr
= n_expr
.as(not null)
4050 n_expr
.parent
= self
4051 _n_expr2
= n_expr2
.as(not null)
4052 n_expr2
.parent
= self
4055 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4057 if _n_expr
== old_child
then
4058 if new_child
!= null then
4059 new_child
.parent
= self
4060 assert new_child
isa AExpr
4067 if _n_expr2
== old_child
then
4068 if new_child
!= null then
4069 new_child
.parent
= self
4070 assert new_child
isa AExpr
4071 _n_expr2
= new_child
4079 redef fun visit_all
(v
: Visitor)
4081 v
.enter_visit
(_n_expr
)
4082 v
.enter_visit
(_n_expr2
)
4085 redef class AAndExpr
4086 private init empty_init
do end
4088 init init_aandexpr
(
4089 n_expr
: nullable AExpr,
4090 n_expr2
: nullable AExpr
4094 _n_expr
= n_expr
.as(not null)
4095 n_expr
.parent
= self
4096 _n_expr2
= n_expr2
.as(not null)
4097 n_expr2
.parent
= self
4100 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4102 if _n_expr
== old_child
then
4103 if new_child
!= null then
4104 new_child
.parent
= self
4105 assert new_child
isa AExpr
4112 if _n_expr2
== old_child
then
4113 if new_child
!= null then
4114 new_child
.parent
= self
4115 assert new_child
isa AExpr
4116 _n_expr2
= new_child
4124 redef fun visit_all
(v
: Visitor)
4126 v
.enter_visit
(_n_expr
)
4127 v
.enter_visit
(_n_expr2
)
4130 redef class ANotExpr
4131 private init empty_init
do end
4133 init init_anotexpr
(
4134 n_kwnot
: nullable TKwnot,
4135 n_expr
: nullable AExpr
4139 _n_kwnot
= n_kwnot
.as(not null)
4140 n_kwnot
.parent
= self
4141 _n_expr
= n_expr
.as(not null)
4142 n_expr
.parent
= self
4145 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4147 if _n_kwnot
== old_child
then
4148 if new_child
!= null then
4149 new_child
.parent
= self
4150 assert new_child
isa TKwnot
4151 _n_kwnot
= new_child
4157 if _n_expr
== old_child
then
4158 if new_child
!= null then
4159 new_child
.parent
= self
4160 assert new_child
isa AExpr
4169 redef fun visit_all
(v
: Visitor)
4171 v
.enter_visit
(_n_kwnot
)
4172 v
.enter_visit
(_n_expr
)
4176 private init empty_init
do end
4179 n_expr
: nullable AExpr,
4180 n_expr2
: nullable AExpr
4184 _n_expr
= n_expr
.as(not null)
4185 n_expr
.parent
= self
4186 _n_expr2
= n_expr2
.as(not null)
4187 n_expr2
.parent
= self
4190 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4192 if _n_expr
== old_child
then
4193 if new_child
!= null then
4194 new_child
.parent
= self
4195 assert new_child
isa AExpr
4202 if _n_expr2
== old_child
then
4203 if new_child
!= null then
4204 new_child
.parent
= self
4205 assert new_child
isa AExpr
4206 _n_expr2
= new_child
4214 redef fun visit_all
(v
: Visitor)
4216 v
.enter_visit
(_n_expr
)
4217 v
.enter_visit
(_n_expr2
)
4221 private init empty_init
do end
4224 n_expr
: nullable AExpr,
4225 n_expr2
: nullable AExpr
4229 _n_expr
= n_expr
.as(not null)
4230 n_expr
.parent
= self
4231 _n_expr2
= n_expr2
.as(not null)
4232 n_expr2
.parent
= self
4235 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4237 if _n_expr
== old_child
then
4238 if new_child
!= null then
4239 new_child
.parent
= self
4240 assert new_child
isa AExpr
4247 if _n_expr2
== old_child
then
4248 if new_child
!= null then
4249 new_child
.parent
= self
4250 assert new_child
isa AExpr
4251 _n_expr2
= new_child
4259 redef fun visit_all
(v
: Visitor)
4261 v
.enter_visit
(_n_expr
)
4262 v
.enter_visit
(_n_expr2
)
4266 private init empty_init
do end
4269 n_expr
: nullable AExpr,
4270 n_expr2
: nullable AExpr
4274 _n_expr
= n_expr
.as(not null)
4275 n_expr
.parent
= self
4276 _n_expr2
= n_expr2
.as(not null)
4277 n_expr2
.parent
= self
4280 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4282 if _n_expr
== old_child
then
4283 if new_child
!= null then
4284 new_child
.parent
= self
4285 assert new_child
isa AExpr
4292 if _n_expr2
== old_child
then
4293 if new_child
!= null then
4294 new_child
.parent
= self
4295 assert new_child
isa AExpr
4296 _n_expr2
= new_child
4304 redef fun visit_all
(v
: Visitor)
4306 v
.enter_visit
(_n_expr
)
4307 v
.enter_visit
(_n_expr2
)
4311 private init empty_init
do end
4314 n_expr
: nullable AExpr,
4315 n_expr2
: nullable AExpr
4319 _n_expr
= n_expr
.as(not null)
4320 n_expr
.parent
= self
4321 _n_expr2
= n_expr2
.as(not null)
4322 n_expr2
.parent
= self
4325 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4327 if _n_expr
== old_child
then
4328 if new_child
!= null then
4329 new_child
.parent
= self
4330 assert new_child
isa AExpr
4337 if _n_expr2
== old_child
then
4338 if new_child
!= null then
4339 new_child
.parent
= self
4340 assert new_child
isa AExpr
4341 _n_expr2
= new_child
4349 redef fun visit_all
(v
: Visitor)
4351 v
.enter_visit
(_n_expr
)
4352 v
.enter_visit
(_n_expr2
)
4356 private init empty_init
do end
4359 n_expr
: nullable AExpr,
4360 n_expr2
: nullable AExpr
4364 _n_expr
= n_expr
.as(not null)
4365 n_expr
.parent
= self
4366 _n_expr2
= n_expr2
.as(not null)
4367 n_expr2
.parent
= self
4370 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4372 if _n_expr
== old_child
then
4373 if new_child
!= null then
4374 new_child
.parent
= self
4375 assert new_child
isa AExpr
4382 if _n_expr2
== old_child
then
4383 if new_child
!= null then
4384 new_child
.parent
= self
4385 assert new_child
isa AExpr
4386 _n_expr2
= new_child
4394 redef fun visit_all
(v
: Visitor)
4396 v
.enter_visit
(_n_expr
)
4397 v
.enter_visit
(_n_expr2
)
4401 private init empty_init
do end
4404 n_expr
: nullable AExpr,
4405 n_expr2
: nullable AExpr
4409 _n_expr
= n_expr
.as(not null)
4410 n_expr
.parent
= self
4411 _n_expr2
= n_expr2
.as(not null)
4412 n_expr2
.parent
= self
4415 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4417 if _n_expr
== old_child
then
4418 if new_child
!= null then
4419 new_child
.parent
= self
4420 assert new_child
isa AExpr
4427 if _n_expr2
== old_child
then
4428 if new_child
!= null then
4429 new_child
.parent
= self
4430 assert new_child
isa AExpr
4431 _n_expr2
= new_child
4439 redef fun visit_all
(v
: Visitor)
4441 v
.enter_visit
(_n_expr
)
4442 v
.enter_visit
(_n_expr2
)
4446 private init empty_init
do end
4449 n_expr
: nullable AExpr,
4450 n_expr2
: nullable AExpr
4454 _n_expr
= n_expr
.as(not null)
4455 n_expr
.parent
= self
4456 _n_expr2
= n_expr2
.as(not null)
4457 n_expr2
.parent
= self
4460 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4462 if _n_expr
== old_child
then
4463 if new_child
!= null then
4464 new_child
.parent
= self
4465 assert new_child
isa AExpr
4472 if _n_expr2
== old_child
then
4473 if new_child
!= null then
4474 new_child
.parent
= self
4475 assert new_child
isa AExpr
4476 _n_expr2
= new_child
4484 redef fun visit_all
(v
: Visitor)
4486 v
.enter_visit
(_n_expr
)
4487 v
.enter_visit
(_n_expr2
)
4490 redef class AIsaExpr
4491 private init empty_init
do end
4493 init init_aisaexpr
(
4494 n_expr
: nullable AExpr,
4495 n_type
: nullable AType
4499 _n_expr
= n_expr
.as(not null)
4500 n_expr
.parent
= self
4501 _n_type
= n_type
.as(not null)
4502 n_type
.parent
= self
4505 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4507 if _n_expr
== old_child
then
4508 if new_child
!= null then
4509 new_child
.parent
= self
4510 assert new_child
isa AExpr
4517 if _n_type
== old_child
then
4518 if new_child
!= null then
4519 new_child
.parent
= self
4520 assert new_child
isa AType
4529 redef fun visit_all
(v
: Visitor)
4531 v
.enter_visit
(_n_expr
)
4532 v
.enter_visit
(_n_type
)
4535 redef class APlusExpr
4536 private init empty_init
do end
4538 init init_aplusexpr
(
4539 n_expr
: nullable AExpr,
4540 n_expr2
: nullable AExpr
4544 _n_expr
= n_expr
.as(not null)
4545 n_expr
.parent
= self
4546 _n_expr2
= n_expr2
.as(not null)
4547 n_expr2
.parent
= self
4550 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4552 if _n_expr
== old_child
then
4553 if new_child
!= null then
4554 new_child
.parent
= self
4555 assert new_child
isa AExpr
4562 if _n_expr2
== old_child
then
4563 if new_child
!= null then
4564 new_child
.parent
= self
4565 assert new_child
isa AExpr
4566 _n_expr2
= new_child
4574 redef fun visit_all
(v
: Visitor)
4576 v
.enter_visit
(_n_expr
)
4577 v
.enter_visit
(_n_expr2
)
4580 redef class AMinusExpr
4581 private init empty_init
do end
4583 init init_aminusexpr
(
4584 n_expr
: nullable AExpr,
4585 n_expr2
: nullable AExpr
4589 _n_expr
= n_expr
.as(not null)
4590 n_expr
.parent
= self
4591 _n_expr2
= n_expr2
.as(not null)
4592 n_expr2
.parent
= self
4595 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4597 if _n_expr
== old_child
then
4598 if new_child
!= null then
4599 new_child
.parent
= self
4600 assert new_child
isa AExpr
4607 if _n_expr2
== old_child
then
4608 if new_child
!= null then
4609 new_child
.parent
= self
4610 assert new_child
isa AExpr
4611 _n_expr2
= new_child
4619 redef fun visit_all
(v
: Visitor)
4621 v
.enter_visit
(_n_expr
)
4622 v
.enter_visit
(_n_expr2
)
4625 redef class AStarshipExpr
4626 private init empty_init
do end
4628 init init_astarshipexpr
(
4629 n_expr
: nullable AExpr,
4630 n_expr2
: nullable AExpr
4634 _n_expr
= n_expr
.as(not null)
4635 n_expr
.parent
= self
4636 _n_expr2
= n_expr2
.as(not null)
4637 n_expr2
.parent
= self
4640 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4642 if _n_expr
== old_child
then
4643 if new_child
!= null then
4644 new_child
.parent
= self
4645 assert new_child
isa AExpr
4652 if _n_expr2
== old_child
then
4653 if new_child
!= null then
4654 new_child
.parent
= self
4655 assert new_child
isa AExpr
4656 _n_expr2
= new_child
4664 redef fun visit_all
(v
: Visitor)
4666 v
.enter_visit
(_n_expr
)
4667 v
.enter_visit
(_n_expr2
)
4670 redef class AStarExpr
4671 private init empty_init
do end
4673 init init_astarexpr
(
4674 n_expr
: nullable AExpr,
4675 n_expr2
: nullable AExpr
4679 _n_expr
= n_expr
.as(not null)
4680 n_expr
.parent
= self
4681 _n_expr2
= n_expr2
.as(not null)
4682 n_expr2
.parent
= self
4685 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4687 if _n_expr
== old_child
then
4688 if new_child
!= null then
4689 new_child
.parent
= self
4690 assert new_child
isa AExpr
4697 if _n_expr2
== old_child
then
4698 if new_child
!= null then
4699 new_child
.parent
= self
4700 assert new_child
isa AExpr
4701 _n_expr2
= new_child
4709 redef fun visit_all
(v
: Visitor)
4711 v
.enter_visit
(_n_expr
)
4712 v
.enter_visit
(_n_expr2
)
4715 redef class ASlashExpr
4716 private init empty_init
do end
4718 init init_aslashexpr
(
4719 n_expr
: nullable AExpr,
4720 n_expr2
: nullable AExpr
4724 _n_expr
= n_expr
.as(not null)
4725 n_expr
.parent
= self
4726 _n_expr2
= n_expr2
.as(not null)
4727 n_expr2
.parent
= self
4730 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4732 if _n_expr
== old_child
then
4733 if new_child
!= null then
4734 new_child
.parent
= self
4735 assert new_child
isa AExpr
4742 if _n_expr2
== old_child
then
4743 if new_child
!= null then
4744 new_child
.parent
= self
4745 assert new_child
isa AExpr
4746 _n_expr2
= new_child
4754 redef fun visit_all
(v
: Visitor)
4756 v
.enter_visit
(_n_expr
)
4757 v
.enter_visit
(_n_expr2
)
4760 redef class APercentExpr
4761 private init empty_init
do end
4763 init init_apercentexpr
(
4764 n_expr
: nullable AExpr,
4765 n_expr2
: nullable AExpr
4769 _n_expr
= n_expr
.as(not null)
4770 n_expr
.parent
= self
4771 _n_expr2
= n_expr2
.as(not null)
4772 n_expr2
.parent
= self
4775 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4777 if _n_expr
== old_child
then
4778 if new_child
!= null then
4779 new_child
.parent
= self
4780 assert new_child
isa AExpr
4787 if _n_expr2
== old_child
then
4788 if new_child
!= null then
4789 new_child
.parent
= self
4790 assert new_child
isa AExpr
4791 _n_expr2
= new_child
4799 redef fun visit_all
(v
: Visitor)
4801 v
.enter_visit
(_n_expr
)
4802 v
.enter_visit
(_n_expr2
)
4805 redef class AUminusExpr
4806 private init empty_init
do end
4808 init init_auminusexpr
(
4809 n_minus
: nullable TMinus,
4810 n_expr
: nullable AExpr
4814 _n_minus
= n_minus
.as(not null)
4815 n_minus
.parent
= self
4816 _n_expr
= n_expr
.as(not null)
4817 n_expr
.parent
= self
4820 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4822 if _n_minus
== old_child
then
4823 if new_child
!= null then
4824 new_child
.parent
= self
4825 assert new_child
isa TMinus
4826 _n_minus
= new_child
4832 if _n_expr
== old_child
then
4833 if new_child
!= null then
4834 new_child
.parent
= self
4835 assert new_child
isa AExpr
4844 redef fun visit_all
(v
: Visitor)
4846 v
.enter_visit
(_n_minus
)
4847 v
.enter_visit
(_n_expr
)
4850 redef class ANewExpr
4851 private init empty_init
do end
4853 init init_anewexpr
(
4854 n_kwnew
: nullable TKwnew,
4855 n_type
: nullable AType,
4857 n_args
: Collection[Object] # Should be Collection[AExpr]
4861 _n_kwnew
= n_kwnew
.as(not null)
4862 n_kwnew
.parent
= self
4863 _n_type
= n_type
.as(not null)
4864 n_type
.parent
= self
4866 if n_id
!= null then
4876 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4878 if _n_kwnew
== old_child
then
4879 if new_child
!= null then
4880 new_child
.parent
= self
4881 assert new_child
isa TKwnew
4882 _n_kwnew
= new_child
4888 if _n_type
== old_child
then
4889 if new_child
!= null then
4890 new_child
.parent
= self
4891 assert new_child
isa AType
4898 if _n_id
== old_child
then
4899 if new_child
!= null then
4900 new_child
.parent
= self
4901 assert new_child
isa TId
4908 for i
in [0.._n_args
.length
[ do
4909 if _n_args
[i
] == old_child
then
4910 if new_child
!= null then
4911 assert new_child
isa AExpr
4912 _n_args
[i
] = new_child
4913 new_child
.parent
= self
4915 _n_args
.remove_at
(i
)
4922 redef fun visit_all
(v
: Visitor)
4924 v
.enter_visit
(_n_kwnew
)
4925 v
.enter_visit
(_n_type
)
4926 if _n_id
!= null then
4927 v
.enter_visit
(_n_id
.as(not null))
4934 redef class AAttrExpr
4935 private init empty_init
do end
4937 init init_aattrexpr
(
4938 n_expr
: nullable AExpr,
4939 n_id
: nullable TAttrid
4943 _n_expr
= n_expr
.as(not null)
4944 n_expr
.parent
= self
4945 _n_id
= n_id
.as(not null)
4949 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
4951 if _n_expr
== old_child
then
4952 if new_child
!= null then
4953 new_child
.parent
= self
4954 assert new_child
isa AExpr
4961 if _n_id
== old_child
then
4962 if new_child
!= null then
4963 new_child
.parent
= self
4964 assert new_child
isa TAttrid
4973 redef fun visit_all
(v
: Visitor)
4975 v
.enter_visit
(_n_expr
)
4976 v
.enter_visit
(_n_id
)
4979 redef class AAttrAssignExpr
4980 private init empty_init
do end
4982 init init_aattrassignexpr
(
4983 n_expr
: nullable AExpr,
4984 n_id
: nullable TAttrid,
4985 n_assign
: nullable TAssign,
4986 n_value
: nullable AExpr
4990 _n_expr
= n_expr
.as(not null)
4991 n_expr
.parent
= self
4992 _n_id
= n_id
.as(not null)
4994 _n_assign
= n_assign
.as(not null)
4995 n_assign
.parent
= self
4996 _n_value
= n_value
.as(not null)
4997 n_value
.parent
= self
5000 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5002 if _n_expr
== old_child
then
5003 if new_child
!= null then
5004 new_child
.parent
= self
5005 assert new_child
isa AExpr
5012 if _n_id
== old_child
then
5013 if new_child
!= null then
5014 new_child
.parent
= self
5015 assert new_child
isa TAttrid
5022 if _n_assign
== old_child
then
5023 if new_child
!= null then
5024 new_child
.parent
= self
5025 assert new_child
isa TAssign
5026 _n_assign
= new_child
5032 if _n_value
== old_child
then
5033 if new_child
!= null then
5034 new_child
.parent
= self
5035 assert new_child
isa AExpr
5036 _n_value
= new_child
5044 redef fun visit_all
(v
: Visitor)
5046 v
.enter_visit
(_n_expr
)
5047 v
.enter_visit
(_n_id
)
5048 v
.enter_visit
(_n_assign
)
5049 v
.enter_visit
(_n_value
)
5052 redef class AAttrReassignExpr
5053 private init empty_init
do end
5055 init init_aattrreassignexpr
(
5056 n_expr
: nullable AExpr,
5057 n_id
: nullable TAttrid,
5058 n_assign_op
: nullable AAssignOp,
5059 n_value
: nullable AExpr
5063 _n_expr
= n_expr
.as(not null)
5064 n_expr
.parent
= self
5065 _n_id
= n_id
.as(not null)
5067 _n_assign_op
= n_assign_op
.as(not null)
5068 n_assign_op
.parent
= self
5069 _n_value
= n_value
.as(not null)
5070 n_value
.parent
= self
5073 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5075 if _n_expr
== old_child
then
5076 if new_child
!= null then
5077 new_child
.parent
= self
5078 assert new_child
isa AExpr
5085 if _n_id
== old_child
then
5086 if new_child
!= null then
5087 new_child
.parent
= self
5088 assert new_child
isa TAttrid
5095 if _n_assign_op
== old_child
then
5096 if new_child
!= null then
5097 new_child
.parent
= self
5098 assert new_child
isa AAssignOp
5099 _n_assign_op
= new_child
5105 if _n_value
== old_child
then
5106 if new_child
!= null then
5107 new_child
.parent
= self
5108 assert new_child
isa AExpr
5109 _n_value
= new_child
5117 redef fun visit_all
(v
: Visitor)
5119 v
.enter_visit
(_n_expr
)
5120 v
.enter_visit
(_n_id
)
5121 v
.enter_visit
(_n_assign_op
)
5122 v
.enter_visit
(_n_value
)
5125 redef class ACallExpr
5126 private init empty_init
do end
5128 init init_acallexpr
(
5129 n_expr
: nullable AExpr,
5131 n_args
: Collection[Object], # Should be Collection[AExpr]
5132 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5136 _n_expr
= n_expr
.as(not null)
5137 n_expr
.parent
= self
5138 _n_id
= n_id
.as(not null)
5145 for n
in n_closure_defs
do
5146 assert n
isa AClosureDef
5147 _n_closure_defs
.add
(n
)
5152 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5154 if _n_expr
== old_child
then
5155 if new_child
!= null then
5156 new_child
.parent
= self
5157 assert new_child
isa AExpr
5164 if _n_id
== old_child
then
5165 if new_child
!= null then
5166 new_child
.parent
= self
5167 assert new_child
isa TId
5174 for i
in [0.._n_args
.length
[ do
5175 if _n_args
[i
] == old_child
then
5176 if new_child
!= null then
5177 assert new_child
isa AExpr
5178 _n_args
[i
] = new_child
5179 new_child
.parent
= self
5181 _n_args
.remove_at
(i
)
5186 for i
in [0.._n_closure_defs
.length
[ do
5187 if _n_closure_defs
[i
] == old_child
then
5188 if new_child
!= null then
5189 assert new_child
isa AClosureDef
5190 _n_closure_defs
[i
] = new_child
5191 new_child
.parent
= self
5193 _n_closure_defs
.remove_at
(i
)
5200 redef fun visit_all
(v
: Visitor)
5202 v
.enter_visit
(_n_expr
)
5203 v
.enter_visit
(_n_id
)
5207 for n
in _n_closure_defs
do
5212 redef class ACallAssignExpr
5213 private init empty_init
do end
5215 init init_acallassignexpr
(
5216 n_expr
: nullable AExpr,
5218 n_args
: Collection[Object], # Should be Collection[AExpr]
5219 n_assign
: nullable TAssign,
5220 n_value
: nullable AExpr
5224 _n_expr
= n_expr
.as(not null)
5225 n_expr
.parent
= self
5226 _n_id
= n_id
.as(not null)
5233 _n_assign
= n_assign
.as(not null)
5234 n_assign
.parent
= self
5235 _n_value
= n_value
.as(not null)
5236 n_value
.parent
= self
5239 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5241 if _n_expr
== old_child
then
5242 if new_child
!= null then
5243 new_child
.parent
= self
5244 assert new_child
isa AExpr
5251 if _n_id
== old_child
then
5252 if new_child
!= null then
5253 new_child
.parent
= self
5254 assert new_child
isa TId
5261 for i
in [0.._n_args
.length
[ do
5262 if _n_args
[i
] == old_child
then
5263 if new_child
!= null then
5264 assert new_child
isa AExpr
5265 _n_args
[i
] = new_child
5266 new_child
.parent
= self
5268 _n_args
.remove_at
(i
)
5273 if _n_assign
== old_child
then
5274 if new_child
!= null then
5275 new_child
.parent
= self
5276 assert new_child
isa TAssign
5277 _n_assign
= new_child
5283 if _n_value
== old_child
then
5284 if new_child
!= null then
5285 new_child
.parent
= self
5286 assert new_child
isa AExpr
5287 _n_value
= new_child
5295 redef fun visit_all
(v
: Visitor)
5297 v
.enter_visit
(_n_expr
)
5298 v
.enter_visit
(_n_id
)
5302 v
.enter_visit
(_n_assign
)
5303 v
.enter_visit
(_n_value
)
5306 redef class ACallReassignExpr
5307 private init empty_init
do end
5309 init init_acallreassignexpr
(
5310 n_expr
: nullable AExpr,
5312 n_args
: Collection[Object], # Should be Collection[AExpr]
5313 n_assign_op
: nullable AAssignOp,
5314 n_value
: nullable AExpr
5318 _n_expr
= n_expr
.as(not null)
5319 n_expr
.parent
= self
5320 _n_id
= n_id
.as(not null)
5327 _n_assign_op
= n_assign_op
.as(not null)
5328 n_assign_op
.parent
= self
5329 _n_value
= n_value
.as(not null)
5330 n_value
.parent
= self
5333 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5335 if _n_expr
== old_child
then
5336 if new_child
!= null then
5337 new_child
.parent
= self
5338 assert new_child
isa AExpr
5345 if _n_id
== old_child
then
5346 if new_child
!= null then
5347 new_child
.parent
= self
5348 assert new_child
isa TId
5355 for i
in [0.._n_args
.length
[ do
5356 if _n_args
[i
] == old_child
then
5357 if new_child
!= null then
5358 assert new_child
isa AExpr
5359 _n_args
[i
] = new_child
5360 new_child
.parent
= self
5362 _n_args
.remove_at
(i
)
5367 if _n_assign_op
== old_child
then
5368 if new_child
!= null then
5369 new_child
.parent
= self
5370 assert new_child
isa AAssignOp
5371 _n_assign_op
= new_child
5377 if _n_value
== old_child
then
5378 if new_child
!= null then
5379 new_child
.parent
= self
5380 assert new_child
isa AExpr
5381 _n_value
= new_child
5389 redef fun visit_all
(v
: Visitor)
5391 v
.enter_visit
(_n_expr
)
5392 v
.enter_visit
(_n_id
)
5396 v
.enter_visit
(_n_assign_op
)
5397 v
.enter_visit
(_n_value
)
5400 redef class ASuperExpr
5401 private init empty_init
do end
5403 init init_asuperexpr
(
5404 n_qualified
: nullable AQualified,
5405 n_kwsuper
: nullable TKwsuper,
5406 n_args
: Collection[Object] # Should be Collection[AExpr]
5410 _n_qualified
= n_qualified
5411 if n_qualified
!= null then
5412 n_qualified
.parent
= self
5414 _n_kwsuper
= n_kwsuper
.as(not null)
5415 n_kwsuper
.parent
= self
5423 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5425 if _n_qualified
== old_child
then
5426 if new_child
!= null then
5427 new_child
.parent
= self
5428 assert new_child
isa AQualified
5429 _n_qualified
= new_child
5435 if _n_kwsuper
== old_child
then
5436 if new_child
!= null then
5437 new_child
.parent
= self
5438 assert new_child
isa TKwsuper
5439 _n_kwsuper
= new_child
5445 for i
in [0.._n_args
.length
[ do
5446 if _n_args
[i
] == old_child
then
5447 if new_child
!= null then
5448 assert new_child
isa AExpr
5449 _n_args
[i
] = new_child
5450 new_child
.parent
= self
5452 _n_args
.remove_at
(i
)
5459 redef fun visit_all
(v
: Visitor)
5461 if _n_qualified
!= null then
5462 v
.enter_visit
(_n_qualified
.as(not null))
5464 v
.enter_visit
(_n_kwsuper
)
5470 redef class AInitExpr
5471 private init empty_init
do end
5473 init init_ainitexpr
(
5474 n_expr
: nullable AExpr,
5475 n_kwinit
: nullable TKwinit,
5476 n_args
: Collection[Object] # Should be Collection[AExpr]
5480 _n_expr
= n_expr
.as(not null)
5481 n_expr
.parent
= self
5482 _n_kwinit
= n_kwinit
.as(not null)
5483 n_kwinit
.parent
= self
5491 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5493 if _n_expr
== old_child
then
5494 if new_child
!= null then
5495 new_child
.parent
= self
5496 assert new_child
isa AExpr
5503 if _n_kwinit
== old_child
then
5504 if new_child
!= null then
5505 new_child
.parent
= self
5506 assert new_child
isa TKwinit
5507 _n_kwinit
= new_child
5513 for i
in [0.._n_args
.length
[ do
5514 if _n_args
[i
] == old_child
then
5515 if new_child
!= null then
5516 assert new_child
isa AExpr
5517 _n_args
[i
] = new_child
5518 new_child
.parent
= self
5520 _n_args
.remove_at
(i
)
5527 redef fun visit_all
(v
: Visitor)
5529 v
.enter_visit
(_n_expr
)
5530 v
.enter_visit
(_n_kwinit
)
5536 redef class ABraExpr
5537 private init empty_init
do end
5539 init init_abraexpr
(
5540 n_expr
: nullable AExpr,
5541 n_args
: Collection[Object], # Should be Collection[AExpr]
5542 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5546 _n_expr
= n_expr
.as(not null)
5547 n_expr
.parent
= self
5553 for n
in n_closure_defs
do
5554 assert n
isa AClosureDef
5555 _n_closure_defs
.add
(n
)
5560 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5562 if _n_expr
== old_child
then
5563 if new_child
!= null then
5564 new_child
.parent
= self
5565 assert new_child
isa AExpr
5572 for i
in [0.._n_args
.length
[ do
5573 if _n_args
[i
] == old_child
then
5574 if new_child
!= null then
5575 assert new_child
isa AExpr
5576 _n_args
[i
] = new_child
5577 new_child
.parent
= self
5579 _n_args
.remove_at
(i
)
5584 for i
in [0.._n_closure_defs
.length
[ do
5585 if _n_closure_defs
[i
] == old_child
then
5586 if new_child
!= null then
5587 assert new_child
isa AClosureDef
5588 _n_closure_defs
[i
] = new_child
5589 new_child
.parent
= self
5591 _n_closure_defs
.remove_at
(i
)
5598 redef fun visit_all
(v
: Visitor)
5600 v
.enter_visit
(_n_expr
)
5604 for n
in _n_closure_defs
do
5609 redef class ABraAssignExpr
5610 private init empty_init
do end
5612 init init_abraassignexpr
(
5613 n_expr
: nullable AExpr,
5614 n_args
: Collection[Object], # Should be Collection[AExpr]
5615 n_assign
: nullable TAssign,
5616 n_value
: nullable AExpr
5620 _n_expr
= n_expr
.as(not null)
5621 n_expr
.parent
= self
5627 _n_assign
= n_assign
.as(not null)
5628 n_assign
.parent
= self
5629 _n_value
= n_value
.as(not null)
5630 n_value
.parent
= self
5633 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5635 if _n_expr
== old_child
then
5636 if new_child
!= null then
5637 new_child
.parent
= self
5638 assert new_child
isa AExpr
5645 for i
in [0.._n_args
.length
[ do
5646 if _n_args
[i
] == old_child
then
5647 if new_child
!= null then
5648 assert new_child
isa AExpr
5649 _n_args
[i
] = new_child
5650 new_child
.parent
= self
5652 _n_args
.remove_at
(i
)
5657 if _n_assign
== old_child
then
5658 if new_child
!= null then
5659 new_child
.parent
= self
5660 assert new_child
isa TAssign
5661 _n_assign
= new_child
5667 if _n_value
== old_child
then
5668 if new_child
!= null then
5669 new_child
.parent
= self
5670 assert new_child
isa AExpr
5671 _n_value
= new_child
5679 redef fun visit_all
(v
: Visitor)
5681 v
.enter_visit
(_n_expr
)
5685 v
.enter_visit
(_n_assign
)
5686 v
.enter_visit
(_n_value
)
5689 redef class ABraReassignExpr
5690 private init empty_init
do end
5692 init init_abrareassignexpr
(
5693 n_expr
: nullable AExpr,
5694 n_args
: Collection[Object], # Should be Collection[AExpr]
5695 n_assign_op
: nullable AAssignOp,
5696 n_value
: nullable AExpr
5700 _n_expr
= n_expr
.as(not null)
5701 n_expr
.parent
= self
5707 _n_assign_op
= n_assign_op
.as(not null)
5708 n_assign_op
.parent
= self
5709 _n_value
= n_value
.as(not null)
5710 n_value
.parent
= self
5713 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5715 if _n_expr
== old_child
then
5716 if new_child
!= null then
5717 new_child
.parent
= self
5718 assert new_child
isa AExpr
5725 for i
in [0.._n_args
.length
[ do
5726 if _n_args
[i
] == old_child
then
5727 if new_child
!= null then
5728 assert new_child
isa AExpr
5729 _n_args
[i
] = new_child
5730 new_child
.parent
= self
5732 _n_args
.remove_at
(i
)
5737 if _n_assign_op
== old_child
then
5738 if new_child
!= null then
5739 new_child
.parent
= self
5740 assert new_child
isa AAssignOp
5741 _n_assign_op
= new_child
5747 if _n_value
== old_child
then
5748 if new_child
!= null then
5749 new_child
.parent
= self
5750 assert new_child
isa AExpr
5751 _n_value
= new_child
5759 redef fun visit_all
(v
: Visitor)
5761 v
.enter_visit
(_n_expr
)
5765 v
.enter_visit
(_n_assign_op
)
5766 v
.enter_visit
(_n_value
)
5769 redef class AClosureCallExpr
5770 private init empty_init
do end
5772 init init_aclosurecallexpr
(
5774 n_args
: Collection[Object], # Should be Collection[AExpr]
5775 n_closure_defs
: Collection[Object] # Should be Collection[AClosureDef]
5779 _n_id
= n_id
.as(not null)
5786 for n
in n_closure_defs
do
5787 assert n
isa AClosureDef
5788 _n_closure_defs
.add
(n
)
5793 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5795 if _n_id
== old_child
then
5796 if new_child
!= null then
5797 new_child
.parent
= self
5798 assert new_child
isa TId
5805 for i
in [0.._n_args
.length
[ do
5806 if _n_args
[i
] == old_child
then
5807 if new_child
!= null then
5808 assert new_child
isa AExpr
5809 _n_args
[i
] = new_child
5810 new_child
.parent
= self
5812 _n_args
.remove_at
(i
)
5817 for i
in [0.._n_closure_defs
.length
[ do
5818 if _n_closure_defs
[i
] == old_child
then
5819 if new_child
!= null then
5820 assert new_child
isa AClosureDef
5821 _n_closure_defs
[i
] = new_child
5822 new_child
.parent
= self
5824 _n_closure_defs
.remove_at
(i
)
5831 redef fun visit_all
(v
: Visitor)
5833 v
.enter_visit
(_n_id
)
5837 for n
in _n_closure_defs
do
5842 redef class AVarExpr
5843 private init empty_init
do end
5845 init init_avarexpr
(
5850 _n_id
= n_id
.as(not null)
5854 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5856 if _n_id
== old_child
then
5857 if new_child
!= null then
5858 new_child
.parent
= self
5859 assert new_child
isa TId
5868 redef fun visit_all
(v
: Visitor)
5870 v
.enter_visit
(_n_id
)
5873 redef class AVarAssignExpr
5874 private init empty_init
do end
5876 init init_avarassignexpr
(
5878 n_assign
: nullable TAssign,
5879 n_value
: nullable AExpr
5883 _n_id
= n_id
.as(not null)
5885 _n_assign
= n_assign
.as(not null)
5886 n_assign
.parent
= self
5887 _n_value
= n_value
.as(not null)
5888 n_value
.parent
= self
5891 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5893 if _n_id
== old_child
then
5894 if new_child
!= null then
5895 new_child
.parent
= self
5896 assert new_child
isa TId
5903 if _n_assign
== old_child
then
5904 if new_child
!= null then
5905 new_child
.parent
= self
5906 assert new_child
isa TAssign
5907 _n_assign
= new_child
5913 if _n_value
== old_child
then
5914 if new_child
!= null then
5915 new_child
.parent
= self
5916 assert new_child
isa AExpr
5917 _n_value
= new_child
5925 redef fun visit_all
(v
: Visitor)
5927 v
.enter_visit
(_n_id
)
5928 v
.enter_visit
(_n_assign
)
5929 v
.enter_visit
(_n_value
)
5932 redef class AVarReassignExpr
5933 private init empty_init
do end
5935 init init_avarreassignexpr
(
5937 n_assign_op
: nullable AAssignOp,
5938 n_value
: nullable AExpr
5942 _n_id
= n_id
.as(not null)
5944 _n_assign_op
= n_assign_op
.as(not null)
5945 n_assign_op
.parent
= self
5946 _n_value
= n_value
.as(not null)
5947 n_value
.parent
= self
5950 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
5952 if _n_id
== old_child
then
5953 if new_child
!= null then
5954 new_child
.parent
= self
5955 assert new_child
isa TId
5962 if _n_assign_op
== old_child
then
5963 if new_child
!= null then
5964 new_child
.parent
= self
5965 assert new_child
isa AAssignOp
5966 _n_assign_op
= new_child
5972 if _n_value
== old_child
then
5973 if new_child
!= null then
5974 new_child
.parent
= self
5975 assert new_child
isa AExpr
5976 _n_value
= new_child
5984 redef fun visit_all
(v
: Visitor)
5986 v
.enter_visit
(_n_id
)
5987 v
.enter_visit
(_n_assign_op
)
5988 v
.enter_visit
(_n_value
)
5991 redef class ARangeExpr
5992 private init empty_init
do end
5994 init init_arangeexpr
(
5995 n_expr
: nullable AExpr,
5996 n_expr2
: nullable AExpr
6000 _n_expr
= n_expr
.as(not null)
6001 n_expr
.parent
= self
6002 _n_expr2
= n_expr2
.as(not null)
6003 n_expr2
.parent
= self
6006 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6008 if _n_expr
== old_child
then
6009 if new_child
!= null then
6010 new_child
.parent
= self
6011 assert new_child
isa AExpr
6018 if _n_expr2
== old_child
then
6019 if new_child
!= null then
6020 new_child
.parent
= self
6021 assert new_child
isa AExpr
6022 _n_expr2
= new_child
6030 redef fun visit_all
(v
: Visitor)
6032 v
.enter_visit
(_n_expr
)
6033 v
.enter_visit
(_n_expr2
)
6036 redef class ACrangeExpr
6037 private init empty_init
do end
6039 init init_acrangeexpr
(
6040 n_expr
: nullable AExpr,
6041 n_expr2
: nullable AExpr
6045 _n_expr
= n_expr
.as(not null)
6046 n_expr
.parent
= self
6047 _n_expr2
= n_expr2
.as(not null)
6048 n_expr2
.parent
= self
6051 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6053 if _n_expr
== old_child
then
6054 if new_child
!= null then
6055 new_child
.parent
= self
6056 assert new_child
isa AExpr
6063 if _n_expr2
== old_child
then
6064 if new_child
!= null then
6065 new_child
.parent
= self
6066 assert new_child
isa AExpr
6067 _n_expr2
= new_child
6075 redef fun visit_all
(v
: Visitor)
6077 v
.enter_visit
(_n_expr
)
6078 v
.enter_visit
(_n_expr2
)
6081 redef class AOrangeExpr
6082 private init empty_init
do end
6084 init init_aorangeexpr
(
6085 n_expr
: nullable AExpr,
6086 n_expr2
: nullable AExpr
6090 _n_expr
= n_expr
.as(not null)
6091 n_expr
.parent
= self
6092 _n_expr2
= n_expr2
.as(not null)
6093 n_expr2
.parent
= self
6096 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6098 if _n_expr
== old_child
then
6099 if new_child
!= null then
6100 new_child
.parent
= self
6101 assert new_child
isa AExpr
6108 if _n_expr2
== old_child
then
6109 if new_child
!= null then
6110 new_child
.parent
= self
6111 assert new_child
isa AExpr
6112 _n_expr2
= new_child
6120 redef fun visit_all
(v
: Visitor)
6122 v
.enter_visit
(_n_expr
)
6123 v
.enter_visit
(_n_expr2
)
6126 redef class AArrayExpr
6127 private init empty_init
do end
6129 init init_aarrayexpr
(
6130 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6141 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6143 for i
in [0.._n_exprs
.length
[ do
6144 if _n_exprs
[i
] == old_child
then
6145 if new_child
!= null then
6146 assert new_child
isa AExpr
6147 _n_exprs
[i
] = new_child
6148 new_child
.parent
= self
6150 _n_exprs
.remove_at
(i
)
6157 redef fun visit_all
(v
: Visitor)
6159 for n
in _n_exprs
do
6164 redef class ASelfExpr
6165 private init empty_init
do end
6167 init init_aselfexpr
(
6168 n_kwself
: nullable TKwself
6172 _n_kwself
= n_kwself
.as(not null)
6173 n_kwself
.parent
= self
6176 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6178 if _n_kwself
== old_child
then
6179 if new_child
!= null then
6180 new_child
.parent
= self
6181 assert new_child
isa TKwself
6182 _n_kwself
= new_child
6190 redef fun visit_all
(v
: Visitor)
6192 v
.enter_visit
(_n_kwself
)
6195 redef class AImplicitSelfExpr
6196 private init empty_init
do end
6198 init init_aimplicitselfexpr
6203 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6207 redef fun visit_all
(v
: Visitor)
6211 redef class ATrueExpr
6212 private init empty_init
do end
6214 init init_atrueexpr
(
6215 n_kwtrue
: nullable TKwtrue
6219 _n_kwtrue
= n_kwtrue
.as(not null)
6220 n_kwtrue
.parent
= self
6223 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6225 if _n_kwtrue
== old_child
then
6226 if new_child
!= null then
6227 new_child
.parent
= self
6228 assert new_child
isa TKwtrue
6229 _n_kwtrue
= new_child
6237 redef fun visit_all
(v
: Visitor)
6239 v
.enter_visit
(_n_kwtrue
)
6242 redef class AFalseExpr
6243 private init empty_init
do end
6245 init init_afalseexpr
(
6246 n_kwfalse
: nullable TKwfalse
6250 _n_kwfalse
= n_kwfalse
.as(not null)
6251 n_kwfalse
.parent
= self
6254 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6256 if _n_kwfalse
== old_child
then
6257 if new_child
!= null then
6258 new_child
.parent
= self
6259 assert new_child
isa TKwfalse
6260 _n_kwfalse
= new_child
6268 redef fun visit_all
(v
: Visitor)
6270 v
.enter_visit
(_n_kwfalse
)
6273 redef class ANullExpr
6274 private init empty_init
do end
6276 init init_anullexpr
(
6277 n_kwnull
: nullable TKwnull
6281 _n_kwnull
= n_kwnull
.as(not null)
6282 n_kwnull
.parent
= self
6285 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6287 if _n_kwnull
== old_child
then
6288 if new_child
!= null then
6289 new_child
.parent
= self
6290 assert new_child
isa TKwnull
6291 _n_kwnull
= new_child
6299 redef fun visit_all
(v
: Visitor)
6301 v
.enter_visit
(_n_kwnull
)
6304 redef class AIntExpr
6305 private init empty_init
do end
6307 init init_aintexpr
(
6308 n_number
: nullable TNumber
6312 _n_number
= n_number
.as(not null)
6313 n_number
.parent
= self
6316 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6318 if _n_number
== old_child
then
6319 if new_child
!= null then
6320 new_child
.parent
= self
6321 assert new_child
isa TNumber
6322 _n_number
= new_child
6330 redef fun visit_all
(v
: Visitor)
6332 v
.enter_visit
(_n_number
)
6335 redef class AFloatExpr
6336 private init empty_init
do end
6338 init init_afloatexpr
(
6339 n_float
: nullable TFloat
6343 _n_float
= n_float
.as(not null)
6344 n_float
.parent
= self
6347 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6349 if _n_float
== old_child
then
6350 if new_child
!= null then
6351 new_child
.parent
= self
6352 assert new_child
isa TFloat
6353 _n_float
= new_child
6361 redef fun visit_all
(v
: Visitor)
6363 v
.enter_visit
(_n_float
)
6366 redef class ACharExpr
6367 private init empty_init
do end
6369 init init_acharexpr
(
6370 n_char
: nullable TChar
6374 _n_char
= n_char
.as(not null)
6375 n_char
.parent
= self
6378 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6380 if _n_char
== old_child
then
6381 if new_child
!= null then
6382 new_child
.parent
= self
6383 assert new_child
isa TChar
6392 redef fun visit_all
(v
: Visitor)
6394 v
.enter_visit
(_n_char
)
6397 redef class AStringExpr
6398 private init empty_init
do end
6400 init init_astringexpr
(
6401 n_string
: nullable TString
6405 _n_string
= n_string
.as(not null)
6406 n_string
.parent
= self
6409 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6411 if _n_string
== old_child
then
6412 if new_child
!= null then
6413 new_child
.parent
= self
6414 assert new_child
isa TString
6415 _n_string
= new_child
6423 redef fun visit_all
(v
: Visitor)
6425 v
.enter_visit
(_n_string
)
6428 redef class AStartStringExpr
6429 private init empty_init
do end
6431 init init_astartstringexpr
(
6432 n_string
: nullable TStartString
6436 _n_string
= n_string
.as(not null)
6437 n_string
.parent
= self
6440 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6442 if _n_string
== old_child
then
6443 if new_child
!= null then
6444 new_child
.parent
= self
6445 assert new_child
isa TStartString
6446 _n_string
= new_child
6454 redef fun visit_all
(v
: Visitor)
6456 v
.enter_visit
(_n_string
)
6459 redef class AMidStringExpr
6460 private init empty_init
do end
6462 init init_amidstringexpr
(
6463 n_string
: nullable TMidString
6467 _n_string
= n_string
.as(not null)
6468 n_string
.parent
= self
6471 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6473 if _n_string
== old_child
then
6474 if new_child
!= null then
6475 new_child
.parent
= self
6476 assert new_child
isa TMidString
6477 _n_string
= new_child
6485 redef fun visit_all
(v
: Visitor)
6487 v
.enter_visit
(_n_string
)
6490 redef class AEndStringExpr
6491 private init empty_init
do end
6493 init init_aendstringexpr
(
6494 n_string
: nullable TEndString
6498 _n_string
= n_string
.as(not null)
6499 n_string
.parent
= self
6502 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6504 if _n_string
== old_child
then
6505 if new_child
!= null then
6506 new_child
.parent
= self
6507 assert new_child
isa TEndString
6508 _n_string
= new_child
6516 redef fun visit_all
(v
: Visitor)
6518 v
.enter_visit
(_n_string
)
6521 redef class ASuperstringExpr
6522 private init empty_init
do end
6524 init init_asuperstringexpr
(
6525 n_exprs
: Collection[Object] # Should be Collection[AExpr]
6536 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6538 for i
in [0.._n_exprs
.length
[ do
6539 if _n_exprs
[i
] == old_child
then
6540 if new_child
!= null then
6541 assert new_child
isa AExpr
6542 _n_exprs
[i
] = new_child
6543 new_child
.parent
= self
6545 _n_exprs
.remove_at
(i
)
6552 redef fun visit_all
(v
: Visitor)
6554 for n
in _n_exprs
do
6559 redef class AParExpr
6560 private init empty_init
do end
6562 init init_aparexpr
(
6563 n_expr
: nullable AExpr
6567 _n_expr
= n_expr
.as(not null)
6568 n_expr
.parent
= self
6571 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6573 if _n_expr
== old_child
then
6574 if new_child
!= null then
6575 new_child
.parent
= self
6576 assert new_child
isa AExpr
6585 redef fun visit_all
(v
: Visitor)
6587 v
.enter_visit
(_n_expr
)
6590 redef class AAsCastExpr
6591 private init empty_init
do end
6593 init init_aascastexpr
(
6594 n_expr
: nullable AExpr,
6595 n_kwas
: nullable TKwas,
6596 n_type
: nullable AType
6600 _n_expr
= n_expr
.as(not null)
6601 n_expr
.parent
= self
6602 _n_kwas
= n_kwas
.as(not null)
6603 n_kwas
.parent
= self
6604 _n_type
= n_type
.as(not null)
6605 n_type
.parent
= self
6608 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6610 if _n_expr
== old_child
then
6611 if new_child
!= null then
6612 new_child
.parent
= self
6613 assert new_child
isa AExpr
6620 if _n_kwas
== old_child
then
6621 if new_child
!= null then
6622 new_child
.parent
= self
6623 assert new_child
isa TKwas
6630 if _n_type
== old_child
then
6631 if new_child
!= null then
6632 new_child
.parent
= self
6633 assert new_child
isa AType
6642 redef fun visit_all
(v
: Visitor)
6644 v
.enter_visit
(_n_expr
)
6645 v
.enter_visit
(_n_kwas
)
6646 v
.enter_visit
(_n_type
)
6649 redef class AAsNotnullExpr
6650 private init empty_init
do end
6652 init init_aasnotnullexpr
(
6653 n_expr
: nullable AExpr,
6654 n_kwas
: nullable TKwas,
6655 n_kwnot
: nullable TKwnot,
6656 n_kwnull
: nullable TKwnull
6660 _n_expr
= n_expr
.as(not null)
6661 n_expr
.parent
= self
6662 _n_kwas
= n_kwas
.as(not null)
6663 n_kwas
.parent
= self
6664 _n_kwnot
= n_kwnot
.as(not null)
6665 n_kwnot
.parent
= self
6666 _n_kwnull
= n_kwnull
.as(not null)
6667 n_kwnull
.parent
= self
6670 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6672 if _n_expr
== old_child
then
6673 if new_child
!= null then
6674 new_child
.parent
= self
6675 assert new_child
isa AExpr
6682 if _n_kwas
== old_child
then
6683 if new_child
!= null then
6684 new_child
.parent
= self
6685 assert new_child
isa TKwas
6692 if _n_kwnot
== old_child
then
6693 if new_child
!= null then
6694 new_child
.parent
= self
6695 assert new_child
isa TKwnot
6696 _n_kwnot
= new_child
6702 if _n_kwnull
== old_child
then
6703 if new_child
!= null then
6704 new_child
.parent
= self
6705 assert new_child
isa TKwnull
6706 _n_kwnull
= new_child
6714 redef fun visit_all
(v
: Visitor)
6716 v
.enter_visit
(_n_expr
)
6717 v
.enter_visit
(_n_kwas
)
6718 v
.enter_visit
(_n_kwnot
)
6719 v
.enter_visit
(_n_kwnull
)
6722 redef class AIssetAttrExpr
6723 private init empty_init
do end
6725 init init_aissetattrexpr
(
6726 n_kwisset
: nullable TKwisset,
6727 n_expr
: nullable AExpr,
6728 n_id
: nullable TAttrid
6732 _n_kwisset
= n_kwisset
.as(not null)
6733 n_kwisset
.parent
= self
6734 _n_expr
= n_expr
.as(not null)
6735 n_expr
.parent
= self
6736 _n_id
= n_id
.as(not null)
6740 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6742 if _n_kwisset
== old_child
then
6743 if new_child
!= null then
6744 new_child
.parent
= self
6745 assert new_child
isa TKwisset
6746 _n_kwisset
= new_child
6752 if _n_expr
== old_child
then
6753 if new_child
!= null then
6754 new_child
.parent
= self
6755 assert new_child
isa AExpr
6762 if _n_id
== old_child
then
6763 if new_child
!= null then
6764 new_child
.parent
= self
6765 assert new_child
isa TAttrid
6774 redef fun visit_all
(v
: Visitor)
6776 v
.enter_visit
(_n_kwisset
)
6777 v
.enter_visit
(_n_expr
)
6778 v
.enter_visit
(_n_id
)
6781 redef class APlusAssignOp
6782 private init empty_init
do end
6784 init init_aplusassignop
(
6785 n_pluseq
: nullable TPluseq
6789 _n_pluseq
= n_pluseq
.as(not null)
6790 n_pluseq
.parent
= self
6793 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6795 if _n_pluseq
== old_child
then
6796 if new_child
!= null then
6797 new_child
.parent
= self
6798 assert new_child
isa TPluseq
6799 _n_pluseq
= new_child
6807 redef fun visit_all
(v
: Visitor)
6809 v
.enter_visit
(_n_pluseq
)
6812 redef class AMinusAssignOp
6813 private init empty_init
do end
6815 init init_aminusassignop
(
6816 n_minuseq
: nullable TMinuseq
6820 _n_minuseq
= n_minuseq
.as(not null)
6821 n_minuseq
.parent
= self
6824 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6826 if _n_minuseq
== old_child
then
6827 if new_child
!= null then
6828 new_child
.parent
= self
6829 assert new_child
isa TMinuseq
6830 _n_minuseq
= new_child
6838 redef fun visit_all
(v
: Visitor)
6840 v
.enter_visit
(_n_minuseq
)
6843 redef class AClosureDef
6844 private init empty_init
do end
6846 init init_aclosuredef
(
6847 n_bang
: nullable TBang,
6848 n_id
: nullable AClosureId,
6849 n_ids
: Collection[Object], # Should be Collection[TId]
6850 n_kwdo
: nullable TKwdo,
6851 n_expr
: nullable AExpr,
6852 n_label
: nullable ALabel
6856 _n_bang
= n_bang
.as(not null)
6857 n_bang
.parent
= self
6858 _n_id
= n_id
.as(not null)
6866 if n_kwdo
!= null then
6867 n_kwdo
.parent
= self
6870 if n_expr
!= null then
6871 n_expr
.parent
= self
6874 if n_label
!= null then
6875 n_label
.parent
= self
6879 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6881 if _n_bang
== old_child
then
6882 if new_child
!= null then
6883 new_child
.parent
= self
6884 assert new_child
isa TBang
6891 if _n_id
== old_child
then
6892 if new_child
!= null then
6893 new_child
.parent
= self
6894 assert new_child
isa AClosureId
6901 for i
in [0.._n_ids
.length
[ do
6902 if _n_ids
[i
] == old_child
then
6903 if new_child
!= null then
6904 assert new_child
isa TId
6905 _n_ids
[i
] = new_child
6906 new_child
.parent
= self
6913 if _n_kwdo
== old_child
then
6914 if new_child
!= null then
6915 new_child
.parent
= self
6916 assert new_child
isa TKwdo
6923 if _n_expr
== old_child
then
6924 if new_child
!= null then
6925 new_child
.parent
= self
6926 assert new_child
isa AExpr
6933 if _n_label
== old_child
then
6934 if new_child
!= null then
6935 new_child
.parent
= self
6936 assert new_child
isa ALabel
6937 _n_label
= new_child
6945 redef fun visit_all
(v
: Visitor)
6947 v
.enter_visit
(_n_bang
)
6948 v
.enter_visit
(_n_id
)
6952 if _n_kwdo
!= null then
6953 v
.enter_visit
(_n_kwdo
.as(not null))
6955 if _n_expr
!= null then
6956 v
.enter_visit
(_n_expr
.as(not null))
6958 if _n_label
!= null then
6959 v
.enter_visit
(_n_label
.as(not null))
6963 redef class ASimpleClosureId
6964 private init empty_init
do end
6966 init init_asimpleclosureid
(
6971 _n_id
= n_id
.as(not null)
6975 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
6977 if _n_id
== old_child
then
6978 if new_child
!= null then
6979 new_child
.parent
= self
6980 assert new_child
isa TId
6989 redef fun visit_all
(v
: Visitor)
6991 v
.enter_visit
(_n_id
)
6994 redef class ABreakClosureId
6995 private init empty_init
do end
6997 init init_abreakclosureid
(
6998 n_kwbreak
: nullable TKwbreak
7002 _n_kwbreak
= n_kwbreak
.as(not null)
7003 n_kwbreak
.parent
= self
7006 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7008 if _n_kwbreak
== old_child
then
7009 if new_child
!= null then
7010 new_child
.parent
= self
7011 assert new_child
isa TKwbreak
7012 _n_kwbreak
= new_child
7020 redef fun visit_all
(v
: Visitor)
7022 v
.enter_visit
(_n_kwbreak
)
7025 redef class AQualified
7026 private init empty_init
do end
7028 init init_aqualified
(
7029 n_id
: Collection[Object], # Should be Collection[TId]
7030 n_classid
: nullable TClassid
7039 _n_classid
= n_classid
7040 if n_classid
!= null then
7041 n_classid
.parent
= self
7045 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7047 for i
in [0.._n_id
.length
[ do
7048 if _n_id
[i
] == old_child
then
7049 if new_child
!= null then
7050 assert new_child
isa TId
7051 _n_id
[i
] = new_child
7052 new_child
.parent
= self
7059 if _n_classid
== old_child
then
7060 if new_child
!= null then
7061 new_child
.parent
= self
7062 assert new_child
isa TClassid
7063 _n_classid
= new_child
7071 redef fun visit_all
(v
: Visitor)
7076 if _n_classid
!= null then
7077 v
.enter_visit
(_n_classid
.as(not null))
7082 private init empty_init
do end
7085 n_comment
: Collection[Object] # Should be Collection[TComment]
7089 for n
in n_comment
do
7090 assert n
isa TComment
7096 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7098 for i
in [0.._n_comment
.length
[ do
7099 if _n_comment
[i
] == old_child
then
7100 if new_child
!= null then
7101 assert new_child
isa TComment
7102 _n_comment
[i
] = new_child
7103 new_child
.parent
= self
7105 _n_comment
.remove_at
(i
)
7112 redef fun visit_all
(v
: Visitor)
7114 for n
in _n_comment
do
7122 n_base
: nullable AModule,
7129 redef fun replace_child
(old_child
: ANode, new_child
: nullable ANode)
7131 if _n_base
== old_child
then
7132 if new_child
== null then
7134 new_child
.parent
= self
7135 assert new_child
isa AModule
7138 old_child
.parent
= null
7143 redef fun visit_all
(v
: Visitor)
7145 if _n_base
!= null then
7146 v
.enter_visit
(_n_base
.as(not null))
7148 v
.enter_visit
(_n_eof
)