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

 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

# 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?

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)

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

imran updated their profile
31 minutes ago
2 hours ago
Syed Ilyas Kazmi left a comment for sufian tahir
2 hours ago
Syed Ilyas Kazmi left a comment for Amjad Sohail
2 hours ago
2 hours ago
Maham Raza. replied to Maham Raza.'s discussion Sabar...
2 hours ago
+ ! ! ! !Marshmallow replied to Maham Raza.'s discussion Sabar...
2 hours ago
+ ! ! ! !Marshmallow liked Maham Raza.'s discussion Sabar...
2 hours ago
2 hours ago
3 hours ago
3 hours ago
Maham Raza. liked Mani Siddiqui BS VIII's discussion سمجھ نہیں آتی
3 hours ago

1

2

3