COMPILER – A TRANSLATOR
The compiler is a special type of computer program that translates a human readable text file into a form that the computer can more easily understand. At its most basic level, a computer can only understand two things, a 1 and a 0. At this level, a human being will operate slowly and find the information contained in a long string of 1s and 0s incomprehensible. A Compiler bridges this gap by translating or transforming the source code written in computer language into target language. This target language often have a binary form known as object code. The name compiler is primarily used for programs that translate source code from High Level language to lower level language (eg Assembly language or machine language code). Every high-level programming language (except strictly interpretive languages) comes with a compiler. In effect, the compiler is the language, because it defines which instructions are acceptable. Because compilers translate source code into object code, which is unique for each type of computer, many compilers are available for the same language. For example, there is a FORTRAN compiler for PCs and another for Apple Macintosh computers. In addition, the compiler industry is quite competitive, so there are actually many compilers for each language on each type of computer. More than a dozen companies develop and sell C compilers for the PC.
1.1 BACKGROUND OF STUDY:
Software for early computers was primarily written in assembly language. Higher Level languages were not invented until the benefits of being able to reuse software on different kinds of CPUs started to become significantly greater than the cost of writing a compiler. The very limited memory capacity of early computers also created many technical problems when implementing a compiler.
The methods and techniques of Compiler provide an enabling technology for generating software from specification. They are applicable to a range of problems that are much broader than programming language translation: Processors for input language, design languages, specification languages and intermediate languages in application programs all demand solution to translation problems.
In those early days, the approach taken to compiler design used to be directly affected by the complexity of the processing, the experience of the person(s) designing it and the resources available.
A compiler for a relatively simple language written by one person might be a single monolithic piece of software. When the source language is large and complex, and high quality output is required, the design may be split into a number of relatively independent phases.
1.2 OBJECTIVE OF THE STUDY
The objective of this work is to establish a better understanding between man and computer in addition to this, the objective is also to present a general introduction to the structure and operation of compilers. Knowledge and insight on this subject will both enhance the general understanding of the art of programming in terms of high level languages and will make it easier for programmers to develop their own systems for appropriate and specific purposes and areas of application. The method of translation is unnecessary for an understanding of the relationship between source program and object code, and even much less relevant is knowing how to actually construct a compiler. However, genuine understanding of a subject is best acquired from an in-depth involvement with both concepts and details. In this case, this involvement is nothing less than the construction of an actual compiler.
1.3 STATEMENT OF PROBLEM
The difficulty presented by the man-machine communication.
Difficulty of tracking down program faults caused by incorrect compiler behavior.
1.4 CONTRIBUTION TO ICT
Creating better understanding of the act of compiler construction will make programmers have a clearer picture of...
Please join StudyMode to read the full document