加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 在野牛中是什么?

发布时间:2020-12-16 10:22:04 所属栏目:百科 来源:网络整理
导读:在第 2.1.2 Grammar Rules for rpcalc节的野牛手册中,写道: In each action,the pseudo-variable $$stands for the semantic value for the grouping that the rule is going to construct. Assigning a value to $$is the main job of most actions 这是否
在第 2.1.2 Grammar Rules for rpcalc节的野牛手册中,写道:

In each action,the pseudo-variable $$stands for the semantic value
for the grouping that the rule is going to construct. Assigning a
value to $$is the main job of most actions

这是否意味着$$用于保存规则的结果?喜欢:

exp exp '+'   { $$= $1 + $2;      }

在开始分配后,$$的典型用法是什么?

解决方法

是的,$$用于保存规则的结果.在分配之后,它通常在某些更高级别(或更低优先级)规则中变为$x.

考虑(例如)输入,如2 * 3 4.假设您遵循正常的优先规则,您将采取类似的行动:{$$= $1 * $3; }.在这种情况下,这将用于2 * 3部分,显然足够,分配6到$$.然后你有{$$= $1 $3;处理添加.对于此操作,$1将被赋予在乘法规则中分配给$$的值6.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读