Semantic analysis
Semantic analysis is a process in a compiler (of a programming language semantic errors (for example, dividing an integer by another real number ( float ANSI standard ) are checked in the source code and the information for the next phase of compilation, which is the generation of object code .
Semantic and syntactic analysis
Semantic analysis processes syntactic input and transforms it into a simpler representation better suited for code generation. This layer of the compiler is also responsible for analyzing the use of identifiers and linking each one to its declaration. In this situation, it verifies whether the program respects the visibility and portability rules of identifiers. Furthermore, it is also expected that the compilation process verifies whether each defined expression has an appropriate type according to the language's own rules.
The goal of semantic analysis is to work at this level of interrelationship between distinct parts of the program. The basic tasks performed during semantic analysis include type checking, control flow checking, and checking the uniqueness of variable declarations. Depending on the programming language, other types of checks may be necessary.

Post comment