一般问题 - 这是一个编译器,还是一个解释器? [英] General question - is this a compiler, or is it an interpreter?

查看:104
本文介绍了一般问题 - 这是一个编译器,还是一个解释器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



只是一般问题:



一种简化的编程语言然后使用高级编程语言(如C ++)解释/编译(?)以提供输出:编译器或解释器



例如



Hello,

Just a general question:

A made-up programming language that is then interpreted/compiled(?) using a high-level programming language such as C++ to give output is what: a compiler or an interpreter

E.g.

MoveCursor(132, 242 (Spline))

- 编写语言示例。



然后将解释/编译(?)以使用高级语言将光标移动到某个位置。高级语言将处理样条算法,计时器函数等。



我的问题是:这是一种源语言源编译器吗?或者是翻译吗?



感谢您的帮助。



我有什么试过:



阅读编译器和口译员;但是,如果这是我的最终项目,我需要知道我实际上在做什么。

- made up programming language example.

This would then be interpreted/compiled(?) to move the cursor to a certain position with a high-level language. The high level language would take care of the spline algorithm, the timer functions, etc.

My question is: Is this made up language a source-to-source compiler, or is it an interpreter?

Thanks for your help.

What I have tried:

Reading up on compilers and interpreters; however, if this is to be my ultimate project, I need to know for absolute sure what it is that I'm actually doing.

推荐答案

引用:

我的问题是:这个组成语言是源到源编译器,还是解释器?

My question is: Is this made up language a source-to-source compiler, or is it an interpreter?

都不是。它是一种编程语言。



编译器是一种将代码从一种语言转换为另一种语言的程序(例如,C到汇编程序)。解释器是执行用编程语言编写的指令的程序(无需编译)。你的语言还没有这些:充其量,你所拥有的只是一种语言规范。



创建一个完整的语言规范(而不仅仅是一个命令),无论你是创建一个解释器还是编译器,它仍然取决于你(另一个开发人员总是可以决定创建另一个,从你的语言规范开始)。语言没有解释或编译属性,但您的实现确实如此。

Neither. It's a programming language.

A compiler is a program that transforms code from one language to another (for example, C to Assembler). An interpreter is a program that performs instructions written in a programming language (without requiring compilation). You don't have any of these yet for your language: at best, all you have is a language specification.

After creating a full language specification (rather than just one command), it's still up to you whether you create an interpreter or compiler (and another developer could always decide to create the other one, starting from your language specification). A language doesn't have the property "interpreted" or "compiled", but your implementation does.


这篇关于一般问题 - 这是一个编译器,还是一个解释器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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