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.

Assignment No. 01 –Solution & Discussion Fall 2014 Compiler Construction CS606 Due Date: 24/11/2014

 

Objective:

 

To learn and understand basic concepts of Context free grammar, parse tree, regular expression, deterministic and nondeterministic finite automata in building a Lexical analyzer.

Instructions:

 

It should be clear that your assignment will not get any credit (zero marks will be awarded) if:

 

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file corrupt.
  • The assignment is copied (from other student or copy from handouts or internet).
  • Student name and ID are not mentioned in the assignment file.
  • It is in some format other than .doc or .docx(MS Word Document).

For any query about the assignment, contact at cs606@vu.edu.pk

Question No 1:                                                                                                                       Marks 10

Let CFG be G = (N,T, S, P) where;

  • N = {<goal>, <expression>, <term>, <factor>}
  • T = {A, B, C, *, +}
  • S = <goal>
  • P=<1,2,3,4,5,6,7,8,9,10>
  1. Derive the expression “A *B+C”.   [5 Marks]
  2. Construct a parse tree for expression “A *B+C”. [5 Marks]

Question No 2:                                                                                                                        Marks 10             

Construct Nondeterministic finite automata (NFA) for regular expression (ab|ba)* by using Thompson’s Construction Algorithm.

+ 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: 950

.

+ 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

kindly start discussion  about this assignment 

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

 

  • N = {<goal>, <expression>, <term>, <factor>}
  • P=<1,2,3,4,5,6,7,8,9,10>

students in exemple of book there is <op> instead of <factor> how it will effect the answer and we have 10 productions here. i m unable to generate 10, i could do only 9. please help

I made 8 productionz in arithmatic expr. n 9 in tabuler form bcz production 2 has been repeated. 

  1. Derive the expression “A *B+C”.

Solution:

 

Production

Result

 

<goal>

1:<goal>?<expression>

<expression>

2: <expression>?<expression><factor><term>

< expression><factor><term>

5: <term>?C

< expression><factor>C

7 :< factor>? +

< expression> + C

2: < expression>?< expression><factor><term> 

< expression><factor><term> + C

4: <term>? B

< expression><factor> B+C

6: <factor>? *

< expression> *B+C

3: < expression>? <term>

<term> *B+C

5: <term>? A

A*B+C

Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....

can we write 

expression=> expression*expression/expression+expression/term

as this is the simple way

need quick answer

koi to is ka idea bta de kesy krna hai

plzz

2nd question ka answer bta do yar koi b plz jaldi extended b finish pe hai

NFA for a|b will be: 

Attachments:

RSS

Latest Activity

Profile IconSufyan Ali, bakhtawar, Zoya Arshad and 4 more joined Virtual University of Pakistan
1 hour ago
Mani Siddiqui BS VIII posted a status
"Life is a jourNey that MuST b traveled no MaTTER H0w Bad the Roads and accommodations"
1 hour ago
Mani Siddiqui BS VIII replied to Mani Siddiqui BS VIII's discussion سمجھ نہیں آتی
1 hour ago
Mani Siddiqui BS VIII and Maria are now friends
1 hour ago
Mani Siddiqui BS VIII replied to Maham Raza.'s discussion Mazi.
1 hour ago
Mani Siddiqui BS VIII liked Maham Raza.'s discussion Mazi.
1 hour ago
Haroon Bahadar updated their profile
2 hours ago
Maham Raza. updated their profile
4 hours ago
Maham Raza. posted discussions
4 hours ago
Soldierr liked +♡ѕωєєт иєσи♡+'s profile
7 hours ago
ABID FAROOQ bHUTTA posted a status
"CS 508 Assignment Solution https://youtu.be/_Zr2Zah754o"
8 hours ago
ABID FAROOQ bHUTTA posted a status
8 hours ago

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

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

.