0% found this document useful (0 votes)
3 views16 pages

Course File CD Unit II

good

Uploaded by

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

Course File CD Unit II

good

Uploaded by

durgabhavani60
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

COURSE FILE INDEX

S. No Details
1 Vision mission of the institute and Department, along with PEOs
2 Course Descriptor (Prepared by Course Coordinator only)
3 Previous results and self-target for present semester
4 Previous question papers along with answers
5 Academic Calendar
6 Student Roll List
7 Individual and Class Timetable
8 Session Planner
Class notes (Must Include the following in Unit Wise)
i. Lecture wise Notes
ii. Blooms Taxonomy (Contain 5 levels questions & answers)
iii. Question Bank (20 Short Answer Questions and 20 Descriptive Questions for
theoretical subjects, or 30 Descriptive/Analytical/Programming/Derivation
Questions for tutorial and programming-based courses for each unit.) along with
COs and blooms taxonomy levels
9 iv. 20 objective questions with answers include Gate questions (For Gate
subjects mandatory of gate questions)
v. 8-10 Unit wise solved Tutorial Problems
vi. 5 Assignment Questions chapter Wise along with Blooms Levels and CO's mapping.
vii. 5 topics for tech talks/ PPT /concept video etc. (selected for the course)
viii. Case Studies and Real-Life Examples
ix. Complex Engineering Problems Incorporating Sustainability Goals
x. SWAYAM/NPTEL/MOOC/Self Learning (provide 5 links for 5 different topics)
xi. Student seminar topics (if applicable)
xii. Two Micro Projects/certifications related to courses (If applicable)
Unit Wise Active Learning (activities)
Collaborative learning
Stump your partner
10 Muddiest point
Flipped classroom
Think pair and share
11 Unit Test question papers along with COs and Blooms Taxonomy Levels
MID-I and MID-II Exam schedules and Question Papers and Award list
12 (Slow learner identification and remedial action-
List of slow learners, Remedial class Timetable, Remedial Lecture Plan, Impact Analysis)
13 CO Attainment for MID-I With Micro Analysis
14 CO Attainment for MID-II With Micro Analysis
15 Final CO Attainment with Micro Analysis
16 Actions Taken Based on the Results of Evaluation of the COs, POs, and PSOs
17 Task table
18 Certificate
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
QUESTION BANK
UNIT-II

Admitted Batch 2023-24 Program/Semester [Link]. VII Sem


Regulation MLRS-R22 Branch CSE

Course Name Compiler Design Course Code 2270517

ALLIMALLI
Course Faculty Academic Year 2026-27
DURGABHAVANI

