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

Questionbank Compiler Design

The document is a question bank for the B.Tech (CS/IT) course at Shri Rawatpura Sarkar University, focusing on compiler design and parsing techniques. It includes various types of questions categorized by Bloom's taxonomy, difficulty levels, and topics related to compilers, lexical analysis, and parsing methods. The questions cover theoretical concepts, practical applications, and examples relevant to the curriculum.

Uploaded by

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

Questionbank Compiler Design

The document is a question bank for the B.Tech (CS/IT) course at Shri Rawatpura Sarkar University, focusing on compiler design and parsing techniques. It includes various types of questions categorized by Bloom's taxonomy, difficulty levels, and topics related to compilers, lexical analysis, and parsing methods. The questions cover theoretical concepts, practical applications, and examples relevant to the curriculum.

Uploaded by

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

Shri Rawatpura Sarkar University

Faculty of Engineering
Department of Computer Science Engineering
Questions in Question Bank
Course Name: [Link] (CS/IT) Course Code:
Comp
Bloom’s etitive
Difficulty
Questions CO Taxonom Exam Area Topic Unit Marks
Level
y Level Questi
on

Which of the following translates the entire program into machine code Compiler vs
1 CO1 1 L Y Compiler 1 1
before execution? A) Interpreter B) Compiler ✅ C) Assembler D) Linker Interpreter

Which of the following executes the program line by line? A) Compiler B) Compiler vs
2 CO1 1 L Y Compiler 1 1
Interpreter ✅ C) Linker D) Loader Interpreter

Which phase of the compiler is responsible for removing whitespace and


Lexical
3 comments and generating tokens? A) Syntax Analyzer B) Lexical CO2 2 M Y Compiler 1 1
Analysis
Analyzer ✅ C) Semantic Analyzer D) Code Generator

Which of the following is not a part of lexical analysis? A) Tokenization


Lexical
4 B) Removing comments C) Syntax tree generation ✅ D) Pattern CO2 2 M Y Compiler 1 1
Analysis
recognition

Regular expressions are used to define: A) Context-free grammar B) Lexical


5 CO2 2 M Y Compiler 1 1
Tokens in lexical analysis ✅ C) Parsing tables D) Syntax trees Analysis

Which of the following converts regular expressions into finite automata?


Lexical
6 A) Syntax Analyzer B) Lexical Analyzer ✅ C) Semantic Analyzer D) CO2 2 M Y Compiler 1 1
Analysis
Code Generator

Which parser uses leftmost derivation and expands top-down? A) Bottom-


7 CO2 2 M Y Compiler Parsing 1 1
up parser B) Top-down parser ✅ C) LR parser D) SLR parser

What type of grammar cannot have left recursion for top-down parsing?
8 A) Context-free grammar ✅ B) Regular grammar C) Context-sensitive CO2 2 M Y Compiler Parsing 1 1
grammar D) Unrestricted grammar

Which of the following is used to remove ambiguity from dangling-else


9 grammar? A) Left factoring B) Left recursion elimination C) Using else CO2 2 M Y Compiler Parsing 1 1
pairing rules ✅ D) Recursive descent

Lexical
Which tool is used as a lexical analyzer generator? A) YACC B) LEX ✅
10 CO2 2 M Y Compiler Analyzer 1 1
C) Bison D) Flex
Tools

Compiler vs
11 Define compiler and interpreter. Explain the differences with examples. CO1 1 L Y Compiler 1 5
Interpreter

12 What is parsing? Also write its classification. CO2 1 L Y Compiler Parsing 1 5

Lexical
13 Differentiate Tokens, Patterns, and Lexemes. CO2 1 L Y Compiler 1 5
Analysis

Grammar
14 What is ambiguity in grammar? CO2 1 L Y Compiler 1 5
Ambiguity

Lexical
15 Define finite automata. CO2 1 L Y Compiler 1 5
Analysis

Grammar
16 Explain elimination of left recursion and left factoring with examples. CO2 2 M Y Compiler Transformatio 1 5
n
Context-Free
17 Explain context-free grammar (CFG) with examples. CO2 1 M Y Compiler 1 5
Grammar

18 Explain the concept of bootstrapping in compiler construction. CO2 1 M Y Compiler Bootstrapping 1 5

