向AVM2添加语言 [英] Adding a language to the AVM2

查看:153
本文介绍了向AVM2添加语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣在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添加语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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