PART-A
Short Answer Questions
(1-mark Questions)
Course Bloom’s
[Link] QUESTION Outcome Taxonomy
1 What is a context-free grammar (CFG)? CO2 Remembering
2 Name two common notations for defining grammars in compiler design. CO2 Remembering
3 Explain why CFGs are used in syntax analysis instead of regular grammars. CO2 Understanding
4 Define terminals and non-terminals with examples. CO2 Remembering
5 What is left recursion in a grammar? CO2 Remembering
6 Why must left recursion be eliminated for top-down parsing? CO2 Understanding
7 What is left factoring in grammar design? CO2 Remembering
8 How does left factoring help predictive (LL(1)) parsing? CO2 Understanding
9 What is an LL(1) grammar? CO2 Remembering
10 Why are FIRST and FOLLOW sets important in LL parsing? CO2 Understanding
11 What is a parse tree? CO2 Remembering
12 Differentiate leftmost and rightmost derivations. CO2 Understanding
13 What is an ambiguous grammar? Provide an example. CO2 Remembering
14 Why are ambiguous grammars problematic for parsing? CO2 Understanding
15 What is operator precedence, and how is it enforced in parsing? CO2 Understanding
16 Describe shift-reduce parsing in one sentence. CO2 Remembering
17 Define LR parsing. CO2 Remembering
18 Name three types of LR parsers. CO2 Remembering
19 How does an SLR parser decide between shift and reduce? CO2 Understanding
20 What is a parser generator? Give one example. CO2 Remembering
PART-B
Descriptive Questions
(5-mark Questions)
[Link] Question Course Bloom’s
Outcome Taxonomy
1 Explain the structure of a compiler and describe the CO2 Understand
functions of each compilation phase with a neat diagram.
2 Discuss the importance of compiler construction in the CO2 Understand
implementation of programming languages.
3 Differentiate between compiler and interpreter with CO2 Analyze
suitable examples.
4 Explain the role of lexical analysis in compiler design and CO2 Understand
describe the process of token generation.
5 Describe input buffering techniques used in lexical CO2 Analyze
analyzers and explain their advantages.
6 Explain how tokens, patterns, and lexemes are used in CO2 Understand
lexical analysis with examples.
7 Discuss the working principle of Lex and explain how it CO2 Analyze
generates lexical analyzers automatically.
8 Construct regular expressions for identifiers, integers, and CO2 Create
floating-point numbers.
9 Explain the difference between deterministic and CO2 Analyze
nondeterministic finite automata with examples.
10 Describe the process of converting regular expressions CO2 Analyze
into finite automata.
11 Explain DFA minimization techniques and discuss their CO2 Evaluate
importance in lexical analyzer optimization.
12 Discuss the design issues involved in lexical-analyzer CO2 Analyze
generators.
13 Explain syntax analysis and discuss its role in compiler CO2 Understand
design.
14 Define context-free grammar and explain its significance CO2 Understand
in syntax analysis.
15 Construct a context-free grammar for arithmetic CO2 Create
expressions involving addition and multiplication.
16 Explain the concept of derivation and parse tree with CO2 Analyze
suitable examples.
17 Compare top-down parsing and bottom-up parsing CO2 Analyze
techniques.
18 Explain recursive descent parsing with a suitable example. CO2 Apply
19 Discuss predictive parsing and explain the construction of CO2 Analyze
predictive parsing tables.
20 Explain shift-reduce parsing with suitable examples. CO2 Understand
21 Describe the working principle of LR parsing and explain CO2 Analyze
its advantages.
22 Differentiate between SLR, CLR, and LALR parsers. CO2 Analyze
23 Explain parser generators and discuss the role of YACC in CO2 Understand
compiler construction.
24 Discuss ambiguous grammars and explain methods to CO2 Evaluate
remove ambiguity.
25 Explain error handling mechanisms used in lexical and CO2 Analyze
syntax analysis.
26 Construct a DFA that accepts binary strings ending with CO2 Create
101 and explain its transitions.
27 Develop Lex rules to recognize identifiers, keywords, and CO2 Create
relational operators.
28 Analyze the process of converting an NFA into DFA with CO2 Analyze
an example.
29 Explain operator precedence parsing and discuss its CO2 Analyze
advantages and limitations.
30 Evaluate the importance of compiler optimization CO2 Evaluate
techniques in modern programming systems.

Signature of Faculty Signature of course coordinator

Signature of HOD Signature of Dean Academics


DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
ASSIGNMENT QUESTIONS
Admitted Batch 2023-24 Program/Semester [Link]. VII Sem
Regulation MLRS-R22 Branch CSE

Compiler Design Course Code 2270517


Course Name
ALLIMALLI
Course Faculty Academic Year 2026-27
DURGABHAVANI

Course Bloom’s
[Link] QUESTION Outcome Taxonomy
Explain the role of Context-Free Grammars (CFGs) in syntax analysis. Provide the
1 formal definition of a CFG. CO2 Understand

Write a grammar for simple arithmetic expressions (including +, *, parentheses),


2 then eliminate left recursion and show steps. CO2 Apply

Compare top-down parsing and bottom-up parsing. Discuss their advantages and
3 limitations in compiler design. CO2 Analyze

Describe the operation of an SLR parser. Outline how ACTION and GOTO tables
4 are constructed and used in parsing. CO2 Apply

