parser: Add 'fun' and 'var'-as-attr keyword
[nit.git] / src / parser / parser_prod.nit
index d2e0ffe..2ec5db6 100644 (file)
@@ -123,6 +123,7 @@ redef class AModule
             n_classdefs: Array[Object]  # Should be Array[PClassdef]
     )
     do
+        empty_init
         _n_packagedecl = n_packagedecl
        if n_packagedecl != null then
                n_packagedecl.parent = self
@@ -245,6 +246,7 @@ redef class APackagedecl
             n_id: TId 
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -351,6 +353,7 @@ redef class AImport
             n_id: TId 
     )
     do
+        empty_init
         _n_visibility = n_visibility
        if n_visibility != null then
                n_visibility.parent = self
@@ -457,6 +460,7 @@ redef class ANoImport
             n_kwend: TKwend 
     )
     do
+        empty_init
         _n_visibility = n_visibility
        if n_visibility != null then
                n_visibility.parent = self
@@ -538,6 +542,7 @@ redef class APublicVisibility
 
     init init_apublicvisibility
     do
+        empty_init
     end
 
     redef meth replace_child(old_child: PNode, new_child: PNode)
@@ -568,6 +573,7 @@ redef class APrivateVisibility
             n_kwprivate: TKwprivate 
     )
     do
+        empty_init
         _n_kwprivate = n_kwprivate
        if n_kwprivate != null then
                n_kwprivate.parent = self
@@ -618,6 +624,7 @@ redef class AProtectedVisibility
             n_kwprotected: TKwprotected 
     )
     do
+        empty_init
         _n_kwprotected = n_kwprotected
        if n_kwprotected != null then
                n_kwprotected.parent = self
@@ -668,6 +675,7 @@ redef class AIntrudeVisibility
             n_kwintrude: TKwintrude 
     )
     do
+        empty_init
         _n_kwintrude = n_kwintrude
        if n_kwintrude != null then
                n_kwintrude.parent = self
@@ -753,6 +761,7 @@ redef class AClassdef
             n_propdefs: Array[Object]  # Should be Array[PPropdef]
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -960,6 +969,7 @@ redef class ATopClassdef
             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
@@ -1011,6 +1021,7 @@ redef class AMainClassdef
             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
@@ -1069,6 +1080,7 @@ redef class AConcreteClasskind
             n_kwclass: TKwclass 
     )
     do
+        empty_init
         _n_kwclass = n_kwclass
        if n_kwclass != null then
                n_kwclass.parent = self
@@ -1127,6 +1139,7 @@ redef class AAbstractClasskind
             n_kwclass: TKwclass 
     )
     do
+        empty_init
         _n_kwabstract = n_kwabstract
        if n_kwabstract != null then
                n_kwabstract.parent = self
@@ -1197,6 +1210,7 @@ redef class AInterfaceClasskind
             n_kwinterface: TKwinterface 
     )
     do
+        empty_init
         _n_kwinterface = n_kwinterface
        if n_kwinterface != null then
                n_kwinterface.parent = self
@@ -1247,6 +1261,7 @@ redef class AUniversalClasskind
             n_kwuniversal: TKwuniversal 
     )
     do
+        empty_init
         _n_kwuniversal = n_kwuniversal
        if n_kwuniversal != null then
                n_kwuniversal.parent = self
@@ -1305,6 +1320,7 @@ redef class AFormaldef
             n_type: PType 
     )
     do
+        empty_init
         _n_id = n_id
        if n_id != null then
                n_id.parent = self
@@ -1383,6 +1399,7 @@ redef class ASuperclass
             n_type: PType 
     )
     do
+        empty_init
         _n_kwspecial = n_kwspecial
        if n_kwspecial != null then
                n_kwspecial.parent = self
@@ -1481,6 +1498,13 @@ redef class AAttrPropdef
            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
@@ -1512,11 +1536,13 @@ redef class AAttrPropdef
             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
@@ -1541,6 +1567,10 @@ redef class AAttrPropdef
        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
@@ -1618,6 +1648,16 @@ redef class AAttrPropdef
             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
@@ -1670,6 +1710,9 @@ redef class AAttrPropdef
         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
@@ -1701,6 +1744,9 @@ redef class AAttrPropdef
         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
