Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmrun.cpp
More file actions
Latest commit
33 lines (28 loc) · 807 Bytes
/
Copy pathmrun.cpp
File metadata and controls
33 lines (28 loc) · 807 Bytes
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
#include"mrun.h"
boolBreakpoint::hit(int s, Environment& e) {
if (step >= 0 && step != s) returnfalse;
return cond->eval(e).b();
}
intExecutionContext::breakpoint() {
Environment& e = envs.back();
for (int i=0; i<brks.size(); i++)
if (brks[i].hit(step, e)) return i;
return0;
}
// GOTO, GOSUB, RETURN, TGOTO, FGOTO,
// PCALL, PRETURN
intExecutionContext::stepInto() {
int s = ++step;
Environment& e = envs.back();
Ast *a = prog->steps[s];
switch (a->t) {
// case GOTO: step = a->l;
// case GOTOC: if (a->c->eval().b()) step = a->l;
// case GOSUBC: if (a->c->eval().b()) { rets.push_back(step); step = a->l; }
// case RETURN: step = rets.size()? rets.back() : -1; rets.pop_back();
// case CALLP:
//
// case
}
returnbreakpoint();
}