Computer Science, asked by deeksha430, 1 year ago

What is compiler and different types of compiler in compiler design?

Answers

Answered by Anonymous
18
Hello here is your answer by Sujeet yaduvanshi ☝☝☝☝☝☝☝☝


Question:-What is compiler and different types of compiler in compiler design?


Answer:-A compiler translates the code written in one language to some other language without changing the meaning of the program.

Types of Compiler :-

1)single pass compilers,

2)multi pass compilers,

3) cross compilers


4)optimizing compilers. 
Answered by Anonymous
8

Compiler

A compiler is a computer program which converts the High level programming language to Low level programming language or Machine language. The codes written in the High level programming language in a computer are turned into the Machine level programming language by compiler. A computer system cannot understand the high programming language, Hence it is necessary to convert the programming language to Low level programming or Machine level language.

A computer system can only understand the Machine level language and Binary codes. This language is in the form of Binary codes in the form of "0,1". A computer can understand only the language of binary code.

When a programmer simply writes a code or program in the text editor by using programming languages like C and Python. This files containing the code are called as "Source statement". When the code has to be executed, The compiler parses the High level programme to the low level programme, This process is also called as Parsing.

Each and every line passes through the compiler and after the execution of all lines, The output code is created in the form of Binary code. This output of the object is also called as 'Object module'. This object code is nothing but the Machine code that processor can process and execute it.

Later, The processed code is sent to the output unit. And this is how the code is executed and output is shown.

Programming languages like Java, C and C++ uses object oriented language. This helps the compiler to perform it's work with the help of bytecode in bits of seconds. Rather than it, some programming languages are very high level programming languages which don't use Object Oriented Programming language. This programming languages require more time to get executed. Examples of this programming languages can be given as Python and JavaScript.

Additionally, In some Operating systems like Mac and Linux, one more step is to be done before executing the code which is to "resolve the instructions locations and data" for executing the more code at same time.

A compiler contains 2 main parts. 3GL and Assembler. 3GL works with the compiler and High level programming languages. And Assembler works on the code written using assembler language by processor.

Similar questions