向AVM2添加语言

编程入门 行业动态 更新时间:2024-10-12 01:24:41
本文介绍了向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添加语言

本文发布于:2023-11-06 03:47:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562644.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语言

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!