# Give a human readable location of the node.
meth locate: String is abstract
+ # Return only the line number of the node
+ meth line_number: Int is abstract
+
# Debug method: output a message prefixed with the location.
meth printl(str: String)
do
do
return "{filename}:{line},{pos}"
end
+
+ redef meth line_number do return line
end
redef class Prod
if first_token == null then
return "????"
end
+ if last_token == null then
+ return "{first_token.locate}--????"
+ end
var lastpos = last_token.pos + last_token.text.length - 1
if first_token.line == last_token.line then
return "{first_token.locate}--{lastpos}"
end
redef meth replace_with(n: PNode)
+ do
+ super
+ assert n isa Prod
+ n.first_token = first_token
+ n.last_token = last_token
+ end
+
+ redef meth line_number
do
- super
- assert n isa Prod
- n.first_token = first_token
- n.last_token = last_token
+ if first_token != null then
+ return first_token.line
+ else
+ return 0
+ end
end
end
n_classdefs: Array[Object] # Should be Array[PClassdef]
)
do
+ empty_init
_n_packagedecl = n_packagedecl
if n_packagedecl != null then
n_packagedecl.parent = self
n_id: TId
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_id: TId
)
do
+ empty_init
_n_visibility = n_visibility
if n_visibility != null then
n_visibility.parent = self
n_kwend: TKwend
)
do
+ empty_init
_n_visibility = n_visibility
if n_visibility != null then
n_visibility.parent = self
init init_apublicvisibility
do
+ empty_init
end
redef meth replace_child(old_child: PNode, new_child: PNode)
n_kwprivate: TKwprivate
)
do
+ empty_init
_n_kwprivate = n_kwprivate
if n_kwprivate != null then
n_kwprivate.parent = self
n_kwprotected: TKwprotected
)
do
+ empty_init
_n_kwprotected = n_kwprotected
if n_kwprotected != null then
n_kwprotected.parent = self
n_kwintrude: TKwintrude
)
do
+ empty_init
_n_kwintrude = n_kwintrude
if n_kwintrude != null then
n_kwintrude.parent = self
n_propdefs: Array[Object] # Should be Array[PPropdef]
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_propdefs: Array[Object] # Should be Array[PPropdef]
)
do
+ empty_init
_n_propdefs = new List[PPropdef]
for n in n_propdefs do
assert n isa PPropdef
n_propdefs: Array[Object] # Should be Array[PPropdef]
)
do
+ empty_init
_n_propdefs = new List[PPropdef]
for n in n_propdefs do
assert n isa PPropdef
n_kwclass: TKwclass
)
do
+ empty_init
_n_kwclass = n_kwclass
if n_kwclass != null then
n_kwclass.parent = self
n_kwclass: TKwclass
)
do
+ empty_init
_n_kwabstract = n_kwabstract
if n_kwabstract != null then
n_kwabstract.parent = self
n_kwinterface: TKwinterface
)
do
+ empty_init
_n_kwinterface = n_kwinterface
if n_kwinterface != null then
n_kwinterface.parent = self
n_kwuniversal: TKwuniversal
)
do
+ empty_init
_n_kwuniversal = n_kwuniversal
if n_kwuniversal != null then
n_kwuniversal.parent = self
n_type: PType
)
do
+ empty_init
_n_id = n_id
if n_id != null then
n_id.parent = self
n_type: PType
)
do
+ empty_init
_n_kwspecial = n_kwspecial
if n_kwspecial != null then
n_kwspecial.parent = self
n.parent = self
end
end
+ redef meth n_kwvar=(n: TKwvar)
+ do
+ _n_kwvar = n
+ if n != null then
+ n.parent = self
+ end
+ end
redef meth n_id=(n: TAttrid)
do
_n_id = n
n_kwredef: TKwredef ,
n_visibility: PVisibility ,
n_kwattr: TKwattr ,
+ n_kwvar: TKwvar ,
n_id: TAttrid ,
n_type: PType ,
n_expr: PExpr
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
if n_kwattr != null then
n_kwattr.parent = self
end
+ _n_kwvar = n_kwvar
+ if n_kwvar != null then
+ n_kwvar.parent = self
+ end
_n_id = n_id
if n_id != null then
n_id.parent = self
end
return
end
+ if _n_kwvar == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwvar
+ _n_kwvar = new_child
+ else
+ _n_kwvar = null
+ end
+ return
+ end
if _n_id == old_child then
if new_child != null then
new_child.parent = self
if _n_kwattr != null then
v.visit(_n_kwattr)
end
+ if _n_kwvar != null then
+ v.visit(_n_kwvar)
+ end
if _n_id != null then
v.visit(_n_id)
end
if _n_kwattr != null then
v.visit(_n_kwattr)
end
+ if _n_kwvar != null then
+ v.visit(_n_kwvar)
+ end
if _n_id != null then
v.visit(_n_id)
end
n_signature: PSignature
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_signature: PSignature
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_signature: PSignature
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_extern: TString
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_block: PExpr
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_block: PExpr
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_block: PExpr
)
do
+ empty_init
_n_kwredef = n_kwredef
if n_kwredef != null then
n_kwredef.parent = self
n_type: PType
)
do
+ empty_init
_n_doc = n_doc
if n_doc != null then
n_doc.parent = self
n_kwreadable: TKwreadable
)
do
+ empty_init
_n_kwredef = n_kwredef
if n_kwredef != null then
n_kwredef.parent = self
n_kwwritable: TKwwritable
)
do
+ empty_init
_n_kwredef = n_kwredef
if n_kwredef != null then
n_kwredef.parent = self
n_id: TId
)
do
+ empty_init
_n_id = n_id
if n_id != null then
n_id.parent = self
n_plus: TPlus
)
do
+ empty_init
_n_plus = n_plus
if n_plus != null then
n_plus.parent = self
n_minus: TMinus
)
do
+ empty_init
_n_minus = n_minus
if n_minus != null then
n_minus.parent = self
n_star: TStar
)
do
+ empty_init
_n_star = n_star
if n_star != null then
n_star.parent = self
n_slash: TSlash
)
do
+ empty_init
_n_slash = n_slash
if n_slash != null then
n_slash.parent = self
n_percent: TPercent
)
do
+ empty_init
_n_percent = n_percent
if n_percent != null then
n_percent.parent = self
n_eq: TEq
)
do
+ empty_init
_n_eq = n_eq
if n_eq != null then
n_eq.parent = self
n_ne: TNe
)
do
+ empty_init
_n_ne = n_ne
if n_ne != null then
n_ne.parent = self
n_le: TLe
)
do
+ empty_init
_n_le = n_le
if n_le != null then
n_le.parent = self
n_ge: TGe
)
do
+ empty_init
_n_ge = n_ge
if n_ge != null then
n_ge.parent = self
n_lt: TLt
)
do
+ empty_init
_n_lt = n_lt
if n_lt != null then
n_lt.parent = self
n_gt: TGt
)
do
+ empty_init
_n_gt = n_gt
if n_gt != null then
n_gt.parent = self
n_cbra: TCbra
)
do
+ empty_init
_n_obra = n_obra
if n_obra != null then
n_obra.parent = self
n_starship: TStarship
)
do
+ empty_init
_n_starship = n_starship
if n_starship != null then
n_starship.parent = self
n_assign: TAssign
)
do
+ empty_init
_n_id = n_id
if n_id != null then
n_id.parent = self
n_assign: TAssign
)
do
+ empty_init
_n_obra = n_obra
if n_obra != null then
n_obra.parent = self
init init_asignature (
n_params: Array[Object] , # Should be Array[PParam]
- n_type: PType
+ n_type: PType ,
+ n_closure_decls: Array[Object] # Should be Array[PClosureDecl]
)
do
+ empty_init
_n_params = new List[PParam]
for n in n_params do
assert n isa PParam
if n_type != null then
n_type.parent = self
end
+ _n_closure_decls = new List[PClosureDecl]
+ for n in n_closure_decls do
+ assert n isa PClosureDecl
+ _n_closure_decls.add(n)
+ n.parent = self
+ end
end
redef meth replace_child(old_child: PNode, new_child: PNode)
end
return
end
+ for i in [0.._n_closure_decls.length[ do
+ if _n_closure_decls[i] == old_child then
+ if new_child != null then
+ assert new_child isa PClosureDecl
+ _n_closure_decls[i] = new_child
+ new_child.parent = self
+ else
+ _n_closure_decls.remove_at(i)
+ end
+ return
+ end
+ end
end
redef meth visit_all(v: Visitor)
if _n_type != null then
v.visit(_n_type)
end
+ for n in _n_closure_decls do
+ v.visit(n)
+ end
end
redef meth visit_all_reverse(v: Visitor)
if _n_type != null then
v.visit(_n_type)
end
+ do
+ var i = _n_closure_decls.length
+ while i >= 0 do
+ v.visit(_n_closure_decls[i])
+ i = i - 1
+ end
+ end
end
end
redef class AParam
n_dotdotdot: TDotdotdot
)
do
+ empty_init
_n_id = n_id
if n_id != null then
n_id.parent = self
end
end
end
+redef class AClosureDecl
+ redef meth n_kwwith=(n: TKwwith)
+ do
+ _n_kwwith = n
+ if n != null then
+ n.parent = self
+ end
+ end
+ redef meth n_kwbreak=(n: TKwbreak)
+ do
+ _n_kwbreak = n
+ if n != null then
+ n.parent = self
+ end
+ end
+ redef meth n_id=(n: TId)
+ do
+ _n_id = n
+ if n != null then
+ n.parent = self
+ end
+ end
+ redef meth n_signature=(n: PSignature)
+ do
+ _n_signature = 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
+
+ private init empty_init do end
+
+ init init_aclosuredecl (
+ n_kwwith: TKwwith ,
+ n_kwbreak: TKwbreak ,
+ n_id: TId ,
+ n_signature: PSignature ,
+ n_expr: PExpr
+ )
+ do
+ empty_init
+ _n_kwwith = n_kwwith
+ if n_kwwith != null then
+ n_kwwith.parent = self
+ end
+ _n_kwbreak = n_kwbreak
+ if n_kwbreak != null then
+ n_kwbreak.parent = self
+ end
+ _n_id = n_id
+ if n_id != null then
+ n_id.parent = self
+ end
+ _n_signature = n_signature
+ if n_signature != null then
+ n_signature.parent = self
+ end
+ _n_expr = n_expr
+ if n_expr != null then
+ n_expr.parent = self
+ end
+ end
+
+ redef meth replace_child(old_child: PNode, new_child: PNode)
+ do
+ assert old_child != null
+ if _n_kwwith == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwwith
+ _n_kwwith = new_child
+ else
+ _n_kwwith = null
+ end
+ return
+ end
+ 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
+ _n_kwbreak = null
+ end
+ return
+ 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
+ _n_id = null
+ end
+ return
+ end
+ if _n_signature == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa PSignature
+ _n_signature = new_child
+ else
+ _n_signature = null
+ end
+ return
+ end
+ if _n_expr == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa PExpr
+ _n_expr = new_child
+ else
+ _n_expr = null
+ end
+ return
+ end
+ end
+
+ redef meth visit_all(v: Visitor)
+ do
+ if _n_kwwith != null then
+ v.visit(_n_kwwith)
+ end
+ if _n_kwbreak != null then
+ v.visit(_n_kwbreak)
+ end
+ if _n_id != null then
+ v.visit(_n_id)
+ end
+ if _n_signature != null then
+ v.visit(_n_signature)
+ end
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
+ end
+
+ redef meth visit_all_reverse(v: Visitor)
+ do
+ if _n_kwwith != null then
+ v.visit(_n_kwwith)
+ end
+ if _n_kwbreak != null then
+ v.visit(_n_kwbreak)
+ end
+ if _n_id != null then
+ v.visit(_n_id)
+ end
+ if _n_signature != null then
+ v.visit(_n_signature)
+ end
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
+ end
+end
redef class AType
redef meth n_id=(n: TClassid)
do
n_types: Array[Object] # Should be Array[PType]
)
do
+ empty_init
_n_id = n_id
if n_id != null then
n_id.parent = self
n_expr: Array[Object] # Should be Array[PExpr]
)
do
+ empty_init
_n_expr = new List[PExpr]
for n in n_expr do
assert n isa PExpr
n_expr: PExpr
)
do
+ empty_init
_n_kwvar = n_kwvar
if n_kwvar != null then
n_kwvar.parent = self
n_expr: PExpr
)
do
+ empty_init
_n_kwreturn = n_kwreturn
if n_kwreturn != null then
n_kwreturn.parent = self
n.parent = self
end
end
+ redef meth n_expr=(n: PExpr)
+ do
+ _n_expr = n
+ if n != null then
+ n.parent = self
+ end
+ end
private init empty_init do end
init init_abreakexpr (
- n_kwbreak: TKwbreak
+ n_kwbreak: TKwbreak ,
+ n_expr: PExpr
)
do
+ empty_init
_n_kwbreak = n_kwbreak
if n_kwbreak != null then
n_kwbreak.parent = self
end
+ _n_expr = n_expr
+ if n_expr != null then
+ n_expr.parent = self
+ end
end
redef meth replace_child(old_child: PNode, new_child: PNode)
end
return
end
+ if _n_expr == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa PExpr
+ _n_expr = new_child
+ else
+ _n_expr = null
+ end
+ return
+ end
end
redef meth visit_all(v: Visitor)
if _n_kwbreak != null then
v.visit(_n_kwbreak)
end
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
end
redef meth visit_all_reverse(v: Visitor)
if _n_kwbreak != null then
v.visit(_n_kwbreak)
end
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
end
end
redef class AAbortExpr
n_kwabort: TKwabort
)
do
+ empty_init
_n_kwabort = n_kwabort
if n_kwabort != null then
n_kwabort.parent = self
n.parent = self
end
end
+ redef meth n_expr=(n: PExpr)
+ do
+ _n_expr = n
+ if n != null then
+ n.parent = self
+ end
+ end
private init empty_init do end
init init_acontinueexpr (
- n_kwcontinue: TKwcontinue
+ n_kwcontinue: TKwcontinue ,
+ n_expr: PExpr
)
do
+ empty_init
_n_kwcontinue = n_kwcontinue
if n_kwcontinue != null then
n_kwcontinue.parent = self
end
+ _n_expr = n_expr
+ if n_expr != null then
+ n_expr.parent = self
+ end
end
redef meth replace_child(old_child: PNode, new_child: PNode)
end
return
end
+ if _n_expr == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa PExpr
+ _n_expr = new_child
+ else
+ _n_expr = null
+ end
+ return
+ end
end
redef meth visit_all(v: Visitor)
if _n_kwcontinue != null then
v.visit(_n_kwcontinue)
end
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
end
redef meth visit_all_reverse(v: Visitor)
if _n_kwcontinue != null then
v.visit(_n_kwcontinue)
end
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
end
end
redef class ADoExpr
n_block: PExpr
)
do
+ empty_init
_n_kwdo = n_kwdo
if n_kwdo != null then
n_kwdo.parent = self
n_else: PExpr
)
do
+ empty_init
_n_kwif = n_kwif
if n_kwif != null then
n_kwif.parent = self
n_else: PExpr
)
do
+ empty_init
_n_kwif = n_kwif
if n_kwif != null then
n_kwif.parent = self
n_block: PExpr
)
do
+ empty_init
_n_kwwhile = n_kwwhile
if n_kwwhile != null then
n_kwwhile.parent = self
end
end
redef class AForExpr
- redef meth n_vardecl=(n: PExpr)
+ redef meth n_kwfor=(n: TKwfor)
do
- _n_vardecl = n
+ _n_kwfor = n
if n != null then
n.parent = self
end
end
- redef meth n_kwdo=(n: TKwdo)
- do
- _n_kwdo = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_block=(n: PExpr)
+ redef meth n_id=(n: TId)
do
- _n_block = n
+ _n_id = n
if n != null then
n.parent = self
end
end
-
- private init empty_init do end
-
- init init_aforexpr (
- n_vardecl: PExpr ,
- n_kwdo: TKwdo ,
- n_block: PExpr
- )
- do
- _n_vardecl = n_vardecl
- if n_vardecl != null then
- n_vardecl.parent = self
- end
- _n_kwdo = n_kwdo
- if n_kwdo != null then
- n_kwdo.parent = self
- end
- _n_block = n_block
- if n_block != null then
- n_block.parent = self
- end
- end
-
- redef meth replace_child(old_child: PNode, new_child: PNode)
- do
- assert old_child != null
- if _n_vardecl == old_child then
- if new_child != null then
- new_child.parent = self
- assert new_child isa PExpr
- _n_vardecl = new_child
- else
- _n_vardecl = null
- end
- return
- 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_block == old_child then
- if new_child != null then
- new_child.parent = self
- assert new_child isa PExpr
- _n_block = new_child
- else
- _n_block = null
- end
- return
- end
- end
-
- redef meth visit_all(v: Visitor)
- do
- if _n_vardecl != null then
- v.visit(_n_vardecl)
- end
- if _n_kwdo != null then
- v.visit(_n_kwdo)
- end
- if _n_block != null then
- v.visit(_n_block)
- end
- end
-
- redef meth visit_all_reverse(v: Visitor)
- do
- if _n_vardecl != null then
- v.visit(_n_vardecl)
- end
- if _n_kwdo != null then
- v.visit(_n_kwdo)
- end
- if _n_block != null then
- v.visit(_n_block)
- end
- end
-end
-redef class AForVardeclExpr
- redef meth n_kwfor=(n: TKwfor)
+ redef meth n_expr=(n: PExpr)
do
- _n_kwfor = n
+ _n_expr = n
if n != null then
n.parent = self
end
end
- redef meth n_id=(n: TId)
+ redef meth n_kwdo=(n: TKwdo)
do
- _n_id = n
+ _n_kwdo = n
if n != null then
n.parent = self
end
end
- redef meth n_expr=(n: PExpr)
+ redef meth n_block=(n: PExpr)
do
- _n_expr = n
+ _n_block = n
if n != null then
n.parent = self
end
private init empty_init do end
- init init_aforvardeclexpr (
+ init init_aforexpr (
n_kwfor: TKwfor ,
n_id: TId ,
- n_expr: PExpr
+ n_expr: PExpr ,
+ n_kwdo: TKwdo ,
+ n_block: PExpr
)
do
+ empty_init
_n_kwfor = n_kwfor
if n_kwfor != null then
n_kwfor.parent = self
if n_expr != null then
n_expr.parent = self
end
+ _n_kwdo = n_kwdo
+ if n_kwdo != null then
+ n_kwdo.parent = self
+ end
+ _n_block = n_block
+ if n_block != null then
+ n_block.parent = self
+ end
end
redef meth replace_child(old_child: PNode, new_child: PNode)
end
return
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_block == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa PExpr
+ _n_block = new_child
+ else
+ _n_block = null
+ end
+ return
+ end
end
redef meth visit_all(v: Visitor)
if _n_expr != null then
v.visit(_n_expr)
end
+ if _n_kwdo != null then
+ v.visit(_n_kwdo)
+ end
+ if _n_block != null then
+ v.visit(_n_block)
+ end
end
redef meth visit_all_reverse(v: Visitor)
if _n_expr != null then
v.visit(_n_expr)
end
+ if _n_kwdo != null then
+ v.visit(_n_kwdo)
+ end
+ if _n_block != null then
+ v.visit(_n_block)
+ end
end
end
redef class AAssertExpr
n_expr: PExpr
)
do
+ empty_init
_n_kwassert = n_kwassert
if n_kwassert != null then
n_kwassert.parent = self
n_expr: PExpr
)
do
+ empty_init
_n_kwonce = n_kwonce
if n_kwonce != null then
n_kwonce.parent = self
n_expr: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr: PExpr
)
do
+ empty_init
_n_kwnot = n_kwnot
if n_kwnot != null then
n_kwnot.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_type: PType
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr: PExpr
)
do
+ empty_init
_n_minus = n_minus
if n_minus != null then
n_minus.parent = self
n_args: Array[Object] # Should be Array[PExpr]
)
do
+ empty_init
_n_kwnew = n_kwnew
if n_kwnew != null then
n_kwnew.parent = self
n_id: TAttrid
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_value: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_value: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
init init_acallexpr (
n_expr: PExpr ,
n_id: TId ,
- n_args: Array[Object] # Should be Array[PExpr]
+ n_args: Array[Object] , # Should be Array[PExpr]
+ n_closure_defs: Array[Object] # Should be Array[PClosureDef]
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
_n_args.add(n)
n.parent = self
end
+ _n_closure_defs = new List[PClosureDef]
+ for n in n_closure_defs do
+ assert n isa PClosureDef
+ _n_closure_defs.add(n)
+ n.parent = self
+ end
end
redef meth replace_child(old_child: PNode, new_child: PNode)
return
end
end
+ for i in [0.._n_closure_defs.length[ do
+ if _n_closure_defs[i] == old_child then
+ if new_child != null then
+ assert new_child isa PClosureDef
+ _n_closure_defs[i] = new_child
+ new_child.parent = self
+ else
+ _n_closure_defs.remove_at(i)
+ end
+ return
+ end
+ end
end
redef meth visit_all(v: Visitor)
for n in _n_args do
v.visit(n)
end
+ for n in _n_closure_defs do
+ v.visit(n)
+ end
end
redef meth visit_all_reverse(v: Visitor)
i = i - 1
end
end
+ do
+ var i = _n_closure_defs.length
+ while i >= 0 do
+ v.visit(_n_closure_defs[i])
+ i = i - 1
+ end
+ end
end
end
redef class ACallAssignExpr
n_value: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_value: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_args: Array[Object] # Should be Array[PExpr]
)
do
+ empty_init
_n_qualified = n_qualified
if n_qualified != null then
n_qualified.parent = self
n_args: Array[Object] # Should be Array[PExpr]
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
init init_abraexpr (
n_expr: PExpr ,
- n_args: Array[Object] # Should be Array[PExpr]
+ n_args: Array[Object] , # Should be Array[PExpr]
+ n_closure_defs: Array[Object] # Should be Array[PClosureDef]
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
_n_args.add(n)
n.parent = self
end
+ _n_closure_defs = new List[PClosureDef]
+ for n in n_closure_defs do
+ assert n isa PClosureDef
+ _n_closure_defs.add(n)
+ n.parent = self
+ end
end
redef meth replace_child(old_child: PNode, new_child: PNode)
return
end
end
+ for i in [0.._n_closure_defs.length[ do
+ if _n_closure_defs[i] == old_child then
+ if new_child != null then
+ assert new_child isa PClosureDef
+ _n_closure_defs[i] = new_child
+ new_child.parent = self
+ else
+ _n_closure_defs.remove_at(i)
+ end
+ return
+ end
+ end
end
redef meth visit_all(v: Visitor)
for n in _n_args do
v.visit(n)
end
+ for n in _n_closure_defs do
+ v.visit(n)
+ end
end
redef meth visit_all_reverse(v: Visitor)
i = i - 1
end
end
+ do
+ var i = _n_closure_defs.length
+ while i >= 0 do
+ v.visit(_n_closure_defs[i])
+ i = i - 1
+ end
+ end
end
end
redef class ABraAssignExpr
n_value: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_value: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_id: TId
)
do
+ empty_init
_n_id = n_id
if n_id != null then
n_id.parent = self
n_value: PExpr
)
do
+ empty_init
_n_id = n_id
if n_id != null then
n_id.parent = self
n_value: PExpr
)
do
+ empty_init
_n_id = n_id
if n_id != null then
n_id.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_expr2: PExpr
)
do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
n_exprs: Array[Object] # Should be Array[PExpr]
)
do
+ empty_init
_n_exprs = new List[PExpr]
for n in n_exprs do
assert n isa PExpr
n_kwself: TKwself
)
do
+ empty_init
_n_kwself = n_kwself
if n_kwself != null then
n_kwself.parent = self
init init_aimplicitselfexpr
do
+ empty_init
end
redef meth replace_child(old_child: PNode, new_child: PNode)
n_kwtrue: TKwtrue
)
do
+ empty_init
_n_kwtrue = n_kwtrue
if n_kwtrue != null then
n_kwtrue.parent = self
n_kwfalse: TKwfalse
)
do
+ empty_init
_n_kwfalse = n_kwfalse
if n_kwfalse != null then
n_kwfalse.parent = self
n_kwnull: TKwnull
)
do
+ empty_init
_n_kwnull = n_kwnull
if n_kwnull != null then
n_kwnull.parent = self
n_number: TNumber
)
do
+ empty_init
_n_number = n_number
if n_number != null then
n_number.parent = self
n_float: TFloat
)
do
+ empty_init
_n_float = n_float
if n_float != null then
n_float.parent = self
n_char: TChar
)
do
+ empty_init
_n_char = n_char
if n_char != null then
n_char.parent = self
n_string: TString
)
do
+ empty_init
_n_string = n_string
if n_string != null then
n_string.parent = self
n_string: TStartString
)
do
+ empty_init
_n_string = n_string
if n_string != null then
n_string.parent = self
n_string: TMidString
)
do
+ empty_init
_n_string = n_string
if n_string != null then
n_string.parent = self
n_string: TEndString
)
do
+ empty_init
_n_string = n_string
if n_string != null then
n_string.parent = self
n_exprs: Array[Object] # Should be Array[PExpr]
)
do
+ empty_init
_n_exprs = new List[PExpr]
for n in n_exprs do
assert n isa PExpr
n_expr: PExpr
)
do
+ empty_init
+ _n_expr = n_expr
+ if n_expr != null then
+ n_expr.parent = self
+ end
+ end
+
+ redef meth replace_child(old_child: PNode, new_child: PNode)
+ do
+ assert old_child != null
+ if _n_expr == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa PExpr
+ _n_expr = new_child
+ else
+ _n_expr = null
+ end
+ return
+ end
+ end
+
+ redef meth visit_all(v: Visitor)
+ do
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
+ end
+
+ redef meth visit_all_reverse(v: Visitor)
+ do
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
+ end
+end
+redef class AAsCastExpr
+ redef meth n_expr=(n: PExpr)
+ do
+ _n_expr = n
+ if n != null then
+ n.parent = self
+ end
+ end
+ redef meth n_kwas=(n: TKwas)
+ do
+ _n_kwas = 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
+
+ private init empty_init do end
+
+ init init_aascastexpr (
+ n_expr: PExpr ,
+ n_kwas: TKwas ,
+ n_type: PType
+ )
+ do
+ empty_init
_n_expr = n_expr
if n_expr != null then
n_expr.parent = self
end
+ _n_kwas = n_kwas
+ if n_kwas != null then
+ n_kwas.parent = self
+ end
+ _n_type = n_type
+ if n_type != null then
+ n_type.parent = self
+ end
end
redef meth replace_child(old_child: PNode, new_child: PNode)
end
return
end
+ if _n_kwas == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwas
+ _n_kwas = new_child
+ else
+ _n_kwas = null
+ end
+ return
+ end
+ if _n_type == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa PType
+ _n_type = new_child
+ else
+ _n_type = null
+ end
+ return
+ end
end
redef meth visit_all(v: Visitor)
if _n_expr != null then
v.visit(_n_expr)
end
+ if _n_kwas != null then
+ v.visit(_n_kwas)
+ end
+ if _n_type != null then
+ v.visit(_n_type)
+ end
end
redef meth visit_all_reverse(v: Visitor)
if _n_expr != null then
v.visit(_n_expr)
end
+ if _n_kwas != null then
+ v.visit(_n_kwas)
+ end
+ if _n_type != null then
+ v.visit(_n_type)
+ end
end
end
redef class APlusAssignOp
n_pluseq: TPluseq
)
do
+ empty_init
_n_pluseq = n_pluseq
if n_pluseq != null then
n_pluseq.parent = self
n_minuseq: TMinuseq
)
do
+ empty_init
_n_minuseq = n_minuseq
if n_minuseq != null then
n_minuseq.parent = self
end
end
end
+redef class AClosureDef
+ redef meth n_kwwith=(n: TKwwith)
+ do
+ _n_kwwith = n
+ if n != null then
+ n.parent = self
+ end
+ end
+ redef meth n_kwdo=(n: TKwdo)
+ do
+ _n_kwdo = 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
+
+ private init empty_init do end
+
+ init init_aclosuredef (
+ n_kwwith: TKwwith ,
+ n_id: Array[Object] , # Should be Array[TId]
+ n_kwdo: TKwdo ,
+ n_expr: PExpr
+ )
+ do
+ empty_init
+ _n_kwwith = n_kwwith
+ if n_kwwith != null then
+ n_kwwith.parent = self
+ end
+ _n_id = new List[TId]
+ for n in n_id do
+ assert n isa TId
+ _n_id.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
+ end
+
+ redef meth replace_child(old_child: PNode, new_child: PNode)
+ do
+ assert old_child != null
+ if _n_kwwith == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwwith
+ _n_kwwith = new_child
+ else
+ _n_kwwith = null
+ end
+ return
+ end
+ for i in [0.._n_id.length[ do
+ if _n_id[i] == old_child then
+ if new_child != null then
+ assert new_child isa TId
+ _n_id[i] = new_child
+ new_child.parent = self
+ else
+ _n_id.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 PExpr
+ _n_expr = new_child
+ else
+ _n_expr = null
+ end
+ return
+ end
+ end
+
+ redef meth visit_all(v: Visitor)
+ do
+ if _n_kwwith != null then
+ v.visit(_n_kwwith)
+ end
+ for n in _n_id do
+ v.visit(n)
+ end
+ if _n_kwdo != null then
+ v.visit(_n_kwdo)
+ end
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
+ end
+
+ redef meth visit_all_reverse(v: Visitor)
+ do
+ if _n_kwwith != null then
+ v.visit(_n_kwwith)
+ end
+ do
+ var i = _n_id.length
+ while i >= 0 do
+ v.visit(_n_id[i])
+ i = i - 1
+ end
+ end
+ if _n_kwdo != null then
+ v.visit(_n_kwdo)
+ end
+ if _n_expr != null then
+ v.visit(_n_expr)
+ end
+ end
+end
redef class AQualified
redef meth n_classid=(n: TClassid)
do
n_classid: TClassid
)
do
+ empty_init
_n_id = new List[TId]
for n in n_id do
assert n isa TId
n_comment: Array[Object] # Should be Array[TComment]
)
do
+ empty_init
_n_comment = new List[TComment]
for n in n_comment do
assert n isa TComment