@@ -1759,6 +1805,7 @@ redef class AMethPropdef
             n_signature: PSignature 
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -1929,6 +1976,7 @@ redef class ADeferredMethPropdef
             n_signature: PSignature 
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -2119,6 +2167,7 @@ redef class AInternMethPropdef
             n_signature: PSignature 
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -2317,6 +2366,7 @@ redef class AExternMethPropdef
             n_extern: TString 
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -2535,6 +2585,7 @@ redef class AConcreteMethPropdef
             n_block: PExpr 
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -2753,6 +2804,7 @@ redef class AConcreteInitPropdef
             n_block: PExpr 
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -2931,6 +2983,7 @@ redef class AMainMethPropdef
             n_block: PExpr 
     )
     do
+        empty_init
         _n_kwredef = n_kwredef
        if n_kwredef != null then
                n_kwredef.parent = self
@@ -3041,6 +3094,7 @@ redef class ATypePropdef
             n_type: PType 
     )
     do
+        empty_init
         _n_doc = n_doc
        if n_doc != null then
                n_doc.parent = self
@@ -3199,6 +3253,7 @@ redef class AReadAble
             n_kwreadable: TKwreadable 
     )
     do
+        empty_init
         _n_kwredef = n_kwredef
        if n_kwredef != null then
                n_kwredef.parent = self
@@ -3277,6 +3332,7 @@ redef class AWriteAble
             n_kwwritable: TKwwritable 
     )
     do
+        empty_init
         _n_kwredef = n_kwredef
        if n_kwredef != null then
                n_kwredef.parent = self
@@ -3347,6 +3403,7 @@ redef class AIdMethid
             n_id: TId 
     )
     do
+        empty_init
         _n_id = n_id
        if n_id != null then
                n_id.parent = self
@@ -3397,6 +3454,7 @@ redef class APlusMethid
             n_plus: TPlus 
     )
     do
+        empty_init
         _n_plus = n_plus
        if n_plus != null then
                n_plus.parent = self
@@ -3447,6 +3505,7 @@ redef class AMinusMethid
             n_minus: TMinus 
     )
     do
+        empty_init
         _n_minus = n_minus
        if n_minus != null then
                n_minus.parent = self
@@ -3497,6 +3556,7 @@ redef class AStarMethid
             n_star: TStar 
     )
     do
+        empty_init
         _n_star = n_star
        if n_star != null then
                n_star.parent = self
@@ -3547,6 +3607,7 @@ redef class ASlashMethid
             n_slash: TSlash 
     )
     do
+        empty_init
         _n_slash = n_slash
        if n_slash != null then
                n_slash.parent = self
@@ -3597,6 +3658,7 @@ redef class APercentMethid
             n_percent: TPercent 
     )
     do
+        empty_init
         _n_percent = n_percent
        if n_percent != null then
                n_percent.parent = self
@@ -3647,6 +3709,7 @@ redef class AEqMethid
             n_eq: TEq 
     )
     do
+        empty_init
         _n_eq = n_eq
        if n_eq != null then
                n_eq.parent = self
@@ -3697,6 +3760,7 @@ redef class ANeMethid
             n_ne: TNe 
     )
     do
+        empty_init
         _n_ne = n_ne
        if n_ne != null then
                n_ne.parent = self
@@ -3747,6 +3811,7 @@ redef class ALeMethid
             n_le: TLe 
     )
     do
+        empty_init
         _n_le = n_le
        if n_le != null then
                n_le.parent = self
@@ -3797,6 +3862,7 @@ redef class AGeMethid
             n_ge: TGe 
     )
     do
+        empty_init
         _n_ge = n_ge
        if n_ge != null then
                n_ge.parent = self
@@ -3847,6 +3913,7 @@ redef class ALtMethid
             n_lt: TLt 
     )
     do
+        empty_init
         _n_lt = n_lt
        if n_lt != null then
                n_lt.parent = self
@@ -3897,6 +3964,7 @@ redef class AGtMethid
             n_gt: TGt 
     )
     do
+        empty_init
         _n_gt = n_gt
        if n_gt != null then
                n_gt.parent = self
@@ -3955,6 +4023,7 @@ redef class ABraMethid
             n_cbra: TCbra 
     )
     do
+        empty_init
         _n_obra = n_obra
        if n_obra != null then
                n_obra.parent = self
@@ -4025,6 +4094,7 @@ redef class AStarshipMethid
             n_starship: TStarship 
     )
     do
+        empty_init
         _n_starship = n_starship
        if n_starship != null then
                n_starship.parent = self
@@ -4083,6 +4153,7 @@ redef class AAssignMethid
             n_assign: TAssign 
     )
     do
