-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
35 lines (24 loc) · 647 Bytes
/
cli.py
File metadata and controls
35 lines (24 loc) · 647 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
34
35
from isa_cpu import ISACPU
from compiler_cfg import CFGCompiler
from debugger import Debugger
from live_cfg import LiveCFG
def main():
print("🧠 INTERACTIVE LANGUAGE CPU\n")
index = {
"entropy": [10, 50],
"variable": [60, 120],
"energy": [130, 200]
}
cpu = ISACPU(index)
compiler = CFGCompiler()
while True:
text = input("> ")
if text.lower() in ("exit", "quit"):
break
program = compiler.compile(text)
cpu.reset()
cpu.build_labels(program)
dbg = Debugger(cpu, program)
dbg.run()
if __name__ == "__main__":
main()