parser: rename 'enum' to 'universal'
[nit.git] / src / parser / parser_nodes.nit
index c77a193..7201f98 100644 (file)
@@ -1,19 +1,43 @@
-# Raw AST node hierarchy.
-# This file was generated by SableCC (http://www.sablecc.org/). 
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2008-2009 Jean Privat <jean@pryen.org>
+# Copyright 2009 Jean-Sebastien Gelinas <calestar@gmail.com>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# AST nodes of the Nit language
+# Was previously based on parser_abs.nit.
 package parser_nodes
 
+import location
+
 # Root of the AST hierarchy
-abstract class PNode
+abstract class ANode
+       var _location: nullable Location
+       # Location is set during AST building. Once built, location cannon be null
+       # However, manual instanciated nodes may need mode care
+       fun location: Location do return _location.as(not null)
 end
 
 # Ancestor of all tokens
 abstract class Token
-special PNode
+special ANode
 end
 
 # Ancestor of all productions
 abstract class Prod
-special PNode
+special ANode
+       fun location=(l: Location) do _location = l
 end
 class TEol
 special Token
@@ -21,7 +45,7 @@ end
 class TComment
 special Token
 end
-class TKwpackage
+class TKwmodule
 special Token
 end
 class TKwimport
@@ -36,7 +60,7 @@ end
 class TKwinterface
 special Token
 end
-class TKwuniversal
+class TKwenum
 special Token
 end
 class TKwspecial
@@ -51,9 +75,6 @@ end
 class TKwtype
 special Token
 end
-class TKwattr
-special Token
-end
 class TKwinit
 special Token
 end
@@ -102,6 +123,9 @@ end
 class TKwwhile
 special Token
 end
+class TKwloop
+special Token
+end
 class TKwfor
 special Token
 end
@@ -159,6 +183,15 @@ end
 class TKwas
 special Token
 end
+class TKwnullable
+special Token
+end
+class TKwisset
+special Token
+end
+class TKwlabel
+special Token
+end
 class TOpar
 special Token
 end
@@ -225,15 +258,24 @@ end
 class TLe
 special Token
 end
+class TLl
+special Token
+end
 class TGt
 special Token
 end
 class TGe
 special Token
 end
+class TGg
+special Token
+end
 class TStarship
 special Token
 end
+class TBang
+special Token
+end
 class TClassid
 special Token
 end
@@ -264,393 +306,423 @@ end
 class TEndString
 special Token
 end
-class EOF 
+class EOF
 special Token
 private init noinit do end
 end
-class PError
+class AError
 special EOF
 private init noinit do end
 end
 
-class PModule special Prod end
-class PPackagedecl special Prod end
-class PImport special Prod end
-class PVisibility special Prod end
-class PClassdef special Prod end
-class PClasskind special Prod end
-class PFormaldef special Prod end
-class PSuperclass special Prod end
-class PPropdef special Prod 
-    readable writable attr _n_doc: PDoc = null
-end
-class PAble special Prod
-    readable writable attr _n_kwredef: TKwredef = null
-end
-class PMethid special Prod end
-class PSignature special Prod end
-class PParam
-special Prod
-    readable writable attr _n_id: TId = null
-    readable writable attr _n_type: PType = null
-end
-class PType special Prod end
-class PExpr special Prod end
-class PAssignOp special Prod end
-class PQualified special Prod end
-class PDoc special Prod end
-
 class AModule
-special PModule
-    readable writable attr _n_packagedecl: PPackagedecl = null
-    readable writable attr _n_imports: List[PImport] = null
-    readable writable attr _n_classdefs: List[PClassdef] = null
-end
-class APackagedecl
-special PPackagedecl
-    readable writable attr _n_doc: PDoc = null
-    readable writable attr _n_kwpackage: TKwpackage = null
-    readable writable attr _n_id: TId = null
-end
-class AImport
-special PImport
-    readable writable attr _n_visibility: PVisibility = null
-    readable writable attr _n_kwimport: TKwimport = null
-    readable writable attr _n_id: TId = null
+special Prod
+    readable var _n_moduledecl: nullable AModuledecl = null
+    readable var _n_imports: List[AImport] = new List[AImport]
+    readable var _n_classdefs: List[AClassdef] = new List[AClassdef]
+end
+class AModuledecl
+special Prod
+    readable var _n_doc: nullable ADoc = null
+    readable var _n_kwmodule: TKwmodule
+    readable var _n_id: TId
+end
+class AImport special Prod end
+class AStdImport
+special AImport
+    readable var _n_visibility: AVisibility
+    readable var _n_kwimport: TKwimport
+    readable var _n_id: TId
 end
 class ANoImport
