Front-end: The process by which the compiler analyzes and understands the program code.
Lexical analysis, word segmentation
How it works: Finite state machines, such as LEX GNULEX
Syntax analysis: Generate the syntax structure of the program (abstract syntax number AST) according to the grammar rules
Recursive descent method, Yacc, JavaCC, GNU Bison, Antlr
Semantic analysis: contextual analysis to disambiguate
* Variable reference resolution, scope \~\~ ~\~ ~ ~
* Legitimacy check
* Data type identification
* Some results of semantic analysis are annotated on the AST as attributes
Backend: The process of generating target code, relative to the target machine.