如何C / C ++编译器的工作? [英] How do C/C++ compilers work?

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

问题描述

在C / C ++编码十年后,我已经注意到了以下的模式 - 非常优秀的程序员往往有编译器的内部结构的详细知识。

After over a decade of C/C++ coding, I've noticed the following pattern - very good programmers tend to have detailed knowledge of the innards of the compiler.

我是一个相当不错的程序员,我有编译器迷信一个特设的收集,所以我想重新启动我的知识和从基础开始。

I'm a reasonably good programmer, and I have an ad-hoc collection of compiler "superstitions", so I'd like to reboot my knowledge and start from the basics.

谁能推荐在线资源的链接或最喜爱的书籍?我在C / C ++编译,优化,GCC和LLVM特别感兴趣。

Can anyone recommend links to online resources or favorite books? I'm particularly interested in C/C++ compiling, optimization, GCC and LLVM.

BTW:在大学我感兴趣的编译器,所以我注册了主题名为解析和翻译。不好动。它结束了教授的车辆在不知情的第三年的计算机科学的学生测试他的先进分析和语法理论的教科书。我留下了没有实际的知识,甚至比以前更糊涂了。

BTW: At university I was interested in compilers, and so I signed up for subject called "Parsing and Translation". Bad move. It ended up being the Professor's vehicle for testing his advanced parsing and grammar theory textbook on unsuspecting 3rd year Comp Sci students. I was left with no practical knowledge, and even more confused than before.

推荐答案

开始与龙书....(应力更上code优化和code代)

Start with the dragon book....(stress more on code optimization and code generation)

再上写了一个教育编程语言如无咖啡因或冷却的编译器..,你可以使用解析器生成(lex和yacc)为您的前端(使生活更轻松,专注于更小鬼的东西)...

Go onto write a toy compiler for an educational programming language like Decaf or Cool.., you may use parser generators (lex and yacc) for your front end(to make life easier and focus on more imp stuff)....

然后用浏览GCC源$ C ​​$ C陪读海合会内部的书。

Then read gcc internals book along with browsing gcc source code.

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

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