-special PImport
-    readable writable attr _n_visibility: PVisibility = null
-    readable writable attr _n_kwimport: TKwimport = null
-    readable writable attr _n_kwend: TKwend = null
+special AImport
+    readable var _n_visibility: AVisibility
+    readable var _n_kwimport: TKwimport
+    readable var _n_kwend: TKwend
 end
+class AVisibility special Prod end
 class APublicVisibility
-special PVisibility
+special AVisibility
 end
 class APrivateVisibility
-special PVisibility
-    readable writable attr _n_kwprivate: TKwprivate = null
+special AVisibility
+    readable var _n_kwprivate: TKwprivate
 end
 class AProtectedVisibility
-special PVisibility
-    readable writable attr _n_kwprotected: TKwprotected = null
+special AVisibility
+    readable var _n_kwprotected: TKwprotected
 end
 class AIntrudeVisibility
-special PVisibility
-    readable writable attr _n_kwintrude: TKwintrude = null
-end
-class AClassdef
-special PClassdef
-    readable writable attr _n_doc: PDoc = null
-    readable writable attr _n_kwredef: TKwredef = null
-    readable writable attr _n_visibility: PVisibility = null
-    readable writable attr _n_classkind: PClasskind = null
-    readable writable attr _n_id: TClassid = null
-    readable writable attr _n_formaldefs: List[PFormaldef] = null
-    readable writable attr _n_superclasses: List[PSuperclass] = null
-    readable writable attr _n_propdefs: List[PPropdef] = null
+special AVisibility
+    readable var _n_kwintrude: TKwintrude
+end
+class AClassdef special Prod end
+class AStdClassdef
+special AClassdef
+    readable var _n_doc: nullable ADoc = null
+    readable var _n_kwredef: nullable TKwredef = null
+    readable var _n_visibility: AVisibility
+    readable var _n_classkind: AClasskind
+    readable var _n_id: nullable TClassid = null
+    readable var _n_formaldefs: List[AFormaldef] = new List[AFormaldef]
+    readable var _n_superclasses: List[ASuperclass] = new List[ASuperclass]
+    readable var _n_propdefs: List[APropdef] = new List[APropdef]
 end
 class ATopClassdef
-special PClassdef
-    readable writable attr _n_propdefs: List[PPropdef] = null
+special AClassdef
+    readable var _n_propdefs: List[APropdef] = new List[APropdef]
 end
 class AMainClassdef
-special PClassdef
-    readable writable attr _n_propdefs: List[PPropdef] = null
+special AClassdef
+    readable var _n_propdefs: List[APropdef] = new List[APropdef]
 end
+class AClasskind special Prod end
 class AConcreteClasskind
-special PClasskind
-    readable writable attr _n_kwclass: TKwclass = null
+special AClasskind
+    readable var _n_kwclass: TKwclass
 end
 class AAbstractClasskind
-special PClasskind
-    readable writable attr _n_kwabstract: TKwabstract = null
-    readable writable attr _n_kwclass: TKwclass = null
+special AClasskind
+    readable var _n_kwabstract: TKwabstract
+    readable var _n_kwclass: TKwclass
 end
 class AInterfaceClasskind
-special PClasskind
-    readable writable attr _n_kwinterface: TKwinterface = null
+special AClasskind
+    readable var _n_kwinterface: TKwinterface
 end
-class AUniversalClasskind
-special PClasskind
-    readable writable attr _n_kwuniversal: TKwuniversal = null
+class AEnumClasskind
+special AClasskind
+    readable var _n_kwenum: TKwenum
 end
 class AFormaldef
-special PFormaldef
-    readable writable attr _n_id: TClassid = null
-    readable writable attr _n_type: PType = null
+special Prod
+    readable var _n_id: TClassid
+    readable var _n_type: nullable AType = null
 end
 class ASuperclass