Count the Tokens: 1. int main() { // 2 variables int a, b; a = 10; return 0; } Lexical
19 CO2 1 M Y Compiler 1 5
2. main() { char ch='A'; int x,y; x=y=20; x++; printf("%d %d", x,y); } Analysis

Lexical
20 Explain the role of a lexical analyzer in a compiler with an example. CO2 2 M Y Compiler 1 5
Analyzer

What is the definition of a compiler, and how does it differ from an Compiler vs
21 CO1 2 H Y Compiler 1 10
interpreter? Interpreter

Explain the different phases of a compiler and the role of each phase in Compiler
22 CO2 2 H Y Compiler 1 10
the compilation process. Phases

What is bootstrapping in the context of compiler construction, and why is


23 CO2 2 H Y Compiler Bootstrapping 1 10
it important?

Define compiler and interpreter. Explain the differences with examples. Lexical
24 CO2 2 H Y Compiler 1 10
What is the role of a lexical analyzer in a compiler? Analysis

Construct a parse tree for the following grammar S -> aSbS / bSaS / ε
Parsing / Parse
25 where the statement is abab. Also verify whether the grammar is CO2 3 H Y Compiler 1 10
Tree
ambiguous for the given statement.

Consider the grammar: S -> aABe , A -> Abc / b , B -> d. Explain how the Parsing /
26 CO2 3 H Y Compiler 1 10
sentence abbcde is reduced to S. Derivation

Grammar
What do you mean by left-recursion and left-factoring, and how are they
27 CO2 2 H Y Compiler Transformatio 1 10
removed?
n

Write the steps and check whether the grammar is LL(1) or not. Construct
28 CO2 3 H Y Compiler LL(1) Parsing 1 10
the parse table for grammar: S -> iCtSS’ / a , S’ -> eS / ε , C -> b

Write the steps and check whether the grammar is LL(1) or not. Construct
29 the parse table for grammar: S -> aBDh , B -> cC , C -> bc / ε , D -> EF , CO2 3 H Y Compiler LL(1) Parsing 1 10
E -> g / ε , F -> f / ε

Compute the First and Follow for grammar: S -> ACB / CbB / Ba , A ->
30 CO2 3 H Y Compiler First & Follow 1 10
da / BC , B -> g / ε , C -> h / ε

Bottom-up parsing starts from: A) Start symbol B) Input string ✅ C) Bottom-up


31 CO1 1 L Y Parsing 2 1
Parse tree D) None of the above Parsing

In bottom-up parsing, a handle is: A) The leftmost derivation of a string


Bottom-up
32 B) A substring that matches the RHS of a production and can be reduced CO1 2 M Y Parsing 2 1
Parsing
✅ C) The start symbol D) A terminal symbol

Which parsing technique uses stack implementation with shift and reduce
Shift-Reduce
33 operations? A) Top-down parsing B) Bottom-up parsing ✅ C) Recursive CO1 2 M Y Parsing 2 1
Parsing
descent parsing D) Predictive parsing

A shift-reduce conflict occurs when: A) Parser cannot decide whether to


Conflicts in
34 shift or reduce ✅ B) Grammar is context-free C) Left recursion exists D) CO2 2 M Y Parsing 2 1
Parsing
Right recursion exists

LR parsers read the input: A) Left to right, producing a leftmost derivation


35 B) Left to right, producing a rightmost derivation in reverse ✅ C) Right CO2 2 M Y Parsing LR Parsing 2 1
to left D) Randomly
Which of the following is a type of LR parser? A) SLR ✅ B) Recursive
36 CO2 1 L Y Parsing LR Parsers 2 1
descent C) Predictive D) LL(1)

Canonical LR (CLR) parsers are also called: A) SLR parsers B) LR(0)


37 CO2 2 M Y Parsing CLR Parsing 2 1
parsers C) LR(1) parsers ✅ D) LL parsers

Look Ahead LR (LALR) parsers are mainly used because: A) They are
38 simpler than SLR B) They are smaller than CLR while maintaining similar CO2 2 M Y Parsing LALR Parsing 2 1
power ✅ C) They do not use stack D) They can parse all grammars

Which tool is an automatic parser generator for bottom-up parsing? A)


39 CO3 1 L Y Parsing Tools YACC 2 1
LEX B) YACC ✅ C) JavaCC D) Flex

Error recovery in bottom-up parsing is done using: A) Panic-mode Error


40 CO3 2 M Y Parsing 2 1
recovery ✅ B) Recursive recovery C) LL parsing D) Left factoring Recovery

