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

Question Bank CD

The document is a comprehensive question bank for the Compiler Design course (CS3501) for the CSE department, covering various units and topics relevant to compiler design. It includes questions categorized into parts A, B, and C, addressing different Bloom's Taxonomy levels from basic definitions to complex explanations and applications. The questions encompass key concepts such as compiler phases, parsing techniques, intermediate code generation, optimization strategies, and error handling.

Uploaded by

binusha
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)
24 views

Question Bank CD

The document is a comprehensive question bank for the Compiler Design course (CS3501) for the CSE department, covering various units and topics relevant to compiler design. It includes questions categorized into parts A, B, and C, addressing different Bloom's Taxonomy levels from basic definitions to complex explanations and applications. The questions encompass key concepts such as compiler phases, parsing techniques, intermediate code generation, optimization strategies, and error handling.

Uploaded by

binusha
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
You are on page 1/ 7

QUESTION BANK

DEPARTMENT : CSE

SUBJECT CODE : CS3501

SUBJECT NAME : Compiler Design

SEMESTER : 5

COURSE COORDINATOR MODULE COORDINATOR PROGRAM COORDINATOR

(Signature with Name and date) (Signature with Name and date) (Signature with Name and date)

IQAC COORDINATOR

(Signature with Name and date)


UNIT I
PART A
Blooms Level
Q. No. Questions CO (BTL1/BTL2)
1. Define Compiler and what are the phases of compiler. CO1 BTL1
2. What are the functions performed in synthesis phase. CO1 BTL1
3. Differentiate analysis and synthesis phase. CO1 BTL2
4. Differentiate token,pattern,lexeme . CO1 BTL2
5. Define the following i) Preprocessor ii) Assembler iii) Loader and Linker CO1 BTL1
6. Define Lexical Analysis. CO1 BTL1
7. Rules of Minimizing DFA. CO1 BTL2
8. Structure of Lex tool. CO1 BTL2
9. Declaration of Lex tool. CO1 BTL1
10. Explain FA. CO1 BTL2
PART B
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
11. Explain about compiler and the Analysis and Synthesis Model of Compiler. CO1 BTL4
12. List down the five properties of compiler. CO1 BTL3
13. Explain translator? Write down the steps to execute a program. CO1 BTL4
14. Discuss all the phases of compiler with a with a diagram. CO1 BTL6
15. Explain the following: CO1
a. YACC
b. Pass
BTL4
c. Bootstrapping
d. LEX Compiler
e. Tokens, Patterns and Lexemes
16. Explain the steps to convert Non-Deterministic Finite tomata (NDFA) CO1 BTL4
into Deterministic Finite Automata (DFA).
17. Explain Regular Expression and write the regular expression for: CO1
a. R=R1+R2 (Union operation)
b. R=R1.R2 (concatenation Operation)
c. R=R1* (Kleen Clouser)
d. R=R+ (Positive Clouser) BTL4
e. Write a regular expression for a language containing strings which
end with “abb” over Ʃ= {a,b}.
f. Construct a regular expression for the language containing all
strings having any number of a’s and b’s except the null string.
18. Design deterministic Finite Automata to accept the regular expression (0+1)* CO1 BTL6
(00+11) (0+1)*
19. Derivation and Parse Tree: CO1
Let G be a Context Free Grammar for which the production Rules
are given below:S -> aB|bA
A -> a|aS|bAA BTL4
B -> b|bS|aBB
Drive the string aaabbabbba using the above grammar (using Left Most
Derivation and Right most Derivation).
20. Explain in detail about recognition and specification of tokens with an CO1 BTL4
example.
PART C
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
Explain how to find the minimized DFA for the following regular CO1
21. BTL4
expression (a+b).(b+c)
22. Explain in detail about LEX structure with an example program. CO1 BTL4
Explain the various phases of the compiler and trace it with the CO1
23. BTL4
program segment (c=a+b*5).
Explain how to recognize valid operators of c program using CO1
24. BTL4
Lex tool