-special PSuperclass
-    readable writable attr _n_kwspecial: TKwspecial = null
-    readable writable attr _n_type: PType = null
+special Prod
+    readable var _n_kwspecial: nullable TKwspecial = null
+    readable var _n_kwsuper: nullable TKwsuper = null
+    readable var _n_type: AType
+end
+class APropdef special Prod
+    readable var _n_doc: nullable ADoc = null
 end
 class AAttrPropdef
-special PPropdef
-    readable writable attr _n_kwredef: TKwredef = null
-    readable writable attr _n_visibility: PVisibility = null
-    readable writable attr _n_kwattr: TKwattr = null
-    readable writable attr _n_id: TAttrid = null
-    readable writable attr _n_type: PType = null
-    readable writable attr _n_readable: PAble = null
-    readable writable attr _n_writable: PAble = null
-    readable writable attr _n_expr: PExpr = null
+special APropdef
+    readable var _n_kwredef: nullable TKwredef = null
+    readable var _n_visibility: AVisibility
+    readable var _n_kwvar: TKwvar
+    readable var _n_id: nullable TAttrid
+    readable var _n_id2: nullable TId
+    readable var _n_type: nullable AType = null
+    readable var _n_readable: nullable AAble = null
+    readable var _n_writable: nullable AAble = null
+    readable var _n_expr: nullable AExpr = null
 end
 class AMethPropdef
-special PPropdef
-    readable writable attr _n_kwredef: TKwredef = null
-    readable writable attr _n_visibility: PVisibility = null
-    readable writable attr _n_methid: PMethid = null
-    readable writable attr _n_signature: PSignature = null
+special APropdef
+    readable var _n_kwredef: nullable TKwredef = null
+    readable var _n_visibility: nullable AVisibility
+    readable var _n_methid: nullable AMethid = null
+    readable var _n_signature: nullable ASignature
 end
 class ADeferredMethPropdef
 special AMethPropdef
-    readable writable attr _n_kwmeth: TKwmeth = null
+    readable var _n_kwmeth: TKwmeth
 end
 class AInternMethPropdef
 special AMethPropdef
-    readable writable attr _n_kwmeth: TKwmeth = null
+    readable var _n_kwmeth: TKwmeth
 end
 class AExternMethPropdef
 special AMethPropdef
-    readable writable attr _n_kwmeth: TKwmeth = null
-    readable writable attr _n_extern: TString = null
+    readable var _n_kwmeth: TKwmeth
+    readable var _n_extern: nullable TString = null
 end
 class AConcreteMethPropdef
 special AMethPropdef
-    readable writable attr _n_kwmeth: TKwmeth = null
-    readable writable attr _n_block: PExpr = null
+    readable var _n_kwmeth: nullable TKwmeth
+    readable var _n_block: nullable AExpr = null
 end
 class AConcreteInitPropdef
 special AConcreteMethPropdef
-    readable writable attr _n_kwinit: TKwinit = null
+    readable var _n_kwinit: TKwinit
 end
 class AMainMethPropdef
 special AConcreteMethPropdef
 end
 class ATypePropdef
-special PPropdef
-    readable writable attr _n_kwredef: TKwredef = null
-    readable writable attr _n_visibility: PVisibility = null
-    readable writable attr _n_kwtype: TKwtype = null
-    readable writable attr _n_id: TClassid = null
-    readable writable attr _n_type: PType = null
+special APropdef
+    readable var _n_kwredef: nullable TKwredef = null
+    readable var _n_visibility: AVisibility
+    readable var _n_kwtype: TKwtype
+    readable var _n_id: TClassid
+    readable var _n_type: AType
+end
+class AAble special Prod
+    readable var _n_visibility: nullable AVisibility = null
+    readable var _n_kwredef: nullable TKwredef = null
 end
 class AReadAble
-special PAble
-    readable writable attr _n_kwreadable: TKwreadable = null
+special AAble
+    readable var _n_kwreadable: TKwreadable
 end
 class AWriteAble
-special PAble
-    readable writable attr _n_kwwritable: TKwwritable = null
+special AAble
+    readable var _n_kwwritable: TKwwritable
 end
