wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Compiler Design

Total questions: 20

Worksheet time: 9mins

Name
Class
Date
1.

Which one of the following is a top-down parser?

a)

Recursive descent parser.

b)

Operator precedence parser.

c)

An LR(k) parser.

d)

An LALR(k) parser

2.

Select a Machine Independent phase of the compiler

a)

Syntax Analysis

b)

Intermediate Code generation

c)

Lexical Analysis

d)

All of the mentioned

3.

Which of the following system software resides in the main memory always

a)

Text Editor

b)

Assembler

c)

Linker

d)

Loader

4.

Output file of Lex is _____ the input file is Myfile?

a)

Myfile.e

b)

Myfile.yy.c

c)

Myfile.lex

d)

Myfile.obj

5.

Type checking is normally done during?

a)

Lexical Analysis

b)

Syntax Analysis

c)

Syntax Directed Translation

d)

Code generation

6.

By whom is the symbol table created?

a)

Compiler

b)

Interpreter

c)

Assembler

d)

None of the mentioned

7.

What does a Syntactic Analyser do?

a)

Maintain Symbol Table

b)

Collect type of information

c)

Create parse tree

d)

None of the mentioned

8.

Semantic Analyser is used for?

a)

Generating Object code

b)

Maintaining symbol table

c)

Generating Object code & Maintaining symbol table

d)

None of the mentioned

9.

What is Syntax Analyser also known as

a)

Hierarchical Analysis

b)

Hierarchical Parsing

c)

None of the mentioned

d)

Hierarchical Analysis & Parsing

10.

A grammar for a programming language is a formal description of

(a)  

11.

which compiler is used for python

4 lines
12.

Syntax Analyzer takes Groups Tokens of source Program into Grammatical Production

a)

TRUE

b)

FALSE

c)

May be

d)

Can't say

13.

Parser are expected to parse the whole code

a)

TRUE

b)

FALSE

c)

MAY BE

d)

Cant say

14.

In SLR parsing for the grammar E’-->E , E--> aEbE|bEaE|ε, In state 0, for inputs ‘a’ and ‘b’

a)

Both will have shift-reduce conflict

b)

Only ‘a’ will have shift-reduce conflict

c)

Only ‘b’ will have shift-reduce conflict

d)

Neither of the other option

15.

The grammar {E-->E+T|T, T-->T*F|F, F-->id} is

a)

Ambiguous

b)

Unambiguous

c)

Partially ambiguous

d)

None of the other options

16.

The symbol table implementation is based on the property of locality of reference is -

a)

Hash Table

b)

Self Organisation

c)

Linear list

d)

None of the above

17.

A system program that set-up an executable program in main memory ready for execution is

a)

loader

b)

linker

c)

assembler

d)

None of the above

18.

For a context-free grammar, left hand side of production rules should contain

a)

Single nonterminal

b)

Set of both terminals and nonterminals

c)

Set of terminals

d)

None of the other options

19.

The regular expression (0|1)*(0|1) represents a language with

a)

Odd nonempty strings

b)

Even nonempty strings

c)

Empty and nonempty binary strings

d)

Nonempty binary strings

20.

Which one of the following is a top-down parser?

a)

Recursive descent parser.

b)

Operator precedence parser.

c)

An LR(k) parser.

d)

An LALR(k) parser