Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我在 BNF 中有这个:
a ::= b {c} | d {e}
有什么办法可以翻译成 Gold-Parser 吗?没有像这样分解它:
<a> ::= <b> <c> <c> ::= | <c> terminal
旁注:如果有人有更好的标题/更多标签,请编辑它,谢谢!
有什么办法可以翻译成 Gold-Parser 吗?不打破它
不,它不支持重复运算符 ({x} ) 作为规则定义的一部分,因此您必须使用多个规则对其进行编码。
{x}
另请参阅将 EBNF 转换为 BNF