- redef meth n_doc=(n: PDoc)
- do
- _n_doc = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_readable=(n: PAble)
- do
- _n_readable = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_writable=(n: PAble)
- do
- _n_writable = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_kwredef=(n: TKwredef)
- do
- _n_kwredef = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_visibility=(n: PVisibility)
- do
- _n_visibility = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_kwattr=(n: TKwattr)
- do
- _n_kwattr = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_id=(n: TAttrid)
- do
- _n_id = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_type=(n: PType)
- do
- _n_type = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_expr=(n: PExpr)
- do
- _n_expr = n
- if n != null then
- n.parent = self
- end
- end
+ init init_aattrpropdef (
+ n_doc: nullable ADoc,
+ n_kwredef: nullable TKwredef,
+ n_visibility: nullable AVisibility,
+ n_kwvar: nullable TKwvar,
+ n_id2: nullable TId,
+ n_type: nullable AType,
+ n_expr: nullable AExpr,
+ n_annotations: nullable AAnnotations,
+ n_block: nullable AExpr
+ )
+ do
+ _n_doc = n_doc
+ if n_doc != null then n_doc.parent = self
+ _n_kwredef = n_kwredef
+ if n_kwredef != null then n_kwredef.parent = self
+ _n_visibility = n_visibility.as(not null)
+ n_visibility.parent = self
+ _n_kwvar = n_kwvar.as(not null)
+ n_kwvar.parent = self
+ _n_id2 = n_id2.as(not null)
+ n_id2.parent = self
+ _n_type = n_type
+ if n_type != null then n_type.parent = self
+ _n_expr = n_expr
+ if n_expr != null then n_expr.parent = self
+ _n_annotations = n_annotations
+ if n_annotations != null then n_annotations.parent = self
+ _n_block = n_block
+ if n_block != null then n_block.parent = self
+ end
+
+ redef fun replace_child(old_child: ANode, new_child: nullable ANode)
+ do
+ if _n_doc == old_child then
+ n_doc = new_child.as(nullable ADoc)
+ return
+ end
+ if _n_kwredef == old_child then
+ n_kwredef = new_child.as(nullable TKwredef)
+ return
+ end
+ if _n_visibility == old_child then
+ n_visibility = new_child.as(AVisibility)
+ return
+ end
+ if _n_kwvar == old_child then
+ n_kwvar = new_child.as(TKwvar)
+ return
+ end
+ if _n_id2 == old_child then
+ n_id2 = new_child.as(TId)
+ return
+ end
+ if _n_type == old_child then
+ n_type = new_child.as(nullable AType)
+ return
+ end
+ if _n_expr == old_child then
+ n_expr = new_child.as(nullable AExpr)
+ return
+ end
+ if _n_annotations == old_child then
+ n_annotations = new_child.as(nullable AAnnotations)
+ return
+ end
+ if _n_block == old_child then
+ n_block = new_child.as(nullable AExpr)
+ return
+ end
+ end