Important RGPV Question
Table of Contents
Toggle
CS-603 (C) Compiler Design,
VI Sem, CS
UNIT 1- Introduction to Compiling & Lexical Analysis
Q.1 Discuss the analysis and synthesis model of compilation. Explain each phase by using the input:
a = (b + c)*(b + c) * 2 (RGPV May 2024)
Q.2 Explain the various Compiler Construction Tools. (RGPV May 2024)
Q.3 What are the issues to be considered in the design of lexical analyzer? Why is buffering used in lexical analysis? (RGPV May 2024)
Q.4 Draw the structure of a compiler and describe various phases in the compilation process. Mention the output of the following statement: id1, id2+id3, *50 at each phase. (RGPV May 2023)
Q.5 Design the LEX program that recognizes the tokens of a C language and returns the token found. (RGPV May 2023)
Q.6 Explain in detail the various phases of compilers with an example. (RGPV May 2022)
Q.7 Solve the given expressions a:= b + c * 4 with different phases of the compiler. (RGPV May 2022)
Q.8 Illustrate the concepts of compiler and interpreter. (RGPV May 2022)
Q.9 What is a cross compiler? Give an example. (RGPV May 2022)
UNIT 2- Syntax Analysis & Syntax Directed Translation
Q.1 Differentiate Top Down Parser and Bottom Up Parser? Give Example for each? (RGPV May 2024)
Q.2 Prepare and Eliminate the left recursion for the grammar (RGPV May 2024)
S -> Aa | b
S ->Ac | Sd | ε
Q.3 Consider the grammar (RGPV May 2024)
E -> E + T
E -> T
T ->T* F
T -> F
F -> (E)
F -> id
Q.4 Construct a LALR parsing table for the grammar given above. Verify whether the input string id + id * id is accepted by the grammar or not.
Q.5 Compute LR(0) items for the following grammar and construct SLR Parser table. (RGPV May 2023)
S→L = R|R
L→*R|id
R→ L
Q.6 Differentiate between Top down parsing and Bottom up parsing. (RGPV May 2023)
Q.7 Construct the Recursive Descent Parser with back tracking for the following grammar (RGPV May 2023)
S → aSbS|bSaS|Є
Q.8 Prove that, if L is a recursive language, then will also recursive language. (RGPV May 2022)
Q.9 What is LL (1) grammar? Give the properties of LL (1) grammar. (RGPV May 2022)
Q.10 What are the various conflicts that occur during shift reduce parsing? (RGPV May 2024)
Q.11 Explain synthesized attribute and inherited attribute with suitable examples. (RGPV May 2024)
Q.12 Differentiate between S-attribute with L-attribute definition with suitable example. (RGPV May 2023)
UNIT 3-Type Checking & Run Time Environment
Q.1 Discuss the various storage allocation strategies in detail. (RGPV May 2024)
Q.2 Explain different Polymorphic functions with suitable examples. (RGPV May 2023)
Q.3 How is Stack storage allocation strategy different from heap allocation strategy? Describe them and mentioning their merits and demerits. (RGPV May 2023)
Q.4 Explain in brief about equivalence of type expression. (RGPV May 2023)
UNIT 4- Code Generation
Q.1 What is a DAG? Draw the DAG for the statement a = (a * b + c) – (a * b + c) (RGPV May 2024)
Q.2 Represent the following in flow graph: : i = 1 sum=0; while (i <= 10) {sum+=i; i++;} (RGPV May 2024)
Q.3 Define flow graph? Explain how a program is converted into a flow graph. (RGPV May 2023)
Q.4 What is DAG? Construct DAG for the following basic blocks: (RGPV May 2023)
D:=B*C; E:=A+B; B:=B+C; A:=E-D;
Q.5 Discuss about peephole optimization. (RGPV May 2023)
Q.6 What are the applications of DAG? (RGPV May 2022)
Q.7 What are DAGs and how are they useful in implementing transformations on basic blocks? (RGPV May 2022)
UNIT 5- Code Optimization
Q.1 Write the three address code sequence for the assignment statement. P:= (X + Y) + (X – C) (RGPV May 2024)
Q.2 What are the different source of optimization of basic blocks? (RGPV May 2024)
Q.3 Explain in brief about different sources of optimization of basic blocks with suitable example. (RGPV May 2023)
Q.4 What are the steps involved in partitioning a sequence of three address statements into basic blocks? (RGPV May 2022)
Q.5 Why are quadruples preferred over triples in an optimizing compiler? (RGPV May 2022)
Q.6 What are the properties of optimizing compilers? (RGPV May 2022)
Q.7 Mention the criteria for code improving transformations. (RGPV May 2022)
EXTRA QUESTIONS
Q.1 Write brief notes: (any three) (RGPV May 2024)
a) Peephole Optimization
b) Global data flow equations
c) Dynamic Storage Allocation
d) Error Detection and Recovery
Q.2 Write a short note on following: (RGPV May 2023)
a) Common sub-expression elimination
b) Register allocation
c) Three address code
Q.3 Explain Finite State Machine (FSM) with its limitations and applications. (RGPV May 2022)
Q.4 Show that the equivalence problem for finite-state transducers is reducible to the equivalence problem for pushdown automata. (RGPV May 2022)
Q.5 What is a context free grammar and explain closure properties of context free grammar? (RGPV May 2022)
Q.6 Explain the following terms with example. (RGPV May 2022)
i) Lexical analysis
ii) SLR Parser
iii) Back patching
iv) Loop optimization
— Best of Luck for Exam —