问题
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