编写编译器时,编程语言需要哪些语言功能? [英] What language features are required in a programming language to make a compiler?

查看:101
本文介绍了编写编译器时,编程语言需要哪些语言功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编程语言似乎经历了多个阶段.首先,有人梦想着一种新的语言,即Foo语言.编译器/解释器是用另一种语言编写的,通常是C或其他一些低级语言.在某个时候,FooL会成熟并成长,最终某个地方的某个人会在FooL本身中为FooL编写编译器和/或解释器.

Programming languages seem to go through several stages. Firstly, someone dreams up a new language, Foo Language. The compiler/interpreter is written in another language, usually C or some other low level language. At some point, FooL matures and grows, and eventually someone, somewhere will write a compiler and/or interpreter for FooL in FooL itself.

我的问题是:使得某人可以自己实现该语言的最小语言功能是什么?

My question is this: What is the minimal subset of language features such that someone could implement that language in itself?

推荐答案

即使使用图灵机-通用图灵机基本上是任何图灵的编译器/解释器机器,因此任何完全翻页语言都应足够:)

Compiler can be written even using a Turing machine - a Universal Turing Machine is basically a compiler/interpreter of any Turing machine, so any Turing-complete language should be enough :)

这篇关于编写编译器时,编程语言需要哪些语言功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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