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

位置参数

infileName of MUF source file to use as input.

可选参数

-h, –helpShow help message and exit.
-u, –uncompileShow compiled MUF tokens.
-r, –runRun compiled MUF program.
-t, –traceShow stacktrace for each instruction.
-d, –debugRun MUF program in interactive debugger.
-c TEXT, –command TEXTSpecify text to push onto the stack for run.
-e TEXT, –textentry TEXTText line to feed to READs. (multiple allowed)
-f FILE, –textfile FILEFile of text lines to feed to READs.
-p NAME FILE, –program NAME FILECreate extra prog from FILE, registered as $NAME.
–timingShow run execution timing.

交互式调试器

交互式muf调试器(在命令行和gui中)接受 以下命令:

whereDisplay the call stack.
stackShow all data stack items.
stack DEPTHShow top DEPTH data stack items.
listList next few source code lines.
list LINEList source code line.
list LINE,LINEList source code between LINEs.
list FUNCList source code at beginning of FUNC.
break LINESet breakpoint at line.
break FUNCSet breakpoint at func.
delete BREAKNUMDelete a breakpoint.
show breakpointsShow current breakpoints.
show functionsList all declared functions.
show globalsShow all global variables.
show varsShow all current function variables.
stepStep one line, going into calls.
step COUNTStep COUNT lines, going into calls.
nextStep one line, skipping over calls.
next COUNTStep COUNT lines, skipping over calls.
finishFinish the current function.
contContinue until next breakpoint.
popPop top data stack item.
dupDuplicate top data stack item.
swapSwap top two data stack items.
rotRot top three data stack items.
push VALUEPush VALUE onto top of data stack.
print VARIABLEPrint the value in the given variable.
traceTurn on tracing of each instr.
notraceTurn off tracing if each instr.
run COMMANDARGRe-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_Doepassword。或:

telnet localhost 8888
connect John_Doe password

有一些简单的构建和聊天muck命令,比如@dig@linksaypose等。您还可以与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或类似的。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java操作数组上的字符串   java JAXB内容未实例化   图形在Java中如何绘制垂直居中的字符串?   java Apache Ant:使用Junit时出现NoClassDefFoundError   java无法从服务器上运行perl脚本   如何在java中沿树进行预排序遍历,并打印0和1以对应每个节点上的特定字符?   java如何创建。p12文件?   java线程访问无效   java只匹配命名空间中的XML节点,而不知道NS前缀   从java获取2d arraylist元素   数组Java动态集合对象   java Xpath通过通配符或布尔运算查找以相同名称开头的节点?   java注释元素类型   java在中看不到Super()。反编译后的类文件