www.vustudents.ning.com

# CS606 Compiler Construction Assignment No 1 Solution & Discussion Due Date:13-11-2012

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

Views: 940

Attachments:

### Replies to This Discussion

i have done this one...so w8 m working on it....i will upload after 1 hour

thanksssss alotttt in advance m w8ing 4 da solution.....

i m not sure about 2nd q ....so do it as ur own

Attachments:

I have tried 2nd Q

Yes it is correct. but do not submit this anyone because it will considered as copy paste.

1

2

3

4

5

## Latest Activity

++❤MQ++A❤❤❤ posted discussions
2 seconds ago
++❤MQ++A❤❤❤ replied to ++❤MQ++A❤❤❤'s discussion How Beautifull
16 minutes ago
52 minutes ago
1 hour ago
Laila kabeer liked ++❤MQ++A❤❤❤'s discussion How Beautifull
1 hour ago
1 hour ago
1 hour ago
1 hour ago