+class AMethid special Prod end
 class AIdMethid
-special PMethid
-    readable writable attr _n_id: TId = null
+special AMethid
+    readable var _n_id: TId
 end
 class APlusMethid
-special PMethid
-    readable writable attr _n_plus: TPlus = null
+special AMethid
+    readable var _n_plus: TPlus
 end
 class AMinusMethid
-special PMethid
-    readable writable attr _n_minus: TMinus = null
+special AMethid
+    readable var _n_minus: TMinus
 end
 class AStarMethid
-special PMethid
-    readable writable attr _n_star: TStar = null
+special AMethid
+    readable var _n_star: TStar
 end
 class ASlashMethid
-special PMethid
-    readable writable attr _n_slash: TSlash = null
+special AMethid
+    readable var _n_slash: TSlash
 end
 class APercentMethid
-special PMethid
-    readable writable attr _n_percent: TPercent = null
+special AMethid
+    readable var _n_percent: TPercent
 end
 class AEqMethid
-special PMethid
-    readable writable attr _n_eq: TEq = null
+special AMethid
+    readable var _n_eq: TEq
 end
 class ANeMethid
-special PMethid
-    readable writable attr _n_ne: TNe = null
+special AMethid
+    readable var _n_ne: TNe
 end
 class ALeMethid
-special PMethid
-    readable writable attr _n_le: TLe = null
+special AMethid
+    readable var _n_le: TLe
 end
 class AGeMethid
-special PMethid
-    readable writable attr _n_ge: TGe = null
+special AMethid
+    readable var _n_ge: TGe
 end
 class ALtMethid
-special PMethid
-    readable writable attr _n_lt: TLt = null
+special AMethid
+    readable var _n_lt: TLt
 end
 class AGtMethid
-special PMethid
-    readable writable attr _n_gt: TGt = null
+special AMethid
+    readable var _n_gt: TGt
+end
+class ALlMethid
+special AMethid
+    readable writable var _n_ll: TLl
+end
+class AGgMethid
+special AMethid
+    readable writable var _n_gg: TGg
 end
 class ABraMethid
-special PMethid
-    readable writable attr _n_obra: TObra = null
-    readable writable attr _n_cbra: TCbra = null
+special AMethid
+    readable var _n_obra: TObra
+    readable var _n_cbra: TCbra
 end
 class AStarshipMethid
-special PMethid
-    readable writable attr _n_starship: TStarship = null
+special AMethid
+    readable var _n_starship: TStarship
 end
 class AAssignMethid
-special PMethid
-    readable writable attr _n_id: TId = null
-    readable writable attr _n_assign: TAssign = null
+special AMethid
+    readable var _n_id: TId
+    readable var _n_assign: TAssign
 end
 class ABraassignMethid
-special PMethid
-    readable writable attr _n_obra: TObra = null
-    readable writable attr _n_cbra: TCbra = null
-    readable writable attr _n_assign: TAssign = null
+special AMethid
+    readable var _n_obra: TObra
+    readable var _n_cbra: TCbra
+    readable var _n_assign: TAssign
 end
 class ASignature
-special PSignature
-    readable writable attr _n_params: List[PParam] = null
-    readable writable attr _n_type: PType = null
+special Prod
+    readable var _n_params: List[AParam] = new List[AParam]
+    readable var _n_type: nullable AType = null
+    readable var _n_closure_decls: List[AClosureDecl] = new List[AClosureDecl]
 end
 class AParam
-special PParam
-    readable writable attr _n_dotdotdot: TDotdotdot = null
+special Prod
+    readable var _n_id: TId
+    readable var _n_type: nullable AType = null
+    readable var _n_dotdotdot: nullable TDotdotdot = null
+end
+class AClosureDecl
+special Prod
+    readable var _n_kwbreak: nullable TKwbreak = null
+    readable var _n_bang: TBang
+    readable var _n_id: TId
+    readable var _n_signature: ASignature
+    readable var _n_expr: nullable AExpr = null
 end
 class AType
-special PType
-    readable writable attr _n_id: TClassid = null
-    readable writable attr _n_types: List[PType] = null
+special Prod
+    readable var _n_kwnullable: nullable TKwnullable = null
+    readable var _n_id: TClassid
+    readable var _n_types: List[AType] = new List[AType]
 end
