You are on page 1of 4

NARAYANA ENGINEERING COLLEGE DEPARTMENT OF CSE DESCRIPTIVE TYPE QUESTIONS Name of the Faculty: B.Mohan/B.

Sunil Kumar Academic year: 2013-2014 Name of the Subject: Compiler Design Class/Semester: III-B.Tech, I-Semester UNIT-1 1. What is a compiler? How do you analyse the source program during compilation? (nov 2012 set 1) 2. How many phases are there in a compiler? Explain each phase in detail. (may 2011 set 3) 3. Explain the following terms: a) Compiler construction tools b) Bootstrapping 4. Explain about Input buffering scheme for scanning the source program. 5. a) What is the role of lexical analyzer? (nov 2012 set 4) b)Explain format for the input or souce file of LEX (Nov 2012 set 3) 6. Explain the following in brief: a) procedure for conversion of NFA into DFA b) Regular Expressions with an example Weekend 1: 17/07/2013 7. Explain the data structures used in compilation 8. How do you specify the tokens? Explain with proper examples. UNIT-2 1. What is meant by Ambiguity? How do you eliminate the ambiguity in the grammar using both left recursive and left factoring methods? Explain with examples. 2. Explain about Recursive descent parsing with backtracking. 3. Explain about Predictive parsing. Construct a predictive parsing table for the given grammar productions below: E E+T| T T T*F| F F (E)| id (Nov 2012 set 3) 4. Explain about Non-recursive descent parsing with an example (may 2012 set 3) 5. . Verify the following grammar is LL(1): S S # S A/B A a/2 B b/2 (apr 2012 set 4) 6. Construct a predictive parsing table for the given grammar productions below: SL=R|R L*R|id R L 7. Explain about Context Free Grammar with an examples.(Nov 2012 set 4) 8. Explain about the following in brief: a) Role of the parser in syntax analyzer b) Error recovery strategies (Nov 2012 set 4)

Weekend 2: 07/08/2013 UNIT-3 1. Write a short note on: a) shift-reduce parsing b) Handles c) Handle pruning d) YACC automatic parser generator 2. What is an LL(1) grammar? Verify whether the following grammar Is LL(1) or not E E+T E T (May 2012 set 2) T T*F T F F id 3. What are the operations to be performed in constructing SLR parsing table? 4. Construct SLR parsing table and transition diagram for the given grammar below: E E+T E T T T*F T F F (E) F id 5. 4. Consider the following grammar: (apr 2012 set 1) S A A BA/ B aB/b. (a) Construct LR(1) parser. (b) Find the moves made by the LR(1) parser on the input string: aabb. 6. Construct LALR parsing table for the given grammar below: (Nov 2012 set 3) SL=R SR L*R LID RL 7. Explain about Error recovery in parsing. 8. a) Construct SLR (or) LR(0) items and parsing table for the given Ambiguous grammar below: (May 2010 set 4) E E+E| E*E| (E)| id b) Explain about Dangling-else ambiguity. UNIT-4 1. Define S-attributed and L- attributed grammers (Nov 2012 set 3). 2. a) What is meant by 3-address code? Give some examples of 3-address statements. b) How do you translate Syntax directed translation into 3-address code?

Weekend 3: 28/08/2013 3. How many methods are there to implement an intermediate code? Explain each of them with an example? 4. Discuss briefly about Syntax directed definitions with an example.(Nov 2012 set 1) 5. Explain about Construction of Syntax trees and DAGs for expressions. 6. How do you specify a Simple type checker? Give some examples. 7. Explain briefly about the following: a) Bottom-up evaluation of S-Attributed definitions b) L-Attributed definitions (Nov 2012 set 3) 8. What is the role of a Type checker in semantic analysis phase? Explain about Type System. UNIT-5 1. Explain about all the Storage allocation strategies in run time storage environment (Nov2012 set 2). 2. What is an Ordered and Unordered symbol table? Which data structures are used to implement a symbol table in an efficient way? Give reasons. (Nov 2012 set 4) 3. Distinguish between static and Dynamic storage allocation techniques (Nov 2012 set 4) 4. Write a short note on Activation tree. 5. write a short notes on : a. Control stacks b. Binding of names 6. What is an Activation record (or) frame and explain about each field in it. 7. Explain about access to non-local names. 8. Explain about representing scope of information. (May 2010 set 3)

UNIT-6 1. Explain different principle sources of optimization techniques. Discuss about Function preserving transformations. (Nov 2011 set 3) 2. Explain about Loop optimization. What are the transformations to be performed in this? May 2010 set 2) 3. How do you optimize the Basic blocks? Explain it with an example. 4. Explain the following terms: a) Dominators b) Natural loops c) Inner loops d) Pre-Headers e) Reducible flow graph f) Weekend 4: 03/10/2013 5. Explain about Local or Peephole optimization. ( may 2012 set 1) 6.Discuss about the Organization for an optimizing compiler. 7. Explain about DAG representation.(Nov 2012 set 4) 8. Explain about Constant folding and Frequency reduction in optimization. UNIT-7 1. Explain about Structure preserving transformations on basic blocks. 2. Explain about flow graphs with an examples. (May 2010 set 4)

3. What are the transformations to be performed in improving code? 4. Discuss about Live-variable analysis. (May 2010 set 2) 5. Explain about Global data flow analysis. 6. Explain about global optimization. 7. Explain about iterative solution of data-flow equations. 8. Explain about dealing with aliases. UNIT-8 1. Discuss about Register allocation and assignment. 2. Explain about Simple code generator. (Nov 2012 set 3) 3. How do you generate code from DAGs? Explain it with an example. 4. Discuss about Code generation algorithm. 5. Explain about Next Use information about names in basic blocks(Nov2012 set4 6. Explain about Run-time storage management. 7. How do you calculate the cost of an instruction. 8. What are the issues in the design of a code generator.(Nov 2012 set 4)

You might also like