(SEM V) THEORY EXAMINATION 2023-24 COMPILER DESIGN

B.Tech Engineering 0 downloads
₹29.00

B.Tech (Semester V) | AKTU / UPTU | Exam Year: 2023–24
Maximum Marks: 100 | Time: 3 Hours | Paper ID: 310677

This question paper focuses on testing the students’ understanding of the design, structure, and optimization techniques of compilers.
It covers major compiler construction phases — Lexical Analysis, Syntax and Semantic Analysis, Intermediate Code Generation, Optimization, and Code Generation.

The paper is divided into three main sections (A, B, C) to evaluate both conceptual understanding and problem-solving skills related to parsing, syntax-directed translation, and optimization.

SECTION A – Short Answer Questions (10 × 2 = 20 Marks)

Students must attempt all ten short questions.
This section assesses conceptual clarity of compiler construction principles and terminology.

Sample Questions (Page 1):

Define bootstrapping in the context of compilers.

Which phase of a compiler is optional and why?

Explain the concept of shift-reduce parsing.

Differentiate between Parse Tree and Syntax Tree with examples.

Define syntax-directed translation schemes.

What are the two types of attributes associated with grammar symbols?

Discuss how scope information is represented in a symbol table.

What is meant by an Activation Record?

Discuss two design issues in code generation.

Explain the concept of global data-flow analysis.

Concepts Covered:
Compiler phases, parsing, syntax trees, syntax-directed translation, symbol table design, activation records, optimization, and data flow analysis.

SECTION B – Descriptive / Medium-Length Questions (3 × 10 = 30 Marks)

Students are required to attempt any three questions.
This section focuses on intermediate-level analytical and theoretical problems on lexical and syntax analysis, code generation, and optimization.

Sample Questions (Page 1):

Describe the relationship between finite state machines and regular expressions. Explain how regular expressions are used in lexical analysis and pattern matching.

Construct LR(1) and LALR parsing tables for the grammar:

Explain the concepts of quadruples and triples in syntax-directed translation.

Describe a simple stack allocation scheme for memory management.

Explain the role of the code generator and how it translates intermediate code to target code.

Concepts Covered:
Regular expressions, LR(1)/LALR parsing, syntax-directed translation, intermediate code forms, stack allocation, and code generator design.

SECTION C – Analytical / Long Answer Questions (5 × 10 = 50 Marks)

Students must attempt one part from each question (Q3–Q7).
This section covers problem-solving, grammar design, code optimization, and semantic error handling.

Sample Questions (Pages 1–2):

Q3.
a. Construct an NFA for the regular expression a(b|c)*.
b. Check whether the grammar E → E+E | E*E | id is ambiguous. If yes, convert it into an unambiguous grammar.

Q4.
a. Check whether the grammar S → PQy, P → Sy|x, Q → yS is LR(0) or not.
b. For the grammar:

 

E → E + T | T   T → T * F | F   F → (E) | id

Construct the shift-reduce parsing tree for id * (id + id).

Q5.
a. Write syntax-directed definitions for the statement:

 

S → id = E   E → E + E | E * E | -E | (E) | id 

b. Explain how syntax-directed translation handles array references in arithmetic expressions.

Q6.
a. Define a Symbol Table and explain data structures used in its implementation.
b. Discuss semantic errors, their detection, and challenges in handling them. Provide suitable examples.

Q7.
a. Apply common subexpression elimination to optimize the block:

 

1. x = a + b   2. y = x * c   3. z = y – d

b. Construct a Directed Acyclic Graph (DAG) for the block:

 

1. x = a + b   2. y = c - d   3. z = x * y

Concepts Covered:
NFA construction, ambiguity detection, LR(0) parsing, syntax-directed translation, symbol table management, DAG creation, and code optimization techniques.

Learning Outcomes:

After completing this paper, students will be able to:

Understand the phases and architecture of a compiler.

Analyze grammars and construct parsing tables.

Implement syntax-directed translation and intermediate code forms.

Detect and resolve semantic and optimization issues in code generation.

Understand data-flow analysis and code optimization in compiler back-end design.

 

S → aAd | bBd | aBe | bAe   A → f   B → f  

File Size
155.14 KB
Uploader
SuGanta International
⭐ Elite Educators Network

Meet Our Exceptional Teachers

Discover passionate educators who inspire, motivate, and transform learning experiences with their expertise and dedication

KISHAN KUMAR DUBEY

KISHAN KUMAR DUBEY

Sant Ravidas Nagar Bhadohi, Uttar Pradesh , Babusarai Market , 221314
5 Years
Years
₹10000+
Monthly
₹201-300
Per Hour

This is Kishan Kumar Dubey. I have done my schooling from CBSE, graduation from CSJMU, post graduati...

Swethavyas bakka

Swethavyas bakka

Hyderabad, Telangana , 500044
10 Years
Years
₹10000+
Monthly
₹501-600
Per Hour