-
-
-
+class ALabel
+special Prod
+    readable var _n_kwlabel: TKwlabel
+    readable var _n_id: TId
+end
+class AExpr special Prod end
 class ABlockExpr
-special PExpr
-    readable writable attr _n_expr: List[PExpr] = null
+special AExpr
+    readable var _n_expr: List[AExpr] = new List[AExpr]
 end
 class AVardeclExpr
-special PExpr
-    readable writable attr _n_kwvar: TKwvar = null
-    readable writable attr _n_id: TId = null
-    readable writable attr _n_type: PType = null
-    readable writable attr _n_assign: TAssign = null
-    readable writable attr _n_expr: PExpr = null
+special AExpr
+    readable var _n_kwvar: TKwvar
+    readable var _n_id: TId
+    readable var _n_type: nullable AType = null
+    readable var _n_assign: nullable TAssign = null
+    readable var _n_expr: nullable AExpr = null
 end
 class AReturnExpr
-special PExpr
-    readable writable attr _n_kwreturn: TKwreturn = null
-    readable writable attr _n_expr: PExpr = null
+special AExpr
+    readable var _n_kwreturn: nullable TKwreturn = null
+    readable var _n_expr: nullable AExpr = null
+end
+class ALabelable
+special Prod
+    readable var _n_label: nullable ALabel = null
 end
 class ABreakExpr
-special PExpr
-    readable writable attr _n_kwbreak: TKwbreak = null
+special AExpr
+special ALabelable
+    readable var _n_kwbreak: TKwbreak
+    readable var _n_expr: nullable AExpr = null
 end
 class AAbortExpr
-special PExpr
-    readable writable attr _n_kwabort: TKwabort = null
+special AExpr
+    readable var _n_kwabort: TKwabort
 end
 class AContinueExpr
-special PExpr
-    readable writable attr _n_kwcontinue: TKwcontinue = null
+special AExpr
+special ALabelable
+    readable var _n_kwcontinue: nullable TKwcontinue = null
+    readable var _n_expr: nullable AExpr = null
 end
 class ADoExpr
-special PExpr
-    readable writable attr _n_kwdo: TKwdo = null
-    readable writable attr _n_block: PExpr = null
+special AExpr
+special ALabelable
+    readable var _n_kwdo: TKwdo
+    readable var _n_block: nullable AExpr = null
 end
 class AIfExpr
-special PExpr
-    readable writable attr _n_kwif: TKwif = null
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_then: PExpr = null
-    readable writable attr _n_else: PExpr = null
+special AExpr
+    readable var _n_kwif: TKwif
+    readable var _n_expr: AExpr
+    readable var _n_then: nullable AExpr = null
+    readable var _n_else: nullable AExpr = null
 end
 class AIfexprExpr
-special PExpr
-    readable writable attr _n_kwif: TKwif = null
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_kwthen: TKwthen = null
-    readable writable attr _n_then: PExpr = null
-    readable writable attr _n_kwelse: TKwelse = null
-    readable writable attr _n_else: PExpr = null
+special AExpr
+    readable var _n_kwif: TKwif
+    readable var _n_expr: AExpr
+    readable var _n_kwthen: TKwthen
+    readable var _n_then: AExpr
+    readable var _n_kwelse: TKwelse
+    readable var _n_else: AExpr
 end
 class AWhileExpr
-special PExpr
-    readable writable attr _n_kwwhile: TKwwhile = null
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_kwdo: TKwdo = null
-    readable writable attr _n_block: PExpr = null
+special AExpr
+special ALabelable
+    readable var _n_kwwhile:  TKwwhile
+    readable var _n_expr: AExpr
+    readable var _n_kwdo: TKwdo
+    readable var _n_block: nullable AExpr = null
+end
+class ALoopExpr
+special AExpr
+special ALabelable
+    readable var _n_kwloop: TKwloop
+    readable var _n_block: nullable AExpr = null
 end
 class AForExpr
