Semantic analysis is best defined as which of the following?
- A. The first phase of compilation that converts source code into a sequence of tokens.
- B. A top-down parsing technique that uses a set of recursive procedures to process the input grammar.
- C. A tree representation showing the syntactic structure of source code according to grammar rules.
- D. The compiler phase that checks source code for meaningful correctness, such as type consistency. ✓
Correct answer
D. The compiler phase that checks source code for meaningful correctness, such as type consistency.
Explanation
Semantic analysis refers to the compiler phase that checks source code for meaningful correctness, such as type consistency.