Introduction to Compiler Design

This set of MCQs helps students to learn about Compiler Design and its introduction, whose design principles provide an in-depth view of translation and optimization process and covers basic translation mechanism and error detection & recovery. It also includes lexical, syntax, and semantic analysis as front end, and code generation and optimization as back-end.

Start Quiz

Which of the following pairs of regular expressions are equivalent?

1(01)* and (10)*1 x (xx)* and (xx)*x x+ and x+ x(*+) All of the mentioned

Which of the following are not regular?

String of )’s which has length that is a perfect square Palindromes Consisting of 0’s 1’s String of 0’s whose length is a prime number All of the mentioned

Which one of the following statement is FALSE?

Context-free languages are closed under union Context-free languages are closed under concatenation Context-free languages are closed under intersection Context-free languages are closed under Kleene closure

Cross-compiler is a compiler __________

Which is written in a different language from the source language? That generates object code for the machine it’s running on. Which is written in the same language as the source language? That runs on one machine but produces object code for another machine

Cross compiler is used in Bootstrapping.

True False

Is GCC a cross Complier.

Yes No

The __________ is a technique for building cross compilers for other machines.

Brazilian Cross Canadian Cross Mexican Cross X-cross

__________ was developed from the beginning as a cross compiler.

Free Pascal GCC Pascal None of the mentioned

Number of states of FSM required to simulate behaviour of a computer with a memory capable of storing “m” words, each of length ‘n’.

m x 2^n

2^mn

2^(m+n)

All of the mentioned

An FSM with __________.

M can be transformed to Numeral relabeling its states

M can be transformed to N, merely relabeling its edges

Both of the mentioned

None of the mentioned

If ∑ = {a, b, c, d, e, f} then number of strings in ∑ of length 4 such that no symbol is used more than once in a string is,

35

360

49

720

A compiler for a high-level language that runs on one machine and produces code for a different machine is called ___________.

Optimizing compiler

One pass compiler

Cross compiler

Multipass compiler

A system program that combines separately compiled modules of a program into a form suitable for execution is called ___________.

Assembler

Linking loader

Cross compiler

None of the mentioned

Let L denotes the language generated by the grammar S – OSO/00. Which of the following is true?

L = O

L is regular but not O+

L is context free but not regular

L is not context free

Given a NFA with N states, the maximum number of states in an equivalent minimized DFA is at least.

N2

2N

3N

N!

Quiz/Test Summary
Title: Introduction to Compiler Design
Questions: 15
Contributed by:
Steve