Analysis and synthesis phase of compiler

There are two main phases in the compiler.

1. Analysis - Front end of a compiler

2. Synthesis - Back end of a compiler

In this tutorial, we will learn the role of analysis and synthesis phase of a compiler.




Analysis phase of compiler

Analysis phase reads the source program and splits it into multiple tokens and constructs the intermediate representation of the source program.

And also checks and indicates the syntax and semantic errors of a source program.

It collects information about the source program and prepares the symbol table. Symbol table will be used all over the compilation process.

This is also called as the front end of a compiler.




Synthesis phase of compiler

It will get the analysis phase input(intermediate representation and symbol table) and produces the targeted machine level code.

This is also called as the back end of a compiler.

Compiler Phases