异常:“在内部解析表中发现无效的操作编号。”多语言例外
我正在使用一个名为 Polyglot 的编译器,它是一个高度可扩展的 Java 编译器。
我在尝试编译一些测试代码时似乎遇到了这个异常:
"Invalid action number found in internal parse table."
How can I make a valid action number for the parse table?
编辑:
我通过稍微修正我的语法解决了这个问题...我在调用没有类型的方法时遇到了问题。 (来晚了抱歉) 现在我更好奇上面的异常是什么时候抛出的? 什么是动作编号?
I am using an Compiler called Polyglot which is a highly extendable compiler for Java.
I seem to have run into this Exception while trying to compile some test code:
"Invalid action number found in internal parse table."
How can I make a valid action number for the parse table?
EDIT:
I solved the problem by just fixing my grammar a bit... I had an issue with calling methods without types. (It is late I'm sorry)
Now I am more curious to when the Exception above is thrown?
And what is an action number?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解析表是描述当给定输入处于给定状态时其解析器应该采取什么操作的表。在每个步骤中,都会查阅解析表来决定采取什么操作。
解析表由两部分组成,action表和goto表。操作表获取堆栈顶部的状态和输入缓冲区中的下一个符号(称为“先行”符号),并返回要执行的操作以及要压入堆栈的下一个状态。 解析表
所以我假设操作编号是代表特定的数字解析表可以采取的操作。
A parsing table is a table describing what action its parser should take when a given input comes while it is in a given state. In each step, the parsing table is consulted to decide what action to take.
The parsing table consists of two parts, the action table and the goto table. The action table takes the state at the top of the stack and the next symbol in the input buffer (called the "lookahead" symbol) and returns the action to take, and the next state to push onto the stack. Parsing table
So I assume that the action number, is a number that represents a specific action the Parsing table can take.