且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

帮助我的编程语言

更新时间:2023-11-20 16:09:04

请参阅对您问题的评论.

显然,您的语言没有被用作编译语言,但是您想添加编译内容.重要的是要了解并非所有的语言都允许编译.它完全取决于语言本身的属性.

可以对称为编译语言"的多种语言进行编译,请参见:
http://en.wikipedia.org/wiki/Compiled_language [ http://en.wikipedia.org/wiki/Compiled_language [ http://en.wikipedia.org/wiki/Interpretive_language [ http://en.wikipedia.org/wiki/Common_Language_Runtime [ http://en.wikipedia.org/wiki/Common_Intermediate_Language [ http://en.wikipedia.org/wiki/.NET_language [ http://en.wikipedia.org/wiki/Phalanger_%28compiler%29 [ ^ ](示例:适用于.NET的PHP).

我建议您尝试创建编译语言.使用.NET,这更容易实现,因为您可以直接将代码编译为CodeDOM,因此您不必担心代码生成的细节.

请参阅:
http://msdn.microsoft.com/en-us/library/650ax5cx [ ^ ],
http://msdn.microsoft.com/en-us/library/650ax5cx [ ^ ],
http://msdn.microsoft.com/en-us/library/ms404261 [ ^ ].

—SA
Please see the comments to your question.

Apparently, your language is not used as a compiled language, but you want to add the compilation. It''s important to understand that not all languages allow compilation. It totally depends on the properties of a language itself.

Compilation is possible for a broad class of languages called "compiled languages", please see:
http://en.wikipedia.org/wiki/Compiled_language[^].

As we are not familiar with the properties of your languages, it''s impossible to answer if it allows compilation or not.

It''s interesting to note that, by the nature of CLR, all .NET languages are compiled. Their compilers compile the source code to Common Intermediate Language (CIL); and CIL is compiled to the instruction-set code during execution; normally on the per-call basis. This is true even for .NET languages based on a formerly interpretive languages, such as PHP.

Please see:
http://en.wikipedia.org/wiki/Compiled_language[^],
http://en.wikipedia.org/wiki/Interpretive_language[^],
http://en.wikipedia.org/wiki/Common_Language_Runtime[^],
http://en.wikipedia.org/wiki/Common_Intermediate_Language[^],
http://en.wikipedia.org/wiki/.NET_languages[^],
http://en.wikipedia.org/wiki/Phalanger_%28compiler%29[^] (an example: PHP for .NET).

I would advise you try to create compiled languages. With .NET, this is much easier to do, because you can compile your code directly to CodeDOM, so you don''t have to take care about the detail of code generation.

Please see:
http://msdn.microsoft.com/en-us/library/650ax5cx[^],
http://msdn.microsoft.com/en-us/library/650ax5cx[^],
http://msdn.microsoft.com/en-us/library/ms404261[^].

—SA