Compiler Design Multiple Choice Questions and Answers - 1

Question: 1

The lexical analyzer takes ____ as input and produces a list of ___ of output.

(A) Machine code, mnemonic

(B) Tokens, source code

(C) Source code, tokens

(D) Both a and b

Ans: C

Source code, tokens

Question: 2

Linear analysis is called ____ in a compiler.

(A) Lexical analysis

(B) Scanning

(C) Testing

(D) Both a and b

Ans: D

Both a and b

Question: 3

Lexical analysis is about breaking a sequence of characters into

(A) Tokens

(B) Lines

(C) Groups

(D) Packets

Ans: A

Tokens

Question: 4

The phase Syntax Analysis is modeled on the basis of

(A) High level language

(B) Low level language

(C) Context free grammar

(D) Regular grammar

Ans: C

Context free grammar

Question: 5

Compiler is a program that

(A) Accepts a program written in a high level language and produces an object program

(B) Appears to execute a source program as if it were machine language

(C) Automates the translation of assembly language into machine language

(D) Places programs into memory and prepares them for execution

Ans: A

Accepts a program written in a high level language and produces an object program

Error Report!

Related Questions