UNIT II
PART A
Blooms Level
Q. No. Questions CO (BTL1/BTL2)
1. Define phrase-level error recovery. CO2 BTL1
2. Illustrate the algorithms for FIRST and FOLLOW with examples. CO2 BTL2
3. Recall the error recovery techniques used in predictive parsing. CO2 BTL1
4. Interpret the concept of operator precedence grammar. CO2 BTL2
5. Define augmented grammar. CO2 BTL1
6. Compare and contrast LR parsers with LL parsers. CO2 BTL2
7. Define dead code elimination. CO2 BTL1
8. Explain the types of LR parsers with examples. CO2 BTL2
9. Identify the steps involved in the bottom-up parsing method. CO2 BTL1
10. Explain ambiguous grammar. CO2 BTL2
PART B
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
11. Demonstrate the parsing techniques using a hierarchical diagram. CO2 BTL3
12. Differentiate between various problems associated with Top-Down Parsing. CO2 BTL4
13. Assess the given production rules and recommend modifications to eliminate CO2
left recursion and left factoring problems. BTL5
14. Compose an explanation for the following concepts with practical examples: CO2
a. Ambiguity (with example)
b. Recursive Descent Parser
c. Predictive LL(1) Parser BTL6
d. Handle pruning
e. Operator Precedence Parser
15. Execute the rules to construct the FIRST and FOLLOW functions. CO2 BTL3
16. Categorize the steps needed to analyze the given grammar and identify CO2 BTL4
17. conflicts
Prioritizeinsteps
parsing.
in constructing a Predictive Parsing Table and decide how to CO2 BTL5
handle conflicting cases.
18. Invent a new approach for performing shift-reduce parsing of "id1+id2+id3" CO2
and analyze its efficiency under the given grammar.
E -> E+E BTL6
E -> E*E
E -> id
19. Demonstrate the properties of an LR parser with its structure and use the CO2
techniques of LR parsing to parse a given input. BTL3
20. Investigate the following concepts in LR parsing: CO2
a. Augmented grammar and its role in parsing
b. Kernel items and their significance BTL4
c. Rules governing closure and goto operations
d. Construction process of LR(0) items with an analytical example
PART C
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
21. Apply the closure and goto operations to the given grammar. CO2 BTL3
22. Construct the rules for building the SLR parsing table. CO2 BTL3
Demonstrate your understanding of the LALR parser by constructing the set
of LR(1) items for the grammar:
23. S → CC CO2 BTL3
C → aC
C→d
Analyze and compare the differences between SLR Parser, LALR parser, and CO2
24. Canonical LR Parser. BTL3

UNIT III
PART A
Blooms Level
Q. No. Questions CO (BTL1/BTL2)
1. Define type equivalence. CO3 BTL1
2. Discuss the role of an intermediate code generator in the compilation process. CO3 BTL2
3. Define leftmost derivation and rightmost derivation with examples. CO3 BTL1
4. Describe the various types of intermediate code representation. CO3 BTL2
5. What is a simple type checker? Write a note on its specification. CO3 BTL1
6. Explain the purpose and types of intermediate code representations. CO3 BTL2
7. Define type expression with an example. CO3 BTL1
8. Explain the general structure of an activation record. CO3 BTL2
9. What are type expressions and type systems? CO3 BTL1
10. Define syntax tree. CO3 BTL1
PART B
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
11. Evaluate the significance of Syntax-Directed Definitions (SDD) in enabling CO3
semantic analysis during compilation BTL5

12. Design the syntax tree and Directed Acyclic Graph (DAG) for the following CO3 BTL6
expression: (a∗b)+(c−d)∗(a∗b)+b
13. Differentiate between synthesized translation and inherited translation, and CO3
analyze their use cases in compiler design. BTL4

14. Demonstrate the concept of intermediate code generation and explain its two CO3
benefits with relevant scenarios. BTL3

15. Assess the significance of the following concepts in compiler optimization: CO3 BTL5
a. Abstract Syntax Tree (AST)
b. Polish Notation
c. Three Address Code
d. Backpatching
16. Construct the syntax tree and derive the postfix notation for the expression: CO3 BTL3
(a + (b * c) ^ d - e / (f + g))
17. Generate quadruples, triples, and indirect triples for the expression: CO3 BTL3
-(a * b) + (c + d) - (a + b + c + d)
18. Design a grammar using S-attribute definitions for a simple programming CO3 BTL6
language feature and implement a syntax-directed definition for it.
19. Formulate a detailed explanation of type checking by creating your own CO3 BTL6
example expression and demonstrating the type validation process step-by-
step.
20. Explain in detail about predictive Translator with an example CO3 BTL5
PART C
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
Explain and demonstrate the specification of a type-checking system using CO3 BTL3
21. examples.
Examine intermediate languages with examples and analyze their role in CO3 BTL4
22. compiler design.
Evaluate the role of syntax-directed definitions and annotated parse trees in CO3 BTL5
23. simplifying expression evaluation for a desk calculator.
Write short notes and use examples to explain: CO3 BTL3
a. Synthesized attributes
b. Inherited attributes
24. c. Dependency graph
d. Evaluation order
e. Directed Acyclic Graph (DAG)

