c – 在野牛中是什么?

c – 在野牛中是什么?,第1张

概述在第 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 mai 在第 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 '+'   { $$=  + ;      }

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

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

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

总结

以上是内存溢出为你收集整理的c – 在野牛中是什么?全部内容,希望文章能够帮你解决c – 在野牛中是什么?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1219646.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-05
下一篇 2022-06-05

发表评论

登录后才能评论

评论列表(0条)

保存