+# An explicit intrude visibility modifier
+class AIntrudeVisibility
+ super AVisibility
+ # The `intrude` keyword
+ var n_kwintrude: TKwintrude is writable, noinit
+end
+
+# A class definition
+#
+# While most definitions are `AStdClassdef`s,
+# there are 2 special cases of class definitions.
+abstract class AClassdef
+ super Prod
+ # All the declared properties (including the main method)
+ var n_propdefs = new ANodes[APropdef](self)
+end
+
+# A standard class definition with a name, superclasses and properties
+class AStdClassdef
+ super AClassdef
+ super ADefinition
+
+ # The class kind (interface, abstract class, etc.)
+ var n_classkind: AClasskind is writable, noinit
+
+ # The name of the class
+ var n_qid: nullable AQclassid = null is writable
+
+ # The `[` symbol
+ var n_obra: nullable TObra = null is writable
+
+ # The list of formal parameter types
+ var n_formaldefs = new ANodes[AFormaldef](self)
+
+ # The `]` symbol
+ var n_cbra: nullable TCbra = null is writable
+
+ # The extern block code
+ var n_extern_code_block: nullable AExternCodeBlock = null is writable
+
+ # The `end` keyword
+ var n_kwend: TKwend is writable, noinit
+
+ fun n_superclasses: Array[ASuperPropdef] do
+ return [for d in n_propdefs do if d isa ASuperPropdef then d]
+ end
+
+ redef fun hot_location do return n_qid.location
+end
+
+# The implicit class definition of the implicit main method
+class ATopClassdef
+ super AClassdef
+end
+
+# The implicit class definition of the top-level methods
+class AMainClassdef
+ super AClassdef
+end
+
+# The modifier for the kind of class (abstract, interface, etc.)
+abstract class AClasskind
+ super Prod
+end
+
+# A default, or concrete class modifier (just `class`)
+class AConcreteClasskind
+ super AClasskind
+
+ # The `class` keyword.
+ var n_kwclass: TKwclass is writable, noinit
+end
+
+# An abstract class modifier (`abstract class`)
+class AAbstractClasskind
+ super AClasskind
+
+ # The `abstract` keyword.
+ var n_kwabstract: TKwabstract is writable, noinit
+
+ # The `class` keyword.
+ var n_kwclass: TKwclass is writable, noinit
+end
+
+# An interface class modifier (`interface`)
+class AInterfaceClasskind
+ super AClasskind
+
+ # The `interface` keyword.
+ var n_kwinterface: TKwinterface is writable, noinit
+end
+
+# An enum/universal class modifier (`enum class`)
+class AEnumClasskind
+ super AClasskind
+
+ # The `enum` keyword.
+ var n_kwenum: TKwenum is writable, noinit
+end
+
+# An extern class modifier (`extern class`)
+class AExternClasskind
+ super AClasskind
+
+ # The `extern` keyword.
+ var n_kwextern: TKwextern is writable, noinit
+
+ # The `class` keyword.
+ var n_kwclass: nullable TKwclass = null is writable
+end
+
+class ASubsetClasskind
+ super AClasskind
+
+ # The `subset` keyword.
+ var n_kwsubset: TKwsubset is writable, noinit
+
+ redef fun visit_all(v) do
+ # TODO: Remove this redefinition once generated from the grammar.
+ v.enter_visit(n_kwsubset)
+ end
+end
+
+# The definition of a formal generic parameter type. eg `X: Y`
+class AFormaldef
+ super Prod
+
+ # The name of the parameter type
+ var n_id: TClassid is writable, noinit
+
+ # The bound of the parameter type
+ var n_type: nullable AType = null is writable
+end
+
+# The definition of a property
+abstract class APropdef
+ super ADefinition
+end
+
+# A definition of an attribute
+# For historical reason, old-syle and new-style attributes use the same `ANode` sub-class
+class AAttrPropdef
+ 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 `isa` keyword, if any
+ var n_kwisa: nullable TKwisa = 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