-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 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 var _n_kwmeth: TKwmeth
-end
-class AInternMethPropdef
-special AMethPropdef
- readable var _n_kwmeth: TKwmeth
-end
-class AExternMethPropdef
-special AMethPropdef
- readable var _n_kwmeth: TKwmeth
- readable var _n_extern: nullable TString = null
-end
-class AConcreteMethPropdef
-special AMethPropdef
- readable var _n_kwmeth: nullable TKwmeth
- readable var _n_block: nullable AExpr = null
-end
-class AConcreteInitPropdef
-special AConcreteMethPropdef
- readable var _n_kwinit: TKwinit
-end
-class AMainMethPropdef
-special AConcreteMethPropdef
+ super APropdef
+
+ # The `var` keyword
+ var n_kwvar: TKwvar is writable, noinit
+
+ # The identifier for a new-style attribute
+ var n_id2: TId is writable, noinit
+
+ # The declared type of the attribute
+ var n_type: nullable AType = null is writable
+
+ # The `=` symbol
+ var n_assign: nullable TAssign = null is writable
+
+ # The initial value, if any (set with `=`)
+ var n_expr: nullable AExpr = null is writable
+
+ # The `do` keyword
+ var n_kwdo: nullable TKwdo = null is writable
+
+ # The initial value, if any (set with `do return`)
+ var n_block: nullable AExpr = null is writable
+
+ # The `end` keyword
+ var n_kwend: nullable TKwend = null is writable
+
+ redef fun hot_location
+ do
+ return n_id2.location
+ end
+end
+
+# A definition of all kind of method (including constructors)
+class AMethPropdef
+ super APropdef
+
+ # The `fun` keyword, if any
+ var n_kwmeth: nullable TKwmeth = null is writable
+
+ # The `init` keyword, if any
+ var n_kwinit: nullable TKwinit = null is writable
+
+ # The `new` keyword, if any
+ var n_kwnew: nullable TKwnew = null is writable
+
+ # The name of the method, if any
+ var n_methid: nullable AMethid = null is writable
+
+ # The signature of the method, if any
+ var n_signature: nullable ASignature = null is writable
+
+ # The `do` keyword
+ var n_kwdo: nullable TKwdo = null is writable
+
+ # The body (in Nit) of the method, if any
+ var n_block: nullable AExpr = null is writable
+
+ # The `end` keyword
+ var n_kwend: nullable TKwend = null is writable
+
+ # The list of declared callbacks (for extern methods)
+ var n_extern_calls: nullable AExternCalls = null is writable
+
+ # The body (in extern code) of the method, if any
+ var n_extern_code_block: nullable AExternCodeBlock = null is writable
+
+ redef fun hot_location
+ do
+ if n_methid != null then
+ return n_methid.location
+ else if n_kwinit != null then
+ return n_kwinit.location
+ else if n_kwnew != null then
+ return n_kwnew.location
+ else
+ return location
+ end
+ end
+end
+
+# The implicit main method
+class AMainMethPropdef
+ super AMethPropdef
+end
+
+class AAnnotPropdef
+ super APropdef
+ super AAnnotation
+end
+
+# A super-class. eg `super X`
+class ASuperPropdef
+ super APropdef
+
+ # The super keyword
+ var n_kwsuper: TKwsuper is writable, noinit
+
+ # The super-class (indicated as a type)
+ var n_type: AType is writable, noinit
+end
+
+
+# Declaration of callbacks for extern methods
+class AExternCalls
+ super Prod
+
+ # The `import` keyword
+ var n_kwimport: TKwimport is writable, noinit
+
+ # The list of declared callbacks
+ var n_extern_calls: ANodes[AExternCall] = new ANodes[AExternCall](self)
+end
+
+# A single callback declaration
+abstract class AExternCall
+ super Prod
+end
+
+# A single callback declaration on a method
+abstract class APropExternCall
+ super AExternCall
+end
+
+# A single callback declaration on a method on the current receiver
+class ALocalPropExternCall
+ super APropExternCall
+
+ # The name of the called-back method
+ var n_methid: AMethid is writable, noinit
+end
+
+# A single callback declaration on a method on an explicit receiver type.
+class AFullPropExternCall
+ super APropExternCall
+
+ # The type of the receiver of the called-back method
+ var n_type: AType is writable, noinit
+
+ # The dot `.`
+ var n_dot: nullable TDot = null is writable
+
+ # The name of the called-back method
+ var n_methid: AMethid is writable, noinit
+end
+
+# A single callback declaration on a method on a constructor
+class AInitPropExternCall
+ super APropExternCall
+
+ # The allocated type
+ var n_type: AType is writable, noinit
+end
+
+# A single callback declaration on a `super` call
+class ASuperExternCall
+ super AExternCall
+
+ # The `super` keyword
+ var n_kwsuper: TKwsuper is writable, noinit
+end
+
+# A single callback declaration on a cast
+abstract class ACastExternCall
+ super AExternCall
+end
+
+# A single callback declaration on a cast to a given type
+class ACastAsExternCall
+ super ACastExternCall
+
+ # The origin type of the cast
+ var n_from_type: AType is writable, noinit
+
+ # The dot (`.`)
+ var n_dot: nullable TDot = null is writable
+
+ # The `as` keyword
+ var n_kwas: TKwas is writable, noinit
+
+ # The destination of the cast
+ var n_to_type: AType is writable, noinit
+end
+
+# A single callback declaration on a cast to a nullable type
+class AAsNullableExternCall
+ super ACastExternCall
+
+ # The origin type to cast as nullable
+ var n_type: AType is writable, noinit
+
+ # The `as` keyword
+ var n_kwas: TKwas is writable, noinit
+
+ # The `nullable` keyword
+ var n_kwnullable: TKwnullable is writable, noinit
+end
+
+# A single callback declaration on a cast to a non-nullable type
+class AAsNotNullableExternCall
+ super ACastExternCall
+
+ # The destination type on a cast to not nullable
+ var n_type: AType is writable, noinit
+
+ # The `as` keyword.
+ var n_kwas: TKwas is writable, noinit
+
+ # The `not` keyword
+ var n_kwnot: TKwnot is writable, noinit
+
+ # The `nullable` keyword
+ var n_kwnullable: TKwnullable is writable, noinit