n_visibility: nullable AVisibility,
n_kwvar: nullable TKwvar,
n_id: nullable TAttrid,
+ n_id2: nullable TId,
n_type: nullable AType,
n_expr: nullable AExpr
)
n_visibility.parent = self
_n_kwvar = n_kwvar.as(not null)
n_kwvar.parent = self
- _n_id = n_id.as(not null)
- n_id.parent = self
+ _n_id = n_id
+ if n_id != null then
+ n_id.parent = self
+ end
+ _n_id2 = n_id2
+ if n_id2 != null then
+ n_id2.parent = self
+ end
_n_type = n_type
if n_type != null then
n_type.parent = self
assert new_child isa TAttrid
_n_id = new_child
else
- abort
+ _n_id = null
+ end
+ return
+ end
+ if _n_id2 == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TId
+ _n_id2 = new_child
+ else
+ _n_id2 = null
end
return
end
end
v.enter_visit(_n_visibility)
v.enter_visit(_n_kwvar)
- v.enter_visit(_n_id)
+ if _n_id != null then
+ v.enter_visit(_n_id.as(not null))
+ end
+ if _n_id2 != null then
+ v.enter_visit(_n_id2.as(not null))
+ end
if _n_type != null then
v.enter_visit(_n_type.as(not null))
end
init init_awriteable (
n_kwredef: nullable TKwredef,
+ n_visibility: nullable AVisibility,
n_kwwritable: nullable TKwwritable
)
do
if n_kwredef != null then
n_kwredef.parent = self
end
+ _n_visibility = n_visibility
+ if n_visibility != null then
+ n_visibility.parent = self
+ end
_n_kwwritable = n_kwwritable.as(not null)
n_kwwritable.parent = self
end
end
return
end
+ if _n_visibility == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa AVisibility
+ _n_visibility = new_child
+ else
+ _n_visibility = null
+ end
+ return
+ end
if _n_kwwritable == old_child then
if new_child != null then
new_child.parent = self
if _n_kwredef != null then
v.enter_visit(_n_kwredef.as(not null))
end
+ if _n_visibility != null then
+ v.enter_visit(_n_visibility.as(not null))
+ end
v.enter_visit(_n_kwwritable)
end
end
v.enter_visit(_n_expr2)
end
end
+redef class AOrElseExpr
+ private init empty_init do end
+
+ init init_aorelseexpr (
+ n_expr: nullable AExpr,
+ n_expr2: nullable AExpr
+ )
+ do
+ empty_init
+ _n_expr = n_expr.as(not null)
+ n_expr.parent = self
+ _n_expr2 = n_expr2.as(not null)
+ n_expr2.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ 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_expr2 == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa AExpr
+ _n_expr2 = new_child
+ else
+ abort
+ end
+ return
+ end
+ end
+
+ redef fun visit_all(v: Visitor)
+ do
+ v.enter_visit(_n_expr)
+ v.enter_visit(_n_expr2)
+ end
+end
redef class ANotExpr
private init empty_init do end