Explain how ambiguous grammars are handled using parser generators (e.g.,
5 Bison/Yacc). Use the dangling-else as an example. CO2 Evaluate
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
TECH TALKS/ PPT /CONCEPT VIDEO ETC

Admitted Batch 2023-24 Program/Semester [Link]. VII Sem


Regulation MLRS-R22 Branch CSE

Course Name Compiler Design Course Code 2270517

ALLIMALLI
Course Faculty Academic Year 2026-27
DURGABHAVANI

Sources Course Bloom’s PO PSO


SNO QUESTION Details Outcome Taxonomy
ScienceDirect:
“Efficient DFA
minimization used
Advances in DFA Minimization to be complicated
1. Techniques for Lexical Analysis but is now made
CO2 Analyze 1, 2, 5 1, 2
simple”
([Link]
)
IEEE-accessible:
“Efficient
Hash-Table-Based and Hopcroft Deterministic
2. Variants in DFA State Minimization Finite Automata Evaluate 1, 2, 5 1, 2
Minimization CO2
Based on
Backward Depth”
PLOS ONE: “An
Comparative Performance of empirical
Lex/Yacc vs ANTLR in Modern evaluation of
3 CO2 Analyze 1, 4, 10 1, 2
Compiler Construction Lex/Yacc and
ANTLR parser
generation tools”
Lexer Tool Comparison: Flex, Lex, PMC via PLOS
Evaluat
4 Rex, ANTLR—What to Use When? ONE & GitHub CO2 e
1, 4, 10 1, 2
sources
SSRN:
Real-Time DFA Construction & “Enhancing
Minimization for High-Speed Parsing Performance of
5 CO2 Create 1, 2, 5, 12 2, 3
(IoT/Embedded Systems) DFA Construction
Using Simulated
Annealing”
Note:

i. Topics should select topics from reputed journal databases such as IEEE, Scopus, Science
Direct, Springer, or Web of Science
ii. Student Presentations must include relevant references, Course Outcomes (COs), and the scope
of the topic.
iii. Student seminar topics also in the same format
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
CASE STUDIES AND REAL-LIFE EXAMPLES
Admitted Batch 2023-24 Program/Semester [Link]. VII Sem
Regulation MLRS-R22 Branch CSE

Course Name Compiler Design Course Code 2270517

Course Faculty ALLIMALLI Academic Year 2026-27


DURGABHAVANI

S.N Question /Topic/Details Type Complexit CO PO PS


O y O
1 Real-world LR(1) grammars & Exploratory High CO2 1,2,5 2,3
theoretical limits

Answer:

Note: Types of Case Studies – Purpose, Complexity Level, and Details


Type of Case Purpose Simple Complexity Details of Complexity
Study Explanation Level Level
To explore a Used when you Involves forming
Exploratory topic where little don’t know much Moderate questions, identifying
is known; ask about the topic and issues, and initial
“what is want to learn more. analysis (Apply,
happening?” Analyze)
To describe in Focuses on Involves observation,
Descriptive detail what is documenting each Low to classification, and
happening compiler phase as Moderate explanation of phases
implemented in such as lexical, syntax,
GCC semantic analysis
(Remember,
Understand)
To explain how Looks at causes and Requires analyzing
Explanatory and why effects. High relationships,
something reasoning, and drawing
happens conclusions (Analyze,
Evaluate)
To study a Focuses only on Demands deep
Intrinsic unique or special understanding a Moderate understanding of one
case just for its special case, not context and internal
own interest generalizing it. dynamics (Understand,
Analyze)
To use one case The case helps Applies the case to
Instrumental to understand a understand general High explore broader
bigger issue concepts or theories. theoretical insights
(Analyze, Evaluate,
Create)
To study several Compare multiple Requires synthesis and
Collective cases and cases to find High comparative analysis
(Multiple) compare them patterns or across cases (Analyse,
differences. Evaluate, create)
To study Track changes in the Observes evolution and
Longitudinal changes over same case over High trends, requires long-
time months or years. term thinking (Analyze
over time, Evaluate,
Create)
Ethnographic To observe real- Researcher spends Involves immersion,
life behaviour time in the company High cultural interpretation,
and culture from to watch and learn and narrative
inside how people work understanding
and interact. (Analyze)
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
Unit Test-II
SET-I
Admitted Batch 2023-24 Program/Semester [Link]. VII Sem
Regulation MLRS-R22 Branch CSE

