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

CD Model Exam Set 1

The document outlines a model exam for a Compiler Design course, including various questions related to parsing, grammar, and compiler phases. It covers topics such as shift reduce parsing, LL(1) grammar, syntax-directed definitions, and optimization in compilers. Additionally, it includes questions on storage organization, lexical analysis, and the construction of finite automata.

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 1

The document outlines a model exam for a Compiler Design course, including various questions related to parsing, grammar, and compiler phases. It covers topics such as shift reduce parsing, LL(1) grammar, syntax-directed definitions, and optimization in compilers. Additionally, it includes questions on storage organization, lexical analysis, and the construction of finite automata.

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

13.

a) (i)Construct stack implementation of shift reduce parsing for the


REG.NO:
grammar (7)
E->E+S
8131- PAVENDAR BHARATHIDASAN COLLEGE OF ENGINEERING E->E*E
AND TECHNOLOGY, MATHUR-TIRUCHIRAPPALLI-620024 E-> (E)
B.E/B.TECH –MODEL EXAM- APR 2018 E-> id and the input string id1+id2*id3
SIXTH SEMESTER
COMMON TO CSE/ IT
(ii) Explain LL(1) grammar for the sentence
CS6660 / COMPILER DESIGN S->iEts| iEtSeS |a ,E->b (6)
TIME: 3 HOURS MAXIMUM MARKS: 100 (OR)
ANSWER ALL QUESTIONS b) (i) Write an algorithm for Non recursive predictive parsing.(7)
PART A- (10*2=20 MARKS) (ii) Explain Context Free grammars with examples. (6)
1. What are two parts of a compilation? Explain briefly?
2. Illustrate diagrammatically how a language is processed. 14. a) (i) Construct a syntax directed definition for constructing a syntax
3. Write a grammar for branching statements. tree for assignment statements
4. List the operations on languages. S->is: =E
5. Write the algorithm for FIRST and FOLLOW in parser. E->E1+E2
6. Define ambiguous grammar. E->E1*E2
7. What is DAG? E->-E1
8. When do Dangling references occur? E->id (7)
9. What are the properties of optimizing compiler? (ii) Discuss specification of a simple type checker (6)
10. Write three address code sequence for the assignment statement
(OR)
d:=(a-b)+(a-c)+(a-c).
b) Discuss storage organization and different storage allocation
PART B – (5*13=65 MARKS) strategies (13)
11. a) Describe the various phases of compiler and trace it with the 15. a) Explain principal sources of optimization with examples (13)
program segment (position: =initial + rate*60). (13)
(OR) (OR)
b) (i) Explain various issues in the design of code generator (7)
b) (i) Explain language processing system with neat diagram.(5)
(ii) Write note on simple code generator (6)
(ii) Explain the need for grouping of phases. (4)
(iii) Explain various error encountered in different phases of
compiler. (4)
PART C(1*15=15 MARKS)
12. a) (i) Differentiate between lexeme ,token and pattern (3)
16. a) Write and explain the algorithm for minimization of a DFA.
(ii) What are the issues of lexical analysis? (4)
Using the above algorithm minimize the following DFA (15)
(iii)Write notes on regular expression. (6)
(OR)
b) (i) Write notes on regular expression to NFA. Construct Regular
expression to NFA for the Sentence ( a|b) * a (6)
(ii) Construct DFA to recognize the language ( a/b )*ab (7)

You might also like