Skip to main content

Compiler Design & Construction Basic Concepts

Compiler Design & Construction Basic Concepts

Compiler Design & Construction Basic ConceptsDefinition of Compiler Design & Construction Basic Concepts – A compiler is a computer program which is used to convert high level language (Source code) into another program (target code), which are easily executable by computer machine. The target code is in the binary form which is executable by CPU of a Computer System. Alternatively, the compiler is designed to convert High level language into low level language (e.g. Assembly language or machine code). The conversion is required because the HLL language is not understandable or executable by computer operating system or CPU. The CPU processor only execute machine language code or binary codes. The compiler can also translate the high level source programs into target program in machine language for the specific hardware.

What is Cross Compiler?

The compiler that runs on one computer but produces object code for a different type of computer. Since the compiler program is working on computer-A but it is producing Object code for Computer-B. This type of compiler is called as Cross Compiler.

What is Decompiler?

The Program which translates low level languages into High level language is called as Decompiler. The computer program which takes an executable file as input and convert it into Source file (HLL), which can be compiled further. In reality the Decompiler are unable to reconstruct the original source code, there remains some obfuscated code.

What are the Types of Compiler?

There are many types of compiler being design according to the Application areas.

  1. Source to Source Compiler – The compiler which takes high level language as input and outputs a High level language after conversion. Ex – Automatic Parallelizing Compiler

  2. Hardware Compilers – The compiler output target computer hardware at a very low level. Such compilers are also called as hardware compilers because the source code they compile controls the final configuration of the hardware and how it operates. The output of these compilation shows an interconnection of transistors or lookup tables. Example – XST (Xilinx Synthesis Tool) is used to configure FPGAs.

  3. Bytecode Compilers – The compiler which compile source code into assembly language. Warren Abstract Machine (WAM), bytecode compiler for java and python are some examples.

  4. JIT (Just In Time) Compiler – It is the last part of a multi-pass compiler chain in which some compilation stages are deferred to run-time.
    Ex – Smalltalk, Microsoft .NETs CIL System.

What is Interpreter?

The interpreter is a computer program which executes directly instructions written in a program or scripting language without being previously compiled into machine language. The interpreter translate one statement at a time.

What are the difference between Interpreter and Compiler?

  1. Interpreter translates one statement at a time. But Compiler scans the entire program and translates it as a whole into machine code.

  2. Interpreter takes less amount of time to analyze the source code but the overall execution time is slower. But compiler takes large amount of time to analyze the source code but the overall execution time is comparatively faster.

  3. The interpreter translate the program until the first error is met. So debugging is easy. The Compiler It shows the error message only after scanning the whole program. So debugging is comparatively hard.

  4. Interpreter are used in language like Python, Ruby. In case of Compiler C, C++ Programming language use Compiler. Compiler Design & Construction Basic Concepts.

Popular posts from this blog

Fix Windows could not find a driver for your network adapter error

Fix Windows could not find a driver for your network adapter error

A Computer run smoothly with the coordination of Software & Hardware. In the absence of any one it will not run at all. Software being the Master utilizes each hardware attached to the System. And each hardware is operated with the help of Device Drivers installed in it. Operating System (OS) uses these device drivers to control & utilize each hardware when needed. Each hardware connected to the system must have their own Device Driver installed. A device driver is a program to initiate a hardware when required by Operating System.

Suppose, you want your PC to connect to the Network, it can only be possible when your PC has network related Device Driver. These Device Drivers are easily downloaded from Manufacturer Websites. In this article we focus on Network related problem. Suppose, your PC not obtaining Network connectivity. And each time you are getting an error message saying "Windows could not find a d…

Fix This Site Can’t Be Loaded from The Cache Chrome Error

Fix This Site Can't Be Loaded from The Cache Chrome Error

This Site Can’t Be Loaded from The Cache - Today, there are several browsers available with extensive features on it. Each browser has its own importance and working principle. Some of the popular browsers available online are Google Chrome, Mozilla Firefox, Opera Mini, Internet Explorer, UC Browser, Safari, Microsoft Edge, Swift fox etc. The popularity of these browsers depends upon the features available in it.

Among them Google Chrome is the newest and mostly used browser around the world. Holding lots of feature make it more complex and hence more prone to errors. The types of error come up with the level of complexity of the program. If you are Chrome user and facing one of such error then read the full article. In this article, we focus on an error saying "This site can't be loaded from the cache". The explanation included with this error will be "The saved (cached) copy of this site was unreadable&qu…

Change Facebook Profile Picture Leaving All Unknown

Change Facebook Profile Picture Leaving All Unknown

Change Facebook Profile Picture Leaving All Unknown - Today, we spend lots of time in Social media platforms such as WhatsApp, Facebook, Instagram, Skype, YouTube, Twitter etc. We love to share Images & Videos with our friends via these platforms. These applications are largely used on Smartphones. We need to download concerned apps from inbuilt software, Play Store in Android Platform.

After downloading the App, we create an ideal account with a profile picture. We join the network by sending friend request. When request is accepted, we are added to such a community. In this article we take a close look on Facebook. Facebook is vastly used all around the world. Two person residing miles away can also share their views easily.

Change Facebook Profile Picture Leaving All Unknown

Whenever we open Facebook, lots of Images & Videos are seen with gentle scroll. In this article we focus on an interesting thing say Profile Picture. In F…