0% found this document useful (0 votes)
44 views

Compiler Design Complete Assignment

This document contains 10 questions related to compiler design for Assignment 5. The questions cover topics like code generation, register allocation, basic blocks, control flow graphs, data flow analysis, peephole optimization, and more. Students are asked to explain concepts, differentiate between topics, provide examples, and translate code snippets into intermediate representations. The assignment is due on October 13th, 2023 and is to be submitted to Mr. Abhishek K.C. Sharma.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Compiler Design Complete Assignment

This document contains 10 questions related to compiler design for Assignment 5. The questions cover topics like code generation, register allocation, basic blocks, control flow graphs, data flow analysis, peephole optimization, and more. Students are asked to explain concepts, differentiate between topics, provide examples, and translate code snippets into intermediate representations. The assignment is due on October 13th, 2023 and is to be submitted to Mr. Abhishek K.C. Sharma.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Compiler Design(BTCS601)

Assignment-01 Date: 09-Aug-2023

Q.1 Explain the Booting process of a System along with the Types of
Booting.
Q.2 What is a BIOS? What are the roles of ROM BIOS and CMOS RAM?
Q.3 Explain various levels of Programming Languages.
Q.4 Explain various Types of Memories along with their Characteristics.
Q.5 Explain the concept of the Von-Newman model by taking the Statement
C=A+B along with a neat and clean diagram and try to generate Symbolic
(Assembly/Mnemonic/HEX) Code and Machine Code.
Q.6 Explain the complete execution process of a “C/C++” program from the
very beginning to till the end. What are the contents of the executable file?
Q.7 What are Finite Automata? What are the NFA and DFA? Give the
conversion process of NFA to DFA.
Q.8 What is Regular Expression? Explain with suitable examples.
Q.9 Describe Context-Free Grammar (CFG). Also, explain CNF and GNF.
Q. 10 Describe PDA and Construct the PDA for anbn.

Date of Submission –18-Aug-2022


Mr. Abhishek K.C. Sharma
Subject Teachers {Sections: VII Semester (B, E, I) & V Semester (J)}
Compiler Design(BTCS601)
Assignment-02 Date: 18-Aug-2023
Q.1 What is a Compiler? Give the primary tasks of a Compiler.
Q.2. What are “Compiler” and “De-compiler”? Why are these needed?
Q.3 Describe the Compiler and its phases with a neat and clean diagram.
Q.4 Explain the “Analysis-Synthesis Model” {Grouping of Phases/Pass-I &
Pass-II/Single Pass vs. Multi-Pass/Frontend & Backend} of Compiler in
brief.
Q.5 Explain the various types of translators (Cousins of Compilers).
Q.6 Provide the Details of Compiler Construction Tools?
Q. 7 What is input Buffering? Describe the techniques of Single Buffering
and Double Buffering Schemes.
Q. 8 What is Lexical Analysis? Explain the Role of Lexical Analyzer. Give
Specification of Tokens.
Q.9 What is LEX? Describe auxiliary definitions and translation rules for
LEX with suitable examples. Give a short description of tools “LEX”.
Q.10 Write short notes on the following:
a. Boot-strapping
b. Cross-Compiler
c. Back Patching
d. Sentinels
e. Error and Recovery Schemes

Date of Submission –28-Aug-2022

Mr. Abhishek K.C. Sharma


Subject Teachers {Sections: VII Semester (B, E, I) & V Semester (J)}
Compiler Design(BTCS601)
Assignment-03 Date: 8-September-2023
Q.1 What is Syntax Analysis? Explain the Role of Parser.
Q.2 Write a short note:
(a) Polish and Reverse Polish notations.
(b) Ambiguous Grammar.
(C) Operator Precedence and Associativity.
Q.3 Describe the classifications of Parsing techniques along with a suitable block
diagram.
Q.4 Explain the leftmost and rightmost derivations with suitable examples.
Q.5 Difference b/w Parse tree and Syntax tree?
Q.6 Describe Brute-Force Parser.
Q.7 Explain the Recursive-Descent Parsing & Predictive Parsing.
Q.8 What is Left Recursion? How is it removed? Explain the need and process of
Left Factoring.
Q.9 Explain the Rules for generating the FIRST and FOLLOW sets of the symbols
for the Grammar.
Q.10. Consider the following Grammar and Construct the LL(1) Parser:
S -> A A -> BC | DBC B -> Bb | ε C -> c | ε D -> a | d
(1) Check left recursion.
(2) Check left factoring.
(3) Transition Diagram
(4) FIRST & FOLLOW.
(5) Parsing Table.
(6) Block Diagram.
(7) Parsing Algorithm.
(8) Parsing with String dbb.

