VB6解析器/词法分析器/脚本编写器 [英] VB6 Parser/Lexer/Scripter

查看:148
本文介绍了VB6解析器/词法分析器/脚本编写器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VB6中有一个游戏,它可以很好地运行,但我一直在尝试创建脚本引擎.我想我希望VB6为我读取纯文本脚本文件,然后进行lex/parse/execute它们.

I've got a game in VB6 and it works great and all, but I have been toying with the idea of creating a scripting engine. Ii'm thinking I'd like VB6 to read in flat text script files for me and then lex/parse/execute them.

我有很好的编程经验,并且我之前已经构建了一个简单的C编译器以及一个LOGO仿真器.

I have good programming experience, and I've built a simple C compiler, as well as a LOGO emulator before.

我的问题是: 我可以使用诸如Lexx/Yakk/Bison之类的任何工具来帮助我吗?我应该如何处理有关词法分析,解析以及将命令反馈给VB6的问题,以便我可以处理它们?从思路上讲有太多障碍(例如,尽管不是不可能,但在装配过程中建造扫雷车是非常困难的,并且是一个坏主意),所以这个想法是否是 Bad IDEA ?/p>

My question is: Are there any tools that I can use, like Lexx/Yakk/Bison to help me? How should I approach this problem in regards to lexing, parsing, and feeding the commands back to VB6 so I can handle them? Is this idea a BAD IDEA in the sense that there are too many obstacles in the way (For example, building minesweeper in assembly, though not impossible, is very difficult, and a bad idea.)?

推荐答案

如果您愿意使用VBScript而不是VB6,则可以只使用MSScriptControl来运行命令,而不必创建自己的命令. 此处是讨论从.Net应用程序使用它的文章. ActiveX控件,因此应该给您很大的灵活性.

If you're willing to use VBScript rather than VB6 you might be able to just use the MSScriptControl to run the commands rather than creating your own. Here's an article discussing using it from a .Net app, though it's an ActiveX control so should give you quite a bit of flexibility.

可以从 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