-
Notifications
You must be signed in to change notification settings - Fork 4
/
notes
103 lines (82 loc) · 2.15 KB
/
notes
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Evaluator
* globalActivation : Activation
* currentActivation : Activation
+ step() : Boolean
+ run() : Void
Activation
* args : Array<Object>
* vars : Map<String, Object>
* parent : Activation
* caller : Activation
* stack : Array<Object>
* nextInstruction : Instruction
+ methodActivation : MethodActivation
+ step() : Activation
+ iPush(value : Object) : Activation
+ iDrop() : Activation
+ iNonLocalReturn(value : Object) : Activation
+ iReturn(value : Object) : Activation
+ declVar(name : String, value : Object) : Void
+ setVar(name : String, value : Object) : Void
+ getVar(name : String) : Object
+ getDeclActivation(name : String) : Activation
+ hasVar(name : String) : Boolean
+ classOf(obj : Object) : Class
MethodActivation <: Activation
* method : Method
* receiver : Object
BlockActivation <: Activation
* block : Block
+ return(value : Object) : Activation
Method
* formals : Array<String>
* code : Instruction
Block <: Object
* formals : Array<String>
* code : Instruction
* parent : Activation
Instruction
+ eval(a: Activation) : Activation
// just call the equivalent method in Activation
PushValue <: Instruction
* next : Instruction
* value : Object
PushVar <: Instruction
* next : Instruction
* name : String
PopIntoVar <: Instruction
* next : Instruction
* name : String
DeclVar <: Instruction
* next : Instruction
* name : String
Drop <: Instruction
* next : Instruction
Call <: Instruction
* next : Instruction
* selector : String
* numArgs : Number
ReturnFromBlock <: Instruction
* next : Instruction
Cond <: Instruction
* nextIfTrue : Instruction
* nextIfFalse : Instruction
-------------------------
Class
* superClass : Class
* methods : Map<String, Method>
* instVarNames : Set<String>
+ newInstance() : Instance<Class>
+ lookup(selector : String) : Method
PushThis <: Instruction
* next : Instruction
PushInstVar <: Instruction
* next : Instruction
* name : String
PopIntoInstVar <: Instruction
* next : Instruction
* name : String
MakeNew <: Instruction
* next : Instruction
ReturnFromMethod <: Instruction
* next : Instruction