compiler design

It's all about self learning.

Bootstrapping and Cross compiler

Learn Bootstrapping, Cross compiler, Complexity of compiler, Examples of Compiler, Difference between Compiler and Interpreter
15 December, 2015     
Applications of Compiler Technology:
  • Techniques used in a lexical analyzer can be used in text editors, information retrieval system, and pattern recognition programs.
  • A high level programming language defines a programming abstraction: The programmer expresses an algorithm using the language, and the compiler must translate that program to the target language.
  • Techniques used in a parser can be used in a query processing system such as SQL.
  • Many software having a complex front-end may need techniques used  in compiler design.
  • Most of the techniques used in compiler design  can be used in Natural Language Processing (NLP) systems.
  • The rapid evolution of computer architectures has also led to an insatiable demand for new complier technology.
  • Used as a Software Productivity Tools.
  • Used in Program translation: Binary Translation, Hardware synthesis ,  Database query Interpreters, Compiled Simulations. 
As we know that source language and target language are two major factors in the structure of a compiler and these two separate languages make the usefulness of separating front and back ends.
but there is third language involved in the compiler construction process i.e. the language in which the complier itself is written. In Unix environment compiler are usually written in C. Even C Compiler are written in C. 
This technique where you use the facilities offered by a language to compile is called as Bootstrapping.   
Compiler may run on one machine and produce object code for another machine such compiler is called a "Cross- Compiler".
A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a Windows PC but generates code that runs on Android Smart phone is a cross compiler.

Compiler language A written in Language B--> Existing Compiler for B Language--> Running complier for A Language .
 It is common to write a compiler in the same language that it is to compile
No compiler for the source language yet exists, the compiler itself cannot be compiled . There are important advantages to be gained from this approach.

Learn from example(see below image)
  • There are 3 host files of different system one is Windows, second is Mac and third is Android.
  • The proprietary native Compiler for Host A (e.g. compiler from MS Studio) is used to build the gcc native compiler for Host A(2).
  • The gcc native compiler for Host A (2) is used to build the gcc cross compiler from machine A to machine B (3).
  • The gcc cross compiler from machine A to machine B (3) is used to build the gcc cross compiler from machine B to machine C (4) 
  • From Windows to Mac and Mac to Android.
  • The end-result cross compiler (4) will not be able to run on build machine A; instead it would run on machine B to compile an application into executable code that would then be copied to machine C and executed on machine C.
  • for ex: GCC, A free software  collection of compilers, can be set up to cross compile. It supports many platforms and languages.
This is the end of introductory part of complier..Hopefully u liked it..
This is just the brief info about Compiler, how , why , what we r going to learn in this course.
Most important is to grab the concept, to learn the technology and every practical aspect of computer science because everything is connected to every other thing.
Today u are learning how one subject is connected to other but after sometime u will learn how one branch of engineering is connected to other one.
U know to grab the concept u need to work hard. First try yourself with these notes and take one standard book to complete the concept and for advance level. After that if you still find yourself in problems take help from others and can also ask me either by call or email.
In student zone you will find my contact info.
But once again i will suggest u to work , to learn yourself. You need to b determine yes v can do anything and nobody can stop us..

Ok till den have fun and visit my website..
In next chapter we will start Complier First Phase LEXICAL ANALYSIS.

Get solution for your websites