COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Syntax Analysis
|
|
Semantic Analysis
|
|
Code Optimization
|
|
Code Generation
|
Detailed explanation-1: -Type checking is the process of verifying that each operation executed in a program respects the type system of the language. This generally means that all operands in any expression are of appropriate types and number. Much of what we do in the semantic analysis phase is type checking.
Detailed explanation-2: -Type checking is an important part of semantic analysis where compiler makes sure that each operator has matching operands. Semantic Analyzer: It uses syntax tree and symbol table to check whether the given program is semantically consistent with language definition.
Detailed explanation-3: -Simply put, semantic analysis is the process of drawing meaning from text. It allows computers to understand and interpret sentences, paragraphs, or whole documents, by analyzing their grammatical structure, and identifying relationships between individual words in a particular context.
Detailed explanation-4: -Semantic analysis is examined at three basic levels: Semantic features of words in a text, Semantic roles of words in a text and Lexical relationship between words in a text.
Detailed explanation-5: -The semantic analysis process begins by studying and analyzing the dictionary definitions and meanings of individual words also referred to as lexical semantics. Following this, the relationship between words in a sentence is examined to provide clear understanding of the context.