2016-11-18 18:11:13 +00:00
|
|
|
##
|
|
|
|
## the Class object should be a variable-pointer object because
|
|
|
|
## it needs to accomodate class instance variables.
|
|
|
|
##
|
2017-01-06 09:53:40 +00:00
|
|
|
class(#pointer) Class(Apex)
|
2015-10-08 14:26:04 +00:00
|
|
|
{
|
2017-01-06 09:53:40 +00:00
|
|
|
dcl spec selfspec superclass subclasses name instvars classvars classinstvars pooldics instmthdic classmthdic.
|
2016-05-03 10:10:28 +00:00
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method(#class) basicNew
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
|
|
|
## you must not instantiate a new class this way.
|
|
|
|
self cannotInstantiate.
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method(#class) initialize
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
|
|
|
^self.
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
(* most of the following methods can actually become class methods of Apex.
|
|
|
|
* if the instance varibles can be made accessible from the Apex class. *)
|
|
|
|
|
|
|
|
method name
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
|
|
|
^self.name
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method superclass
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
|
|
|
^self.superclass
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method specNumInstVars
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
|
|
|
## shift right by 7 bits.
|
|
|
|
## see stix-prv.h for details.
|
|
|
|
^self.spec bitShift: -7
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
(*method inheritsFrom: aSuperclass
|
2016-05-03 10:10:28 +00:00
|
|
|
{
|
|
|
|
| c |
|
|
|
|
c := self superclass.
|
|
|
|
[c notNil] whileTrue: [
|
|
|
|
[ c == aSuperclass ] ifTrue: [^true].
|
|
|
|
c := c superclass.
|
|
|
|
].
|
|
|
|
^false
|
2017-01-06 09:53:40 +00:00
|
|
|
}*)
|
2015-10-08 14:26:04 +00:00
|
|
|
}
|