Computer Science, asked by shaileshmrj2001, 9 months ago

10.Consider the grammarP={S->aS | aSbS | Є } is ambiguous by constructing: (a)
two parse trees

Answers

Answered by mahalakshmi123445
0

Answer:

sorry i dont know......

Answered by Anonymous
1

Answer:

The ambiguity is easy to show: you can derive the string aab as follows:

(at every step we expand the leftmost non-terminal);

S -> aSbS -> aaSbS -> aabS -> aab

S -> aS -> aaSbS -> aabS -> aab

These two parses correspond to associating the b with the first or the

second a. This is somewhat analogous to the problem of the dangling else,

where the last else may be associated with the previous then or with an

earlier one.

Similar questions