programming4us
programming4us
DESKTOP

What is a cross-compiler?

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
7/24/2010 8:00:55 PM
1.2 WHAT IS A CROSS-COMPILER?
A cross-compiler is a compiler that runs on one machine and produces object code for another machine. The cross-compiler is used to implement the compiler, which is characterized by three languages:
  1. The source language,

  2. The object language, and

  3. The language in which it is written.

If a compiler has been implemented in its own language, then this arrangement is called a "bootstrap" arrangement. The implementation of a compiler in its own language can be done as follows.

Implementing a Bootstrap Compiler

Suppose we have a new language, L, that we want to make available on machines A and B. As a first step, we can write a small compiler: SCAA, which will translate an S subset of L to the object code for machine A, written in a language available on A. We then write a compiler SCSA, which is compiled in language L and generates object code written in an S subset of L for machine A. But this will not be able to execute unless and until it is translated by SCAA; therefore, SCSA is an input into SCAA, as shown below, producing a compiler for L that will run on machine A and self-generate code for machine A: SCAA.

Now, if we want to produce another compiler to run on and produce code for machine B, the compiler can be written, itself, in L and made available on machine B by using the following steps:


Other  
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
REVIEW
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us
programming4us
 
 
programming4us