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

www.vustudents.ning.com

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 = {, , , } T = {A, B, C, *, +} S = P=<1,2,3,4,5,6,7,8,9,10> Derive the expression “A *B+C”.   [5 Marks] 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 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?)

Attachments:

### Replies to This Discussion

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 1:? 2: ? < expression> 5: ?C < expression>C 7 :< factor>? + < expression> + C 2: < expression>?< expression> < expression> + C 4: ? B < expression> B+C 6: ? * < expression> *B+C 3: < expression>? *B+C 5: ? 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

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:

## Latest Activity

17 minutes ago
28 minutes ago
1 hour ago
1 hour ago
1 hour ago
1 hour ago
Ayesha joined +M.Tariq Malik's group

### CS609 System Programming

1 hour ago
Ayesha joined +M.Tariq Malik's group

### CS607 Artificial Intelligence

1 hour ago
Ayesha joined +M.Tariq Malik's group

### CS605 Software Engineering-II

1 hour ago
Ayesha joined +M.Tariq Malik's group

### CS604 Operating Systems

1 hour ago
Ayesha joined +M.Tariq Malik's group

1 hour ago
1 hour ago

1

2

3