Top-down vs
41 Difference between top-down and bottom-up parsing. CO1 1 L Y Parsing 2 5
Bottom-up

Grammar
42 Write short notes on: a) Left recursion b) Left Factoring CO2 2 M Y Parsing Transformatio 2 5
n

Error
43 Explain error recovery techniques in bottom-up parsing. CO3 2 M Y Parsing 2 5
Recovery

Short notes on: a) Canonical collection of LR(0) items b) Closure LR Parsing


44 CO2 2 M Y Parsing 2 5
operation c) GOTO operation d) Define augmented grammar Concepts

Explain stack implementation of shift-reduce parser with step-by-step Shift-Reduce


45 CO2 3 H Y Parsing 2 5
derivation. Parsing

46 What is CLR (Canonical LR) parser? CO2 1 M Y Parsing CLR Parsing 2 5

47 What is LALR parser? CO2 1 M Y Parsing LALR Parsing 2 5

48 Define YACC. CO3 1 L Y Parsing Tools YACC 2 5

Grammar
49 What is an ambiguous grammar? CO2 1 M Y Parsing 2 5
Ambiguity

Consider grammar G: S → aB / bA, A → aS / bAA / a, B → bS / aBB / b.


50 CO2 3 H Y Parsing Derivation 2 5
Find LMD, RMD for string w = aaabbabbba

Bottom-up vs
51 What is bottom-up parsing? Explain how it differs from top-down parsing. CO1 2 H Y Parsing 2 10
Top-down

Differentiate between Simple LR (SLR), Canonical LR (CLR), and Look-


52 CO2 3 H Y Parsing LR Parsers 2 10
Ahead LR (LALR) parsers.

Explain the stack implementation of shift-reduce parsing with example: E Shift-Reduce


53 CO2 3 H Y Parsing 2 10
→ E+E, E → EE, E → (E), E → id for input id (id+id) Parsing

During shift-reduce parsing, what types of conflicts can arise? Explain Conflicts in
54 CO2 3 H Y Parsing 2 10
shift-reduce and reduce-reduce conflicts. Parsing
Explain how an LR parser works in the context of a given grammar and
55 CO2 3 H Y Parsing LR Parsing 2 10
how it handles shifts and reductions.

LR Parsing /
For grammar S → AaBb, S → BbBa, A → ε, B → ε. Compute closure (I)
56 CO2 3 H Y Parsing Closure & 2 10
and GOTO operation.
GOTO

57 Show that the grammar E → E+E, E → E*E, E → id is LR(1) or not. CO2 3 H Y Parsing LR Parsing 2 10

SLR Table
58 Construct a SLR table using grammar S → CC, C → cC, C → d CO2 3 H Y Parsing 2 10
Construction

What is YACC, and how is it used as an automatic parser generator for


59 CO3 2 M Y Parsing Tools YACC 2 10
bottom-up parsing?

What is error recovery in parsing, and how does it work in bottom-up Error
60 CO3 2 M Y Parsing 2 10
parsers? Recovery

Syntax-
Syntax-directed translation is based on: A) Tokens B) Grammar and
61 CO1 1 L Y SDT/ICG Directed 3 1
attributes ✅ C) Machine code D) Lexical analysis
Translation

Which of the following is an S-attributed definition? A) Uses only


62 inherited attributes B) Uses only synthesized attributes ✅ C) Uses both CO1 1 L Y SDT/ICG Attributes 3 1
synthesized and inherited attributes D) Uses no attributes
Which of the following is an L-attributed definition? A) Uses only
synthesized attributes B) Uses only inherited attributes C) Uses both
63 CO1 2 M Y SDT/ICG Attributes 3 1
synthesized and inherited attributes with restrictions ✅ D) Does not use
attributes

A syntax tree represents: A) Lexical tokens B) Parse tree without


64 CO2 2 M Y SDT/ICG Syntax Tree 3 1
unnecessary nodes ✅ C) Machine code D) Assembly instructions

Which of the following is not an intermediate code form? A) Abstract


Intermediate
65 Syntax Tree (AST) B) Three-address code C) Polish notation D) Machine CO2 1 L Y SDT/ICG 3 1
Code
code ✅

Three-address code typically has how many addresses per statement? A) Intermediate
66 CO2 1 L Y SDT/ICG 3 1
One B) Two C) Three ✅ D) Four Code

Which of the following is used for translation of Boolean expressions? A) Boolean