-special PExpr
-    readable writable attr _n_vardecl: PExpr = null
-    readable writable attr _n_kwdo: TKwdo = null
-    readable writable attr _n_block: PExpr = null
-end
-class AForVardeclExpr
-special PExpr
-    readable writable attr _n_kwfor: TKwfor = null
-    readable writable attr _n_id: TId = null
-    readable writable attr _n_expr: PExpr = null
+special AExpr
+special ALabelable
+    readable var _n_kwfor: TKwfor
+    readable var _n_id: TId
+    readable var _n_expr: AExpr
+    readable var _n_kwdo: TKwdo
+    readable var _n_block: nullable AExpr = null
 end
 class AAssertExpr
-special PExpr
-    readable writable attr _n_kwassert: TKwassert = null
-    readable writable attr _n_id: TId = null
-    readable writable attr _n_expr: PExpr = null
+special AExpr
+    readable var _n_kwassert: TKwassert
+    readable var _n_id: nullable TId = null
+    readable var _n_expr: AExpr
+    readable var _n_else: nullable AExpr = null
 end
 class AAssignFormExpr
-special PExpr
-    readable writable attr _n_assign: TAssign = null
-    readable writable attr _n_value: PExpr = null
+special AExpr
+    readable var _n_assign: TAssign
+    readable var _n_value: AExpr
 end
 class AReassignFormExpr
-special PExpr
-    readable writable attr _n_assign_op: PAssignOp = null
-    readable writable attr _n_value: PExpr = null
+special AExpr
+    readable var _n_assign_op: AAssignOp
+    readable var _n_value: AExpr
 end
 class AOnceExpr
 special AProxyExpr
-    readable writable attr _n_kwonce: TKwonce = null
+    readable var _n_kwonce: TKwonce
 end
 class ASendExpr
-special PExpr
-    readable writable attr _n_expr: PExpr = null
+special AExpr
+    readable var _n_expr: AExpr
+    readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
 end
 class ABinopExpr
 special ASendExpr
-    readable writable attr _n_expr2: PExpr = null
+    readable var _n_expr2: AExpr
 end
 class ABoolExpr
-special PExpr
+special AExpr
 end
 class AOrExpr
 special ABoolExpr
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_expr2: PExpr = null
+    readable var _n_expr: AExpr
+    readable var _n_expr2: AExpr
 end
 class AAndExpr
 special ABoolExpr
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_expr2: PExpr = null
+    readable var _n_expr: AExpr
+    readable var _n_expr2: AExpr
+end
+class AOrElseExpr
+special ABoolExpr
+    readable var _n_expr: AExpr
+    readable var _n_expr2: AExpr
 end
 class ANotExpr
 special ABoolExpr
-    readable writable attr _n_kwnot: TKwnot = null
-    readable writable attr _n_expr: PExpr = null
+    readable var _n_kwnot: TKwnot
+    readable var _n_expr: AExpr
 end
 class AEqExpr
 special ABinopExpr
 end
 class AEeExpr
 special ABoolExpr
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_expr2: PExpr = null
+    readable var _n_expr: AExpr
+    readable var _n_expr2: AExpr
 end
 class ANeExpr
 special ABinopExpr
@@ -661,16 +733,22 @@ end
 class ALeExpr
 special ABinopExpr
 end
+class ALlExpr
+special ABinopExpr
+end
 class AGtExpr
 special ABinopExpr
 end
 class AGeExpr
 special ABinopExpr
 end
+class AGgExpr
+special ABinopExpr
+end
 class AIsaExpr
 special ABoolExpr
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_type: PType = null
+    readable var _n_expr: AExpr
+    readable var _n_type: AType
 end
 class APlusExpr
 special ABinopExpr
@@ -692,94 +770,100 @@ special ABinopExpr
 end
 class AUminusExpr
 special ASendExpr
-    readable writable attr _n_minus: TMinus = null
+    readable var _n_minus: TMinus
 end
 class ANewExpr
-special PExpr
-    readable writable attr _n_kwnew: TKwnew = null
-    readable writable attr _n_type: PType = null
-    readable writable attr _n_id: TId = null
-    readable writable attr _n_args: List[PExpr] = null
+special AExpr
+    readable var _n_kwnew: TKwnew
+    readable var _n_type: AType
+    readable var _n_id: nullable TId = null
+    readable var _n_args: List[AExpr] = new List[AExpr]
 end
 class AAttrFormExpr
