COMPILER DESIGNING MCQ BANK
Q. The method which merges the bodies of two loops is
-Constant folding
-Loop jamming
-Loop unrolling
-None of these
Ans: Loop jamming
Q. A grammar that produces more than one parse tree for some sentence is called as
-Ambiguous
-Unambiguous
-Regular
-All of these
Ans. -Ambiguous
Q. Compiler translates the source code to
-Executable code
-Machine code
-Binary code
-Both B and C
Ans. Both B and C
Q. The bottom-up parsing method is also called
-Shift reduce parsing
-Predictive parsinng
-Recursive descent parsing
-None of these
Ans: Shift reduce parsing
Q. Which of the following groups is/are taken together into semantic structures?
-syntax analyzer
-Intermediate code generation
-Lexical analyzer
-Semantic analyzer
Ans. Lexical analyzer
Q. Grammar of the programming is checked at _______ phase of compiler.
-Semantic analysis
-Syntax analysis
-Code optimization
-Code generation
Ans. Syntax analysis
Q. A bottom-up parser generates
-Left-most derivation in reverse
-Left-most derivation
-Right-most derivation in reverse
-Right –most derivation
Ans: Right-most derivation in reverse
Q. ...... is a process of finding a parse tree for a string of tokens.
-Parsing
-Analysing
-Recognizing
-Tokenizing
Ans. Parsing
Q. The action of parsing the source program into proper syntactic classes is called
-General syntax analysis
-Interpretation analysis
-Syntax analysis
-Lexical analysis
Ans: Lexical analysis
Q. What is the action of parsing the source program into proper syntactic classes?
-Lexical analysis
-Syntax analysis
-General syntax analysis
-Interpretation analysis
Ans. Lexical analysis
Q. A compiler which allows only the modified section of the source code to be recompiled is called
-Subjective compiler
-Dynamic compiler
-Re-configurable compiler
-Incremental compiler
Ans: Incremental compiler
Q. Compiler can check ________ error.
-Logical
-Syntax
-Content
-Both A and B
Ans. Syntax
Q. Compiler should report the presence of __________ in the source program, in translation process.
-Classes
-Objects
-Errors
-Text
Ans. Errors
Q. Shift reduce parsers are __________
-Top down Parser
-Bottom Up parser
-May be top down or bottom up
-None of the mentioned
Ans. Bottom up parser
Q. What is the output of lexical analyzer?
-A parse tree
-A list of tokens
-Intermediate code
-Machine code
Ans. A list of tokens
Q. Scissoring enables __________
-A part of data to be displayed
-Entire data to be displayed
-None of the mentioned
-No data to be displayed
Ans. A part of data to be displayed
Q. How many parts of compiler are there?
- 1
- 2
- 4
- 8
Ans. 2
Q. Lexical analysis is about breaking a sequence of characters into
-Groups
-Packets
-Lines
-Tokens
Ans. Tokens
Q. The optimization which avoids test at every iteration is?
-Loop unrolling
-Loop jamming
-constant folding
-None of the mentioned
Ans. Loop u rolling
Q. _______ is the most general phase structured grammar.
-Context sensitive
-Regular
-Context free
-All of these
Ans. Context sensitive
Q. Pee Hole optimization __________
-Loop Optimization
-Local Optimization
-Constant folding
-Data Flow analysis
Ans. Constant folding
Q. ....... is considered as a sequence of characters in a token.
-Texeme
-Pattern
-Lexeme
-Mexeme
Ans. Lexeme
Q. Which table is a permanent database that has an entry for each terminal symbol?
-Reductions
-Identifier table
-Literal table
-Terminal table
Ans: Terminal table
Q. What is the name of the process that determining whether a string of tokens can be generated by a grammar?
-Analysing
-Recognizing
-Translating
-Parsing
Ans. Parsing
Q. Compiler translates the source code to
-Machine code
-Binary code
-Executable code
-Both 1 and 2
Ans. Both 1 and 2
Q. Which of the following parsers is the most powerful?
-SLR
-LALR
-Canonical LR
-Operator-precedence
Ans: Canonical LR
Q. What is the output of lexical analyzer?
-A list of tokens
-Intermediate code
-A parse tree
-Machine code
Ans. A list of tokens
Q. A top-down parser generates
-Left-most derivation in reverse
-Left-most derivation
-Right-most derivation in reverse
-Right –most derivation
Ans: Left-most derivation
Q. How many parts of compiler are there?
- 8
- 4
- 2
- 1
Ans. 2
Q. Which of the following symbol table implementation has the minimum access time?
-Self-organizing list
-Linear
-Search tree
-Hash table
Ans: Hash table
Q. .....................is a process of finding a parse tree for a string of tokens.
-Analysing
-Recognizing
-Tokenizing
-Parsing
Ans. Parsing
Q. A compiler is preferable to an interpreter because
-A Debugging can be faster and easier
-if one changes a statement, only that statement needs re-compilation
-It is much helpful in the initial stages of program development
-It can generate stand alone programs that often take less time for execution
Ans: It can generate stand alone programs that often take less time for execution
Q. Which of the following is the fastest logic?
-TTL
-ECL
-CMOS
-LSI
Ans. Ecl
Q. A _________ is a software utility that translates code written in higher language into a low level language.
-Converter
-Compiler
-Text editor
-Code optimizer
Ans. Compiler
Q. A latch is constructed using which two cross coupled?
-AND OR gates
-AND gates
-NAND and NOR gates
-NAND gates
Ans. Nand gates
Q. A optimizing compiler
-Is optimized to take less time for execution
-Optimized the code
-Is optimized to occupy less space
-None of the mentioned
Ans. Optimized the code
Q. The linker __________
-Is similar to interpreter
-Uses source code as its input
-Is required to create a load module
-None of the mentioned
Ans. Is required to create a load module
Q. Which of the following actions an operator precedence parser may take to recover from an error?
-Delete symbols from the stack
-Insert symbols onto the stack
-Inserting or deleting symbols from the input
-All of the mentioned
Ans. all of the mentioned
Q. An optimizer Compiler __________
-Is optimized to occupy less space
-Is optimized to occupy less space & Optimize the code
-Optimize the code
-None of the mentioned
Ans. d. None of the mentioned
Q. Shift reduce parsers are
-Bottom up parser
-Top down parser
-Top down parserMaybe both
-None of the mentioned
Ans. Bottom up parser
Q. A grammar that produces more than one parse tree for some sentence is called __________
-Ambiguous
-Unambiguous
-Regular
-None of the mentioned
Ans. Ambiguous
Q. Which of the following is used for grouping of characters into tokens?
-Parser
-Code generator
-Lexical analyser
-Code generator
Ans. Lexical analyser
Q. A bottom up parser generates __________
-Right most derivation
-Rightmost derivation in reverse
-Leftmost derivation
-Leftmost derivation in reverse
Ans. Rightmost derivation in reverse
Q. In a compiler, keywords of a language are recognized during -
-the code generation
-parsing of the program
-the lexical analysis of the program
-dataflow analysis
Ans. Lexical analysis of the program
Comments
Post a Comment