Semester : SEMESTER 6
Subject : Compiler Design
Year : 2021
Term : JULY
Branch : COMPUTER SCIENCE AND ENGINEERING
Scheme : 2015 Full Time
Course Code : CS 304
Page:1
B 03000CS304052002 Pages: 3
Reg No.: Name:
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
Sixth Semester B.Tech Degree Regular and Supplementary Examination July 2021
Course Code: CS304
Course Name: COMPILER DESIGN
Max. Marks: 100 Duration: 3 Hours
PARTA
Answer all questions, each carries 3 marks. Marks
1 Write a regular expression to denote the language of all strings of a's and 5ط (3)
with an even number of a's followed by an odd number of b's.
2 Distinguish between front end and back end of a compiler. (3)
3 Show that the following grammar is ambiguous : (3)
S7ictsS
S7iCtSes
ടുക്
0ص
+ Explain backtracking with an example. (3)
PART تا
Answer any two full questions, each carries 9 marks.
5 9) Eliminate left recursion from the following grammar: (4)
6൨ Aa|b
ھ۸ Ac|Sd|h
b) Construct a recursive descent parser for the following grammar (5)
ETE
E’> +TE’ |e
TR Fi
7" -> *FT’ | 8
F>(E)|id
6 Explain in detail the various phases of a compiler with a neat diagram. Illustrate (9)
Page 1 of 3