将 EBNF 转换为 BNF
我的计算机语言课已经过去几年了,所以我已经忘记了 BNF 和 EBNF 的要点,而且我身边也没有教科书。具体来说,我忘记了如何将 EBNF 转换为 BNF。
据我所知,我知道要点之一是转换
{ term }
为
<term> | <many-terms>
但我不记得其他规则。我尝试在网上查找此内容,但只能找到家庭作业问题的链接,或有关用大括号转换术语的小评论。我找不到定义翻译的详尽规则列表。
It's been a few years since my computer-language class and so I've forgotten the finer points of BNF's and EBNF's and I don't have a textbook next to me. Specifically, I've forgotten how to convert an EBNF into BNF.
From what little I remember, I know that one of the main points is to convert
{ term }
into
<term> | <many-terms>
But I don't remember the other rules. I've tried to look this up online but I can only find links to either homework questions, or a small comment about converting terms with curly braces. I can't find an exhaustive list of rules that define the translation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅此页面。
See this page.???? It contains instructions for each production that needs to be converted:
请注意:ISO 标准中列出的 EBNF 还包括语法规则的例外情况,这些例外情况没有 BNF 等效项。 500 - 内部服务器错误给出的转换仅适用于与 RBNF/ABNF 重叠的 EBNF 部分。
Be warned: EBNF as it's listed in the ISO standard also includes exceptions to syntactic rules, which do not have a BNF equivalent. The conversion given by 500 - Internal Server Error only works for the portion of EBNF which overlaps with RBNF/ABNF.