We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

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


Objective:

 

To learn and understand the concepts of LR(1) parsers, canonical collections and shift/reduce conflicts.

 

 

Lectures Covered: 22-30                                                     

 

 

Instructions:

 

Please read the following instructions carefully before submitting assignment:

 

  • You will submit your assignment before or on due date on VU-LMS.
  • Assignment should be completed by your own efforts it should not be copied from internet, handouts or books.
  • You should submit your solution in Word File only via assignment interface at VU-LMS.
  • Assignment sent via Email will not be replied and accepted/graded in any case.
  • If the submitted assignment does not open or file is corrupt, it will not be graded.

 

 

Question No 1:                                                                                                                          Marks 20

 

Consider the following context free grammar:

 

S  →  Sa

S  →  bS

S  →   c

 

(a) Write the canonical collections of LR(1) items for the given context free grammar:

[4 marks]

 

(b) Identify all conflicting items from solution of part a, and the types of the conflicts. [4 marks]

 

(c) Could the original grammar be converted into an LALR(1) parser that parses all input correctly by resolving conflicts, in the way that YACC and similar parser generators allow? If so, how should they be resolved? In either case, please explain briefly. [4 marks]

 

(d) Rewrite the grammar in an equivalent form that is suitable for LL parsing and minimizes the use of stack space. [4 marks]

 

(e) Rewrite the grammar in an equivalent form that is directly suitable for LR parsing (i.e., does not result in conflicts) and minimizes the use of stack space. [4 marks]

 

 


+ 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)


Views: 2490

Attachments:

Replies to This Discussion

Plz guid about solution

ksi ko b ni ata

koi to banai

ye subject q itna mushkil hai  

Thanks GOD ......   me done complete

 

SHARE PLEASE

shokhaa....

anwar jaisooo ko ata jata kuch hota nai... aur shooky hoty rehty hai...

ja pai kam kar apna... kar li hai too announcement krva dy VU pay 

thanks dear on this compliment

agr mujy nhi ati to ap bana kar upload kar dy dekhty hn u kya ho .............. 

 

 

http://www.refinesol.com/

very good ... can you plz share?? 

to ni select krna tha phr :P

Marynoor q hum jo prh rhy is liay mushkil h

Anwar ul haq please share idea 

RSS

Latest Activity

Profile Iconwaqar, Hammad Syed, Farhadullah khan and 13 more joined Virtual University of Pakistan
8 minutes ago
Miss. Churhail liked Omar's discussion Dua
47 minutes ago
+ "Տehɑr" liked Omar's discussion Dua
54 minutes ago
+_iiffiiiiiii_+ updated their profile
55 minutes ago
+_iiffiiiiiii_+ liked +_iiffiiiiiii_+'s profile
58 minutes ago
HAFIZA AREESHA ASLAM replied to +M.Tariq Malik's discussion SOC101 Introduction to Sociology Assignment 01 Fall 2020 Solution / Discussion in the group SOC101 Introduction to Sociology
1 hour ago
Ifra Malik joined +M.Tariq Malik's group
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT402 Solved MCQs Online Quiz No 01 Fall 2020 Solution / Discussion Last Date: 08-12-2020 in the group MGT402 Cost & Management Accounting
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT602 Assignment 01 Fall 2020 Solution / Discussion Due Date: 09-12-2020 in the group MGT602 Entrepreneurship
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT602 Assignment 01 Fall 2020 Solution / Discussion Due Date: 09-12-2020 in the group MGT602 Entrepreneurship
2 hours ago
+M.Tariq Malik liked +M.Tariq Malik's discussion MGT602 Assignment 01 Fall 2020 Solution / Discussion Due Date: 09-12-2020
2 hours ago
+M.Tariq Malik added a discussion to the group MGT602 Entrepreneurship
2 hours ago
+M.Tariq Malik replied to HAFIZA AREESHA ASLAM's discussion ECO402 Microeconomics Assignment 01 Fall 2020 Solution / Discussion in the group ECO402 Microeconomics
2 hours ago
+M.Tariq Malik liked HAFIZA AREESHA ASLAM's discussion ECO402 Microeconomics Assignment 01 Fall 2020 Solution / Discussion
2 hours ago
+M.Tariq Malik replied to HAFIZA AREESHA ASLAM's discussion ECO403 Assignment 01 Fall 2020 Solution / Discussion Due Date: 10-12-2020 in the group ECO403 Macroeconomics
2 hours ago
+M.Tariq Malik liked HAFIZA AREESHA ASLAM's discussion ECO403 Assignment 01 Fall 2020 Solution / Discussion Due Date: 10-12-2020
2 hours ago
+ ! ! ! ! ! تاشہ liked 乇メ-丂イひり3刀イ.'s discussion *** My Drawing ***
2 hours ago
+ ! ! ! ! ! تاشہ liked 乇メ-丂イひり3刀イ.'s discussion *** الوداع اردو ***
2 hours ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
2 hours ago
Ayesha liked +M.Tariq Malik's discussion ENG201 Business and Technical English Writing GDB No 01 Fall 2020 Solution / Discussion Last Date: 08-12-2020
3 hours ago

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

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

.