1

我正在将以下语法从 BNF 转换为 EBNF。

<race> => go <dir_list> and stop

<dir_list> =>   <dir> 
              | <dir> then <dir_list>
<dir> =>   from <point> to <point>  
         | around <point>   
         | to <point> 
<point> =>   A
           | B
           | C

我做了我的研究,我想出了

<race> => go <dir_list> and stop
<dir_list> => <dir> { (then) <dir> }
<dir> => (from | around | to ) { <point> to <point> }
<point> => (A|B|C)

这是正确的,没有人可以为我提供解决方案吗?

4

0 回答 0