+redef class ADebugTypeExpr
+ private init empty_init do end
+
+ init init_adebugtypeexpr (
+ n_kwdebug: nullable TKwdebug,
+ n_kwtype: nullable TKwtype,
+ n_expr: nullable AExpr,
+ n_type: nullable AType
+ )
+ do
+ empty_init
+ _n_kwdebug = n_kwdebug.as(not null)
+ n_kwdebug.parent = self
+ _n_kwtype = n_kwtype.as(not null)
+ n_kwtype.parent = self
+ _n_expr = n_expr.as(not null)
+ n_expr.parent = self
+ _n_type = n_type.as(not null)
+ n_type.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_kwdebug == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwdebug
+ _n_kwdebug = new_child
+ else
+ abort
+ end
+ return
+ end
+ if _n_kwtype == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwtype
+ _n_kwtype = new_child
+ else
+ abort
+ end
+ return
+ end
+ if _n_expr == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa AExpr
+ _n_expr = new_child
+ else
+ abort
+ end
+ return
+ end
+ if _n_type == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa AType
+ _n_type = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_kwdebug)
+ v.enter_visit(_n_kwtype)
+ v.enter_visit(_n_expr)
+ v.enter_visit(_n_type)
+ end
+end
+redef class AListExprs
+ private init empty_init do end
+
+ init init_alistexprs (
+ n_exprs: Collection[Object] # Should be Collection[AExpr]
+ )
+ do
+ empty_init
+ for n in n_exprs do
+ assert n isa AExpr
+ _n_exprs.add(n)
+ n.parent = self
+ end
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ for i in [0.._n_exprs.length[ do
+ if _n_exprs[i] == old_child then
+ if new_child != null then
+ assert new_child isa AExpr
+ _n_exprs[i] = new_child
+ new_child.parent = self
+ else
+ _n_exprs.remove_at(i)
+ end
+ return
+ end
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ for n in _n_exprs do
+ v.enter_visit(n)
+ end
+ end
+end
+redef class AParExprs
+ private init empty_init do end
+
+ init init_aparexprs (
+ n_opar: nullable TOpar,
+ n_exprs: Collection[Object], # Should be Collection[AExpr]
+ n_cpar: nullable TCpar
+ )
+ do
+ empty_init
+ _n_opar = n_opar.as(not null)
+ n_opar.parent = self
+ for n in n_exprs do
+ assert n isa AExpr
+ _n_exprs.add(n)
+ n.parent = self
+ end
+ _n_cpar = n_cpar.as(not null)
+ n_cpar.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_opar == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TOpar
+ _n_opar = new_child
+ else
+ abort
+ end
+ return
+ end
+ for i in [0.._n_exprs.length[ do
+ if _n_exprs[i] == old_child then
+ if new_child != null then
+ assert new_child isa AExpr
+ _n_exprs[i] = new_child
+ new_child.parent = self
+ else
+ _n_exprs.remove_at(i)
+ end
+ return
+ end
+ end
+ if _n_cpar == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TCpar
+ _n_cpar = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_opar)
+ for n in _n_exprs do
+ v.enter_visit(n)
+ end
+ v.enter_visit(_n_cpar)
+ end
+end
+redef class ABraExprs
+ private init empty_init do end
+
+ init init_abraexprs (
+ n_obra: nullable TObra,
+ n_exprs: Collection[Object], # Should be Collection[AExpr]
+ n_cbra: nullable TCbra
+ )
+ do
+ empty_init
+ _n_obra = n_obra.as(not null)
+ n_obra.parent = self
+ for n in n_exprs do
+ assert n isa AExpr
+ _n_exprs.add(n)
+ n.parent = self
+ end
+ _n_cbra = n_cbra.as(not null)
+ n_cbra.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_obra == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TObra
+ _n_obra = new_child
+ else
+ abort
+ end
+ return
+ end
+ for i in [0.._n_exprs.length[ do
+ if _n_exprs[i] == old_child then
+ if new_child != null then
+ assert new_child isa AExpr
+ _n_exprs[i] = new_child
+ new_child.parent = self
+ else
+ _n_exprs.remove_at(i)
+ end
+ return
+ end
+ end
+ if _n_cbra == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TCbra
+ _n_cbra = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_obra)
+ for n in _n_exprs do
+ v.enter_visit(n)
+ end
+ v.enter_visit(_n_cbra)
+ end
+end