• During the various phases of the compiler, errors may be encountered and such errors must be handled so that the source code is converted to its corresponding object code.

  • The errors are generally in the form of messages

  • The errors that occur in different phases of the compiler are listed below

Phase of the compiler

Type of error encountered

Lexical analyzer

Wrongly spelled tokens

Syntax analyzer

Missing parenthesis

Semantic analyzer

invalid token sequences in type, scope error 

Intermediate code generator

Mismatched operands for an operator

Code Optimizer

When the statement is not reachable

Code Generator

When the memory is full or proper registers are not allocated

Symbol tables

Error of multiple declared identifiers