Theory of Computation MCQ (Multiple Choice Questions) - SchoolingAxis

Theory of Computation MCQ (Multiple Choice Questions)

 1. _____ is used for grouping up of characters into token.

a. Lexical Analyzer

b. oolex

c. jflex

d. All of the mentioned


Ans- d. All of the mentioned


2. Which of the following characters are ignored while lexical analysis?

a. .

b. =

c. #

d. WhiteSpace


Ans- d. WhiteSpace


3. Which phase of compiler includes Lexical Analysis?

a. 1

b. 2

c. 3

d. Its primary function, not in any phase


Ans- a. 1


4. Lexers and parsers are not found in which of the following?

a. compiler front end processing

b. prettyprinters

c. linters

d. none of the mentioned


Ans- d. none of the mentioned


5. A program that performs lexical analysis is termed as:

a. scanner

b. lexer

c. tokenizer

d. All of the mentioned


Ans- d. All of the mentioned


6. Which among the following is not a tool to construct lexical analyzer from a regular expression?

a. lex

b. flex

c. jflex

d. None of the mentioned


Ans- d. None of the mentioned


7. The output of the lexical and syntax analyzer can stated as:

a. parse stream, parse tree

b. token tree, parse tree

c. token stream, parse tree

d. All of the mentioned


Ans- c. token stream, parse tree


8. The methodology to show an error when the analyzer faces a keyword over an user's input is based on:

a. rule priority

b. longest match rule

c. keyword-out rule

d. None of mentioned


Ans- a. rule priority


9. If the lexical analyser finds a lexeme with the same name as that of a reserved word,it ___

a. overwrites the word

b. overwrites the functionality

c. generates an error

d. something else


Ans- c. generates an error


10. Lexemes can be referred to as:

a. elements of lexicography

b. sequence of alphanumeric characters in a token

c. lexical errors

d. None of the mentioned


Ans- b. sequence of alphanumeric characters in a token

Previous Post Next Post