Yacc: Code after each non-terminal

我只是一个虾纸丫 提交于 2019-12-13 02:51:27

问题


Is there a way to execute code after each Terminal?

So that something like this is possible:

a : B { code } C { some code }

Any help would really be appreciated!


回答1:


The example you gave should work as is.




回答2:


You are right. I some how didn't get that C is $3 after inserting the code and not $2... really odd.



来源:https://stackoverflow.com/questions/393104/yacc-code-after-each-non-terminal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!