All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 08 · MOCK TEST

Mock 9 – Semantic Analysis, Code Generation & Optimisation (Part 2)

Unit 8: Theory of Computation and Compilers · 16 questions · about 19 minutes. Press End Mock any time to see your score and the correct answers.

All 10 topic-wise mocks in this unit
0 / 16 answered 00:00
Q1. Suppose a cloud contains software stack such as Operating System, Application software, etc. This model is referred as _____ model.

Directions (Q91–95): Consider the following three-address code.
100: t1 = y + 2
101: initial = x / t1
102: limit = 10
103: if i > j goto 105
104: goto 111
105: if num > b goto 107
106: goto 111
107: num = limit − 1
108: b = y + 2
109: i = i − num
110: goto 103
111: j = i − num
112: k = j + b

Q2.

Which of the following is the Optimized version for the given TAC in the passage

Q3.

Match the LIST-I with LIST-II

Figure
Q4.

Which of the following tasks could be attained using syntax trees in compiler design ?

(A) Type Checking

(B) Code Generation

(C) Code Optimization

(D) Error Handling

Q5.

Arrange the following stages of parsing in the correct order as they typically occur in the compilation process.

(A) Lexical Analysis

(B) Sematic Analysis

(C) Syntax Analysis

(D) Intermediate Code Generation

(E) Code Optimization

Q6.

Which of the following symbol table implementations is best suited if access time is to be minimum?

Q7.

Three address codes can be represented in special structures known as :

(A) Quadruples

(B) Triples

(C) Patterns

(D) Indirect Triples

Q8.

Arrange the following phases of a compiler as per their order of execution (start to end)

(a) Target code generation

(b) Syntax Analysis

(c) Code optimization

(d) Semantic Analysis

(e) Lexical Analysis

Q9.

Which phase of compiler checks the grammar of programming?

Q10.

The compiler for high level language that runs on one machine and produces code for other machine is called-

Q11.

In the context of Binding which one of the following is incorrect?

Q12.

Match List I with List II. List I: (A) Activation record, (B) Location counter, (C) Reference count, (D) Address relocation. List II: (I) Linker/loader, (II) Garbage collection, (III) Subroutine call, (IV) Assembler.

Q13.

Which of the following is not an intermediate code form?

Q14.

Which of the following are applications of symbol table?

(A) Storage allocation

(B) Checking type compatability

(C) Suppressing duplicate error messages

Q15.

Which data structure is used by the compiler for managing variables and their attributes?

Q16.

Replacing the expression by 8.56 is known as