abstract class
compiler::SlotDef
sys::Obj
compiler::Node
compiler::DefNode
compiler::SlotDef
Mixin: compiler::CSlot
1 //
2 // Copyright (c) 2006, Brian Frank and Andy Frank
3 // Licensed under the Academic Free License version 3.0
4 //
5 // History:
6 // 19 Jul 06 Brian Frank Creation
7 //
8
9 **
10 ** SlotDef models a slot definition - a FieldDef or MethodDef
11 **
12 abstract class SlotDef : DefNode, CSlot
13 {
14
15 //////////////////////////////////////////////////////////////////////////
16 // Construction
17 //////////////////////////////////////////////////////////////////////////
18
19 new make(Location location, TypeDef parentDef)
20 : super(location)
21 {
22 this.parentDef = parentDef
23 }
24
25 //////////////////////////////////////////////////////////////////////////
26 // DefNode
27 //////////////////////////////////////////////////////////////////////////
28
29 override Namespace ns() { return parent.ns }
30
31 //////////////////////////////////////////////////////////////////////////
32 // CSlot
33 //////////////////////////////////////////////////////////////////////////
34
35 override CType parent() { return parentDef }
36 override Str qname() { return "${parent.qname}.${name}" }
37
38 //////////////////////////////////////////////////////////////////////////
39 // Tree
40 //////////////////////////////////////////////////////////////////////////
41
42 abstract Void walk(Visitor v, VisitDepth depth)
43
44 //////////////////////////////////////////////////////////////////////////
45 // Fields
46 //////////////////////////////////////////////////////////////////////////
47
48 readonly TypeDef parentDef // parent TypeDef
49 override Str name // slot name
50 Bool overridden := false // set by Inherit when successfully overridden
51
52 }
2 // Copyright (c) 2006, Brian Frank and Andy Frank
3 // Licensed under the Academic Free License version 3.0
4 //
5 // History:
6 // 19 Jul 06 Brian Frank Creation
7 //
8
9 **
10 ** SlotDef models a slot definition - a FieldDef or MethodDef
11 **
12 abstract class SlotDef : DefNode, CSlot
13 {
14
15 //////////////////////////////////////////////////////////////////////////
16 // Construction
17 //////////////////////////////////////////////////////////////////////////
18
19 new make(Location location, TypeDef parentDef)
20 : super(location)
21 {
22 this.parentDef = parentDef
23 }
24
25 //////////////////////////////////////////////////////////////////////////
26 // DefNode
27 //////////////////////////////////////////////////////////////////////////
28
29 override Namespace ns() { return parent.ns }
30
31 //////////////////////////////////////////////////////////////////////////
32 // CSlot
33 //////////////////////////////////////////////////////////////////////////
34
35 override CType parent() { return parentDef }
36 override Str qname() { return "${parent.qname}.${name}" }
37
38 //////////////////////////////////////////////////////////////////////////
39 // Tree
40 //////////////////////////////////////////////////////////////////////////
41
42 abstract Void walk(Visitor v, VisitDepth depth)
43
44 //////////////////////////////////////////////////////////////////////////
45 // Fields
46 //////////////////////////////////////////////////////////////////////////
47
48 readonly TypeDef parentDef // parent TypeDef
49 override Str name // slot name
50 Bool overridden := false // set by Inherit when successfully overridden
51
52 }