C++ Compiler & IDE

C++ Compiler & IDE

What is a Compiler?

A compiler is a software program that converts high-level source into a low-level object code in machine language. The process of converting high-level language into machine language is known as compilation.

The processor executes object code, which indicates when binary high and low signals are required in the arithmetic logic unit of the processor.

Explain

C++ is a high-level language. A high-level programming language understandable by us humans. Its words and phrases similar to English or another human language. But a computer does not understand high-level programming language that ate readable for a human. The computer understands the only binary language that is based on 1’s and 0’s, it is called the machine code.

A program written in the high-level programming language is called a source code. If we want to convert source code into machine code then we need a Software, called compiler or Interpreter that convert high language to machine language

What is the Difference between Compiler and Interpreter?

Comparison CompilerInterpreter
TechniquesConvert entire program to machine languageConvert program one statement at a time into machine language
ExamplesC / C++ languages use compilerRuby, Python, Basic use Interpreter
SpeedThe compiler is Faster than an interpreterThe interpreter is slower than the compiler
DebuggingErrors check on Entire programErrors check on Line By Line of the program generated
MemoryMore memory due to object code is generatedUse less memory due to no intermediate object code  

A compiler executes four major steps:

Scanning: 

In Compiler scanner phase, it reads one character at a time from the source code and keeps track of which character is present in which line.

Lexical Analysis: 

In the Compiler Lexical Analysis phase, it converts the sequence of characters that appear in the source code into a series of strings of characters known as tokens.

Syntactic Analysis: 

In the Compiler Syntactic analysis phase, it is performed, which involves preprocessing to determine whether the tokens created during lexical analysis are in proper order as per their usage.

Semantic Analysis: 

In Compiler Semantic Analysis or context-sensitive analysis is a process in compiler construction, usually after parsing, to gather necessary semantic information (Semantic analysis is the task of ensuring that the declarations and statements of a program are semantically correct) from the source code

     There are following top Compiler list for C++.

  •      Borland C++ / Turbo C++ [Old and most popular IDE]
  •      Visual C++ [Microsoft Platform]
  •      Dev C++
  •      GCC
  •      Eclipse