Docsity

Compiler Design MCQ., Exercises of Compiler Design

Toggle sidebar
bg1
1) Users write the programs in which language?
a. Low-level Language
b. High-Level Language
c. Decimal-Format
d. Middle-Level Language
2) Which computer program accepts the high-level language and converts it into
assembly language?
a. Interpreter
b. Linker
c. Assembler
d. Compiler
3) Does the compiler program translate the whole source code in one step?
a. No
b. Depends on the Compiler
c. Don't Know
d. Yes
4) Which of the following file is an output of the assembler?
a. Program file
b. Object file
c. Data File
d. Task File
5) Which tool is used for grouping of characters in tokens in the compiler?
a. Parser
b. Code optimizer
c. Code generator
d. Scanner
pf3
pf4
pf5
pf8

Partial preview of the text

Download Compiler Design MCQ. and more Exercises Compiler Design in PDF only on Docsity!

1) Users write the programs in which language?

a. Low-level Language b. High-Level Language c. Decimal-Format d. Middle-Level Language

2) Which computer program accepts the high-level language and converts it into

assembly language?

a. Interpreter b. Linker c. Assembler d. Compiler

3) Does the compiler program translate the whole source code in one step?

a. No b. Depends on the Compiler c. Don't Know d. Yes

4) Which of the following file is an output of the assembler?

a. Program file b. Object file c. Data File d. Task File

5) Which tool is used for grouping of characters in tokens in the compiler?

a. Parser b. Code optimizer c. Code generator d. Scanner

6) What is the linker?

a. It is always used before the program execution. b. It is required to create the load module. c. It is the same as the loader d. None of the above

7) Parsing is categorized into how many types?

a. three types b. four types c. two types d. five types

8) In which parsing, the parser constructs the parse tree from the start symbol

and transforms it into the input symbol.

a. Bottom-up parsing b. Top-down parsing c. None of the above d. Both a and b

9) Which derivation is generated by the top-down parser?

a. Right-most derivation in reverse b. Left-most derivation in reverse c. Right-most derivation d. Left-most derivation

10) Which derivation is generated by the bottom-up parser?

a. Right-most derivation in reverse b. Left-most derivation in reverse c. Right-most derivation d. Left-most derivation

a. Mexeme b. Lexeme c. Texeme d. Pattern

17) Which part of the compiler highly used the grammar concept?

a. Code optimization b. Code generation c. Parser d. Lexical Analysis

18) Which phase of the compiler checks the grammar of the programming?

a. Code Optimization b. Semantic Analysis c. Code Generation d. Syntax Analysis

19) Which of the following component is important for semantic analysis?

a. Yacc b. Lex c. Symbol Table d. Type Checking

20) Which phase of the compiler is also known as Scanner?

a. Syntax Analysis b. Lexical Analysis c. Semantic Analysis d. Code generation

21) Which phase of the compiler is also known as Parser?

a. Code Optimization

b. Semantic Analysis c. Syntax Analysis d. Lexical Analysis

22) Which of the following parser is a top-down parser?

a. An LALR parser b. A LR parser c. Operator precedence parser d. Recursive descent parser

23) Keywords are recognized in a compiler during -

a. the code generation b. the data flow analysis c. the lexical analysis of the program d. the program parsing

24) Leaf nodes in a parse tree indicate?

a. sub-terminals b. half-terminals c. non-terminals d. terminals

33) Which phenomenon happens when the non-terminal on the left side is

repeated as the first symbol on the right side?

a. Left-most derivation b. Left recursion c. Left factoring d. Left parsing

36) The compiler can detect what type of errors?

a. neither logical nor grammatical error

b. GOTO c. COMPUTE d. FOLLOW