UNIT IV
PART A
Blooms Level
Q. No. Questions CO (BTL1/BTL2)
1. Write the quadruple for the expression (x+y)∗(y+z)+(x+y+z)(x + y) \ast (y + CO4 BTL1
z) + (x + y + z)(x+y)∗(y+z)+(x+y+z).
2. Describe the concept of a DAG and its applications. CO4 BTL2
3. What are Abstract Syntax Trees? CO4 BTL1
4. Illustrate the use of address descriptors and register descriptors with examples. CO4 BTL2
5. What is common subexpression elimination? CO4 BTL1
6. Explain the concept of flow graphs and constant folding in program CO4
optimization. BTL2

7. What is reduction in strength? CO4 BTL1


8. Explain the lazy-code motion problem with an example or algorithm. CO4 BTL2
9. Define stack allocation space. CO4 BTL1
10. Define activation tree. CO4 BTL1
PART B
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
11. Define a symbol table and explain how names are stored in it. CO4 BTL3
12. Identify and explain the data structures used in a symbol table. CO4 BTL3
13. Analyze the limitations of stack allocation. CO4 BTL4
14. Discuss two important aspects of heap management. CO4 BTL4
15. Compare Static allocation, Stack allocation, and Heap Allocation with their CO4 BTL4
merits
Explainand
thelimitations.
concept of an activation record and discuss its various fields.
16. CO4 BTL3
17. Analyze the functions of an error handler. CO4 BTL4
18. Evaluate the process of Error Detection and Recovery. CO4 BTL5
19. Classify the errors and analyze the errors in each phase of the Compiler. CO4 BTL3
20. Illustrate loop optimization with a suitable example. CO4 BTL5
PART C
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
21. Explain various code optimization techniques in detail. CO4 BLT5
22. Explain in detail about storage allocation strategies. CO4 BLT5

23. Explain in detail about Activation tree with an example. CO4 BLT5

24. Explain Activation record with example of factorial program CO4 BLT5

UNIT V
PART A
Blooms Level
Q. No. Questions CO (BTL1/BTL2)
1. Define induction variables. CO5 BTL1
2. Illustrate how code motion improves the efficiency of a program. CO5 BTL2
3. Identify the concept of induction variables. CO5 BTL1
4. Describe how induction variable elimination enhances code optimization. CO5 BTL2
5. Explain machine-independent code optimization. CO5 BTL1
6. Explain how copy propagation helps in simplifying code. CO5 BTL2
7. Identify induction variables. CO5 BTL1
8. Explain the function and purpose of a flow graph in compiler design. CO5 BTL2
9. Define Basic Block CO5 BTL1
10. What are the characteristics of peep hole optimization? CO5 BTL1
PART B
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
11. Implement a partitioning algorithm to divide the given program into basic CO5 BTL3
blocks.
12. Construct the flow graph for the following program: CO5 BTL3
Prod = 0;
I = 1;
Do {
Prod = Prod + a[I] * b[I];
I = I + 1;
} while (I <= 10);
13. Perform code optimization by applying dead code elimination, variable CO5 BTL3
elimination, code motion, and reduction in strength on a sample program.
14. Categorize and explain the different types of loops, such as natural loops, CO5 BTL4
inner loops, and reducible flow graphs, with examples.
15. Examine the process of eliminating common sub-expressions with an example CO5 BTL4
and analyze its impact on code efficiency.
16. Assess the effectiveness of machine-dependent and machine-independent code CO5 BTL5
optimization techniques with suitable examples.
17. Evaluate the impact of applying code optimization techniques, such as dead CO5 BTL5
code elimination and reduction in strength, on a complex program.
18. Explain the DAG representation of basic block with example CO5 BTL5
19. Formulate an algorithm to identify and optimize inner loops and natural loops CO5 BTL6
in a program.
20. Develop a comprehensive example demonstrating the use of control and data CO5 BTL6
flow analysis for optimizing a code segment
PART C
Blooms Level
Q. No. Questions CO (BTL3 to BTL6)
For the code CO5 BTL5
Sum = 0
do 10 i=1, n
10 sum = sum +a(i) *a(i)
Explain the following:
21. 1)Three address code
2) Control flow graph
3) Local common sub expression elimination
4) Invariant code motion
5) Reduction in strength
22. Compare various data flow algorithms with an example. CO5 BTL4
Examine and illustrate the concept of peephole optimization techniques by CO5 BTL4
23. analyzing their impact on reducing redundant instructions, improving code
efficiency, and optimizing resource usage.
24. Explain in detail about basic blocks and flow graphs with an example. CO5 BTL5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy