muf语言模拟器和调试器。
MufSim的Python项目详细描述
用于muf和 MUV 语言,带有gui和命令行界面。
这是not一个完整的垃圾模拟器。这不会不 模拟所有权限和行为。它是,但是 确保正确操作堆栈的方法,以及 调试和测试不需要 部分MUF。
安装
窗口
解压缩MufSimWin64.zip存档文件并放置结果 MufSim.exebinary某个有用的地方。
操作系统x
解压缩MufSimOSX64.zip存档文件并放置结果 MufSim.app应用程序包位于/Applications文件夹中。
Linux
使用pypi安装:
pip install mufsim
从源安装:
python3 setup.py build install
使用gui调试器
窗口
运行MufSim.exe二进制文件以启动gui调试器/ide。
操作系统x
打开MufSim.app应用程序包以启动gui 调试器/IDE。
Linux
运行mufsimgui二进制文件以启动gui调试器/ide。
使用命令行调试器
使用量
mufsim [-h] [-u] [-r] [-t] [-d] [-c COMMAND] [-e TEXTENTRY] [-f TEXTFILE] [-p REGNAME FILE] infile
位置参数
infile | Name of MUF source file to use as input. |
可选参数
-h, –help | Show help message and exit. |
-u, –uncompile | Show compiled MUF tokens. |
-r, –run | Run compiled MUF program. |
-t, –trace | Show stacktrace for each instruction. |
-d, –debug | Run MUF program in interactive debugger. |
-c TEXT, –command TEXT | Specify text to push onto the stack for run. |
-e TEXT, –textentry TEXT | Text line to feed to READs. (multiple allowed) |
-f FILE, –textfile FILE | File of text lines to feed to READs. |
-p NAME FILE, –program NAME FILE | Create extra prog from FILE, registered as $NAME. |
–timing | Show run execution timing. |
交互式调试器
交互式muf调试器(在命令行和gui中)接受 以下命令:
where | Display the call stack. |
stack | Show all data stack items. |
stack DEPTH | Show top DEPTH data stack items. |
list | List next few source code lines. |
list LINE | List source code line. |
list LINE,LINE | List source code between LINEs. |
list FUNC | List source code at beginning of FUNC. |
break LINE | Set breakpoint at line. |
break FUNC | Set breakpoint at func. |
delete BREAKNUM | Delete a breakpoint. |
show breakpoints | Show current breakpoints. |
show functions | List all declared functions. |
show globals | Show all global variables. |
show vars | Show all current function variables. |
step | Step one line, going into calls. |
step COUNT | Step COUNT lines, going into calls. |
next | Step one line, skipping over calls. |
next COUNT | Step COUNT lines, skipping over calls. |
finish | Finish the current function. |
cont | Continue until next breakpoint. |
pop | Pop top data stack item. |
dup | Duplicate top data stack item. |
swap | Swap top two data stack items. |
rot | Rot top three data stack items. |
push VALUE | Push VALUE onto top of data stack. |
print VARIABLE | Print the value in the given variable. |
trace | Turn on tracing of each instr. |
notrace | Turn off tracing if each instr. |
run COMMANDARG | Re-run program, with COMMANDARG. |
添加库
可以使用-p命令添加额外的库程序对象- 行参数,或者在gui应用程序中打开额外的库muf文件。 例如,如果您有以下muf文件:
库foo.muf
$version 1.000 $lib-version 1.000 : foo[ s -- ] me @ s @ "foo" strcat notify ; public foo $libdef foo
命令测试.muf
$include $lib/foo : main[ arg -- ] "Blah" foo ;
您可以在命令行调试器中运行它们,如下所示:
mufsim -r -p lib/foo lib-foo.muf cmd-test.muf
外部客户端连接
您可以从外部客户端连接并登录到播放器对象,以 测试诸如mcp和mcpgui程序之类的东西。这样做,(假设你在 运行mufsim的同一台机器)只需连接到localhost, 端口8888,并使用密码连接到测试用户John_Doe。 password。或:
telnet localhost 8888 connect John_Doe password
有一些简单的构建和聊天muck命令,比如@dig, @link,say,pose等。您还可以与muf交互 程序读取或使用MCP。
模拟淤泥数据库
模拟一个小数据库,以支持各种属性和 与数据库相关的原语。此数据库如下:
Room: Global Environment Room(#0R) Owner: Wizard(#1PWM3) Properties: _defs/.tell: "me @ swap notify" Player: Wizard(#1PWM3) Location: Global Environment Room(#0R) Home: Global Environment Room(#0R) Descriptor: 3 (First online.) Password: potrzebie Properties: sex: "male" Room: Test Chamber #2(#2R) Owner: Wizard(#1PWM3) Registered: $mainroom Properties: _/de:<Description> Exit: test(#3E) Owner: Wizard(#1PWM3) Location: Test Chamber #2(#2R) Linked to: cmd-test(#4FM3) Program: cmd-test(#4FM3) Owner: Wizard(#1PWM3) Location: Wizard(#1PWM3) Registered: $cmd/test Note: The first program file is loaded into this program object. Player: John_Doe(#5PM3) Location: Test Chamber #2(#2R) Home: Test Chamber #2(#2R) Password: password Properties: _/de:<Description> sex: "male" test#: 5 test#/1: "This is line one." test#/2: "This is line two." test#/3: "This is line three." test#/4: "This is line four." test#/5: "This is line five." abc: "prop_abc" abc/def: "prop_def" abc/efg: "prop_efg" abc/efg/hij: "prop_hij" abc/efg/klm: "prop_klm" abc/nop/qrs: "prop_qrs" abc/nop/tuv: "prop_tuv" Player: Jane_Doe(#6PM1) Location: Test Chamber #2(#2R) Home: Test Chamber #2(#2R) Password: password Properties: _/de:<Description> sex: "female" Thing: Test Cube(#7) Location: Test Chamber #2(#2R) Properties: _/de:<Description>
当muf程序加载到gui调试器/ide中时,新程序将 为他们创造。这同样适用于通过^{tt9}加载的额外程序$ 在命令行调试器中。如果你真的需要,你可以连接到 数据库中使用外部连接的播放机之一,您可以使用 许多标准的muck构建命令,比如@dig,@action, @pcreate,@link或类似的。