34 Describe the set of strings defined by each of the followingsets of productio
ID: 3615330 • Letter: 3
Question
34 Describe the set of strings defined by each of the followingsets of productionsin EBNF
a) <string> ::= <L>+<D>?<L>+
<L> ::= a | b | c
<D> ::= 0 | 1
b) <string> ::= <sign><D>+ | <D>+
<sign> ::= + | -
<D> ::= 0 | 1 |2 | 3| 4| 5| 6| 7| 8| 9
Explanation / Answer
Dear, we enclose all nonterminal symbols in brackets replace -> in a production with ::= | alternation orseparation + equivalent to {1, } ? equivalent to {0, 1} we can represent the given statements a) ::= +?+ ::= a | b | c ::= 0 | 1 Nonterminals ,, Terminals a|b|c | 0|1 set of Letters a |b|c 1to times followed by Digits 0 |1 0 or 1 time followedby letters a|b|c 1 to times we can use first and follow set operationsfor better understanding ::= +?+ ::= a | b | c ::= 0 | 1 EBNF STEP1: ::= + means First of = First of L ::=a|b|c in syntax chart L contains a|b|c Director = {a b c} U Follow STEP2: ::= + D? means First of = First of Followed by ::=a|b|c in syntax chart D contains 0|1 ::= 0 | 1 Director = {0 1} U Follow STEP3: ::=+?+ means First of = First of Followed by Followedby L ::= a | b |c in syntax chart L contains a|b|c ::= 0 | 1 Director = {a bc} U Follow U Follow b) ::= + | + ::= + | - ::= 0 | 1 |2 | 3| 4| 5| 6| 7| 8| 9 Nonterminals ,, Terminals +|- | 0|1|2 | 3| 4| 5| 6| 7| 8| 9 set of symbols +|- followed byDigits 0 |1|2 | 3| 4| 5| 6| 7| 8| 9 1 to times. or Digits 0|1|2 | 3| 4| 5| 6| 7| 8| 9 1 to times. we can use first and follow set operationsfor better understanding ::= + | + ::= + | - ::= 0 | 1 |2 | 3| 4| 5| 6| 7| 8| 9 EBNF STEP1: ::= means First of = optional ::= + | - STEP2: ::= + means First of Followed by digits D ::= 0 | 1 |2 | 3| 4| 5| 6| 7| 8|9 in syntax chart Dcontains 0 | 1 |2 | 3| 4| 5| 6| 7| 8| 9 Director = {0 1 2 3 4 5 6 7 8 9} U Follow STEP3: ::= + | + meansFirst of Followed by digits D ::= 0 |1 |2 | 3| 4| 5| 6| 7| 8| 9 insyntax chart D contains 0 | 1 |2 | 3| 4| 5| 6| 7| 8| 9 Director = {0 1 2 3 4 5 6 7 8 9} U Follow I hope this will helps you!!!!!!!!!!Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.