Phases/Structure of Compiler- It takes the high-level language source code as the input.
- It scans the characters of source code from left to right.
- It groups the characters into lexemes.
- Each lexeme corresponds to form a token.
- It removes white spaces and comments.
- It checks and removes the lexical errors.
Three-stage compiler structure. Regardless of the exact number of phases in the compiler design, the phases can be assigned to one of three stages. The stages include a front end, a middle end, and a back end. The front end scans the input and verifies syntax and semantics according to a specific source language.
In a compiler,. linear analysis. is called LEXICAL ANALYSIS or SCANNING and; is performed by the LEXICAL ANALYZER or LEXER,. hierarchical analysis.
The compiler has two modules namely the front end and the back end. Front-end constitutes the Lexical analyzer, semantic analyzer, syntax analyzer, and intermediate code generator. And the rest are assembled to form the back end. It is also called a scanner.
Three-stage compiler structure. Regardless of the exact number of phases in the compiler design, the phases can be assigned to one of three stages. The stages include a front end, a middle end, and a back end. The front end scans the input and verifies syntax and semantics according to a specific source language.