+        empty_init
         _n_id = n_id
        if n_id != null then
                n_id.parent = self
@@ -4169,6 +4240,7 @@ redef class ABraassignMethid
             n_assign: TAssign 
     )
     do
+        empty_init
         _n_obra = n_obra
        if n_obra != null then
                n_obra.parent = self
@@ -4257,9 +4329,11 @@ redef class ASignature
 
     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
@@ -4270,6 +4344,12 @@ redef class ASignature
        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)
@@ -4297,6 +4377,18 @@ redef class ASignature
             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)
@@ -4307,6 +4399,9 @@ redef class ASignature
         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)
@@ -4321,6 +4416,13 @@ redef class ASignature
         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
@@ -4354,6 +4456,7 @@ redef class AParam
             n_dotdotdot: TDotdotdot 
     )
     do
+        empty_init
         _n_id = n_id
        if n_id != null then
                n_id.parent = self
@@ -4429,6 +4532,169 @@ redef class AParam
         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
@@ -4445,6 +4711,7 @@ redef class AType
             n_types: Array[Object]  # Should be Array[PType]
     )
     do
+        empty_init
         _n_id = n_id
        if n_id != null then
                n_id.parent = self
@@ -4516,6 +4783,7 @@ redef class ABlockExpr
             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
@@ -4606,6 +4874,7 @@ redef class AVardeclExpr
             n_expr: PExpr 
     )
     do
+        empty_init
         _n_kwvar = n_kwvar
        if n_kwvar != null then
                n_kwvar.parent = self
@@ -4744,6 +5013,7 @@ redef class AReturnExpr
             n_expr: PExpr 
     )
     do
+        empty_init
         _n_kwreturn = n_kwreturn
        if n_kwreturn != null then
                n_kwreturn.parent = self
@@ -4807,17 +5077,30 @@ redef class ABreakExpr
            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)
@@ -4833,6 +5116,16 @@ redef class ABreakExpr
             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)
@@ -4840,6 +5133,9 @@ redef class ABreakExpr
         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)
@@ -4847,6 +5143,9 @@ redef class ABreakExpr
         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
@@ -4864,6 +5163,7 @@ redef class AAbortExpr
             n_kwabort: TKwabort 
     )
     do
+        empty_init
         _n_kwabort = n_kwabort
        if n_kwabort != null then
                n_kwabort.parent = self
@@ -4907,17 +5207,30 @@ redef class AContinueExpr
            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)
@@ -4933,6 +5246,16 @@ redef class AContinueExpr
             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)
@@ -4940,6 +5263,9 @@ redef class AContinueExpr
         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)
@@ -4947,6 +5273,9 @@ redef class AContinueExpr
         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
@@ -4972,6 +5301,7 @@ redef class ADoExpr
             n_block: PExpr 
     )
     do
+        empty_init
         _n_kwdo = n_kwdo
        if n_kwdo != null then
                n_kwdo.parent = self
@@ -5066,6 +5396,7 @@ redef class AIfExpr
             n_else: PExpr 
     )
     do
+        empty_init
         _n_kwif = n_kwif
        if n_kwif != null then
                n_kwif.parent = self
@@ -5216,6 +5547,7 @@ redef class AIfexprExpr
             n_else: PExpr 
     )
     do
+        empty_init
         _n_kwif = n_kwif
        if n_kwif != null then
                n_kwif.parent = self
@@ -5390,6 +5722,7 @@ redef class AWhileExpr
             n_block: PExpr 
     )
     do
+        empty_init
         _n_kwwhile = n_kwwhile
        if n_kwwhile != null then
                n_kwwhile.parent = self
@@ -5486,129 +5819,37 @@ redef class AWhileExpr
     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
-        _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
@@ -5616,12 +5857,15 @@ redef class AForVardeclExpr
 
     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
@@ -5634,6 +5878,14 @@ redef class AForVardeclExpr
        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)
@@ -5669,6 +5921,26 @@ redef class AForVardeclExpr
             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)
@@ -5679,8 +5951,14 @@ redef class AForVardeclExpr
         if _n_id != null then
             v.visit(_n_id)
         end
-        if _n_expr != null then
-            v.visit(_n_expr)
+        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
 
@@ -5695,6 +5973,12 @@ redef class AForVardeclExpr
         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
@@ -5728,6 +6012,7 @@ redef class AAssertExpr
             n_expr: PExpr 
     )
     do
+        empty_init
         _n_kwassert = n_kwassert
        if n_kwassert != null then
                n_kwassert.parent = self
