

MCQOPTIONS
Saved Bookmarks
This section includes 21 Mcqs, each offering curated multiple-choice questions to sharpen your Automata Theory knowledge and support exam preparation. Choose a topic below to get started.
1. |
A particular BNF definition for a “word” is given by the following rules. ∷ = | | ∷ = | ∷ = | ∷ = a | b | c | ….. |y| z ∷ = 0 |1|2| …… | 9Which of the following lexical entries can be derived from < word > ?l. pickII. pickslll. c44 |
A. | I, II Wand Ill |
B. | I and II only |
C. | I and III only |
D. | II and III only |
Answer» E. | |
2. |
DU-chains(Definition-Use) in complier design |
A. | consist of a definition of a variable and all its uses, reachable from that definition |
B. | are created using a form of static code analyses |
C. | are prerequisite for many compiler optimization including constant propagation and common sub-expression elimination |
D. | All of the above |
Answer» E. | |
3. |
Arrange the given compilation process in the correct order.a. Linkingb. Assemblingc. Compilingd. Pre-processing |
A. | d → c → b → a |
B. | a → c → b → d |
C. | d → c → a → b |
D. | a → b → c → d |
Answer» B. a → c → b → d | |
4. |
Access time of the symbol table will be logarithmic, if it is implemented by |
A. | Linear list |
B. | Search Tree |
C. | Hash Table |
D. | Self-organization list |
Answer» C. Hash Table | |
5. |
Lexical analysis is the _______ phase of a compiler. |
A. | First |
B. | Second |
C. | third |
D. | fourth |
Answer» B. Second | |
6. |
A lexical analyzer uses the following patterns to recognize three tokens T1, T2, and T3 over the alphabet {a,b,c}. |
A. | 𝑇1𝑇2𝑇3 |
B. | 𝑇1𝑇1𝑇3 |
C. | 𝑇2𝑇1𝑇3 |
D. | 𝑇3𝑇3 |
Answer» E. | |
7. |
In compiler, which of the following reads input characters to identify tokens? |
A. | Code generator |
B. | Code optimizer |
C. | Semantic analyzer |
D. | Lexical analyzer |
Answer» E. | |
8. |
A(n) ______ is a sequence of characters in source program that is matched by the pattern for a token. |
A. | Lexeme |
B. | Operator |
C. | Operand |
D. | Function |
Answer» B. Operator | |
9. |
A_PROGRAM_THAT_PERFORMS_LEXICAL_ANALYSIS_IS_TERMED_AS:?$ |
A. | scanner |
B. | lexer |
C. | tokenizer |
D. | all of the mentioned |
Answer» E. | |
10. |
Which phase of compiler includes Lexical Analysis?$ |
A. | 1 |
B. | 2 |
C. | 3 |
D. | Its primary function, not in any phase |
Answer» E. | |
11. |
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 |
Answer» B. prettyprinters | |
12. |
The scanner outputs: |
A. | Stream of tokens |
B. | Image file |
C. | Intermediate code |
D. | Machine code |
Answer» D. Machine code | |
13. |
Which of the following is the task of lexical analysis? |
A. | To build the uniform symbol table |
B. | To initialize the variables |
C. | To organize the variables in a lexical order |
D. | None of the mentioned |
Answer» B. To initialize the variables | |
14. |
The action of parsing the source code into proper syntactic classes is known as: |
A. | Parsing |
B. | Interpretation analysis |
C. | Lexicography |
D. | Lexical Analysis |
Answer» B. Interpretation analysis | |
15. |
____________ is used for grouping up of characters into token. |
A. | Lexical Analyzer |
B. | oolex |
C. | jflex |
D. | All of the mentioned |
Answer» E. | |
16. |
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 |
Answer» E. | |
17. |
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 |
Answer» E. | |
18. |
Statement 1 is assertion, Statement 2 is the reason |
A. | Statement 1 is assertion, Statement 2 is the solution |
B. | There is no such Statement 2 |
C. | This is not a function of Lexical Analyzer |
Answer» D. | |
19. |
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 |
Answer» B. longest match rule | |
20. |
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 |
Answer» D. something else | |
21. |
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 |
Answer» C. lexical errors | |