67 Polish notation ✅ B) L-attributed definitions C) S-attributed definitions CO2 2 M Y SDT/ICG Expression 3 1
D) Syntax tree Translation

Which statement type is not part of three-address statements? A) Three-Address


68 CO2 1 L Y SDT/ICG 3 1
Assignment B) Unary C) Conditional jump D) HTML tag ✅ Code

Emitting a translation in syntax-directed translation means: A) Generating


Intermediate
69 machine code B) Producing intermediate code or output ✅ C) Lexical CO2 2 M Y SDT/ICG 3 1
Code
analysis D) Parsing

Translation of flow-of-control statements in three-address code often Flow-of-


70 uses: A) Sequential execution only B) Conditional and unconditional CO2 2 M Y SDT/ICG Control 3 1
jumps ✅ C) Only assignment statements D) None of the above Translation

Three-Address
71 Explain the types of three-address statements and their implementation. CO2 2 M Y SDT/ICG 3 5
Code

Attribute
72 What is attribute grammar? Explain different types of attributes. CO1 1 L Y SDT/ICG 3 5
Grammar

Explain intermediate forms of source programs: abstract syntax tree, Intermediate


73 CO2 2 M Y SDT/ICG 3 5
Polish notation, and three-address code. Code
Syntax Tree vs
74 Difference between syntax tree and parse tree. CO2 1 L Y SDT/ICG 3 5
Parse Tree

TAC
75 Explain different three-address code representations. CO2 1 L Y SDT/ICG Representation 3 5
s

Boolean
76 How are Boolean expressions translated into intermediate code? CO2 2 M Y SDT/ICG Expression 3 5
Translation

77 Define abstract syntax tree (AST). CO2 1 L Y SDT/ICG AST 3 5

Syntax Tree vs
78 Difference between syntax tree and parse tree. CO2 1 L Y SDT/ICG 3 5
Parse Tree

79 Define syntax-directed translation. CO1 1 L Y SDT/ICG SDT 3 5

Intermediate
80 Explain different intermediate forms of source code with example. CO2 2 M Y SDT/ICG 3 5
Code

Explain how syntax trees and intermediate code are used in compiler back- Compilation
81 CO2 3 H Y SDT/ICG 3 5
end for code generation. Back-End

Syntax-
What is a syntax-directed definition (SDD)? How does it relate to the
82 CO1 2 M Y SDT/ICG Directed 3 10
syntax and semantics of a programming language?
Definitions

What are S-attributed and L-attributed definitions? Explain their


83 CO1 3 H Y SDT/ICG Attributes 3 10
differences and how they are evaluated.

Create an annotated parser tree for expression (15+7)(5+6) with Syntax Tree
84 CO2 3 H Y SDT/ICG 3 10
grammar: E→E+T, E→T, T→T F, T→F, F→id, F→(E) Construction

Discuss the different types of three-address statements and how they are Three-Address
85 CO2 3 H Y SDT/ICG 3 10
implemented in an intermediate code generator. Code

Write three-address code, quadruples, triples, and indirect for: a) Three-Address


86 CO2 3 H Y SDT/ICG 3 10
(a+b+c)(c+d+e) b) a=b -x+b-c Code

Describe the process of constructing syntax trees. Why are they important
87 CO2 3 H Y SDT/ICG Syntax Trees 3 10
in compilation? Construct a syntax tree for (a+8)*(b+3).

How is syntax-directed translation used to generate three-address code for


88 simple statements, Boolean expressions, and flow-of-control statements? CO2 3 H Y SDT/ICG SDT to TAC 3 10
Provide examples.

For expression a+b*(b-c)+(b-c)*d: a) Construct complete syntax tree b) DAG &


89 CO2 3 H Y SDT/ICG 3 10
Construct DAG c) Write instruction sequence Syntax Trees

Generate TAC for program segment: 1) While (A<C and B>D) do if a==1
TAC for
90 then c=c+1 else c=c+2 end if end do; 2) while (a>b and a<c) if a>20 then CO2 3 H Y SDT/ICG 3 10
Control Flow
x=x+20 else x=x+30 end if

Type checking in a compiler is used to: A) Verify syntax B) Verify Compiler


91 CO1 1 L Y Type Checking 4 1
semantics ✅ C) Generate code D) Optimize code Design

