We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Question:- 

By considering the following grammar:

 

E  => E+E

E  => E*E

E  =>  (E)

E  =>  id

 

Apply the Shift-Reduce function on the string “ id+id*id ” . Use the following table for your solution.

Stack

 

Input

 

Action

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 1933

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

Action  ? 

please tell me how many lectures cover this assigment ?

and which lecture has detail about this topic 

 koi mistake ho to Comments kijya ga 
duao ma b yad rknaa  pyara bachoo 

lec 27 main sy h

thanks 

idea solution, not 100% sure

100%

ap ka bikul theek h

wasimali     which solution is correct 

Thanks wasimali

Assignment No. 02
Semester Spring 2016
Compiler Construction CS606
BC120401037: Ammar Ahmad

QUESTION:
By considering the following grammar:
E à E+E
E à E*E
E à (E)
E à id
Apply the Shift-Reduce function on the string “ id+id*id ”. Use the following table for your solution.

ANSWER:


Stack Input Action
id + id * id Initial State
id +id * id Shift id
E +id * id Reduce by E : id
E+ id * id Shift +
E + id *id Shift id
E+E *id Reduce by E : id
E+E* id Shift *
E+E*id Shift id
E+E*E Reduce by E : id
E+E Reduce by E : E ‘*’ E
E Reduce by E : E ‘+’ E

RSS

Latest Activity

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.