Convert the following EBNF grammar to BNF:
[ ] { ab }
z { ze }
x [y] z
BNF:
| | |
ab | ab // 1 or more , HW3 Q1. how to convert it into 0 or more?
z | ze
xz | xyz
HW3 Q2. How to convert it into 0 or more without using empty string rule?.
Notes:
1) You can add additional rules.
2) You should use the "empty string" rule, i.e., :
--> e | s
which means, the abstract can be replaced with an empty string "e", or "s" , where e=" " is stands for empty.
As an example, all of the following sentences belong to the rule above:
"s"
"ss"
" " (empty string, where e = " " )
But, these sentences do not belong to :
"e"
"es"![Convert the following EBNF grammar to BNF: [ ] { ab }](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66fa22a288563_89866fa22a21f3c3.jpg)
undefined
HW3 Convert the following EBNF grammar to BNF: >[] {ab } zze} x [y] z BNF: > abab // 1 or more , HW3 Q1. how to convert it into 0 or more? z ze Xzxyz HW3 Q2. How to convert it into 0 or more without using empty string rule?. Notes: 1) You can add additional rules. 2) You should use the "empty string" rule, i.e., : --> es which means, the abstract can be replaced with an empty string "e", or "s", where e="" is stands for empty. As an example, all of the following sentences belong to the rule above: "s" "SS" ""(empty string, where e="") But, these sentences do not belong to : "e" "es" HW3 Convert the following EBNF grammar to BNF: >[] {ab } zze} x [y] z BNF: > abab // 1 or more , HW3 Q1. how to convert it into 0 or more? z ze Xzxyz HW3 Q2. How to convert it into 0 or more without using empty string rule?. Notes: 1) You can add additional rules. 2) You should use the "empty string" rule, i.e., : --> es which means, the abstract can be replaced with an empty string "e", or "s", where e="" is stands for empty. As an example, all of the following sentences belong to the rule above: "s" "SS" ""(empty string, where e="") But, these sentences do not belong to : "e" "es