在OCaml中编写口译员 [英] Writing an interpreter in OCaml

查看:112
本文介绍了在OCaml中编写口译员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在大学里学习一门课程,要求我用OCaml语言编写从操作语义开始的口译员.不幸的是,除了从课程幻灯片中,他们没有给我们提供很多可供学习的资源.有人可以建议我一些书或网站,以便在其中找到一些东西(或类似内容)吗? 谢谢.

I'm following a course in my University that ask me to write an interpreter in OCaml of a language starting from its operational semantics. Unfortunately, they didn't give us much resources from which we can learn about it, except from the lesson's slides. Can someone suggest me some book or some website where I can find something about it (or similar) ? Thanks.

推荐答案

也许您应该尝试类型和编程语言" ,这可能是该主题的一个很好的参考(特别是如果您的输入语言可以正常工作的话).

May be you should try Types and Programming Languages by B. Pierce which is probably a good reference on the topic (especially if your input language is functional).

如果您想深入了解语义学,我建议编程语言的形式语义学.但这对实施没有帮助.

If you want to go deeper into semantics I would advice Formal Semantics of Programming Languages by G. Winskel. But it won't help you with implementation.

最后,如果您需要在某一时刻编译语言而不是对其进行解释,则应该看看 A.Appel编写的ML中的现代编译器实现.

Finally, if at one point you need to compile your language instead of interpreting it you should have a look at Modern Compiler Implementation in ML by A. Appel.

但是这些书可能对您想做的事过于刻板(您的演讲笔记可能就足够了.)

But these books are probably overkills for what you want to do (your lectures notes should probably be enough).

这篇关于在OCaml中编写口译员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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