Compiler Design MCQ Questions And Answers - Semantic Analysis

This section focuses on "Semantic Analysis" in Compiler Design. These Multiple Choice Questions (MCQs) should be practiced to improve the Compiler Design skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. What is true about Syntax Directed Definitions?

A. Syntax Directed Definitions + Semantic rules = CFG
B. Syntax Directed Definitions + CFG = Semantic rules
C. CFG + Semantic rules = Syntax Directed Definitions
D. None of the above

View Answer


2. Which of the following error is expected to recognize by semantic analyzer?

A. Type mismatch
B. Undeclared variable
C. Reserved identifier misuse.
D. All of the above

View Answer


3. ____________ is a medium to provide semantics to the context-free grammar

A. Domain grammer
B. Attribute grammar
C. Object grammer
D. Value grammer

View Answer


4. Semantic analyzer attaches attribute information with AST, which are called?

A. Analyzer attribute
B. Attributed AST
C. Analyzer AST
D. AST

View Answer


5. Which attributes get values from the attribute values of their child nodes?

A. Synthesized attributes
B. Inherited attributes
C. S-attributed SDT
D. L-attributed SDT

View Answer


6. Which form of SDT uses both synthesized and inherited attributes with restriction of not taking values from right siblings?

A. T-attributed SDT
B. A-attributed SDT
C. S-attributed SDT
D. L-attributed SDT

View Answer


7. If an SDT uses only synthesized attributes, it is called as?

A. T-attributed SDT
B. A-attributed SDT
C. S-attributed SDT
D. R-attributed SDT

View Answer


8. Which of the following tasks should be performed in semantic analysis?

A. Scope resolution
B. Type checking
C. Array-bound checking
D. All of the above

View Answer


9. What is meant by compositional semantics?

A. Determining the meaning
B. Logical connectives
C. Semantics
D. All of the above

View Answer


10. What is true about Attribute Grammar?

A. Attribute grammar is a special form of context-free grammar
B. Each attribute has well-defined domain of values
C. The right part of the CFG contains the semantic rules
D. All of the above

View Answer





Discussion


* You must be logged in to add comment.