Date of Submission –15-September- 2023


Mr. Abhishek K.C. Sharma
Subject Teachers {Sections: VII Semester (B, E, I) & V Semester (J)}
Compiler Design (BTCS601)
Assignment-04 Date: 15-Sep-2023
Q.1 Describe the Bottom–up parser and its classifications.
Q.2 What is shift-reduce Parser?
Q.3 What is Operator Precedence Grammar?
Q.4 Explain the LR Parser along with its features and types.
Q.5 Draw the block diagram of LR Parser.
Q.6 Perform the SLR Parsing on the following Grammar G by explaining every
point in detail. Grammar G:
(1) E -> E+T
(2) E -> T
(3) T -> T*F
(4) T -> F
(5) F -> (E)
(6) F -> id
(i) Augmented Grammar G’.
(ii) Preparing Canonical Set of items LR (0) through closure operation.
(iii) Preparing Transition Diagram T.
(iv) Block Diagram for LR Parser.
(v) Algorithm for constructing parsing Table.
(vi) Constructing Parsing Table M.
(vii) Performing the SLR Parsing by use of the string id*id+id.
Q.7 Differentiate b/w CLR and LALR with parsing.
Q.8 What is Syntax Directed Translations [Semantic Phase]? Also, explain its
roles.
Q.9 Write Short notes on:
(i) Annotated Parse Tree.
(ii) S-attribute Definitions (Synthesized)
(iii) L-attribute Definitions (Inherited)
(iv) Dependency Graphs
Q.10 Parameter passing techniques. Explain various techniques.

Date of Submission –27-Sep-2023

Mr. Abhishek K.C. Sharma


Subject Teachers {Sections: VII Semester (B, E, I) & V Semester (J)}
Compiler Design (BTCS601)
Assignment-05 Date: 29-Sep-2023
Q.1 What do you mean by three address code?
Translate the expression
-(a+b)*(c+d)+(a+b+c) into Quadruples, Triples, Indirect triples.
Q.1 Difference b/w Syntax Tree and DAG.
a) Construct the DAG for the following basic block:
d := b * c
e := a + b
b := b * c
a := e – d
b) Construct the DAG for the following basic blocks:
(i) t1=4*i (ii) t2=a[t1] (iii)t3=4*i
(iv)t4=b[t2] (v) t5=t2*t4 (vi)t6=prod+t5
(vii)prod=t6 (viii)t7=i+1 (ix) i=t7
(x) if i<=20 goto step (1)
Q.3 What do you mean by Activation Record?
Q.4 What is the difference between dynamic and static storage management?
Explain the importance of run-time storage management in the compiler.
Q.5 What do you understand by code generation? What are the general issues in
designing a code generator? What is register allocation and assignment?
Generate the code for the following expression using only one register.
d := b * c
e := a + b
b := b * c
a := e - d
Q.6 What do you mean by optimization technique? Explain the principle sources of
optimization with suitable examples.
Q.7 What is a basic block? Discuss various transformations that can be done on the
basic block with the help of a suitable example.
Q.8 What do you mean by control flow graph?
Q.9 What is global data-flow analysis? What is its use in code optimization?
Q.10 Explain the process of peephole optimization.

Date of Submission –13-Oct-2023

Mr. Abhishek K.C. Sharma


Subject Teachers {Sections: VII Semester (B, E, I) & V Semester (J)}

You might also like