从简单文本生成源代码的编译器可以被视为源到源编译器吗?
Can a compiler, that generate a source code from a simple text, be considered as a source-to-source compiler?
我正在编写一个编译器来从随机的简单文本生成 JSON 代码,但我不了解这类编译器的类型。我可以将其视为源到源编译器吗?
A source-to-source compiler is a compiler that takes the source code of a program written in one programming language as its input and produces the equivalent source code in another programming language.
(问题是输入的是文本,而不是用一种编程语言编写的程序的源代码)
或者是否有其他类型的编译器?
谢谢
通常,源到源编译器被理解为
translate between programming languages that operate at approximately the same level of abstraction
因此,我认为——如果 "random simple text" 你的意思是一个简单的英语阶段——你只是在编写一个普通的旧编译器。
I.E.,我认为英语是 "high-level language," 和 JSON 是相对的 "low-level language." 因此这意味着您正在从较高的抽象级别编译到较低的抽象级别 -就像一个普通的编译器。
我正在编写一个编译器来从随机的简单文本生成 JSON 代码,但我不了解这类编译器的类型。我可以将其视为源到源编译器吗?
A source-to-source compiler is a compiler that takes the source code of a program written in one programming language as its input and produces the equivalent source code in another programming language.
(问题是输入的是文本,而不是用一种编程语言编写的程序的源代码)
或者是否有其他类型的编译器? 谢谢
通常,源到源编译器被理解为
translate between programming languages that operate at approximately the same level of abstraction
因此,我认为——如果 "random simple text" 你的意思是一个简单的英语阶段——你只是在编写一个普通的旧编译器。
I.E.,我认为英语是 "high-level language," 和 JSON 是相对的 "low-level language." 因此这意味着您正在从较高的抽象级别编译到较低的抽象级别 -就像一个普通的编译器。