向 AVM2 添加语言

发布于 2024-07-12 09:05:34 字数 239 浏览 10 评论 0原文

我对创建一种在 AVM2 上运行的语言很感兴趣,并且正在寻求从哪里开始的建议。 我确实意识到这绝不是一项微不足道的任务,但我想尝试一下,至少在此过程中了解更多有关实现语言的知识。

我一直在研究 ANTLR,并一直在阅读语言开发的语法问题。 我正在寻找的是有关采取路径的建议或有用的参考资料/书籍。

例如,我想生成(脚本/手动)一些非常简单的 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.

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.

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.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

蓝礼 2024-07-19 09:05:35

如果您对 Haxe 不感兴趣,您基本上需要编写自己的编译器,将对象编译为 ABC(Actionscript 字节代码)。 Adobe 在 ABC 上提供的 AVM2 概述 文档以及 AVM2 应该帮助您开始。 这是一个相当详尽的文档,但请注意字节码指令中的一些拼写错误。

您还需要将字节码包装在 doABC 标记中,作为 SWF 容器的一部分。 您可以从 SWF 文件格式文档中获取更多信息。

如果您想在编写数据结构(优化的 int 格式等)方面取得先机,请随时查看 asmock 上的代码,这是我一直在从事的一个动态模拟项目。 SWF/ByteCode 生成内容有点混乱,但有 IDataOutput 包装器(SWF, ByteCode)可能会派上用场。

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.

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.

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.

油饼 2024-07-19 09:05:35

Adobe 的 Project Alchemy 可以作为一个很好的参考
http://labs.adobe.com/technologies/alchemy/

进展如何?
我也有兴趣做一个 Java 到 AVM2 编译器......
你有发布的代码吗?

Project Alchemy by Adobe can be a good reference
http://labs.adobe.com/technologies/alchemy/

How did it go?
I'm also interested in doing a Java to AVM2 compiler...
Do you have any published code?

素年丶 2024-07-19 09:05:35

看看 Haxe:它是一种开源语言,可以针对不同的平台,包括 AVM。 您可以深入研究 SWF 编译器源代码以获得一些灵感。

Take a look at Haxe: it is an open source language that can target different platforms, including the AVM. You can dig into the SWF compiler source code to get some inspiration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文