Phases of a Compiler

A compiler is a computer program that translate text written in a computer language into another.

The compiler has a number of phases and symbol table manager and an error handler.

The Phases of the compiler are:

1. Input source program
2. Lexical analyzer
3. Syntax Analyzer
4. Semantic Analyzer
5. Intermediate code generator
6. Code Optimizer
7. Code Generator
8. Target Program

Symbol Table System - An essential function of a compiler is to record the identifiers used in the source program and collect information about various attributes of each identifier.

Error Detection - each phase can encounter errors. After detecting an errors, a phase must somehow deal with that errors, so that compilation can proceed, allowing further errors in the source program to be detected.

No comments: