如何创建编译器 [英] how to create compiler

查看:109
本文介绍了如何创建编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式创建编译器以构建并运行.cs文件,这为我提供了解决方案.

how to programatically create a compiler to build and run a .cs file give me solution.

推荐答案

StartButton -> CMD [ENTER]
csc /out:MyFile.exe mysoource.cs [ENTER]
MyFile [ENTER];



除非您打算自己编写一个编译器,否则在这种情况下,您将需要一本有关编译器编写的书的帮助-这根本不是一件微不足道的任务.



Unless you mean to write a compiler yourself, in which case you are going to need the help of a book on compiler writing - it is not a trivial task in any way at all.


首先,您应该向人们解释一些问题和意图,以更好地帮助您.
还有两个,Google/Yahoo/Bing是您的好朋友.

我用不到不到几秒钟的时间在Google上搜索了用C#编写编译器",它带给我以下有用的链接!

http://blogs.microsoft.co.il/blogs/sasha/archive/2010/10/06/writing-a-compiler-in-c-lexical-analysis.aspx

在c#.net中编写编译器 [ http://stackoverflow.com/questions/821086/resources-for- Writing-ac-sharp-compiler-for-class [ ^ ]

另外,请检查问题在最后一个链接中提供的详细信息种类.那赢得了他/她的很多赞美和回答.

希望能有所帮助.如果是这样,请将答案标记为解决方案和/或投票.

谢谢,
Milind
First, You should explain the question and intention little better for people to help you.
And two, Google/Yahoo/Bing are your pals.

I searched on Google "write a compiler in c#" in less than few seconds, it brought me following useful links !

http://blogs.microsoft.co.il/blogs/sasha/archive/2010/10/06/writing-a-compiler-in-c-lexical-analysis.aspx

write compiler in c#.net[^]

http://stackoverflow.com/questions/821086/resources-for-writing-a-c-sharp-compiler-for-class[^]

Also, check the kind of details poster has provided in the question in last link. That earned him/her lots of praise and answers.

Hope that helps. If it does, mark the answer as solution and/or upvote.

Thanks,
Milind


让我们假设,您不想制作自己的c#编译器,并且对使用Microsoft制造的c#编译器感到满意-他们将其提供给任何未提供此功能的人仅作为命令行工具,也作为库.在这里查看:在运行时编译代码 [
Let''s suppose, you don''t want to make your own c# compiler, and you are satisfied by using the one made by Microsoft - they made it available to anyone not only as command line tool, but also as library. Look here: Compiling code during runtime[^].
If you want to make compiler for an other platform, that''s an other topic... but don''t even try that...


这篇关于如何创建编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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