-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLoad.st
56 lines (38 loc) · 816 Bytes
/
Load.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Instruction subclass: Load [
Load class >> load: aType from: anObject to: aSymbol [
^ self new
load: aType from: anObject to: aSymbol;
yourself
]
| type source dest |
load: aType from: anObject to: aSymbol [
type := aType.
source := anObject.
dest := aSymbol
]
type [
^ type
]
source [
^ source
]
destination [
^ dest
]
readFrom: aByteArray at: anInteger [
^ self type readFrom: aByteArray at: anInteger
]
accept: aVisitor [
aVisitor visitLoad: self
]
printOn: aStream [
aStream
nextPutAll: 'load ', type name.
aStream
nextPutAll: ' from '.
source printOn: aStream.
aStream
nextPutAll: ' to '.
dest printOn: aStream
]
]