How To Exam?

a knowledge trading engine...


SRM University 2007 B.Tech Computer Science and Engineering BANK : COMPILER DESIGN - Question Paper

Wednesday, 30 January 2013 08:05Web

18. Consider the Grammar

S??? (L) / a
L???L, S / S
Construct the left most derivation for the subsequent sentence
(a, (a,a) )

19. Consider the Grammar

S??? (L) / a
L???L, S / S
Construct the left most derivation for the subsequent sentence
a,( (a,a) , (a,a) )

20. What is Left recursion? Write the rules to eliminate left recursion.

21. Consider the grammar
S???aSbS / bSaS/ ?
Show this grammar is ambiguous by constructing 2 various Leftmost derivations for the sentence abab.



22. Eliminate the left recursion for the subsequent grammar

S???(L) / a
L???L,S / S
23. What is Left factoring? how do you eliminate it?

24. What is parsing table?

25. What is the use of LEX?

26. What is a handle?

27. What is handle pruning?

28. What is a transition diagram? provide example?

29. What is the need for separating the parser from scanner?

30. Translate the arithmetic expression a*-(b+c) into a syntax tree.




UNIT –III
10 MARKS:


1. Explain predictive parsing
2. What is the role of lexical analyzer. discuss the problems of a lexical analyzer.
3. Explain the operator precedence parsing algorithm
4. Construct SLR parsing table for

S->AS|0, A-> SA|1
5. a. Check whether the subsequent grammar is a LL(1) grammar
(4)
S->iEtS | iEtSeS | a
E->b

b. Explain the 1st and follow procedures to construct a predictive parser. (6)
6. Explain the fault recovery in predictive parsing.
7. Construct predictive parser for the subsequent grammar
S -> (L) | a
L -> L,S | S
8. Check whether the subsequent grammar is SLR(1) or not.Explain with reasons.

S -> L = R
S -> R
L -> *R
L -> id
R -> L
9. Write short notes on:

a) Left factoring
b) Handle pruning
c) Left recursion & backtracking
10. Explain shift-reduce parsing with stack implementation.
11. Explain the algorithm for constructing precedence functions with suitable example.
12. discuss LALR parsing, justify how it is efficient over SLR parsing .
13. Discuss the language for specifying lexical analysis & implementation problems


UNIT-IV
PART-A

1.Define a Quadruple.How it is various from Triples.

2.Convert the exp into 3 address code & Quadruple.
S=(a+b)/(c-d)*(e+f)

3.Write the prefix & postfix exp foe the subsequent
A=(20+(-5)*6+12)

4.What are Synthesized & Inherited Attributes.

5. Convert the provided exp into 3 address code
a or b and not c

6.What do you mean by Backpatching, why we are going for backpatching.

7.Draw the syntax tree for the subsequent exp
a:=b* -c + b * -c

8.Write the postfix notation for the subsequent exp
(-(a+b)*(c+d)+(a+b+c)).

9.Translate the exp –(a+b)*(c+d)+(a+b+c) into
a) Quadruple
b) Triples
c) Indirect triples.

PART-B
1.Explain the different Inter mediate code with suitable ex.

2.Explain the process of translating an assignment stmt.

3.Describe the process of translating CASE stmt.

4.Discuss Back Patching.

5. define the process of translating Boolean Expression.

6.Explain about flow of control stmts.


UNIT –V
PART-A

1.What are the 3 storage allocation strategies.Explain every in detail.

2.Need for code optimization.

3.What do you mean by Peep-hole optimization.

4.Construct DAG for the subsequent exp (a+b)-(e-(c+d)).

5.Write the mnemonic code for (a+b)-(e-(c+d)).



6.Construct the DAG for the subsequent basic block

d:=b*c
e:=a+b
b:=b*c
a:=e-d


7. What do you mean by symbol table..explain.

8. What informations are stored in symbol table.

9.Explain about static & stack allocation.

10.What are the code optimization techniques.

11. discuss about common sub exp elimination & renaming of temp variables.

PART-B

1.Explain in detail about Run Time Storage Allocation.

2.Explain in detail about Local & loop Optimisation.

3. .Explain in detail about Peep-Hole Optimisation.

4.Explain the problems in the design of code generator.

5. Algorithm for constructing the DAG . discuss with Suitable ex.






( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER SRM University 2007 B.Tech Computer Science and Engineering BANK : COMPILER DESIGN - Question Paper