-special PExpr
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_id: TAttrid = null
+special AExpr
+    readable var _n_expr: AExpr
+    readable var _n_id: TAttrid
 end
 class AAttrExpr
 special AAttrFormExpr
 end
 class AAttrAssignExpr
-special AAttrFormExpr 
-special AAssignFormExpr 
+special AAttrFormExpr
+special AAssignFormExpr
 end
 class ACallFormExpr
 special ASendExpr
-    readable writable attr _n_id: TId = null
-    readable writable attr _n_args: List[PExpr] = null
+    readable var _n_id: TId
+    readable var _n_args: List[AExpr] = new List[AExpr]
 end
 class AAttrReassignExpr
-special PExpr
-special AAttrFormExpr 
-special AReassignFormExpr 
+special AExpr
+special AAttrFormExpr
+special AReassignFormExpr
 end
 class ACallExpr
 special ACallFormExpr
 end
 class ACallAssignExpr
 special ACallFormExpr
-special AAssignFormExpr 
+special AAssignFormExpr
 end
 class ACallReassignExpr
-special PExpr
+special AExpr
 special ACallFormExpr
-special AReassignFormExpr 
+special AReassignFormExpr
 end
 class ASuperExpr
-special PExpr
-    readable writable attr _n_qualified: PQualified = null
-    readable writable attr _n_kwsuper: TKwsuper = null
-    readable writable attr _n_args: List[PExpr] = null
+special AExpr
+    readable var _n_qualified: nullable AQualified = null
+    readable var _n_kwsuper: TKwsuper
+    readable var _n_args: List[AExpr] = new List[AExpr]
 end
 class AInitExpr
 special ASendExpr
-    readable writable attr _n_kwinit: TKwinit = null
-    readable writable attr _n_args: List[PExpr] = null
+    readable var _n_kwinit: TKwinit
+    readable var _n_args: List[AExpr] = new List[AExpr]
 end
 class ABraFormExpr
 special ASendExpr
-    readable writable attr _n_args: List[PExpr] = null 
+    readable var _n_args: List[AExpr] = new List[AExpr]
 end
 class ABraExpr
 special ABraFormExpr
 end
 class ABraAssignExpr
 special ABraFormExpr
-special AAssignFormExpr 
+special AAssignFormExpr
 end
 class AVarFormExpr
-special PExpr
-    readable writable attr _n_id: TId = null 
+special AExpr
+    readable var _n_id: TId
 end
 class ABraReassignExpr
 special ABraFormExpr
-special AReassignFormExpr 
+special AReassignFormExpr
+end
+class AClosureCallExpr
+special AExpr
+    readable var _n_id: TId
+    readable var _n_args: List[AExpr] = new List[AExpr]
+    readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
 end
 class AVarExpr
 special AVarFormExpr
 end
 class AVarAssignExpr
 special AVarFormExpr
-special AAssignFormExpr 
+special AAssignFormExpr
 end
 class AVarReassignExpr
 special AVarFormExpr
-special AReassignFormExpr 
+special AReassignFormExpr
 end
 class ARangeExpr
-special PExpr
-    readable writable attr _n_expr: PExpr = null 
-    readable writable attr _n_expr2: PExpr = null
+special AExpr
+    readable var _n_expr: AExpr
+    readable var _n_expr2: AExpr
 end
 class ACrangeExpr
 special ARangeExpr
@@ -788,96 +872,127 @@ class AOrangeExpr
 special ARangeExpr
 end
 class AArrayExpr
-special PExpr
-    readable writable attr _n_exprs: List[PExpr] = null
+special AExpr
+    readable var _n_exprs: List[AExpr] = new List[AExpr]
 end
 class ASelfExpr
-special PExpr
-    readable writable attr _n_kwself: TKwself = null
+special AExpr
+    readable var _n_kwself: nullable TKwself
 end
 class AImplicitSelfExpr
 special ASelfExpr
 end
 class ATrueExpr
 special ABoolExpr
-    readable writable attr _n_kwtrue: TKwtrue = null
+    readable var _n_kwtrue: TKwtrue
 end
 class AFalseExpr
 special ABoolExpr
