retagged by
2,357 views

5 Answers

Best answer
3 3 votes

Actually here u have to draw the tree and associate semantic rule and work accordingly..

However as the grammar is ambiguous as clear from the grammar , so we can construct the parse tree in other way too i.e. taking E --> E ↑ E at the topmost level so in that case we will get A) as correct option..Hence both are true..

Hence option C) is correct answer..

selected by
0 0 votes
Option b cannot be the answer because * is having higher precedence than | symbol.So * should be evaluated first.

Hence the answer is option a.
0 0 votes
A is correct answer , travel the tree from bottom to up , first (a) will be printed then (b) then (*) then (c) and at last (!)
0 0 votes
it is ambigous grammar. So we can have two different parse tree

so we can have both the print sequence

C is correct answer here

ona funny note: it is ACEE question.. so be sure that the answer marked is always incorrect
Position:
Show:

Related questions

2 2 votes
1 1 answer
1.2k
1.2k views
Tushar Shinde asked Jan 19, 2016
1,203 views
Consider the $SDTS$ for the ambiguous grammar$E \rightarrow E + E$ $out ("1 + 2 ")$$E \rightarrow E ^{*} E$ $out ("2 ^{*} 3")$$E \rightarrow num$ ...
3 3 votes
1 1 answer
1.7k
1.7k views
Tushar Shinde asked Jan 12, 2016
1,695 views
Fill in the blanksConsider the $SDTS$ below$E1\rightarrow E \ out (*2)$$E \rightarrow +T \ out('1')$$E \rightarrow T \ out (10^*)$$E \rightarrow T*F \ out ( ' * ' )$$T \r...
1 1 vote
2 answers 2 answers
1.7k
1.7k views
Lakshay Kakkar asked Nov 20, 2017
1,734 views
What is the correct answer to this problem? In the key, the answer is given as A but I'm getting C. Please tell me why it is so. Thanks.