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.


+ Link For Assignments, GDBs & Online Quizzes Solution


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

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




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



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.

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


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”.









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


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


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

NFA for a|b will be: 



Looking For Something? Search Here


This is a member-supported website. Your contribution is greatly appreciated!

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

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