@@ -5826,6 +6111,7 @@ redef class AOnceExpr
             n_expr: PExpr 
     )
     do
+        empty_init
         _n_kwonce = n_kwonce
        if n_kwonce != null then
                n_kwonce.parent = self
@@ -5896,6 +6182,7 @@ redef class ASendExpr
             n_expr: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -5954,6 +6241,7 @@ redef class ABinopExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6032,6 +6320,7 @@ redef class AOrExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6110,6 +6399,7 @@ redef class AAndExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6188,6 +6478,7 @@ redef class ANotExpr
             n_expr: PExpr 
     )
     do
+        empty_init
         _n_kwnot = n_kwnot
        if n_kwnot != null then
                n_kwnot.parent = self
@@ -6266,6 +6557,7 @@ redef class AEqExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6344,6 +6636,7 @@ redef class AEeExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6422,6 +6715,7 @@ redef class ANeExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6500,6 +6794,7 @@ redef class ALtExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6578,6 +6873,7 @@ redef class ALeExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6656,6 +6952,7 @@ redef class AGtExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6734,6 +7031,7 @@ redef class AGeExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6812,6 +7110,7 @@ redef class AIsaExpr
             n_type: PType 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6890,6 +7189,7 @@ redef class APlusExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -6968,6 +7268,7 @@ redef class AMinusExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -7046,6 +7347,7 @@ redef class AStarshipExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -7124,6 +7426,7 @@ redef class AStarExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -7202,6 +7505,7 @@ redef class ASlashExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -7280,6 +7584,7 @@ redef class APercentExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -7358,6 +7663,7 @@ redef class AUminusExpr
             n_expr: PExpr 
     )
     do
+        empty_init
         _n_minus = n_minus
        if n_minus != null then
                n_minus.parent = self
@@ -7445,6 +7751,7 @@ redef class ANewExpr
             n_args: Array[Object]  # Should be Array[PExpr]
     )
     do
+        empty_init
         _n_kwnew = n_kwnew
        if n_kwnew != null then
                n_kwnew.parent = self
@@ -7571,6 +7878,7 @@ redef class AAttrExpr
             n_id: TAttrid 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -7665,6 +7973,7 @@ redef class AAttrAssignExpr
             n_value: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -7799,6 +8108,7 @@ redef class AAttrReassignExpr
             n_value: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -7915,9 +8225,11 @@ redef class ACallExpr
     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
@@ -7932,6 +8244,12 @@ redef class ACallExpr
                _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)
@@ -7969,6 +8287,18 @@ redef class ACallExpr
                 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)
@@ -7982,6 +8312,9 @@ redef class ACallExpr
             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)
@@ -7999,6 +8332,13 @@ redef class ACallExpr
                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
@@ -8041,6 +8381,7 @@ redef class ACallAssignExpr
             n_value: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -8204,6 +8545,7 @@ redef class ACallReassignExpr
             n_value: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -8351,6 +8693,7 @@ redef class ASuperExpr
             n_args: Array[Object]  # Should be Array[PExpr]
     )
     do
+        empty_init
         _n_qualified = n_qualified
        if n_qualified != null then
                n_qualified.parent = self
@@ -8458,6 +8801,7 @@ redef class AInitExpr
             n_args: Array[Object]  # Should be Array[PExpr]
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -8554,9 +8898,11 @@ redef class ABraExpr
 
     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
@@ -8567,6 +8913,12 @@ redef class ABraExpr
                _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)
@@ -8594,6 +8946,18 @@ redef class ABraExpr
                 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)
@@ -8604,6 +8968,9 @@ redef class ABraExpr
             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)
@@ -8618,6 +8985,13 @@ redef class ABraExpr
                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
@@ -8652,6 +9026,7 @@ redef class ABraAssignExpr
             n_value: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -8787,6 +9162,7 @@ redef class ABraReassignExpr
             n_value: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -8905,6 +9281,7 @@ redef class AVarExpr
             n_id: TId 
     )
     do
+        empty_init
         _n_id = n_id
        if n_id != null then
                n_id.parent = self
@@ -8971,6 +9348,7 @@ redef class AVarAssignExpr
             n_value: PExpr 
     )
     do
+        empty_init
         _n_id = n_id
        if n_id != null then
                n_id.parent = self
@@ -9077,6 +9455,7 @@ redef class AVarReassignExpr
             n_value: PExpr 
     )
     do