Course Name Compiler Design Course Code 2270517

ALLIMALLI
Course Faculty Academic Year 2026-27
DURGABHAVANI

Answer the following Questions 2*5=10

Course Bloom’s
[Link] QUESTION Outcome Taxonomy
Explain the concepts of FIRST and FOLLOW sets with examples and their use in
1. parsing CO2 Apply
Compare SLR, LALR, and CLR parsers in terms of parse table size, language
2. coverage, and conflicts. CO2 Analyze
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
ACTIVE LEARNING
UNIT-II
Admitted Batch 2023-24 Program / Semester [Link]. VII Sem
Regulation MLRS-R22 Branch CSE
Course Name Compiler Design Course Code 2270517
ALLIMALLI
Course Faculty Academic Year 2026-27
DURGABHAVANI

Activity name Stump your partner Topic Syntax Analysis

No of Students Date of ALP


Attended Conducted

Group Roll Numbers Course Bloom’s


QUESTION/TOPIC Outcome Taxonomy
No
Visualize the parsing process: build parse trees &
1 abstract syntax trees from code snippets CO2 Understand
Build a mini parser (top-down) in groups from a
2 simple grammar using recursive-decent techniques CO2 Apply

Create a flowchart illustrating top-down vs. bottom-up


3 parsing workflows CO2 Create

Roleplay parser actions: “shift”, “reduce”, “match


4 terminal/non-terminal” CO2 Understand

Token relay: identify lexeme-token pairs and grammar


5 rule matches in live code snippets CO2 Apply

Note: Attach 2 geotag photos of the ALP Conducted


DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
Swayam / NPTEL / MOOC / Self Learning
Admitted Batch 2023-24 Program / Semester [Link]. VII Sem
Regulation MLRS-R22 Branch CSE
Course Name Compiler Design Course Code 2270517

Course Faculty ALLIMALLI Academic Year 2026-27


DURGABHAVANI

Details/Links of
S. No Topic Swayam/NPTEL/MOOCs/Self CO PO PSOs
Learning
1 NPTEL: Compiler Design – Syntax CO
Syntax Analysis
Analysis (Prof. P. Das, IIT Kharagpur). 2
& Context-Free 1, 2 1
Covers CFGs and parsing basics
Grammars
([Link], [Link])
2 Top-Down vs CO
Coursera article: What Is Syntax
Bottom-Up 2
Analysis? – Explains top-down and 1, 3 1, 2
Parsing
bottom-up parsing
Techniques
3 Parser Theory: CO
LL(1), LR Scribd: COMPILER UNIT II – Covers 2
Parsing & role of parser, CFG, top-down, 2, 5 2
Predictive bottom-up, LL/LR parser overview
Parsing
4 In-depth Parsing CO
NPTEL slides (via Scribd): Unit 2 –
Methods & 2
Details recursive-descent, SLR, 1, 4 1
Table
canonical LR, LALR parsing
Construction
5 ANTLR and Wikipedia: ANTLR – Demonstrates CO
Practical Parser grammar specification (EBNF) and 2 4, 10 1, 2
Generators multi-language parser generation
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
COMPLEX ENGINEERING PROBLEMS INCORPORATING SUSTAINABILITY GOALS

Admitted Batch 2023-24 Program / Semester [Link]. VII Sem


Regulation MLRS-R22 Branch CSE
Course Name Compiler Design Course Code 2270517
Course Faculty ALLIMALLI Academic Year 2026-27
DURGABHAVANI

Course Bloom’s SDG


