You are on page 1of 2
Model Question Paper 6" Sem (Elective) Compiler design CS664 Answer any five UL IV VI Explain different phases of a compiler with example, 10 b With fig explain the role of lexical analyzer in compiler design. Also give reasons for separating analysis phase into lexical analysis and parsing on 1 Define left reeu gtammar? > EeIT T> THI FP (EB) Jid ‘Also obtain first and follow function for the above resulting grammar 10 ion? Eliminate left recursion from the following Construct LL(1) geammar shown below Sie $8Va S'Desfe Eb 10 a What do you mean by handle pruning give example. Give an algorithm for constructing precedence functions. 47 b Qbtain set of canonical LR(O) items for the grammar. SDIFR SIR LIFRL > id, ROL 6 © Write a note on error recovery in LR parsing 4 a Obtain directed acyclic geaph for the expression arab (atatat(ata+ata)). Also give sequence of instruction for constructing the above da da b Write a note on L-attributed definition 6 © Give SDTS for arithmetic expression with +, * and -. Show annotated parse tree for the input 3-+4 * 5 8 a Explain different storage allocation strategy ? 8 b With example explain different parameter passing metho 8 Explain the approaches to implement dynamic scope in lexical implementation of lexical seope 4 What are the methods for representing 3 address statement, Explain with an example 6 vu VIL b- Give annotated parse tree for x: © Obtain SD definition to produce 3 address for Booleans Explain the different issues involved in design of code generator b Obtain 3 address code sequence for expression d give code generated for each statement, b) +(a-c)#fa-c) also Write a note on Back patching a Explain any 5 kinds of code optimization technique Explain with an example the tools used to recognize token and Statement in a given programming language. 6 0 10

You might also like