问题描述
有人可以向我解释锄头C和C ++都是上下文敏感的吗?
Can someone explain to me hoe both C and C++ are context sensitive??
推荐答案
这可能会让你感到困惑的是区分大小写 ;?
Could it be you''re confusing that with "case-sensitive"?
你指的是语法吗?我怀疑
的几个部分是使它对上下文敏感的语法,但是我会说一个人需要的
事实。知道一个给定的令牌是否是一个类型名称,而解析的是b $ b,是主要原因。两种语言都有typdef关键字
通过定义新的typname来引入上下文敏感性。而且C ++有很多其他的构造,我猜它会这样做,比如模板。
在groups.google.com上搜索,你肯定会得到很多点击。
-Howard
Are you referring to the grammar(s)? I suspect there are several parts of
the grammar(s) that make it context sensitive, but I''d say off-hand that the
fact that one needs to know if a given token is a typename or not, while
parsing, is the main reason. Both languages have the typdef keyword which
introduces context sensitivity by defining a new typname. And C++ has a lot
of other constructs that I''d guess make it so, such as templates.
Search on groups.google.com, and you''re sure to get a lot of hits.
-Howard
这篇关于C和C ++如何对上下文敏感的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!