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}"
init init_amodule (
n_packagedecl: PPackagedecl ,
- n_imports: Array[Object] , # Should be Array[PImport]
- n_classdefs: Array[Object] # Should be Array[PClassdef]
+ n_imports: Collection[Object] , # Should be Collection[PImport]
+ n_classdefs: Collection[Object] # Should be Collection[PClassdef]
)
do
empty_init
n_visibility: PVisibility ,
n_classkind: PClasskind ,
n_id: TClassid ,
- n_formaldefs: Array[Object] , # Should be Array[PFormaldef]
- n_superclasses: Array[Object] , # Should be Array[PSuperclass]
- n_propdefs: Array[Object] # Should be Array[PPropdef]
+ n_formaldefs: Collection[Object] , # Should be Collection[PFormaldef]
+ n_superclasses: Collection[Object] , # Should be Collection[PSuperclass]
+ n_propdefs: Collection[Object] # Should be Collection[PPropdef]
)
do
empty_init
private init empty_init do end
init init_atopclassdef (
- n_propdefs: Array[Object] # Should be Array[PPropdef]
+ n_propdefs: Collection[Object] # Should be Collection[PPropdef]
)
do
empty_init
private init empty_init do end
init init_amainclassdef (
- n_propdefs: Array[Object] # Should be Array[PPropdef]
+ n_propdefs: Collection[Object] # Should be Collection[PPropdef]
)
do
empty_init
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
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
private init empty_init do end
init init_asignature (
- n_params: Array[Object] , # Should be Array[PParam]
+ n_params: Collection[Object] , # Should be Collection[PParam]
n_type: PType ,
- n_closure_decls: Array[Object] # Should be Array[PClosureDecl]
+ n_closure_decls: Collection[Object] # Should be Collection[PClosureDecl]
)
do
empty_init
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
n_kwwith: TKwwith ,
n_kwbreak: TKwbreak ,
n_id: TId ,
- n_signature: PSignature
+ n_signature: PSignature ,
+ n_expr: PExpr
)
do
empty_init
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)
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_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)
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
init init_atype (
n_id: TClassid ,
- n_types: Array[Object] # Should be Array[PType]
+ n_types: Collection[Object] # Should be Collection[PType]
)
do
empty_init
private init empty_init do end
init init_ablockexpr (
- n_expr: Array[Object] # Should be Array[PExpr]
+ n_expr: Collection[Object] # Should be Collection[PExpr]
)
do
empty_init
end
end
redef class AForExpr
- redef meth n_vardecl=(n: PExpr)
- do
- _n_vardecl = n
- if n != null then
- n.parent = self
- end
- end
- redef meth n_kwdo=(n: TKwdo)
+ redef meth n_kwfor=(n: TKwfor)
do
- _n_kwdo = n
+ _n_kwfor = 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
- empty_init
- _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
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_kwnew: TKwnew ,
n_type: PType ,
n_id: TId ,
- n_args: Array[Object] # Should be Array[PExpr]
+ n_args: Collection[Object] # Should be Collection[PExpr]
)
do
empty_init
init init_acallexpr (
n_expr: PExpr ,
n_id: TId ,
- n_args: Array[Object] , # Should be Array[PExpr]
- n_closure_defs: Array[Object] # Should be Array[PClosureDef]
+ n_args: Collection[Object] , # Should be Collection[PExpr]
+ n_closure_defs: Collection[Object] # Should be Collection[PClosureDef]
)
do
empty_init
init init_acallassignexpr (
n_expr: PExpr ,
n_id: TId ,
- n_args: Array[Object] , # Should be Array[PExpr]
+ n_args: Collection[Object] , # Should be Collection[PExpr]
n_assign: TAssign ,
n_value: PExpr
)
init init_acallreassignexpr (
n_expr: PExpr ,
n_id: TId ,
- n_args: Array[Object] , # Should be Array[PExpr]
+ n_args: Collection[Object] , # Should be Collection[PExpr]
n_assign_op: PAssignOp ,
n_value: PExpr
)
init init_asuperexpr (
n_qualified: PQualified ,
n_kwsuper: TKwsuper ,
- n_args: Array[Object] # Should be Array[PExpr]
+ n_args: Collection[Object] # Should be Collection[PExpr]
)
do
empty_init
init init_ainitexpr (
n_expr: PExpr ,
n_kwinit: TKwinit ,
- n_args: Array[Object] # Should be Array[PExpr]
+ n_args: Collection[Object] # Should be Collection[PExpr]
)
do
empty_init
init init_abraexpr (
n_expr: PExpr ,
- n_args: Array[Object] , # Should be Array[PExpr]
- n_closure_defs: Array[Object] # Should be Array[PClosureDef]
+ n_args: Collection[Object] , # Should be Collection[PExpr]
+ n_closure_defs: Collection[Object] # Should be Collection[PClosureDef]
)
do
empty_init
init init_abraassignexpr (
n_expr: PExpr ,
- n_args: Array[Object] , # Should be Array[PExpr]
+ n_args: Collection[Object] , # Should be Collection[PExpr]
n_assign: TAssign ,
n_value: PExpr
)
init init_abrareassignexpr (
n_expr: PExpr ,
- n_args: Array[Object] , # Should be Array[PExpr]
+ n_args: Collection[Object] , # Should be Collection[PExpr]
n_assign_op: PAssignOp ,
n_value: PExpr
)
private init empty_init do end
init init_aarrayexpr (
- n_exprs: Array[Object] # Should be Array[PExpr]
+ n_exprs: Collection[Object] # Should be Collection[PExpr]
)
do
empty_init
private init empty_init do end
init init_asuperstringexpr (
- n_exprs: Array[Object] # Should be Array[PExpr]
+ n_exprs: Collection[Object] # Should be Collection[PExpr]
)
do
empty_init
init init_aclosuredef (
n_kwwith: TKwwith ,
- n_id: Array[Object] , # Should be Array[TId]
+ n_id: Collection[Object] , # Should be Collection[TId]
n_kwdo: TKwdo ,
n_expr: PExpr
)
private init empty_init do end
init init_aqualified (
- n_id: Array[Object] , # Should be Array[TId]
+ n_id: Collection[Object] , # Should be Collection[TId]
n_classid: TClassid
)
do
private init empty_init do end
init init_adoc (
- n_comment: Array[Object] # Should be Array[TComment]
+ n_comment: Collection[Object] # Should be Collection[TComment]
)
do
empty_init