Which of the following is not a type expression? A) Basic type B) Array Type
92 CO1 1 L Y Unit IX 4 1
type C) Function type D) Symbol table ✅ Expressions
Static type checking is done: A) At compile time ✅ B) At run time C)
93 CO1 1 L Y Type Checking Unit IX 4 1
During execution D) Dynamically

Dynamic type checking is done: A) At compile time B) At link time C) At


94 CO1 1 L Y Type Checking Unit IX 4 1
run time ✅ D) During lexical analysis

Equivalence of type expressions can be checked using: A) Structural


Type
95 equivalence ✅ B) Name equivalence C) Both structural and name CO1 2 M Y Unit IX 4 1
Equivalence
equivalence ✅ D) None of the above

Overloading in programming languages refers to: A) Using multiple


96 memory locations B) Using the same function or operator name for CO1 2 M Y Overloading Unit IX 4 1
different types ✅ C) Using too many parameters D) Excessive recursion

Which storage allocation strategy allocates memory at compile time? A)


Storage
97 Static allocation ✅ B) Stack allocation C) Heap allocation D) Dynamic CO2 1 L Y Unit IX 4 1
Allocation
allocation

Which storage allocation strategy allocates memory during program


Storage
98 execution? A) Static allocation B) Stack allocation ✅ C) Compile-time CO2 1 L Y Unit IX 4 1
Allocation
allocation D) None of the above

Access to non-local names in a runtime environment requires: A) Lexical Runtime


99 CO2 2 M Y Unit IX 4 1
scoping ✅ B) Static typing C) Dynamic typing D) Symbol overloading Environment

Which of the following does not belong to runtime environment


Runtime
100 management? A) Parameter passing B) Storage organization C) Type CO2 1 L Y Unit IX 4 1
Environment
checking ✅ D) Symbol tables

Explain the difference between compile-time and run-time storage Storage


101 CO2 1 L Y Unit IX 4 5
allocation. Allocation

Explain parameter passing methods: call by value, call by reference, and Parameter
102 CO2 2 M Y Unit IX 4 5
call by value-result. Passing

103 What is function/operator overloading? CO1 1 L Y Overloading Unit IX 4 5

Parameter
104 Name parameter passing methods in programming languages. CO2 1 L Y Unit IX 4 5
Passing

Runtime
105 Define storage organization. CO2 1 L Y Unit IX 4 5
Environment

106 Explain the specification of a simple type checker with an example. CO1 2 M Y Type Checking Unit IX 4 5

Type
107 Explain type expressions and type systems in compiler design. CO1 2 M Y Unit IX 4 5
Expressions

Runtime
108 Explain access to non-local names in runtime environments. CO2 2 M Y Unit IX 4 5
Environment

Type
109 What is name equivalence of types? CO1 1 L Y Unit IX 4 5
Equivalence

110 What is a symbol table? CO2 1 L Y Symbol Tables Unit IX 4 5

What is type checking in the context of a compiler, and why is it


111 CO1 2 M Y Type Checking Unit IX 4 10
important?
Differentiate between static and dynamic type checking. Provide examples
112 CO1 3 H Y Type Checking Unit IX 4 10
of each.

What is function and operator overloading? How does overloading impact


113 CO1 3 H Y Overloading Unit IX 4 10
type checking in a language?

Explain the concept of type conversions. What are the different types of Type
114 CO1 3 H Y Unit IX 4 10
type conversions, and why are they necessary? Conversions

What is meant by the equivalence of type expressions? How is this Type


115 CO1 2 M Y Unit IX 4 10
determined in a type system? Equivalence

Describe the role of symbol tables in a compiler. How do they contribute


116 CO2 2 M Y Symbol Tables Unit IX 4 10
to the management of scope and types?

Discuss the different storage organization strategies used in a run-time Storage


117 CO2 3 H Y Unit IX 4 10
environment. How does memory allocation work? Organization

What are the different methods of parameter passing in a run-time Parameter


118 CO2 2 M Y Unit IX 4 10
environment? Provide examples for each method. Passing

Storage
119 Explain dynamic storage allocation strategies. CO2 2 M Y Unit IX 4 10
Allocation

What is activation tree? How is control stack maintained with the help of Runtime
120 CO2 3 H Y Unit IX 4 10
activation tree? Environment

What is the primary purpose of a code optimizer? A) Generate machine


Understan Code
121 code B) Improve the efficiency of generated code ✅ C) Check syntax CO1 Low Y X 5 1
d Optimization
errors D) Parse the source code

