Slide 1Lexical Analysis Dragon Book: chapter 3 Slide 2 Compiler structure Lexical analyzer Syntax analyzer Semantic analyzer Intermediate code generator Code optimizer Code…