0% found this document useful (0 votes)
18 views2 pages

CD Model Exam Set 2

This document outlines the structure and content of a model exam for B.E/B.Tech students in Compiler Design, covering various topics such as lexical analysis, compiler phases, and parsing techniques. It includes questions on symbol tables, finite automata, error recovery, and optimization techniques. The exam consists of multiple parts with specific questions aimed at assessing students' understanding of compiler construction and design principles.

Uploaded by

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

CD Model Exam Set 2

This document outlines the structure and content of a model exam for B.E/B.Tech students in Compiler Design, covering various topics such as lexical analysis, compiler phases, and parsing techniques. It includes questions on symbol tables, finite automata, error recovery, and optimization techniques. The exam consists of multiple parts with specific questions aimed at assessing students' understanding of compiler construction and design principles.

Uploaded by

cs0814
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

REG.

NO:

8131- PAVENDAR BHARATHIDASAN COLLEGE OF ENGINEERING


AND TECHNOLOGY, MATHUR-TIRUCHIRAPPALLI-620024 (ii) Explain the various errors encountered in different phases
B.E/B.TECH –MODEL EXAM- APR 2018 of a compiler. (4)
SIXTH SEMESTER
COMMON TO CSE/ IT
(iii) Describe the software tools and error recovery in lexical
CS6660 / COMPILER DESIGN analyzer (4)
TIME: 3 HOURS MAXIMUM MARKS: 100
ANSWER ALL QUESTIONS 12. a) (i)Discuss the role of Lexical analyzers in detail with necessary
PART A- (10*2=20 MARKS) examples. (7)
1. What is a symbol table? (ii) Discuss how finite automata is used to represent tokens
2. List the various compiler construction tools. and perform lexical analysis with examples. (6)
3. List the rules that form the BASIS. OR
4. Differentiate tokens, patterns, lexemes. b) Conversion of regular expression (a/b)*abb to NFA and
5. Construct a parse tree for -(id + id ). Write an algorithm for minimizing the number of states of a
6. What is meant by handle pruning? DFA. (13)
7. Write down syntax directed definition of a simple desk calculator. (8)
8. List dynamic storage allocation techniques.
9. Identify the constructs for optimization in basic block.
10. What are the characteristics of peephole optimization?
13. a) (i)Construct parse tree for the input string w=cad using top
PART B – (5*13=65 MARKS)
down parser.
11. a) (i)Explain the phases of compiler with a neat diagram. (8)
A→ab|a (3)
(ii) Write notes on compiler construction tools. (5)
OR
b) (i) Explain the cousins of compiler. (5)

(ii) Construct parsing table for the grammar and find moves
made by predictive parser on input 1d+id*id and find FIRST and
FOLLOW. (10)
E→E+T/T
T→T*F/F
F→ (E)/id
OR
b) (i) Explain ambiguous grammer
G: E→E+E| E*E| (E) | -E| id for the sentence
id+id*id.
(ii) Construct SLR parsing Table for the following belong to that grammar or not.(15)
grammer: (i) (a,a) (ii) (a, (a ,a)) (iii) (a, ((a , a), (a , a)) )
G: E→E+T| T,T→T*F| F,F→(E) | id.

14. a) (i)Describe in detail the source language issues. (6)


(ii)Write detailed notes on parameter passing. (4)
(iii)Explain about symbol tables. (3)
OR

b) (i)Explain type conversions with suitable grammar. (5)


(ii) Illustrate type checking with necessary diagram. (6)
(iii)Distinguish between static and dynamic storage
allocations (2)

15. a) Construct DAG and optimal target code for the expression
x=((a+b)/(b-c))-(a+b)*(b-c)+/. And What are the advantages of
DAG representation. (13)

OR
(b) Explain global data flow analysis with necessary equations.(13)

PART C(1*15=15 MARKS)


16. Construct Predictive Parsing table for the following grammar:
S ->(L)/a, L -> L, S/S and check whether the following sentences

You might also like