0% found this document useful (0 votes)
136 views8 pages

Important Questions of CD

The document outlines the syllabus for Compiler Design for JNTUH R18 CSE, CSM, detailing various topics across five units. Each unit includes questions categorized by marks, covering concepts such as linkers, loaders, finite automata, parsing techniques, syntax-directed translation, runtime environments, and optimization strategies. The document serves as a study guide for students preparing for exams in this subject.

Uploaded by

afreen affu
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)
136 views8 pages

Important Questions of CD

The document outlines the syllabus for Compiler Design for JNTUH R18 CSE, CSM, detailing various topics across five units. Each unit includes questions categorized by marks, covering concepts such as linkers, loaders, finite automata, parsing techniques, syntax-directed translation, runtime environments, and optimization strategies. The document serves as a study guide for students preparing for exams in this subject.

Uploaded by

afreen affu
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/ 8

( Compiler Design ) - JNTUH R18 CSE,CSM

 Unit 1:
( 2,3 - marks ) :

1. Define linker and loader ?


2. What is the use of “lex” tool ?
3. What is the difference between compiler and
interpreter?
4. What is a Compiler?
5. Write a short note on regular expressions?
6. Explain the structure of a compiler?
7. Explain about the “C” compiler?
8. What is Finite automata?
9. What is tokens, how tokens are generated ?

( 5-marks : ) ( Same Topics but the difference is in asking questions )

1. What do you understand by the terms Tokens, Patterns,


and Lexemes ?
2. Define compiler. Explain various phases of compiler with
neat sketch ?
Or
Discuss the action taken by every phase of compiler on
the following instruction of Source Program while
compilation id=id+id*60 ?
3. Explain various Error Recovery strategies in Lexical
analysis ?
4. Give the DFA and NFA to accept the strings containing a,
b such that the string contains even number of a’s and
odd number of b’s ?
( Or )
What is a Finite Automata? Explain briefly about NFA and
DFA.
Write an algorithm to convert a given NFA into an
equivalent DFA
5. Explain with an example how lex program perform lexical
analysis for the arithmetic operators and identifiers in C?
Or
Design the LEX program that recognizes the tokens of a C
language and returns the token found ?
6. Explain about input buffering concept in lexical analysis ,
how it will improve the efficiency in recognition of tokens ?
7. Demonstrate the DFA – based pattern matchers ?

 Unit - 2 :
 (2 , 3 -marks ):

1. Define context free grammar?


2. What is parse tree & example ?
3. Differentiate between Top-Down Parsing and Bottom-Up
Parsing ?
4. What is ambiguity grammar ?
5. Write a small note on YACC ?
6. What is the role of Syntax Analysis?

( 5-marks ) :

1. What is left recursion? Describe the algorithm used


for eliminating left recursion ?
2. Remove the left recursion for the following
grammar and also find FIRSTS and FOLLOWs.
E→E + T | T
T→T * F | F
F → (E)/id
3. Differentiate between Top down and Bottom up
parsing techniques ?
4. Discuss about the LR Parser and explain its
advantages , characteristics ?
5. Show that the following grammar is LALR(1)
S→Aa | bAc | dc | bda
A→d
6. Consider the following grammar and construct
predictive parsing table.
expr expr + term
expr term
term term * factor
term factor
factor (expr)
factor id
7. Construct CLR parsing table for the following
Grammar
S →L=R
S→R
L→*R
L→id
R→L
8. Compute LR(0) items for the following grammar
and construct SLR parser table ?
S→L=R | R
L→ *R | id
R→L

9. Write down the algorithm for Recursive-Decent


parsing , Explain RD parsers with an example.

 Unit - 3 :
( 2,3 - marks ) :

1. What are the evaluation orders for syntax directed


definitions?
2. Explain the variants of syntax trees ?
3. What are the applications of Syntax Directed
Translation?
4. Define Type Checking?
5. What is three address code ?
6. What is syntax tree ?
7. Define L-attributes in SDT ?
8. What is the role of intermediate code generator ?

( 5-marks ) :

1. Compare Syntax-Directed Translation and Syntax-


Directed Definition ?
2. Explain about Annotated Parse Tree with example.?
3. Compare S-attributed definitions and L-attributed
definitions.
4. Demonstrate the concept of SSD’s used in Syntax
directed translations ?
5. Explain the Three address code(TAC) concept and its
advantages in representing intermediate code?
6. Explain about variants of syntax trees ?
7. Explain the Evaluation Orders for SDD's in syntax-
directed translation ?
8. Explain the role of type checking in intermediate code
generations & Explain some common type checking
techniques ?
9. Give the syntax-directed definition of a simple desk
calculator and construct an annotated parse tree for
the input expression (4*7+1)*2 ?
10. How are inherited attributes differ from synthesized
attributes?
11. Write Three address code for Conditional statements (
switch , if ..etc)?

 Unit - 4:
( 2,3 - marks ) :

1. What is Stack ?
2. What is heap ?
3. What is the use of run time environment ?
4. What is non-local data ?
5. What is garbage collection ?
6. What is trace based collection ?
7. What is target Language ?
8. Explain the addresses in the target code ?

( 5- Marks ) :

1. Demonstrate the concept of static link , dynamic link in


accessing a non local data on the stack ?
2. Explain the heap management in runtime
environment?
3. Demonstrate the concept of stack allocation of space in
runtime environments ,How are local, global variables
and function parameters allocated in stack?
4. What is garbage collection, explain how it is crucial in
run-time environment ?
5. Explain what are the limitations are there in trace based
garbage collection ?
6. Explain Issues in the Design of a Code Generator ?
7. Explain peephole optimization with an illustrative
example?
8. What is a basic block? How to construct a basic block?
9. Explain various storage allocation strategies with an
example ?

 Unit - 5 :
( 2,3 marks ) :

1. What is flow graph?


2. What is Constant Propagation?
3. What is Data flow analysis?
4. What is Optimization?
5. What is the need of optimization?
6. What is flow function, transfer function?
7. What is machine independent optimization?
8. What is partial redundancy in code optimization?

( 5 Marks ) :

1. Explain the following with an example


a) Constant Propagation
b) Partial Redundancy Elimination
2. Explain loop optimization techniques with example?
3. Explain various notations used in data flow analysis ?
4. Differentiate between Machine-dependent and
Machine-independent Optimization.
5. Explain the basic terms of data flow analysis.
6. Explain in detail about the how one instruction is
scheduling with an example?
7. What is Flow-Graph? Explain how the given program
can be converted into Flow Graph?

--“All The Best For Your Exams!!”—


@codingfataka

You might also like