BNF to standard EBNF

こ雲淡風輕ζ 提交于 2019-12-13 07:30:49

问题


I am converting BNF dialect 2 to standard EBNF and making the grammar as simple as possible from this problem below.

  <state> -> <abc> | <abc>;
  <state> -> <def> | <def>;
  <state> -> <ghi> | <ghi>;

here is my attempt that I followed along page 131 in my textbook http://umsl.edu/~mfrp9/misc/cpl.pdf

<state> -> (<abc> | <abc>)(<def> | <def)(<ghi> | <ghi>);

Is this a correct solution and is there a simpler solution than this with {...} for repeated?

Also I noticed in this post How to convert BNF to EBNF compared to the example above in my textbook removed <...> in the post and in my book it didn't? does it matter or what is the situation?

来源:https://stackoverflow.com/questions/26134894/bnf-to-standard-ebnf

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