You are on page 1of 3
NSG ACADEMY SAVITRIBAI PHULE PUNE UNIVERSITY PREVIOUS QUESTION PAPER of COMPILER CONSTRUCTION (APR 19) T.Y.B.Sc. Computer Science (BCS) - SEMESTERAV SUBJECT CODE :- CS-342(New 2013 Pattern) NSG ACADEMY Visit : 1st Floor, Pinnacle Pride, Above Maharashtra Electronics, Near Durvankur Dining Hall, Sadashiv Peth, Pune, PUNE, Maharashtra, 411030 Contact Us: +91-7276030223 +91-9823782121 CS-342 — Compiler Construction (2013 Pattern) (Semester-IV) April 2019 Ql) Attempt all of the following : [10x1=10] a) Define operand descriptors. b) Define annotated parse tree. c) State true or false. Bottom-up parsing the process of derivation. d) Define cross compiler. ©) State true or false. The yywrap() lex library function by default always return 1. ) List the techniques used in code optimization. 2) Define term handle. h) What is the purpose of augmenting the grammer. i) Name the data structures used while implementing the Dynamic memory allocation. i) Give the name of the file which is obtained after compilation of the lex program by the Lex compiler. Q2) Attempt any two of the following : [2x5=10] a) Check whether the given grammar is LL(1) or not. S>aABlc A> Bald B-> bA | Ab| € (epsilon) b) Write a LEX program which identifies the tokens like id, if, for and while. ©) Write a Recursive Descent Parser (RDP) for the following grammar. S>aA|SbB A> aA|bB B>b Q3) Attempt any two of the following : [2x5=10] a) Consider the following operator grammar. S>S+S|S*S|d i) Construct the operator precedence relation table. ii) Construct the precedence function table. b) Consider the following grammar and SDD of the grammar as given below. D>TL T > int | float L> Lid | id The SDD is as follows Production Semantic Rule D>TL Linh = Tval Tint T.val = int T= float T.val = float L>L, id Ly.inh = Linh 9 Q4) A val = Ly.inh.id.val L>id al = id.val Construct a dependency graph for the input string int id),ids,id Write a short note on Activation Record used in Dynamic memory allocation. Attempt any one of the following. (either A or B) a. Check whether the given grammar is SLR(1) or not, (6) S>bAB|aA A> Ab|b B>aBla b. Consider the equation a=b%(-c)+b*(-c). [4] Give i) Triple representation ii) Quadruple representation a, Check whether the given grammar is canonical LR(1) or not. [6] S>beS | SbA|a A>d b. Solve the following. [4] i) Define Directed Acyclic Graph (DAG). Construct DAG for the following expression (ata*(c-b)#(e-b)*d) ii)Define Flow Graph, Draw a flow graph for the following three address code. ,

You might also like