Download Compilation Systems Volume 1 (Tools)
Transcript
Compilation Systems Volume 1 (Tools) There are hundreds of programming languages available to the computing world. Concurrent Computer Corporation supports a few of the most popular languages: C See the Concurrent C Reference Manual Fortran See the hf77 Fortran Reference Manual Ada See the HAPSE Reference Manual assembly language See Chapter 2 (“Assembler and Assembly Language”) in this manual. C, Fortran, and Ada are often referred to as high-level languages. The source code for programs written in these languages is fairly portable across computer systems provided by different manufacturers. In addition, these programs can be accepted and processed by compilers produced by different software vendors. The literary world provides an abundance of books and references on these languages. Assembly language is often referred to as a low-level language. This language provides mnemonics and directives which usually map one-to-one with the instruction set and resources of the computer system. All of these languages are supported for the supporting hardware platforms. Compilation Systems Concepts 1 A compilation system is a set of language processors, commands, utilities, and libraries which can be used in the development of software programs. Compilation systems convert source code into binary programs which can be executed on a computer. In addition, they provide tools and facilities for debugging and analyzing program behavior and characteristics. At the heart of a compilation system is the language processor. Usually, this is the compiler. A compiler is a program which accepts, as input, source code written in a highlevel language. It processes this input and produces a lower-level representation of the source code. This new representation can be an assembly language representation of the higher-level source code, making it necessary to run an assembler to produce a machinelevel representation of the code. Sometimes a compiler will translate the high-level language directly into the machine-level representation. A compiler analyzes the source code, both syntactically and semantically. A good compiler detects as many errors as it can locate, enabling the programmer to correct them before they occur during execution of the program. A good compiler can also optimize the program. Optimization transforms the program, allowing it to run faster and more efficiently. Some languages are processed by an interpreter. Whereas a compiler produces output that must be further processed and then executed, an interpreter performs “on the fly” translation and execution of the program. Assembly language is processed by an assembler. Assemblers are usually less sophisticated than compilers and interpreters. An assembler often does nothing more than convert the specified assembly language instructions and directives into machine instructions. 1-2