我必须在哪里开始构建编译器? [英] Where I Have To Start Building A Compiler?

查看:102
本文介绍了我必须在哪里开始构建编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须开始为C ++编程语言构建编译器吗?

我应该使用什么语言来构建编译器?





谢谢

where i have to start building a compiler for C++ programming language?
what language i should use for building a compiler?


thanks

推荐答案

当你问到从哪里开始我可以推荐这一系列文章来自Crenshaw [ ^ ]



至于语言 - 你真正喜欢的任何东西......当天'C'编译器是用'C'编写的!



这个 SO发布 [ ^ ]被关闭为没有建设性但确实有一些适合您的问题的建议



Edi t - 上面的SO帖子现已被删除 - 这是一个类似的帖子 [< a href =http://stackoverflow.com/questions/1669/learning-to-write-a-compilertarget =_ blanktitle =New Window> ^ ]
As you asked where to start I can recommend this series of articles from Crenshaw[^]

As to language - anything you like really ... back in the day the 'C' compiler was written in 'C' !

This SO Post[^] was closed as "not constructive" but does have some suggestions that would be appropriate for your question

Edit - the above SO post has now been removed - here is a similar one[^]


编写编译器是一项复杂的任务,编写 C ++ 编译器是一项令人生畏的任务。

我建议你选择一种更简单的目标语言来开始。你可能需要一些关于这个论点的背景知识(你可以从已经建议的Creenshaw系列开始,或者看看老兄的Wirth的书:编译器构造 [ ^ ],或着名的'龙书' [ ^ ])。

您也可以考虑使用一个用于编写编译器的许多可用工具,例如 flex [ ^ ]和野牛 [ ^ ], ANTLR [ ^ ]等...
Writing a compiler is a complex task, writing a C++ compiler is a daunting task.
I would suggest you to choose a much more simple target language for starting. You probably need some background on the argument (you might start with the already suggested Creenshaw series, or check out the oldie goldie Wirth's book: "Compiler Contruction"[^], or the famous 'Dragon Book'[^]).
You may also consider using one of the many available tools for writing a compiler, e.g. flex[^] and bison[^], ANTLR[^], etc...


有不同的互联网上的开源编译器,但我赞成 LLVM ,因为它是一个新的和现代的开始,现在在XCode IDE中很有效率Apple-世界。它摇滚;-)



考虑开发一些开源项目,而不是开始一些。
There are different open source compilers in the internet, but I would favour the LLVM, because it is a fresh and modern start, which is now productive in the XCode IDE of the Apple- world. And it rocks ;-)

Consider working on some open source project instead of starting some.


这篇关于我必须在哪里开始构建编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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