GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
205 views

 

asked in Compiler Design by Boss (6.1k points)  
retagged by | 205 views
@valshall 2$4$8$? actually i have typed 2Dollar4Dollar8Dollar. But somehow that $ is not showing up.
I think some $ is missing in your answer
2 $ 4 $ 8 $...

@amitabh is right ..don't know why dollar is not showing

 

Is this answer possible?

dollar b/w 4 nd 8 should be there and after 8 only one dollar
Nopes

2 Answers

+1 vote

SDT evaluation

answered by Loyal (2.5k points)  
S --> XY

S --> ZXY

S --> ZX*XY

S --> ZX*ZXY

S --> ZX*ZZXY

@amitabh...see this
that is what i have derived...complete the derivation you will get the same answer.

Is this right?

No. See where you are going wrong is : ZX when reduced to X --->prints $. But when epsilon is reduced to X,it doesn't print $. See the grammar carefully.
She has printed the second dollar where actually  the first dollar is printed. But second dollar will also be printed in the subsequent step when again zx reduces to X. So her final answer is correct.
0 votes

2dollar48 dollar dollar is possible.ZX is reduced to X twice at last

answered by (267 points)  
edited by


Top Users Sep 2017
  1. Habibkhan

    6362 Points

  2. Warrior

    2234 Points

  3. Arjun

    2212 Points

  4. nikunj

    1980 Points

  5. manu00x

    1726 Points

  6. SiddharthMahapatra

    1718 Points

  7. Bikram

    1716 Points

  8. makhdoom ghaya

    1660 Points

  9. A_i_$_h

    1528 Points

  10. rishu_darkshadow

    1512 Points


25,988 questions
33,561 answers
79,406 comments
31,026 users