Compilers Multiple Choice Questions on “Syntax Analyser”.
1. Which phase of the compiler is Syntax Analysis?
a) First
b) Second
c) Third
d) None of the mentioned
Answer: b
Clarification: It is Second Phase Of Compiler after Lexical Analyzer.
2. Syntax Analyser is also known as ___________
a) Hierarchical Analysis
b) Hierarchical Parsing
c) None of the mentioned
d) Hierarchical Analysis & Parsing
Answer: d
Clarification: It is also called as Hierarchical Analysis or Parsing.
3. Syntax Analyser takes Groups Tokens of source Program into Grammatical Production.
a) True
b) False
Answer: a
Clarification: It Groups Tokens of source Program into Grammatical Production.
4. From where it takes its input from?
a) Lexical analyser
b) Syntactic Analyser
c) Semantic Analyser
d) None of the mentioned
Answer: a
Clarification: A syntax analyzer or parser takes the input from a lexical analyzer in the form of token streams.
5. Parsers are expected to parse the whole code.
a) True
b) False
Answer: a
Clarification: Parsers are expected to parse the whole code even if some errors exist in the program.
6. A grammar for a programming language is a formal description of _______________
a) Syntax
b) Semantics
c) Structure
d) Library
Answer: c
Clarification: The grammar clearly indicates which type of structure does a program has.
7. Which of these is not true about the Symbol Table?
a) All the labels of the instructions are symbols
b) Table has entry for symbol name address value
c) Perform the processing of the assembler directives
d) Created during pass 1
Answer: c
Clarification: The Symbol table does not ever perform the processing of the assembler derivative.
8. Which of these features of assembler are Machine-Dependent?
a) Instruction formats
b) Addressing modes
c) Program relocation
d) All of the mentioned
Answer: d
Clarification: All of these options are features of assembler which are machine dependent.
9. A compiler can check?
a) Logical Error
b) Syntax Error
c) Both Logical and Syntax Error
d) Not Logical and Syntax Error
Answer: b
Clarification: No compiler can ever check logical errors.
10. The fourth Generation computer was made up of ______________
a) Transistor
b) Vacuum tubes
c) Chips
d) Microprocessor chips
Answer: d
Clarification: It is the only way to increase its throughput.