Compilers Questions and Answers – Syntax Analyser – 1

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Syntax Analyser – 1”.

1. Which phase of the compiler is Syntax Analysis?
a) First
b) Second
c) Third
d) None of the mentioned
View Answer

Answer: b
Explanation: 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
View Answer

Answer: d
Explanation: 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
View Answer

Answer: a
Explanation: It Groups Tokens of source Program into Grammatical Production.
advertisement
advertisement

4. From where it takes its input from?
a) Lexical analyser
b) Syntactic Analyser
c) Semantic Analyser
d) None of the mentioned
View Answer

Answer: a
Explanation: 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
View Answer

Answer: a
Explanation: Parsers are expected to parse the whole code even if some errors exist in the program.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. A grammar for a programming language is a formal description of _______________
a) Syntax
b) Semantics
c) Structure
d) Library
View Answer

Answer: c
Explanation: 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
View Answer

Answer: c
Explanation: The Symbol table does not ever perform the processing of the assembler derivative.
advertisement

8. Which of these features of assembler are Machine-Dependent?
a) Instruction formats
b) Addressing modes
c) Program relocation
d) All of the mentioned
View Answer

Answer: d
Explanation: 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
View Answer

Answer: b
Explanation: No compiler can ever check logical errors.
advertisement

10. The fourth Generation computer was made up of ______________
a) Transistor
b) Vacuum tubes
c) Chips
d) Microprocessor chips
View Answer

Answer: d
Explanation: It is the only way to increase its throughput.

Sanfoundry Global Education & Learning Series – Compilers.

To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.