开发者

Is GCC a LALR(1) compiler?

Can anyone deny/co开发者_开发百科nfirm this??


It can't be, at least not entirely -- the C grammar doesn't fit LALR(1).


http://gcc.gnu.org/ml/gcc-help/2004-08/msg00099.html

The Gcc parser is a LALR grammar file for Bison, which is a LALR parser generator. Therefore, if you want to say that, gcc is LALR.


Yes, GCC is LALR.

"The Gcc parser is a LALR grammar file for Bison, which is a LALR parser generator. Therefore, if you want to say that, gcc is LALR."


This discussion (though old) says gcc is LALR while for C++ it is a hand-written recursive descent one.


The quote above is out of date. All parser of GCC is hand written now. And I am pretty sure cpp is a lalr(k) parser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