edited by
5,720 views
6 votes
6 votes

A particular BNF definition for a "word is given by the following rules.

<word>      :: = <letter> I <letter> <charpair> I <letter> <intpair>
<charpair>  :: = <letter> <letter> I <charpair> <letter> <letter>
<intpair>   :: = <integer> <integer> I <intpair> <integer> <integer>
<letter>    :: = a I b I c I ......I Y I Z
<integer>   :: = 0 I 1 I 2 I ......I 9

Which of the following lexical entries can be derived from $\textsf{< word >}?$

  1. pick
  2. picks
  3. $\textsf{c44}$
  1. I, II and III
  2. I and II only
  3. I and III only
  4. II and III only
edited by

3 Answers

1 votes
1 votes
pick can't be generated other are generated hence ans should be B
1 votes
1 votes
Ans: D.

What I thought, "word" is having only 4 char. Which can't be derived from the grammar.

"words" is having 5 char, which is odd, so can be derived from the grammar.

Also c22 can be drived.

So ans is II and III, implies option D.
Answer:

Related questions

2 votes
2 votes
2 answers
1
2 votes
2 votes
1 answer
2
0 votes
0 votes
2 answers
3
4 votes
4 votes
2 answers
4