wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Compiler Design

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

1. Which of the following is a stage of compiler design?a) Semantic analysisb) Intermediate code generatorc) Code generatord) All of the mentioned

a)

A

b)

B

c)

C

d)

D

2.

2. A programmer, writes a program to multiply two numbers instead of dividing them by mistake, how can this error be detected?a) Compiler or interpreterb) Compiler onlyc) Interpreter onlyd) None of the mentioned

a)

A

b)

B

c)

C

d)

D

3.

3. Who is responsible for the creation of the symbol table?a) Assemblerb) Compilerc) Interpreterd) All of the mentioned

a)

A

b)

B

c)

C

d)

D

4.

4. Let L1 = {w ∈ {0,1}∗ | w has at least as many occurrencesof (110)’s as (011)’s}.Let L2 = { ∈ {0,1}∗ | w has at least as many occurrencesof (000)’s as (111)’s}.Which of the following is correct?a) L2 is regularb) L1 and L2 are regularc) L1 is regular but not L2d) None of them are regular

a)

A

b)

B

c)

C

d)

D

5.

5. Which of the following is a correct statement?I. For some programming languages, there are parsing algorithms with an O(3) complexity.II. A recursive programming language can be constructed with static storage allocation.III. In the context of bottom-up parsing, no L-attributed definition can be evaluated.IV. Code-improvement modifications can be carried out at both the intermediate and source code levels.a) I and IIIb) I and IVc) I, II and IVd) I, II, III and IV

a)

A

b)

B

c)

C

d)

D

6.

6. Which of the following can detect an error if a programmer by mistake writes multiplication instead of division?a) Interpreterb) Compiler or interpreter testc) Compilerd) None of the mentioned

a)

A

b)

B

c)

C

d)

D

7.

7. Why Generation of intermediate code based on an abstract machine model is useful in compilers?a) Writing for intermediate code generationb) Portability of the front end of the compilerc) Implementation of lexical analysis and syntax analysis is made easierd) All of the mentioned

a)

A

b)

B

c)

C

d)

D

8.

8. Which of the following technique is used for building cross compilers for other machines?a) Canadian Crossb) Mexican Crossc) X-crossd) Brazilian Cross

a)

A

b)

B

c)

C

d)

D

9.

9. An object module for a group of programs that were compiled separately is handed to a linker. Which of the following about an object module isn’t true?a) Relocation bitsb) Names and locations of all external symbols denied in the object modulec) Absolute addresses of internal symbols

a)

A

b)

B

c)

C

d)

D

10.

10. In which of the following phase of the compiler is Lexical Analyser?a) Secondb) Thirdc) Firstd) All of the mentioned

a)

A

b)

B

c)

C

d)

D