I have 10+ years of experience in teaching maths physics and chemistry for 10th 11th 12th and interm...

Vijaya Lakshmi

Vijaya Lakshmi

Hyderabad, Telangana , New Nallakunta , 500044
30+ Years
Years
₹9001-10000
Monthly
₹501-600
Per Hour

I am an experienced teacher ,worked with many reputed institutions Mount Carmel Convent , Chandrapu...

Shifna sherin F

Shifna sherin F

Gudalur, Tamilnadu , Gudalur , 643212
5 Years
Years
₹6001-7000
Monthly
₹401-500
Per Hour

Hi, I’m Shifna Sherin! I believe that every student has the potential to excel in Math with the righ...

Divyank Gautam

Divyank Gautam

Pune, Maharashtra , Kothrud , 411052
3 Years
Years
Not Specified
Monthly
Not Specified
Per Hour

An IIT graduate having 8 years of experience teaching Maths. Passionate to understand student proble...

Explore Tutors In Your Location

Discover expert tutors in popular areas across India

Guitar Classes Near By Greater Kailash Learn Guitar with Expert Guidance & Transform Your Passion into a Lifelong Skill Greater Kailash, Delhi
Voice-over Training Near Sushant Lok Phase 1 – Learn Professional Voice Acting Phase I Sushant Lok, Gurugram
Digital Marketing Course Near Sector 62 Gurugram – Master Online Growth & Build a High-Demand Career Sector 62, Gurugram
Stenography Classes Near Sector 93 Gurugram – Build Speed, Accuracy & Secure Government Career Opportunities Sector 93, Gurugram
Guitar Classes Near Central Noida Sector 1 – Learn Guitar with Expert Trainers Noida
Zumba Classes Near Palam Vihar Extension – Dance Your Way to Fitness New Palam Vihar, Gurugram
Keyboard / Piano Classes Near DLF Phase 3 – Learn Music with Professional Training DLF Phase 3, Gurugram
Cake Decoration Classes Near By Dwarka Mor – Master the Art of Creative Cake Designing Dwarka Mor, Delhi
Zumba Classes Near Sector 133 Greater Noida – Fun, Fitness and Energy in Every Step Noida
Singing & Guitar Classes Near Sector 106 Gurugram (Dwarka Expressway) – Discover Your Musical Talent Sector 106, Gurugram
Guitar Classes Near New Friends Colony – Learn Guitar from Expert Trainers in South Delhi New Friends Colony, Delhi
Vedic Maths Classes Near By Dwarka Mor Improve Speed, Accuracy & Confidence in Mathematics Dwarka Mor, Delhi
Coding Classes for Kids Near Sector 65 Gurugram – Build Future Tech Leaders from an Early Age Sector 65, Gurugram
Music Theory & Composition Classes Near By Najafgarh – Build Your Musical Foundation Najafgarh, Delhi
Science Classes Near By Dwarka Mor – Build Strong Concepts in Physics, Chemistry & Biology Dwarka Mor, Delhi
Baking Classes Near Sector 84 Gurugram – Learn Cake & Bakery Skills Professionally Sector 84, Gurugram
Tailoring & Stitching Classes Near By Dwarka Mor – Learn Professional Sewing Skills Dwarka Mor, Delhi
Coding Classes for Kids Near By Kirti Nagar – Build Future-Ready Skills Early Kirti Nagar, Delhi
Guitar Classes Near Central Noida Sector 5 – Learn Guitar with Professional Trainers B Block Sector 5, Noida
Language Classes Near Tilak Nagar – Learn, Speak & Grow with Confidence Tilak Nagar, Delhi
⭐ Premium Institute Network

Discover Elite Educational Institutes

Connect with top-tier educational institutions offering world-class learning experiences, expert faculty, and innovative teaching methodologies

Réussi Academy of languages

sugandha mishra

Réussi Academy of languages
Madhya pradesh, Indore, G...

Details

Coaching Center
Private
Est. 2021-Present

Sugandha Mishra is the Founder Director of Réussi Academy of Languages, a premie...

IGS Institute

Pranav Shivhare

IGS Institute
Uttar Pradesh, Noida, Sec...

Details

Coaching Center
Private
Est. 2011-2020

Institute For Government Services

Krishna home tutor

Krishna Home tutor

Krishna home tutor
New Delhi, New Delhi, 110...

Details

School
Private
Est. 2001-2010

Krishna home tutor provide tutors for all subjects & classes since 2001

Edustunt Tuition Centre

Lakhwinder Singh

Edustunt Tuition Centre
Punjab, Hoshiarpur, 14453...

Details

Coaching Center
Private
Est. 2021-Present
Great success tuition & tutor

Ginni Sahdev

Great success tuition & tutor
Delhi, Delhi, Raja park,...

Details

Coaching Center
Private
Est. 2011-2020