[Link] QUESTION Outcome Taxonomy
SDG 7 –
How can compiler optimization techniques (like instruction
Analyze / Affordable
1 scheduling or phase ordering) be applied to reduce power CO2 Create & Clean
consumption in syntax analysis modules within IoT compilers?
Energy
Evaluate how DFA minimization in real-time lexical analyzers SDG 12 –
Responsible
can improve energy efficiency on mobile/embedded platforms.
2. CO2 Evaluate Consumption
Propose an optimized minimization strategy. &
Production
Design a lightweight LR(1)-based parser suitable for resource- SDG 9 –
Industry,
constrained embedded systems (e.g., smart sensors), balancing
3 CO2 Create Innovation &
parsing power and memory footprint. Infrastructur
e
Analyze the benefits of using parser generators (like ANTLR)
SDG 13 –
with energy-aware grammar simplification for green computing
4 CO2 Analyze Climate
applications. Action
Develop a capstone project: a mini compiler front-end that
translates simple DSL for energy-harvesting IoT devices, SDG 11 –
Sustainable
5 incorporating packrat or predictive parsing optimized for low CO2 Create
Cities &
energy. Communities

Note:

1. For this only give from analyze and above level questions.
2. This include Project based learning, problem-based learning, mini projects, integrated design
projects, capstone projects, hackathon or any other activity-based learning towards solving
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
Blooms Taxonomy
Admitted Batch 2023-24 Program / Semester [Link]. VII Sem
Regulation MLRS-R22 Branch CSE
Course Name Compiler Design Course Code 2270517
Course Faculty ALLIMALLI DURGABHAVANI Academic Year 2026-27
[Link] Bloom’s Answer CO PO PSO Bloom’s
Question Level
1 Explain the role of Syntax analysis is the second phase of CO2 PO1, PSO1 Understand
syntax analysis in a compiler that checks whether the PO2
compiler design. sequence of tokens generated by
lexical analysis follows the
grammatical rules of the programming
language.
2 Compare top-down Top-down parsing starts from the start CO2 PO1, PSO1 Analyze
parsing and symbol and attempts to derive the PO2
bottom-up parsing input string, while bottom-up parsing
techniques. starts from the input string and
reduces it to the start symbol. Top-
down parsing is simpler but cannot
handle left recursion efficiently,
whereas bottom-up parsing is more
powerful and widely used in LR
parsers.
3 Construct a A CFG for arithmetic expressions is: CO2 PO1, PSO2 Apply
context-free `E → E + T T<br>T → T * F PO5
grammar (CFG)
for arithmetic
expressions
involving addition
and multiplication.
4 Analyze the LR parsing reads input from left to CO2 PO1, PSO2 Analyse
working principle right and constructs the rightmost PO5
of LR parsing and derivation in reverse. It uses parsing
explain why it is tables and stack operations for
more powerful efficient syntax analysis. LR parsers
than simple parsing can handle a larger class of grammars,
methods. detect syntax errors accurately, and
are suitable for automatic parser
generation tools like YACC.
5 Evaluate the use of Ambiguous grammars produce more CO2 PO2, PSO2 Evaluate
ambiguous than one parse tree for the same input. PO5
grammars in parser For example, the expression a+b*c
generators with can have multiple interpretations
suitable examples. without precedence rules. Parser
generators resolve ambiguity using
precedence and associativity
declarations., they may lead to parsing
conflicts if not handled properly.
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
20 objective questions with answers include Gate questions

[Link] Multiple Choice Question Options Answer


1 Which phase of the compiler converts a) Syntax Analysis b) Lexical Analysis c) b) Lexical
source code into tokens? Semantic Analysis d) Code Optimization Analysis
2 The output of lexical analysis is a) Parse Tree b) Tokens c) Machine Code d) b) Tokens
________. Intermediate Code
3 Which of the following is used to a) Regular Expression b) Context-Free b) Context-Free
describe the syntax of programming Grammar c) Finite Automata d) Symbol Grammar
languages? Table
4 Which automaton is generally used in a) PDA b) NFA c) DFA d) Turing Machine c) DFA
lexical analyzers?
5 In compiler design, Lex is mainly used a) Code Optimization b) Syntax Analysis c) c) Lexical
for ________. Lexical Analysis d) Semantic Analysis Analysis
6 Which parser constructs the parse tree a) Top-Down Parser b) Predictive Parser c) c) Bottom-Up
from leaves to root? Bottom-Up Parser d) Recursive Descent Parser
Parser
7 Which of the following parsing a) Recursive Parsing b) Shift-Reduce Parsing b) Shift-Reduce
techniques uses stack operations? c) Predictive Parsing d) Top-Down Parsing Parsing
8 A grammar that generates more than one a) Regular Grammar b) Ambiguous Grammar b) Ambiguous
parse tree for the same string is called c) Left Recursive Grammar d) Context- Grammar
________. Sensitive Grammar
9 Which parser is more powerful among a) SLR b) CLR c) Recursive Descent d) b) CLR
the following? Operator Precedence
10 Which symbol denotes epsilon a) # b) $ c) ε d) @ c) ε
production in CFG?
11 Which of the following is NOT a a) Lexical Analysis b) Syntax Analysis c) c) Linking
compiler phase? Linking d) Code Generation
12 Which parsing method starts from the a) Bottom-Up Parsing b) Shift-Reduce c) Top-Down
start symbol? Parsing c) Top-Down Parsing d) LR Parsing Parsing
13 Which of the following removes left a) Left Factoring b) Grammar Simplification c) Recursion
recursion? c) Recursion Elimination d) Parser Elimination
Generation
14 The parser generated by YACC is a) LL(1) Parser b) Recursive Parser c) LALR c) LALR Parser
generally a/an ________. Parser d) Operator Parser
15 Which of the following is used for token a) Parse Tree b) DFA c) Regular Expression c) Regular
specification? d) CFG Expression
16 A DFA cannot contain ________. a) States b) Input Symbols c) ε-transitions d) c) ε-transitions
Final States
17 Which data structure is mainly used by a) Queue b) Stack c) Linked List d) Tree b) Stack
LR parsers?
18 Which grammar can be parsed using a) Ambiguous Grammar b) LL(1) Grammar b) LL(1)
predictive parsing? c) Left Recursive Grammar d) Regular Grammar
Grammar
19 The process of reducing DFA states is a) DFA Construction b) DFA Optimization c) c) DFA
called ________. DFA Minimization d) DFA Simulation Minimization
20 Which compiler phase checks type a) Lexical Analysis b) Syntax Analysis c) c) Semantic
compatibility? Semantic Analysis d) Code Generation Analysis
DEPARTMENT OF COMPUTER SCIENCE ENGINEERING
Admitted Batch 2023-24 Program/Semester [Link]. VII Sem
Regulation MLRS-R22 Branch CSE
Course Name Compiler Design Course Code 2270517
ALLIMALLI
Course Faculty Academic Year 2026-27
DURGABHAVANI

[Link] Seminar Topics Source Details Course Bloom’s PO PSO


Outcome Taxonomy
(CO)
1 Role of Lexical Compiler Design CO2 Understand PO1, PSO1
Analysis in textbooks (Aho, Lam, PO2
Compiler Design Sethi, Ullman), lecture
notes on compiler
phases
2 Finite Automata and Automata Theory CO2 Apply PO1, PSO2
Regular Expressions books, IEEE papers on PO5
in Lexical Analysis DFA/NFA applications
in scanners
3 DFA Optimization Research papers on CO2 Evaluate PO1, PSO2
Techniques in DFA minimization and PO5
Lexical Analyzer lexical analyzer
Design optimization
4 Top-Down and Compiler Design CO2 Analyze PO1, PSO1
Bottom-Up Parsing textbooks, academic PO2
Techniques in notes on parsing
Syntax Analysis techniques
5 LR Parsers and YACC/Bison CO2 Analyze PO1, PSO2
Parser Generators documentation, PO5
(YACC/Bison) compiler construction
reference books

You might also like