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

查看:155
本文介绍了添加语言到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字节code和获取作为一个起点上的虚拟机上运行。

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的,你将基本需要编写自己的编译器编译的对象到美国广播公司(由ActionScript字节code)。该 AVM2概述文档可从Adobe在ABC和AVM2这应有助于你开始。这是一个相当全面的文档,但保持警觉几个错字在字节code的说明。

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.

您还需要包装字节code在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.

如果你想编写的数据结构(优化廉政格式等)获得领先地位,随意签出code在asmock,一个动态的嘲讽项目我一直在工作。该SWF /字节code生成的东西有点混乱,但还有为IDataOutput包装(<一href="https://asmock.svn.sourceforge.net/svnroot/asmock/trunk/source/ASMock/src/flemit/framework/SWFOutput.as"相对=nofollow> SWF ,<一个href="https://asmock.svn.sourceforge.net/svnroot/asmock/trunk/source/ASMock/src/flemit/framework/byte$c$c/Byte$c$cWriter.as"相对=nofollow>字节code )可能会派上用场。

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天全站免登陆