View more random threads:
- CS201 Assignment 4 Solution, June 2010
- MGT411 Money and Banking Assignments NO.02 Last Date 30th...
- More Questions More learning at Distance learning...
- Digital Logic and Design CS302 Solution of Assignment 2...
- HRM627 Assignment # 1 - Idea solution Fall 2010
- CS605 Software Engineering-Assignment No 1 3rd November 2012
- CS301 Data Structures Assignment # 3 May 2010
- PSY101 Introduction to Psychology Assignment No.1 Solution...
- Entrepreneurship (MGT602) fall 2010 first assignment
- CS614 Assignment No. 04 Deadline 5 July 2010
CS606 Compiler Construction Assignment No.1 Semester Fall 2012
Assignment No. 01
Semester Fall 2012
Compiler Construction CS606
Total Marks: 20
Due Date: 13/11/2012
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:
o The assignment is submitted after due date.
o The submitted assignment does not open or file corrupt.
o The assignment is copied (from other student or copy from handouts or internet).
o Student name and ID are not mentioned in the assignment file.
o It is in some format other than .doc or .docx(MS Word Document).
For any query about the assignment, contact at
BEST OF LUCK
Question No 1: Marks 10
Let CFG be G = (Vn, Vt, S, P) where Vn = {<goal>, <expression>, <term>, <factor>}, Vt = {1, 2,
3, x, y, z, -, +}, S = <goal> and Productions(P) are;
<goal> <expression>
<expression> <term> / <expression> + <term>
<term> <factor> / <term> - <factor>
<factor> 1 / 2 / 3 / x / y / z
Considering the above productions of a CFG, you are required to do the following tasks:
a. Derive the expression “x + 2 - y”. [5 Marks]
b. Construct a parse tree for the expression “x + 2 - y”. [5 Marks]
Question No 2: Marks 10
Construct Nondeterministic finite automata (NFA) for regular expression (a | b)* using
Thompson’s Construction Algorithm. Show the sequence of moves made by each in processing
the input string “ababbab”.
Sponsored Links
There are currently 1 users browsing this thread. (0 members and 1 guests)