+        empty_init
         _n_id = n_id
        if n_id != null then
                n_id.parent = self
@@ -9175,6 +9554,7 @@ redef class ARangeExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -9253,6 +9633,7 @@ redef class ACrangeExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -9331,6 +9712,7 @@ redef class AOrangeExpr
             n_expr2: PExpr 
     )
     do
+        empty_init
         _n_expr = n_expr
        if n_expr != null then
                n_expr.parent = self
@@ -9394,6 +9776,7 @@ redef class AArrayExpr
             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
@@ -9452,6 +9835,7 @@ redef class ASelfExpr
             n_kwself: TKwself 
     )
     do
+        empty_init
         _n_kwself = n_kwself
        if n_kwself != null then
                n_kwself.parent = self
@@ -9493,6 +9877,7 @@ redef class AImplicitSelfExpr
 
     init init_aimplicitselfexpr
     do
+        empty_init
     end
 
     redef meth replace_child(old_child: PNode, new_child: PNode)
@@ -9523,6 +9908,7 @@ redef class ATrueExpr
             n_kwtrue: TKwtrue 
     )
     do
+        empty_init
         _n_kwtrue = n_kwtrue
        if n_kwtrue != null then
                n_kwtrue.parent = self
@@ -9573,6 +9959,7 @@ redef class AFalseExpr
             n_kwfalse: TKwfalse 
     )
     do
+        empty_init
         _n_kwfalse = n_kwfalse
        if n_kwfalse != null then
                n_kwfalse.parent = self
@@ -9623,6 +10010,7 @@ redef class ANullExpr
             n_kwnull: TKwnull 
     )
     do
+        empty_init
         _n_kwnull = n_kwnull
        if n_kwnull != null then
                n_kwnull.parent = self
@@ -9673,6 +10061,7 @@ redef class AIntExpr
             n_number: TNumber 
     )
     do
+        empty_init
         _n_number = n_number
        if n_number != null then
                n_number.parent = self
@@ -9723,6 +10112,7 @@ redef class AFloatExpr
             n_float: TFloat 
     )
     do
+        empty_init
         _n_float = n_float
        if n_float != null then
                n_float.parent = self
@@ -9773,6 +10163,7 @@ redef class ACharExpr
             n_char: TChar 
     )
     do
+        empty_init
         _n_char = n_char
        if n_char != null then
                n_char.parent = self
@@ -9823,6 +10214,7 @@ redef class AStringExpr
             n_string: TString 
     )
     do
+        empty_init
         _n_string = n_string
        if n_string != null then
                n_string.parent = self
@@ -9873,6 +10265,7 @@ redef class AStartStringExpr
             n_string: TStartString 
     )
     do
+        empty_init
         _n_string = n_string
        if n_string != null then
                n_string.parent = self
@@ -9923,6 +10316,7 @@ redef class AMidStringExpr
             n_string: TMidString 
     )
     do
+        empty_init
         _n_string = n_string
        if n_string != null then
                n_string.parent = self
@@ -9973,6 +10367,7 @@ redef class AEndStringExpr
             n_string: TEndString 
     )
     do
+        empty_init
         _n_string = n_string
        if n_string != null then
                n_string.parent = self
@@ -10016,6 +10411,7 @@ redef class ASuperstringExpr
             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
@@ -10074,10 +10470,86 @@ redef class AParExpr
             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)
@@ -10093,6 +10565,26 @@ redef class AParExpr
             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)
@@ -10100,6 +10592,12 @@ redef class AParExpr
         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)
@@ -10107,6 +10605,12 @@ redef class AParExpr
         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
@@ -10124,6 +10628,7 @@ redef class APlusAssignOp
             n_pluseq: TPluseq 
     )
     do
+        empty_init
         _n_pluseq = n_pluseq
        if n_pluseq != null then
                n_pluseq.parent = self
@@ -10174,6 +10679,7 @@ redef class AMinusAssignOp
             n_minuseq: TMinuseq 
     )
     do
+        empty_init
         _n_minuseq = n_minuseq
        if n_minuseq != null then
                n_minuseq.parent = self
@@ -10209,6 +10715,142 @@ redef class AMinusAssignOp
         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
@@ -10225,6 +10867,7 @@ redef class AQualified
             n_classid: TClassid 
     )
     do
+        empty_init
         _n_id = new List[TId]
        for n in n_id do
                assert n isa TId
@@ -10296,6 +10939,7 @@ redef class ADoc
             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