比较解决相互递归性
在这种情况下如何解决相互递归?
value : comparison | 'A' | 'B' | 'C';
comparison : value comparison_operator value;
How can I solve mutual recursivity in this case?
value : comparison | 'A' | 'B' | 'C';
comparison : value comparison_operator value;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗯,问题在于它的给出的含义是模糊的。您希望它对
A这样的输入执行什么操作? BC
其中
与您的 Comparison_operator 规则相匹配?如果您想要相当于A; (BC)
那么它就很简单了:如果你想要别的东西,它就会变得更复杂。
Well, the problem is that its ambiguous as given. What do you want it to do for an input like
A <op> B <op> C
where<op>
is something that matches your comparison_operator rule? If you want the equivalent ofA <op> (B <op> C)
then its quite easy:If you want something else, it becomes more complex.
像这样固定:
Fixed like so: