0% found this document useful (0 votes)
5 views

CD model CSE set 1

Cd

Uploaded by

lovelymurali904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

CD model CSE set 1

Cd

Uploaded by

lovelymurali904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Reg.No.

MODEL EXAMINATION (SET-1)


BRANCH :B.E(CSE) SUBCODE :CS3501
YEAR/SEM :III/V SUB TITLE : Compiler Design
DATE :19-11-2024 Q.PSETTER :Mrs.S.Vinotha , AP/CSE

TIME :9.00am-12.00pm MAX.MARKS:100

AnswerAllQuestions
PART– A(10X2=20)

1. What input buffering?


2. Define translators and compilers.
3. What are the goal of an error handler in a parser?
4. Define a parse tree.
5. What is meant by backpatching?
6. What is meant by type checking?
7. Define symbol table?
8. What is a flow graph? Give an example.
9. Define DAG. Give an example.
10. What is the basic block?
PART– B(5X13=65)

11.a.(i) Construct the minimized DFA using the tabular method. (7)

(ii) Construct minimize DFA for regular expression (0+1)*(0+1)01 using thompson's
construction. (6)
(OR)
b.(i) Explain the role of lexical analyzer. (8)
(ii) Describe the languages denoted by the following regular expressions:
(1) a(a|b)*a
(2) ((ε|a)b*)*
(3) (a|b)*a(a|b)(a|b)
(4) a*ba*ba*ba*
(5) !!(aa|bb)((ab|ba)(aa|bb)(ab|ba)(aa|bb)*)*. (5)
12.a.(i) Consider context-free grammar.
S->SS+|SS*|a
and the string aa+a*
(1) Give a leftmost derivation for the string.
(2) Give a rightmost derivation for the string.
(3) Give a parse tree for the string.
(4) Is the grammar ambiguous or unambiguous? Justify your answer. (5)
(ii) Explain the error handling and error recovery mechanism of syntax analysers. (8)
.(OR)
b.(i) Show the following grammar.
S->SA|A
A-> a
is SLR(1) but not LL(1). (5)
(ii) State and explain the algorithm to eliminate left recursion from a grammar. (8)
13.a.(i)The expressions involving operator + and integer or floating-point operands.Floating-point
numbers are distinguished by having a decimal point.
E->E+T|T
T-> num.num num
Give an SDD to determine the type of each term T and expression E. (5)
(ii) Explain the S-Attribute Definitions with examples. (8)
(OR)
b.(i) Translate the arithmetic expression a + (b + c) into
(1) Syntax tree
(2) Quadruples. (5)
(ii) State and explain the translation of expressions and the addressing array elements with
example. (8)
14.a. Discuss about the run time storage management of a code generator in detail. (13)
(OR)
b.(i) What are the issues in the design of code generator? Explain in detail. (7)
(ii) Write the short notes on optimal code generation for the expression. (6)
15.a. What are induction variable and how to find the induction variable in loops and optimize their
computation .Explain with example. (13)
(OR)
b. Explain the optimization of basic blocks? How does the Directed Acyclic Graph(DAG)
representation of a basic block facilitate code improving transformations within the
represented code? (13)
PART – C (1 X 15=15)
16.a..Discuss the address code and its implementation, with examples. (15)
(OR)
b. Explain in detail about the design of a predictive translator. (15)

Staff In-charge HoD – CSE

You might also like