Compiler Design MCQ Questions PDF
Compiler Design MCQ Questions PDF
1. Lex
2. Symbol Table
3. Yacc
4. Type Checking
1. A LR parser
2. Recursive descent parser
3. An LALR parser
4. Operator precedence parser
1. Semantic Analysis
2. Code Optimization
3. Syntax Analysis
4. Lexical Analysis
1. Lexical Analysis
2. Semantic Analysis
3. Syntax Analysis
4. Code generation
1. SLR
2. Operator Precedence
3. Canonical LR
4. LALR
Answer: Canonical LR
1. High-Level Language
2. Decimal-Format
3. Low-level Language
4. Middle-Level Language
1. Firstly scans the entire program and then transforms it into machine-understandable
code
2. The execution takes place after the removal of all syntax errors
3. More execution time
4. Debugging process is slow
1. a syntax tree
2. a set of RE
3. string character
4. a set of tokens
11. Which phase of the compiler checks the grammar of the programming?
1. Semantic Analysis
2. Syntax Analysis
3. Code Optimization
4. Code Generation
Answer: Syntax Analysis
12. Which computer program accepts the high-level language and converts it into
assembly language?
1. Linker
2. Assembler
3. Interpreter
4. Compiler
Answer: Compiler
13. Which part of the compiler highly used the grammar concept?
1. Code generation
2. Parser
3. Code optimization
4. Lexical Analysis
Answer: Parser
14. From the following grammars, which describes the lexical syntax?
1. Context-free Grammar
2. Syntactic Grammar
3. Lexical Grammar
4. Regular Grammar
1. Task File
2. Data File
3. Program file
4. Object file
17. Which grammar gives multiple parse trees for the same string?
1. Regular
2. Ambiguous
3. Unambiguous
4. None of above
Answer: Ambiguous
18. In which parsing, the parser constructs the parse tree from the start symbol and
transforms it into the input symbol
1. Top-down parsing
2. Bottom-up parsing
3. All of above
4. None of above
1. Lexeme
2. Mexeme
3. Texeme
4. Pattern
Answer: Lexeme
20. Which compiler runs on one machine and generates code for multiple machines?
1. Onepass compiler
2. Optimizing compiler
3. Multipass compiler
4. Cross compiler
21. Which tool is used for grouping of characters in tokens in the compiler?
1. Code optimizer
2. Code generator
3. Parser
4. Scanner
Answer: Scanner
1. half-terminals
2. sub-terminals
3. non-terminals
4. terminals
Answer: terminals
1. removing whitespace
2. breaking the syntaxes in the set of tokens
3. removing comments
4. All of the above
24. The value of which variable is updated inside the loop by a loop-invariant value?
1. invariable
2. induction
3. strength
4. loop
Answer: induction
26. Which graph describes the basic block and successor relationship?
1. DAG
2. Flow graph
3. Control graph
4. Hamilton graph
1. Context-free grammar
2. Regular grammar
3. Context-sensitive grammar
4. All of above
1. Type 1 language
2. Type 2 language
3. Type 0 language
4. Type 3 language
1. four types
2. five types
3. three types
4. two types