A basic block is: A) A sequence of instructions with no branches except at


Code
122 the end ✅ B) A single instruction C) Entire program code D) Only jump CO1 Remember Low Y X 5 1
Optimization
instructions

Which of the following represents the control flow of basic blocks? A) Understan
123 CO1 Low Y Control Flow X 5 1
DAG B) Flow graph ✅ C) Symbol table D) Parse tree d

Principal sources of optimization include: A) Loop optimization, common


Optimization
124 subexpression elimination ✅ B) Lexical analysis C) Syntax analysis D) CO1 Apply Medium Y X 5 1
Techniques
Code generation

In a DAG representation of a basic block: A) Nodes represent variables or


Understan DAG
125 operations ✅ B) Nodes represent functions only C) Nodes represent CO1 Medium Y X 5 1
d Representation
basic blocks D) Nodes represent memory addresses

Global data flow analysis is used to: A) Optimize individual instructions


Data Flow
126 B) Track information across basic blocks ✅ C) Allocate registers D) CO2 Apply Medium Y X 5 1
Analysis
Generate machine code

Code generation is: A) Machine-independent B) Machine-dependent ✅ Code


127 CO2 Remember Low Y X 5 1
C) Only lexical analysis D) Only optimization Generation

Which of the following is a target of code generation? A) Source code B) Understan Code
128 CO2 Low Y X 5 1
Intermediate code C) Object code ✅ D) Flow graph d Generation

Peephole optimization is used to: A) Optimize global loops B) Optimize


Local
129 small sequences of instructions ✅ C) Allocate registers D) Construct CO1 Apply Medium Y X 5 1
Optimization
basic blocks

Register allocation during code generation is important because: A) It


Understan Register
130 reduces memory access and improves execution speed ✅ B) It checks CO2 Medium Y X 5 1
d Allocation
syntax C) It parses source code D) It generates intermediate code
Understan Peephole
131 Explain peephole optimization techniques in detail CO1 Medium Y X 5 5
d Optimization

Code
132 Compare code optimization and code generation CO1 Analyze Medium Y X 5 5
Optimization

Understan Loop
133 What is an induction variable? Explain the induction variable elimination CO1 Medium Y X 5 5
d Optimization

What are different types of local optimization techniques with suitable Local
134 CO1 Apply Medium Y X 5 5
examples Optimization

What is a DAG? Construct the DAG for the expression: a = b * – c + b * – DAG


135 CO1 Apply Medium Y X 5 5
c Representation

Register
136 What is register allocation? CO2 Remember Low Y X 5 5
Allocation

Local
137 Name any optimization performed on basic blocks CO1 Remember Low Y X 5 5
Optimization

Code
138 What is the target machine in code generation? CO2 Remember Low Y X 5 5
Generation

Code
139 Explain the design of a simple code generator with an example CO2 Apply Medium Y X 5 5
Generation

140 What is a flow graph? CO2 Remember Low Y Control Flow X 5 5

Understan Code
141 Define code optimization. What are the different optimization techniques? CO1 Medium Y X 5 10
d Optimization

Data Flow
142 Write an algorithm to compute IN and OUT data flow equations CO2 Apply High Y X 5 10
Analysis

Explain loop optimization. What are different loop optimization Loop


143 CO1 Analyze High Y X 5 10
techniques? Optimization

Peephole
144 Explain peephole optimization with example CO1 Apply Medium Y X 5 10
Optimization

Data Flow
145 Write short notes on global data flow analysis CO2 Remember Medium Y X 5 10
Analysis

Understan Code
146 Define code generator and explain issues in design of code generator CO2 Medium Y X 5 10
d Generation

Write in detail the steps of code generation algorithm including the Code
147 CO2 Apply High Y X 5 10
function getreg Generation

What is a loop-invariant? How will you detect loop-invariant Loop


148 CO1 Analyze High Y X 5 10
computation? Give the algorithm Optimization

Generate code for the following C statements: a) x=(x+y)*16 b) x=(a+b)- Code


149 CO2 Apply High Y X 5 10
((c+d)-e) Generation
Construct the TAC and flow graph for the following program: a) f=1; i=1;
TAC & Flow
150 while(i<=5) do { f=f*i; i=i+1; } b) while(a<c and b>d) do if(a==1) then CO2 Apply High Y X 5 10
Graph
c=c+1; else while(a<=d) do a=a+b;

You might also like