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

CSE - CS604A - COMPILER DESIGN - R18 - Booklet

Uploaded by

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

CSE - CS604A - COMPILER DESIGN - R18 - Booklet

Uploaded by

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

JISCE / UG / CSE / R18 / EVEN / SEM-6 / CS604A / 2022-23 JISCE / UG / CSE / R18 / EVEN / SEM-6 / CS604A / 2022-23

10. (a) Explain with suitable examples. Convert the following 10 2 COMPILER DESIGN
NFA to the equivalent DFA. (Diagram is given below)
CS604A
TIME ALLOTTED: 3 HOURS FULL MARKS: 70
The figures in the margin indicate full marks.
Candidates are required to give their answers in their own words as far as practicable

GROUP – A
(Multiple Choice Type Questions)
1. Answer any ten from the following, choosing the correct alternative of each question: 10×1=10
Marks CO No.
(i) Role of preprocessor is to _____________. 1 4
(a) Produce output data
(b) Produce output to compilers
(c) Produce input to compilers
(d) None of these
(b) What is an operator precedence parser? 2 2 (ii) A finite automata recognizes __________. 1 2
(c) List the advantages and disadvantages of operator 3 3 (a) Any Language
precedence parsing. (b) A Context Sensitive Language
11. (a) Differentiate between: 5 4 (c) A Regular Language
Static Type Checking vs Dynamic Type Checking (d) A Context Free Language
(b) Write Short Notes on any two 2×5=10 (iii) A compiler is a translator that converts source program to 1 1
(i) Inherited attribute and synthesized attribute for 5 4 a ________________.
Syntax Directed Translation (a) HLL
(ii) Parse Tree 5 2 (b) Exe Code
(iii) Lexeme, Tokens and Patterns 5 3 (c) Assembly Code
(iv) LEX and YACC 5 3 (d) Machine Code
(iv) Identify the error which will not be detected by the 1 1
compiler?
(a) Lexical error
(b) Syntactic error
(c) Semantic error
(d) Logical error
(v) Which data structure is mainly used during shift-reduce 1 3
parsing?
(a) Array
(b) Stack
(c) Queue
(d) Pointer
(vi) The most powerful parser is _____________. 1 3
(a) SLR
(b) LALR
(c) Canonical LR
(d) Operator-precedence

Page 4 of 4 Page 1 of 4
JISCE / UG / CSE / R18 / EVEN / SEM-6 / CS604A / 2022-23 JISCE / UG / CSE / R18 / EVEN / SEM-6 / CS604A / 2022-23

(vii) A basic block can be analyzed by __________. 1 3 GROUP – B


(a) DAG (Short Answer Type Questions)
(b) A graph which may involve cycles Answer any three from the following 3×5=15
(c) Flow graph Marks CO No.
(d) None of these
2. (a) What do you mean by augmented grammar? 2 3
(viii) The grammar S → Sa | aS | a is _________. 1 1
(b) What do you mean by LR (0) items? Explain. 3 3
(a) Left recursive
3. Sketch out the DAG for the following basic block 5 2
(b) Right recursive
d:= b*c
(c) ambiguous
e:=a+b
(d) unambiguous
b:=b+c
(ix) White space and tabs are removed in _________ phase. 1 3
a:= e-d
(a) lexical analysis
4. (a) What is type checking? 1 3
(b) syntax analysis
(b) Differentiate between Dynamic and Static type checking. 4 2
(c) semantic analysis
5. (a) Explain input buffering techniques?. 3 1
(d) none of these
(x) Consider the following two statements S1 and S2: 1 2 (b) What are sentinels? 2 1
S1: {02n |n >= l} is a regu1ar language 6. Deduce the output of each phase for the expression 5 1
S2: {0m 0n 0(m+n) l m >= 1 and n >= 2} is a regu1ar a: = b + c *50
language [Assume a, b and c are real numbers]
Which of the following is true?
(a) Only S1 is correct
GROUP – C
(b) Only S2 is correct (Long Answer Type Questions)
(c) Both S1 and S2 are correct
Answer any three from the following 3×15=45
(d) None of S1 and S2 is correct
(xi) The grammar E →E+E|E*E|a is ____________. 1 2 Marks CO No.
(a) Ambiguous 7. (a) Checked the string id + id * id is parsed or not from the 5 3
(b) Unambiguous above SLR parsing table.
(c) Both (a) and (b) (b) Justify the statement “Copy propagation Leads to Dead 5 4
(d) None of these code”.
(xii) In a programming language, an identifier is permitted to 1 4 (c) Explain Nesting Depth Approach. 5 1
be a letter followed by any number of letter or digits. If L 8. (a) Write a context-free grammar for the following language. 6 4
and D denote the set of letters and digits respectively, Strings over the alphabet {a, b} that have exactly as many
which of the following expressions defines an identifier? a’s as b’s.
(a) (L | D) +
S ::= aSbS | bSaS |
(b) L. (L | D)*
(b) Translate the following expression: a=b* - c+b* -c into 9 4
(c) (L . D)*
(i) Quadruples
(d) L (L . D)*
(ii) Triples
(iii) Indirect Triples
9. (a) Consider the grammar: 5 3
S->aABb
A->c| Є
B->d| Є
Find out the FOLLOW(A) and FOLLOW(B).
(b) Explain stages of compilation. 5 1
(c) Explain Symbol Table and its organization. 5 1

Page 2 of 4 Page 3 of 4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy