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

查看:30
本文介绍了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,因为道路上有太多障碍(例如,在组装中建造扫雷舰,虽然并非不可能,但非常困难,而且是个坏主意.)?

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.

控件可以从 这里.

这篇关于VB6 解析器/词法分析器/脚本器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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