You are on page 1of 3

1.

Which tool is used for grouping of characters in tokens in the


compiler?

A. Parser
B. Code generator
C. Scanner
D. Code optimizer

Answer : C

2. A set of instructions executed directly by a computer’s central


processing unit is

A. Command Language
B. Machine Language
C. Style Sheet Language
D. Markup Language
Answer : B

3. The method which merges the bodies of two loops is

A. Loop unrolling
B. Constant folding
C. Loop jamming
D. None of the above

Answer : C

4.  Which of the following actions an operator precedence parser


may take to recover from an error?

A. Delete symbols from the stack


B. Inserting or deleting symbols from the input
C. Insert symbols onto the stack
D. All of the above

Answer : D

5. What is the output of the lexical analyzer?

A. A parse tree
B. A list of tokens
C. Machine code
D. Intermediate code

Answer : B

6. When is the type checking usually done?

A. During syntax directed translation


B. During syntax analysis
C. During lexical analysis
D. During code optimization

Answer : A

7. A grammar that produces more than one parse tree for some
sentence is called as

A. Unambiguous
B. Ambiguous
C. Regular
D. None of the above

Answer : B

8. Lexical analysis is about breaking a sequence of characters into

A. Packets
B. Lines
C. Tokens
D. Groups

Answer : C

9. What is the use of a symbol table in compiler design?

A. Finding name’s scope


B. Type checking
C. Keeping all of the names of all entities in one place
D. All of the above
Answer : D
10. Identify the data structure which has minimum access time in
case of symbol table implementation?

A. Hash table
B. Self-organizing list
C. Linear
D. Search tree
Answer : A

You might also like