0% found this document useful (0 votes)
15 views4 pages

Compiler 6

This document is an examination paper for Compiler Construction with a maximum score of 100 marks. It consists of two sections, each containing various questions related to compiler design concepts such as lexical analysis, parsing techniques, symbol tables, and code optimization. Students are instructed to attempt all questions and provide answers in a structured format.

Uploaded by

jaymehta11th
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Compiler 6

This document is an examination paper for Compiler Construction with a maximum score of 100 marks. It consists of two sections, each containing various questions related to compiler design concepts such as lexical analysis, parsing techniques, symbol tables, and code optimization. Students are instructed to attempt all questions and provide answers in a structured format.

Uploaded by

jaymehta11th
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 4
Seat No. : 5391 December-2008 Compiler Construction (CC) gq REFGRENCE Hours} [Max. Marks : 100 (10 : 30 A.M. to 1:30 P.M.) Instructions : 5391 (1) Attempt all questions. (2) Answers to the sections must be written separately. (3) Figures to right indicate marks. (4) Assume suitable data if necessary. SECTION -1 Answer the following questions 18 (1) Write note on front end and back end of the compilers. (2) Give the associativity of the operator. @) (4) 6) (6) M (8) (9) @ (b) What is the role of Lexical Analyzer ? Give the need for Lexical Analysis in compilation. What do you mean by ambiguity ? Define ambiguous grammar. Write down RE for: “All string of digits with no repeated digit”, Differentiate between Parse Tree and Syntax Tree Construct the syntax tree for a* (td) id. What information does Symbol Table hold? Write down about the data structures used to represent the Symiol Table. Explain the roles performed by Syntax Analyzer phase of compiler with an example. What is operator grammar ? Define operator precedence parsing, Construct a deterministic automaton for (0 | 1)* O11. 4 Construct predictive parsing table for following 4 SA AaB |Ad B-> bBC|f cog 1 PTO. 5391 © ® @ 0) © @ Explain multipass and single pass compiler and also state factors affecting passes of compiter. oR Give reasons for separating lexical analyzer and parser. ‘Contider the following augmented grammar: Sos s-cc C > eCid Prepare the goto graph for it. OR Check whether the given grammar is LL (1) or not. SSH S~aSAle AsbS|e What is attributed grammar ? What is synthesized grammar ? Can it be simulated by the use of YACC ? What is the input and output to YACC ? 4 Explain the algorithm for constructing predictive parser. OR . Compare top-down and bottom-up parsing. What are the drawbacks of top-down parsing ? Explain. 4 Explain : Stack Memory allocation/management. What is the role of Activation Record in Dynamic Memory allocation ? OR Give the translation of three address code for the following stmt : while a TS|S. Whether the transformed grammar is LL (1) ? Describe the LR parsing algorithm. 4 Write syntax directed Definition for translating following grammar for postfix notation. Also draw annotated parse tree for 9-5 +2. 8 expr—> expr + term expr —> expr—term term -> 0] 1 | ....19 OR Construct canonical collection of the sets of LR(1) items and LR(1) parsing table for the following grammar : 8 S—> AaAbjBbBa Ae Boe 3 P.T.O. 6. (a) Construct the LR(0) items and SLR parser to parse the input string : “id * id + id”. (Assume the Grammar) OR Outline the symbol table organization for non block structured language. (b) Construct a (minimum state) DFA for the foliowing RE : 1*(0|01)* or minimize the states. OR The following grammar for if-then-else statements is proposed Stmt + if expr then stmt | stmt | if expr then stmt else stmt. Show that the grammar is ambiguous (©) S>(ya LoLs Ss What are the terminal and non terminal symbols ? Contract the left most and right most. derivations and the corresponding parse tree for the sentence : (aa, a). OR What are the factors to be considered in the task of code generation, 5391 4

You might also like