是有一个简单的编译器为一个小语言 [英] is there a simple compiler for a small language

查看:132
本文介绍了是有一个简单的编译器为一个小语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个简单的编译器编译一个简单的语言,我需要它写一篇关于它,并了解编译器如何工作,我不是寻找一个复杂的东西只是一个简单的语言(简单我的意思是小代码,因为例如gcc是toooooo大)。

I am looking for a simple compiler that compiles a simple language, I need it to write a paper about it and to learn how compilers work, I am not looking for a sophisticated thing just a simple language (by simple I mean a small code because for example gcc is toooooo big). any help is appreciated.


推荐答案

如果你想看代码,我对Eijiro Sumii的 MinCaml 编译器。

  • It's only 2000 lines long.


  • 只有2000行。

It compiles a pretty interesting source language.

编译代码的速度与gcc和原生OCaml编译器竞争。

Speed of compiled code is competetive with gcc and the native OCaml compilers.

我提到我的印象非常深刻吗?

Did I mention I've been very impressed?

这篇关于是有一个简单的编译器为一个小语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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