APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY Previous Years Question Paper & Answer

Course : B.Tech

Semester : SEMESTER 6

Subject : Compiler Design

Year : 2018

Term : APRIL

Scheme : 2015 Full Time

Course Code : CS 304

Page:1





PDF Text (Beta):

B B6815 Pages: 2

Reg No.: Name:

APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
SIXTH SEMESTER B.TECH DEGREE EXAMINATION, APRIL 2018

Course Code: CS304
Course Name: COMPILER DESIGN (CS, IT)
Max. Marks: 100 Duration: 3 Hours
PARTA
Answer all questions, each carries 3 marks. Marks
1 Draw the transition diagram for the regular definition, (3)
relop>< | <= | = | <> | >= | >
2 With an example source language statement, explain tokens, lexemes and (3)
patterns.
3 Define LL( 1) grammars. (3)
4 Is the grammar SS(S)S/ ‏ع‎ ambiguous? Justify your answer. (3)
PART B

Answer any two full questions, each carries 9 marks.
5 9) Apply bootstrapping to develop a compiler for a new high level language Pon (3)
machine N.
b) Now I have a compiler for P on machine N. Apply bootstrapping to obtaina (4)

compiler for P on machine M.

c) Define cross-compilers. (2)
6 a)
Consider the following grammar
E> EorT|T
> 7 and F |
٣ج‎ not F | (8) | true | false
(2)
(i) Remove left recursion from the grammar. (4)
(ii) Construct a predictive parsing table.
(iii) Justify the statement “ The grammar is LL (1)”. (3)
7 a) Design arecursive descent parser for the grammar ScAd, ^ > 20/ b (5)

b) Fora source language statement a= b*c - 2, where a, b and c are float variables, (4)
* and — represents multiplication and subtraction on same data types, show the
input and output at each of the compiler phases.
PART C
Answer all questions, each carries 3 marks.

8 Compute the FIRST and FOLLOW for the following Grammar. (3)

Page 1 of 2

Similar Question Papers