formaldef
= classid annotations? typing_o {-> New formaldef(classid, typing_o.type, annotations)};
-superclass {-> superclass}
- = {super} no kwsuper [n2]:no type annotation_withend {-> New superclass(kwsuper, type, annotation_withend.annotations)}
+superclass {-> propdef}
+ = {super} [doc]:no redef visibility kwsuper [n2]:no type annotation_withend {-> New propdef.super(doc.doc, redef.kwredef, visibility, kwsuper, type, annotation_withend.annotations)}
;
propdefs {-> propdef*}
= propdefn+ no {-> [propdefn.propdef]}
+ | {super} superclass {-> [superclass.propdef]}
| {empty} no {-> []}
;
propdefn {-> propdef}
!toplevel| {init} [doc]:no redef visibility kwinit qmethid? signature annotation_noend? kwdo stmtso kwend_o {-> New propdef.meth(doc.doc, redef.kwredef, visibility, Null, kwinit, Null, qmethid.methid, signature, annotation_noend.annotations, Null, Null, stmtso.expr)}
!toplevel| {type} [doc]:no redef visibility kwtype classid typing annotation_withend {-> New propdef.type(doc.doc, redef.kwredef, visibility, kwtype, classid, typing.type, annotation_withend.annotations)}
!toplevel| {extern_init_implicit} [doc]:no redef visibility kwnew qmethid? signature annotation_noend? extern_calls extern_code_block {-> New propdef.meth(doc.doc, redef.kwredef, visibility, Null, Null, kwnew, qmethid.methid, signature, annotation_noend.annotations, extern_calls, extern_code_block, Null)}
+!toplevel| {super} superclass {-> superclass.propdef}
;
annotation_withend~nonull {-> annotations?}
= {oneliner} kwis many_annotations {-> many_annotations.annotations}
| {extern} kwextern kwclass?
;
formaldef = [id]:classid type? annotations?;
-superclass = kwsuper type annotations?;
propdef = {attr} doc? kwredef? visibility kwvar [id2]:id type? expr? annotations? [block]:expr?
| {main_meth} kwredef? [block]:expr?
| {type} doc? kwredef? visibility kwtype [id]:classid type annotations?
| {meth} doc? kwredef? visibility kwmeth? kwinit? kwnew? methid? signature annotations? extern_calls? extern_code_block? [block]:expr?
+ | {super} doc? kwredef? visibility kwsuper type annotations?
;
methid = {id} id | {plus} plus | {minus} minus | {star} star | {starstar} starstar | {slash} slash | {percent} percent | {eq} eq | {ne} ne | {le} le | {ge} ge | {lt} lt | {gt} gt | {ll} ll | {gg} gg | {bra} obra cbra | {starship} starship | {assign} id assign | {braassign} obra cbra assign;
# The extern block code
var n_extern_code_block: nullable AExternCodeBlock = null is writable
- # The list of super-classes
- var n_superclasses = new ANodes[ASuperclass](self)
-
# 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_id.location
end
var n_type: nullable AType = null is writable
end
-# A super-class. eg `super X`
-class ASuperclass
- super Prod
-
- # 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
-
# The definition of a property
abstract class APropdef
super ADefinition
super AMethPropdef
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