A1. The main phases include lexical analysis, syntax analysis, semantic analysis, optimization, and code generation.