使用C#和visual studio 2017创建C编译器 [英] Create C compiler using C# and visual studio 2017

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

问题描述

如何使用C#和Visual Studio 2017编写程序,编写代码源编写C编程,我该怎么做?编写这个程序的任何简单解决方案?如果没有,那么我如何使用flex和Bison进行该程序?如果C#没有做这个工作,那么我可以用来创建这个C编译器的完美语言,谢谢



我尝试过的:



我试图编写一个程序,可以编译C代码源并显示程序输出中的错误(界面)

How can i write a program using C# and visual studio 2017 that compile a code source writing on C programming, How can i do that? any simple solution to write this program? if not , so how can i use flex and bison for that program ? If C# didn't do this job, what is the perfect language that i can use to create this C compiler, thanks

What I have tried:

I tried to coding a program that can compile a C code source and show errors in output of my program (interface)

推荐答案

你有没有尝试谷歌搜索如何编写C编译器 [ ^ ]?



这不是一项微不足道的任务。没有什么简单的。



现在,如果你只想编译C代码,你可以随时启动CL.exe命令行编译器。 />


我不知道这个项目的意图是什么,所以不可能告诉你什么是最好的。
Have you tried Googling for "How to write a C compiler[^]"?

This is not a trivial task. There is nothing simple about it.

Now, if you were looking to just compile C code, you could always just launch the CL.exe command line compiler.

I have no idea what the intent of this project is so it's impossible to tell you "what's best".


建立一个 C 编译器从头开始,尽管可行,但相当复杂。

工具如 flex bison 实际上会简化任务。但是,它们以 C / C ++ 为导向。您可以查看 ANTLR [ ^ ]。
Building a C compiler from scratch, altough feasible, is rather complex.
Tools like flex and bison would actually simplify the task. However, they are C/C++ oriented. You might have a look at ANTLR[^].


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

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