What are the 2 stages of a compiler that it works?
- ishitajuneja01
- Jun 18, 2023
- 1 min read

compiler is one of the most important tools in computer science. It turns code that people can read into directions that machines can follow.
It is divided into 2 stages, the front and back. These stages collaborate to analyze, optimize, and produce efficient code.
This article will look at the phases of a compiler, specifically the front-end and back-end stages.
In addition, we'll look at multiple inheritances in Java, a famous programming language recognized for its object-oriented features.
Let's go into the interesting realm of the phases of compiler and investigate the complexities of their two critical stages.
Stages of Compiler
There are 2 stages of compiler which include the front-end stage and the back end stage. Let's discuss each stage in more detail:
1. Front-End Stage
One of the stages of the compiler is the front-end stage. It is made up of several key processes that evaluate and comprehend the structure and meaning of the source code.
a. Lexical Analysis
Lexical analysis, often known as scanning, is one of the phases of compiler in the front-end stage.
The original code is split into meaningful units called tokens during this procedure. These tokens represent the programming language's simplest building blocks, such as keywords, identifiers, operators, and constants.
The lexical analyzer goes through the source code character by character, recognizing and classifying each token according to established rules and patterns....
Comments