(SEM V) THEORY EXAMINATION 2022-23 COMPILER DESIGN
Course: B.Tech (Semester V) Subject Code: KCS-502
Subject Name: Compiler Design Time: 3 Hours
Total Marks: 100 Note: Attempt all sections.
Section A – Short Answer Questions (2 × 10 = 20 Marks)
Answer all in brief:
How will you group the phases of a compiler? Mention the role of semantic analysis.
What are the various parts in a LEX program? Differentiate Parse tree and Syntax tree with an example.
List the properties of intermediate representation. Differentiate between LR and LL parsers.
What is phrase level error recovery? Discuss the capabilities of Context-Free Grammar (CFG).
Define loop jamming. What is an induction variable?
Section B – Descriptive Questions (10 × 3 = 30 Marks)
Attempt any three:
Write an SDD (Syntax Directed Definition) to produce three-address code for Boolean expressions and generate the code for:
Discuss stack allocation and heap allocation strategies of the runtime environment with examples.
Explain attributed grammars and the translation scheme for converting an infix expression to postfix.
Construct NFA and DFA for the regular expression:
(0 + 1)*(00 + 11)(0 + 1)*
Explain lexical analysis and syntax analysis phases of the compiler with examples and discuss error reporting in both phases.
Section C – Long Answer Questions (10 × 5 = 50 Marks)
Question 3
(a) Construct the CLR parse table for:
A → BB B → cB B → d or (b) Construct the SLR parsing table for:
S → 0S0 S → 1S1 S → 10
Question 4
(a) Explain back patching and generate three-address code for:
a < b or c > d and e < f or (b) Define Top-Down Parsing. Discuss its problems with suitable examples.
Question 5
(a) Define an Activation Record. Draw and explain the fields in a general activation record.
or
(b) Explain scope representation — scope by number and scope by location.
Question 6
(a) Define Symbol Table and discuss data structures used for symbol table implementation.
or
(b) Explain the following optimization techniques:
Copy Propagation Dead-Code Elimination
Code Motion Reduction in Strength
Question 7
(a) Explain the DAG (Directed Acyclic Graph) representation of a basic block with an example.
or
(b) Write Quadruples, Triples, and Indirect Triples for the expression:
if c < d then x = y * z else x = y + z```
Related Notes
BASIC ELECTRICAL ENGINEERING
ENGINEERING PHYSICS THEORY EXAMINATION 2024-25
(SEM I) ENGINEERING CHEMISTRY THEORY EXAMINATION...
THEORY EXAMINATION 2024-25 ENGINEERING MATHEMATICS...
(SEM I) THEORY EXAMINATION 2024-25 ENGINEERING CHE...
(SEM I) THEORY EXAMINATION 2024-25 ENVIRONMENT AND...
Need more notes?
Return to the notes store to keep exploring curated study material.
Back to Notes StoreLatest Blog Posts
Best Home Tutors for Class 12 Science in Dwarka, Delhi
Top Universities in Chennai for Postgraduate Courses with Complete Guide
Best Home Tuition for Competitive Exams in Dwarka, Delhi
Best Online Tutors for Maths in Noida 2026
Best Coaching Centers for UPSC in Rajender Place, Delhi 2026
How to Apply for NEET in Gurugram, Haryana for 2026
Admission Process for BTech at NIT Warangal 2026
Best Home Tutors for JEE in Maharashtra 2026
Meet Our Exceptional Teachers
Discover passionate educators who inspire, motivate, and transform learning experiences with their expertise and dedication
Explore Tutors In Your Location
Discover expert tutors in popular areas across India
Discover Elite Educational Institutes
Connect with top-tier educational institutions offering world-class learning experiences, expert faculty, and innovative teaching methodologies