# CS606 Assignment 2 Solution Spring 2018

CS606 – Compiler Construction Total Marks: 20 Due Date: May 28, 2018 Instructions Please read the following instructions carefully before submitting assignment: It should be clear that your assignment will not get any credit if: o        Assignment is submitted after due date. o        Submitted assignment does not open or file is corrupt. o        Assignment is copied (From internet/ […]

# CS606 Assignment 1 Solution Spring 2018

Assignment Task 1: [Marks = 10] ∑ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Write a RE that would accept any number that is divisible to digit 5. For example; If I input string 21356496 then RE would not accept this number as it is not divisible to 5. And if I would […]

# CS606 Compiler Construction Assignment 1 Solution 2017

Task 1: [Marks = 10] ∑ = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Write a RE that would accept any number that is divisible to digit 4. For example; If I enter string 21356496 then RE would accept this number as it is divisible to 4. And if I would pass / enter […]

# CS606 GDB Solution feb 2015

“Three types of Intermediate representation (IR) have been discussed in this course and i.e. 1. Graphical IRs 2. Linear IRs 3. Hybrid IRs Selecting an appropriate IR for a compiler is critical step which depends on some important properties of IR. Speed and efficiency of compiler may vary according to these properties. You are required […]

# CS606 Assignment 3 Solution Feb 2015

CS606 Compiler Construction Assignment 3 Solution Feb 2015 Question No 1:                                                                                                                       Marks 20 Consider the following grammar productions. Suppose you have an attribute E.type which can be set to either INT or BOOL.  Assume that the type of an expression is set to INT if an error is detected and you have a routine msg() […]

# CS606 Compiler Construction Assignment 1 Solution

Assignment No. 02 Semester: Fall 2014 Compiler Construction CS606   Total Marks: 20 Due Date: 08/12/2014 Objective: To learn and understand basic concepts of Parse Trees, Top Down Parsers, Predictive Parsing, First and Follow Sets in building a Lexical analyzer. Instructions: It should be clear that your assignment will not get any credit (zero marks […]

# CS606 Compiler Construction GDB Solution Spring 2014

Graded Discussion Topic: There are two types of parsing techniques, Top-down and Bottom-up. Considering an ambiguous grammar, which parsing technique is more appropriate to use? Discuss it with proper reasoning. Solution: Bottom-up parsing technique is used for ambiguous grammar. Bottom-up parsing can be viewed as trying to find a rightmost derivation in reverse for an input […]

# CS606 Compiler Construction Assignment 4 Solution Spring 2014

Question No 1:                                                                                                                       Marks 20 Consider the following grammar productions. Suppose you have an attribute E.type which can be set to either INT or BOOL.  Assume that the type of an expression is set to INT if an error is detected and you have a routine msg() similar to printf() that can be used to print error message. […]

# CS606 Compiler Construction Assignment 1 Solution Spring 2014

Assignment No. 01 Semester: Spring 2014 Compiler Construction CS606 Total Marks: 20 Due Date: 12/05/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: o The assignment is submitted […]

# CS606 Compiler Construction Assignment 3 Solution Fall 2013

Question No 1: Marks 20 Consider the following grammar: S → Sb S → cS S → a (a) Identify all conflicting items, and the types of the conflicts. [10 marks] (b) Rewrite the grammar in an equivalent form that is suitable for LL parsing and minimizes the use of stack space. [5 marks] (c) […]