+ 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
+redef class APlusAssignOp
+ private init empty_init do end
+
+ init init_aplusassignop (
+ n_pluseq: nullable TPluseq
+ )
+ do
+ empty_init
+ _n_pluseq = n_pluseq.as(not null)
+ n_pluseq.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_pluseq == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TPluseq
+ _n_pluseq = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_pluseq)
+ end
+end
+redef class AMinusAssignOp
+ private init empty_init do end
+
+ init init_aminusassignop (
+ n_minuseq: nullable TMinuseq
+ )
+ do
+ empty_init
+ _n_minuseq = n_minuseq.as(not null)
+ n_minuseq.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_minuseq == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TMinuseq
+ _n_minuseq = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_minuseq)
+ end
+end
+redef class AClosureDef
+ private init empty_init do end
+
+ init init_aclosuredef (
+ n_bang: nullable TBang,
+ n_id: nullable AClosureId,
+ n_ids: Collection[Object], # Should be Collection[TId]
+ n_kwdo: nullable TKwdo,
+ n_expr: nullable AExpr,
+ n_label: nullable ALabel
+ )
+ do
+ empty_init
+ _n_bang = n_bang.as(not null)
+ n_bang.parent = self
+ _n_id = n_id.as(not null)
+ n_id.parent = self
+ for n in n_ids do
+ assert n isa TId
+ _n_ids.add(n)
+ n.parent = self
+ end
+ _n_kwdo = n_kwdo
+ if n_kwdo != null then
+ n_kwdo.parent = self
+ end
+ _n_expr = n_expr
+ if n_expr != null then
+ n_expr.parent = self
+ end
+ _n_label = n_label
+ if n_label != null then
+ n_label.parent = self
+ end
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_bang == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TBang
+ _n_bang = new_child
+ else
+ abort
+ end
+ return
+ end
+ if _n_id == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa AClosureId
+ _n_id = new_child
+ else
+ abort
+ end
+ return
+ end
+ for i in [0.._n_ids.length[ do
+ if _n_ids[i] == old_child then
+ if new_child != null then
+ assert new_child isa TId
+ _n_ids[i] = new_child
+ new_child.parent = self
+ else
+ _n_ids.remove_at(i)
+ end
+ return
+ end
+ end
+ if _n_kwdo == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwdo
+ _n_kwdo = new_child
+ else
+ _n_kwdo = null
+ 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
+ _n_expr = null
+ end
+ return
+ end
+ if _n_label == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa ALabel
+ _n_label = new_child
+ else
+ _n_label = null
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_bang)
+ v.enter_visit(_n_id)
+ for n in _n_ids do
+ v.enter_visit(n)
+ end
+ if _n_kwdo != null then
+ v.enter_visit(_n_kwdo.as(not null))
+ end
+ if _n_expr != null then
+ v.enter_visit(_n_expr.as(not null))
+ end
+ if _n_label != null then
+ v.enter_visit(_n_label.as(not null))
+ end
+ end
+end
+redef class ASimpleClosureId
+ private init empty_init do end
+
+ init init_asimpleclosureid (
+ n_id: nullable TId
+ )
+ do
+ empty_init
+ _n_id = n_id.as(not null)
+ n_id.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_id == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TId
+ _n_id = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_id)
+ end
+end
+redef class ABreakClosureId
+ private init empty_init do end
+
+ init init_abreakclosureid (
+ n_kwbreak: nullable TKwbreak
+ )
+ do
+ empty_init
+ _n_kwbreak = n_kwbreak.as(not null)
+ n_kwbreak.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_kwbreak == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwbreak
+ _n_kwbreak = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_kwbreak)
+ end
+end
+redef class AModuleName
+ private init empty_init do end
+
+ init init_amodulename (
+ n_quad: nullable TQuad,
+ n_path: Collection[Object], # Should be Collection[TId]
+ n_id: nullable TId
+ )
+ do
+ empty_init
+ _n_quad = n_quad
+ if n_quad != null then
+ n_quad.parent = self
+ end
+ for n in n_path do
+ assert n isa TId
+ _n_path.add(n)
+ n.parent = self
+ end
+ _n_id = n_id.as(not null)
+ n_id.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_quad == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TQuad
+ _n_quad = new_child
+ else
+ _n_quad = null
+ end
+ return
+ end
+ for i in [0.._n_path.length[ do
+ if _n_path[i] == old_child then
+ if new_child != null then
+ assert new_child isa TId
+ _n_path[i] = new_child
+ new_child.parent = self
+ else
+ _n_path.remove_at(i)
+ end
+ return
+ end
+ end
+ if _n_id == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TId
+ _n_id = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ if _n_quad != null then
+ v.enter_visit(_n_quad.as(not null))
+ end
+ for n in _n_path do
+ v.enter_visit(n)
+ end
+ v.enter_visit(_n_id)
+ end
+end
+redef class AExternCalls
+ private init empty_init do end
+
+ init init_aexterncalls (
+ n_kwimport: nullable TKwimport,
+ n_extern_calls: Collection[Object] # Should be Collection[AExternCall]
+ )
+ do
+ empty_init
+ _n_kwimport = n_kwimport.as(not null)
+ n_kwimport.parent = self
+ for n in n_extern_calls do
+ assert n isa AExternCall
+ _n_extern_calls.add(n)
+ n.parent = self
+ end
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_kwimport == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwimport
+ _n_kwimport = new_child
+ else
+ abort
+ end
+ return
+ end
+ for i in [0.._n_extern_calls.length[ do
+ if _n_extern_calls[i] == old_child then
+ if new_child != null then
+ assert new_child isa AExternCall
+ _n_extern_calls[i] = new_child
+ new_child.parent = self
+ else
+ _n_extern_calls.remove_at(i)
+ end
+ return
+ end
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_kwimport)
+ for n in _n_extern_calls do
+ v.enter_visit(n)
+ end
+ end
+end
+redef class AExternCall
+ private init empty_init do end
+
+ init init_aexterncall
+ do
+ empty_init
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ end
+end
+redef class ASuperExternCall
+ private init empty_init do end
+
+ init init_asuperexterncall (
+ n_kwsuper: nullable TKwsuper
+ )
+ do
+ empty_init
+ _n_kwsuper = n_kwsuper.as(not null)
+ n_kwsuper.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_kwsuper == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwsuper
+ _n_kwsuper = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_kwsuper)
+ end
+end
+redef class ALocalPropExternCall
+ private init empty_init do end
+
+ init init_alocalpropexterncall (
+ n_methid: nullable AMethid
+ )
+ do
+ empty_init
+ _n_methid = n_methid.as(not null)
+ n_methid.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_methid == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa AMethid
+ _n_methid = new_child
+ else