-    readable writable attr _n_kwfalse: TKwfalse = null
+    readable var _n_kwfalse: TKwfalse
 end
 class ANullExpr
-special PExpr
-    readable writable attr _n_kwnull: TKwnull = null
+special AExpr
+    readable var _n_kwnull: TKwnull
 end
 class AIntExpr
-special PExpr
-    readable writable attr _n_number: TNumber = null
+special AExpr
+    readable var _n_number: TNumber
 end
 class AFloatExpr
-special PExpr
-    readable writable attr _n_float: TFloat = null
+special AExpr
+    readable var _n_float: TFloat
 end
 class ACharExpr
-special PExpr
-    readable writable attr _n_char: TChar = null
+special AExpr
+    readable var _n_char: TChar
 end
 class AStringFormExpr
-special PExpr
+special AExpr
 end
 class AStringExpr
 special AStringFormExpr
-    readable writable attr _n_string: TString = null
+    readable var _n_string: TString
 end
 class AStartStringExpr
 special AStringFormExpr
-    readable writable attr _n_string: TStartString = null
+    readable var _n_string: TStartString
 end
 class AMidStringExpr
 special AStringFormExpr
-    readable writable attr _n_string: TMidString = null
+    readable var _n_string: TMidString
 end
 class AEndStringExpr
 special AStringFormExpr
-    readable writable attr _n_string: TEndString = null
+    readable var _n_string: TEndString
 end
 class ASuperstringExpr
-special PExpr
-    readable writable attr _n_exprs: List[PExpr] = null
+special AExpr
+    readable var _n_exprs: List[AExpr] = new List[AExpr]
 end
 class AParExpr
 special AProxyExpr
 end
 class AProxyExpr
-special PExpr
-    readable writable attr _n_expr: PExpr = null
+special AExpr
+    readable var _n_expr: AExpr
 end
 class AAsCastExpr
-special PExpr
-    readable writable attr _n_expr: PExpr = null
-    readable writable attr _n_kwas: TKwas = null
-    readable writable attr _n_type: PType = null
+special AExpr
+    readable var _n_expr: AExpr
+    readable var _n_kwas: TKwas
+    readable var _n_type: AType
+end
+class AAsNotnullExpr
+special AExpr
+    readable var _n_expr: AExpr
+    readable var _n_kwas: TKwas
+    readable var _n_kwnot: TKwnot
+    readable var _n_kwnull: TKwnull
+end
+class AIssetAttrExpr
+special AAttrFormExpr
+    readable var _n_kwisset: TKwisset
 end
+class AAssignOp special Prod end
 class APlusAssignOp
-special PAssignOp
-    readable writable attr _n_pluseq: TPluseq = null
+special AAssignOp
+    readable var _n_pluseq: TPluseq
 end
 class AMinusAssignOp
-special PAssignOp
-    readable writable attr _n_minuseq: TMinuseq = null
+special AAssignOp
+    readable var _n_minuseq: TMinuseq
+end
+class AClosureDef
+special ALabelable
+    readable var _n_bang: TBang
+    readable var _n_id: AClosureId
+    readable var _n_ids: List[TId] = new List[TId]
+    readable var _n_kwdo: nullable TKwdo = null
+    readable var _n_expr: nullable AExpr = null
+end
+class AClosureId
+special Prod
+end
+class ASimpleClosureId
+special AClosureId
+    readable var _n_id: TId
+end
+class ABreakClosureId
+special AClosureId
+    readable var _n_kwbreak: TKwbreak
 end
 class AQualified
-special PQualified
-    readable writable attr _n_id: List[TId] = null
-    readable writable attr _n_classid: TClassid = null
+special Prod
+    readable var _n_id: List[TId] = new List[TId]
+    readable var _n_classid: nullable TClassid = null
 end
 class ADoc
-special PDoc
-    readable writable attr _n_comment: List[TComment] = null
+special Prod
+    readable var _n_comment: List[TComment] = new List[TComment]
 end
 
 class Start
 special Prod
-    readable writable attr _n_base: PModule
-    readable writable attr _n_eof: EOF
+    readable var _n_base: nullable AModule
+    readable var _n_eof: EOF
 end