This article, and the one to follow, are based on a Software Development class I taught a few years ago. The students in this class were non-programmers who had been hired to receive bug reports for a compiler product. As Analysts, they had to understand the software compilation process in some detail, even though some of them had never written a single line of code. It was a fun class to teach, so I'm hoping that the subject translates into interesting reading. In this article, I'm going to discuss the process that the computer goes through to compile source code into an executable program. I won't be clouding the issue with the Make environment, or Revision Control, like I necessarily did in the class.
Compiling a C program:- Behind the Scenes - GeeksforGeeks
In the series of C tutorial we learned some basic of C programming language , configured C compiler and learned to compile and execute C program. Since the compilation and execution of first C program , I must answer few questions before moving ahead. Questions such as - what is meant by compilation, what happens during compilation, how a simple plain text file gets converted to executable binary file. The process of translating source code written in high level to low level machine code is called as Compilation. The compilation is done by a special software known as compiler. The compiler checks source code for any syntactical or structural errors and generates object code with extension. The below image describes the entire C compilation process.
The compilation is a process of converting the source code into object code. It is done with the help of the compiler. The compiler checks the source code for the syntactical or structural errors, and if the source code is error-free, then it generates the object code. The c compilation process converts the source code taken as input into the object code or machine code.
The compilation process is a sequence of various phases. Each phase takes input from its previous stage, has its own representation of source program, and feeds its output to the next phase of the compiler. Let us understand the phases of a compiler. The first phase of scanner works as a text scanner.