+redef class ALlMethid
+ private init empty_init do end
+
+ init init_allmethid (
+ n_ll: nullable TLl
+ )
+ do
+ empty_init
+ _n_ll = n_ll.as(not null)
+ n_ll.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_ll == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TLl
+ _n_ll = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_ll)
+ end
+end
+redef class AGgMethid
+ private init empty_init do end
+
+ init init_aggmethid (
+ n_gg: nullable TGg
+ )
+ do
+ empty_init
+ _n_gg = n_gg.as(not null)
+ n_gg.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_gg == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TGg
+ _n_gg = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_gg)
+ end
+end