被GCC和Clang的解析器真的手写的吗? [英] Are GCC and Clang parsers really handwritten?

查看:286
本文介绍了被GCC和Clang的解析器真的手写的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个都叫礼Bendersky 在其博客中表示GCC和Clang的解析器是手写写的,不与YACC的帮助下完成或任何其他编译器编译器。此外,他似乎是说,他们是递归下降解析器。

A guy named Eli Bendersky wrote in his blog that GCC and Clang parser are handwritten, that is not done with the help of yacc or any other compiler-compiler. Furthermore he seems to say that they are recursive-descent parsers.

莫非有人在这里证实,一些主流的编译器框架仍然采取这种手写的解析器?

Could someone here confirm that some mainstream compiler frameworks still resort to such handwritten parsers?

更新关于这一主题这里有趣的博客

推荐答案

是:


  • 在GCC时使用的YACC(野牛)分析器一次,但它与在3.x系列的一些点手写递归下降解析器代替:看的http://gcc.gnu.org/wiki/New_C_Parser 获取链接到相关的补丁提交。

  • GCC used a yacc (bison) parser once upon a time, but it was replaced with a hand-written recursive descent parser at some point in the 3.x series: see http://gcc.gnu.org/wiki/New_C_Parser for links to relevant patch submissions.

锵还采用了手写的递归下降解析器:请参见对于C一个统一的解析器,目标C,C ++和Objective C ++附近的 http://clang.llvm.org/features.html

Clang also uses a hand-written recursive descent parser: see the section "A single unified parser for C, Objective C, C++ and Objective C++" near the end of http://clang.llvm.org/features.html .

这篇关于被GCC和Clang的解析器真的手写的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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