我有兴趣在AVM2上运行一个语言,我正在寻找从哪里开始的建议。我意识到这不是一个微不足道的任务,但我想尝试一下,至少学习更多关于实现一种语言的路上。
I'm interested in making a language to run on the AVM2 and I'm looking for advice on where to start. I do realize that this is by no means a trivial task, but I would like to give it a try and at the very least learn more about implementing a language along the way.
我搞乱了ANTLR,并一直在阅读语法开发的语法问题。
I have messed around with ANTLR and have been reading up on syntax issues for language development. What I'm looking for is advice on a path to take or useful references/books.
例如,我想生成(脚本/手动)一些非常简单的AVM2
For instance I would like to generate (script/manually) some very simple AVM2 bytecode and get that to run on the VM as a start.
感谢
推荐答案如果你对haXe不感兴趣,你基本上需要编写自己的编译器,编译对象到ABC(Actionscript字节代码)。 Adobe提供的ABC上的 AVM2概述文档和AVM2帮助您开始。
If you are not interested in haXe, you will basically need to write your own compiler that compiles objects down to ABC (Actionscript Byte Code). The AVM2 Overview document available from Adobe on ABC and the AVM2 which should help you get started. It's a fairly thorough document but stay alert for a few typo's in the bytecode instructions.
您还需要将字节码包装在doABC标签中作为SWF容器的一部分。这是一个相当详细的文档,但在字节码指令中保持警告。 。您可以从 SWF文件格式文档中获取更多信息。
You will also need to wrap the bytecode in a doABC tag as part of a SWF container. You can get more information from the SWF File Format documentation.
如果你想编写数据结构(优化的int格式等等),请随时查阅asmock的代码,这是一个动态模拟项目工作。 SWF / ByteCode生成东西有点乱,但有IDataOutput包装器( SWF , ByteCode )可能会派上用场。
If you'd like a headstart on writing the data structures (optimised int formats, etc), feel free to checkout the code at asmock, a dynamic mocking project I've been working on. The SWF/ByteCode generation stuff is a bit messy but there are IDataOutput wrappers (SWF, ByteCode) that might come in handy.
更多推荐
向AVM2添加语言
发布评论