Professional Documents
Culture Documents
QUESTION BANK
Staff-in-charge : D.BALAMURUGAN
PART-A
1. What is language processing system? (Nov-Dec 2008)
2. What are compilers? Mention the broad steps in the process of compilation (Nov-Dec 2013)
3. Define cross compiler (May-June 2013-IT) / (May-June 2014)
4. Define pre-processor & what are the functions of pre-processor? (Nov-Dec 2007) / ND 2014
5. What do you meant by interpreter?
6. Write short notes on error handler
7. Mention some of the cousins of the compiler (Apr-May 2015 cbe)
8. What is front end and back end of compiler?
9. Give any 2 reasons why phases of compiler should be grouped? (May-June 2014)
10. List some compiler construction tools (Nov-Dec 2016)
11. What is symbol table? What are its attributes? (Nov-Dec 2007/2016, 2013-IT) / (May-June
2014) / Write short notes on symbol table manager
12. Differentiate compiler & interpreter (May-June2013-IT)/(Nov-Dec 2013-IT)
13. What is difference between compiler and assembler? (Apr-May 2015 cbe)
14. Identify compiler too1 that perform each of the following actions (May-June 2014-IT)
a) analyzes the program text and represents it as a hierarchical structure.
b)variables represent the logical signals (0 or 1 )in a switching circuit.,
PART-B
1. Explain the various phases of compiler with neat diagram / Explain process of compilation
(ND 2016) / (MJ 2013 /2014 IT) / ND 2013 IT / AM 2015 cbe / ND 2014 cbe
2. Briefly explain the compiler construction tools with benefits & drawbacks.( ND 2016) / ND
2014 (AM 2015) / ND 2013 IT / MJ 2013 IT / AM 2015 cbe // ND 2014 cbe
3. Describe how various phases should be combined as a pass in a compiler / Explain need for
grouping of phases (ND 2016) / ND 2014 / MJ 2014 IT / AM 2008
4. Explain various errors encountered in different phases of compiler (ND 2016)
5. What are the other tools related to compiler? / Explain cousins of compiler (MJ / ND 2014
IT , cbe)
6. Define the following terms : compiler, interpreter, translator and differentiate between
them(MJ 2014)
7. Explain simple one pass compiler (MJ 2013 IT )
8. Discuss how symbol table used in various phases of compiler (ND 2014 cbe)
9. Explain process of bootstrapping (AM 2015 cbe)
10. How abstract stack machine used as translator ( MJ 2009)
11. Write down the output of each phase for the expression
i) a: = b + c * 50.
ii) a=(b+c)*(b+c)*2 (AM 2014) / (MJ 2014 IT)
iii) position:=initial+rate*60 (MJ 2013 IT)
UNIT-II :LEXICAL ANALYSIS
PART-A
1. What is role of lexical analyser? (Nov-Dec 2014)
2. What is LEX? (MJ 2013-IT)/Write about tool for generating lexical analyzer (AM 2015 cbe)
3. What are the issues to be considered in design of lexical analyzer? (May-June 2009 / 2007)
4. i) What are tokens? Give example (Nov-Dec 2013-IT)
ii) Define patterns, lexeme, tokens / differentiate patterns, lexeme, tokens (Nov-Dec 2016) /
(May June 2014) /(May-June 2014-IT) / ND 2014 cbe
5. i)Give the error recovery actions in lexical errors / lexical phase of compiler (Apr-may
2015) / (Nov-Dec 2008)
ii) Give two examples of lexical errors. (May-June 2014-IT)
6. What is the use of symbol table in lexical analyzing ? (ND 2014 cbe)
7. Mention types of input buffering (Nov-Dec 2013-IT)
8. Write note on buffer pair (Apr-May 2008)
9. Why is buffering used in lexical analysis? What are the commonly used buffering methods?
(May-June 2014)
10. Compare DFA & NFA (May-June 2014)
11. Define regular expression
12. Give the rules in regular expression/ Give the algebraic properties of regular expression
13. Define kleene closure or star closure and positive closure
14. What are the three parts of lexical program? (ND 2014 cbe)
15. Write regular definition to represent date in the following format Jan-5th 2014 (Apr-may
2015)
16. Write regular expression to
i) describe a language consists of string made of even number of as & bs (Nov-Dec
2014)
ii) to represent identifier (May-June 2013-IT) (Apr-May 2015 cbe)
iii) for the following over X = {a,b}. all strings containing exactly one a , all strings
containing an even number of a's. (May-June 2014-IT)
PART-B
PART-A
1. What is meant by parser? mention its types (Nov-Dec 2013-IT)
2. What are the different levels of syntax error handler? /What are error recovery strategies in
parser?
3. Write differences between regular grammar & CFG (May-June 2013-IT)
4. Define ambiguity / What is ambiguous grammar? (Nov-Dec 2007)
5. Define sentential form.
6. What is role of parser? (Apr-may 2015)
7. Write differences between top down & bottom up parsing (May-June 2013-IT)
8. i)What are the difficulties with top down parsing?
ii) What are the factors to be considered for top down parsing? (May-June 2009)
9. What is predictive parser? (Nov-Dec 2007)
10. What is meant by recursive-descent parser?
11. What is CLR? (Nov-Dec 2008)
12. Define LL (1) grammar.
13. What are the actions available in shift reduce parser?
14. What are the disadvantages of operator precedence parsing? (MJ 2007) / (AM 2015 cbe)
15. Define augmented grammar.
16. Define handle pruning.(Nov-Dec 2016) / ND 2014 cbe
17. What is annotated parse tree? (May-June 2013-IT)
18. Write CF grammar to represent palindrome (Nov-Dec 2014)
19. i)Construct parse tree for ( id + id ) (Nov-Dec 2016)
ii) Draw the syntax tree for the statement (a+b) * (c+d) (Nov-Dec 2013-IT)
iii) Derive the string and construct a syntax tree for the input string ceaedbe using the
grammar S->SaA|A,A->AbB|B,B->cSd|e (May-June 2009)
20. Consider the following Grammar G. (Nov-Dec 2013-IT)
E -> E+T | T T -> T*F | F F -> (E) | id. Find the FIRST of all non terrninals,
PART-B
1. What is FIRST and FOLLOW? Explain in detail with an example. Write down the necessary
algorithm.
2. Find First and Follow:
a) E->E+T/T T->T*F/F
F-> (E)/id
b) S->aZ A->bY
B->X
Input: XYZ
5. LL (1)
S->AaAb/BbBa A->
B->
Check whether the grammar is LL (1) but not SLR (1)
6. LR (1):
a) S->CC C->Cc
C->d
b) S->Aa/bAc/Bc/bBa
A->d B->d
Check whether the grammar is LR (1) but not LALR (1)
7. Generate SLR Parsing Table for the following grammar (AM 2015)
S -> Aa l bAc l Bc l bBa
A->d
B->d
And parse the sentence "bdc" and "dd".
8. Write down the algorithm to eliminate left-recursion and left-factoring and apply both to the
following grammar (AM 2015)
E-->E+T | E-T | T
T ->a | b | (E)
9. LALR:
a) S->CC C->Cc
C->d
b) S->Aa/bAc/dc/bda
A->d
Check whether the grammar is LALR (1) but not SLR (1)
c) E->E+T | T , T->T*F |F , F->(E) |id parse the sentence (a+b)*c (ND 2014)
UNIT- IV SYNTAX DIRECTED TRANSLATION & RUN TIME ENVIRONMENT
16. i)Generate intermediate code for the following code segment along with the required syntax
directed translation scheme (ND 2014)
While (i<10)
If(r%2==0)
Evensum=evensum+i:
Else
Oddsum =oddsum + i;
ii)Generate intermediate code for the following code segment along with the required syntax
directed translation scheme s=s+a[i][j] (ND 2014)
UNIT-V- CODE OPTIMIZATION AND CODE GENERATION
Principal Sources of Optimization-DAG- Optimization of Basic Blocks-Global Data Flow
Analysis- Efficient Data Flow Algorithms-Issues in Design of a Code Generator - A Simple Code
Generator Algorithm.
PART-A
1. What are the issues in the design of code generator? (May-June 2009)
2. Define basic block and flow graph. (Nov-Dec 2007 / 2008) / (Apr-May 2008)
3. How do you find leaders in basic block? (Apr-May 2008) /Write the steps for constructing
leaders in basic blocks. (May-June 2009)
4. What is meant by register descriptors and address descriptors?
5. What are the actions to perform the code generation algorithms?
6. Define DAG with example. Give the applications of DAG.(ND 2013-IT /2008) /( MJ-2007)
7. Define Peephole optimization. What are the characteristics of Peephole optimization? (Nov-
Dec 2016)
8. Name the techniques in loop optimization (May-June 2014)
9. What are the criteria used for code improving transformations (Nov-Dec 2008)
10. What are the primary structure preserving transformations on basic blocks? (MJ 2007)
11. Define Common sub-expression elimination with ex.
12. Define reduction in strength with ex.
13. What is inline expansion? ( Nov-Dec 2007)
14. Define code motion (Apr-May 2008) / (May-June 2007)
15. Identify the constructs for optimization in basic block (Nov-Dec 2016)
16. Write algorithm that orders the DAG node for generating optimal target code (AM 2015)
17. What role does target machine play on code generation phase of compiler? (Apr-may 2015)
18. How liveness of variable is calculated? (Apr-may 2015)
19. What is global data flow analysis? (Nov-Dec 2014) / (Apr-May 2008)
20. What are the difference between syntax tree and DAG? (May-June 2013-IT)
21. Differentiate basic block and flow graph ( Nov-Dec 2014)
22. How would you represent dummy blocks with no statement indicated in global data flow
analysis? (May-June 2014 )
PART-B
1. What are the issues in the design of code generator? Explain in detail / Explain - code
generation phase with simple code generation algorithm .(ND 2014)
2. Write a code generation algorithm. Explain about the descriptor and function getreg().Give
an example.
3. Explain about Optimization of basic blocks.
4. Explain peephole optimization and various code improving Transformations. (ND 2014)
5. Explain - Generating code from DAG with suitable example (ND 2014)
6. Explain DAG representation of basic blocks. What are the advantages of DAG
representation? Give example (AM 2015)
7. Explain principle sources of code optimization in details. (AM 2008)
8. Explain about transformation on a basic block.
9. Explain global Data flow analysis with necessary equations (ND 2016)
10. Explain any 4 issues in designing code generator (ND 2016)
11. Write the Code Generation Algorithm using Dynamic Programming and generate code for
the statement x= a / (b - c) - s*(e + f). [Assume aII instructions to be unit cost] (AM 2015)
12. Construct DAG & optimal target code for the expression ((a+b)/ (b-c)) - (a+b)*(b-c) + f
(AM 2015)
13. Explain loop optimization in detail & apply it for the given code (AM 2015)
14. What are the optimization techniques applied on procedures calls? Explain with example
(AM 2015)
15. Perform analysis of available expressions on the following code by converting into basic
blocks and compute global common sub expression elimination (Ref QN paper for the code)
(AM 2015)
16. Generate DAG representation of the following code and list out the applications of DAG
representation (ND 2014)
i = 1; while (i<=10) do
sum+ = a[il;