Preview

Design and Development of a Simple Program Compiler Pl/0

Powerful Essays
Open Document
Open Document
16769 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Design and Development of a Simple Program Compiler Pl/0
CHAPTER ONE
COMPILER – A TRANSLATOR
1.0 INTRODUCTION: 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



References: Aho, Alfred & Sethi, Ravi & Ullman, Jeffrey.(2001) “Compilers: Principles, Techniques, and Tools” The Classic Dragon book. Allen, Frances E., (1981)"A History of Language Processor Technology in IBM", IBM Journal of Research and Development, v.25, no.5, Allen, Randy; and Kennedy, Ken, (2001) “Optimizing Compilers for Modern Architectures”, Morgan Kaufmann Publishers, Appel, Andrew (1987) “Modern Compiler Implementation in C/Java/ML” Appel, Andrew Wilson Bornat, Richard, (1979) “Understanding and Writing Compilers: A Do It Yourself Guide”, Macmillan Publishing. Brown, P.J.(2004) “Writing Interactive Compilers and Interpreters” Cambridge University Press, Cooper, Keith D., and Torczon, Linda, (2004) “Engineering a Compiler”, Morgan Kaufmann, Leverett; Cattel; Hobbs; Newcomer; Reiner; Schatz; Wulf,(1980) “An Overview of the Production Quality Compiler-Compiler Project, in Computer” ICT journal vol3(8):38-49 McKeeman, William Marshall; Horning, James J.; Wortman, David B Muchnick, Steven, (1997) “Advanced Compiler Design and Implementation”, Morgan Kaufmann Publishers, Scott, Michael Lee,( 2005) “Programming Language Pragmatics”, Terry, Patrick D., (1997) “Compilers and Compiler Generators: An Introduction with C++”, International Thomson Computer Press, Wirth, Niklaus, (1996) “Compiler Construction”, Addison- Wesley, , 176 pages

You May Also Find These Documents Helpful

  • Good Essays

    The language for which the compiler has been made is named as “M#”. M# is a general-purpose programming language having the most basic functionalities in it. This language basically focuses on the mathematical calculations, which are done using arithmetic operators and a few relational operators. M# is a case sensitive language.…

    • 703 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Computers only understand one language and that is the machine language (binary code). This type of language is represented in a two digit sequence zero (0) or one (1). Computers use this machine language to represent every task that they perform by means of electrical current that go through switches (capacitors). If a switch has current it means that the switch is “ON” in machine language this will be represented as the number “one”. If there is no current going through the switch then it is considered to be “OFF” and represented in binary code as the number “zero”.…

    • 322 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Week 1 Homework

    • 843 Words
    • 5 Pages

    Machine code is the language which the computer hardware understands and executes. Instructions in a high-level language are closer to a natural language, such as English and therefore are easier to understand and learn than machine language.…

    • 843 Words
    • 5 Pages
    Good Essays
  • Better Essays

    Compilation: programs are translated into machine code which can directly execute on the computer. Compiler analyzes the whole code and generates the machine code which makes it very fast process. And due to this, compiled programs don’t require any second application or package to run it. The time takes to create a program from compilation is relatively faster than interpretation. As a disadvantage, compilation process is hardware specific into which machine it get compiled. Architecture of the computer affects…

    • 1672 Words
    • 7 Pages
    Better Essays
  • Good Essays

    • The code for MS Windows is proprietary and closed source, while the code for many Unix distributions (such as Linux) is free and open source.…

    • 567 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Intro to Computers

    • 340 Words
    • 2 Pages

    Most computer software falls into one of three categories: compilers and other translator programs, software applications, and system software. Describe and give examples of each. [RQ, no. 2]…

    • 340 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    pt1420 assignment 1

    • 728 Words
    • 3 Pages

    Programming language is a vital and essential part of computers. Even though you do not actually see these languages, they are the bases and make up of software programs. Software is essential to a computer because without software, a computer can do nothing. All of the software that we use to make our computers useful is created by individuals known as programmers; these programmers use different types of programming languages to develop software programs. The first primitive programming language was actually created for the invention of the ‘difference engine’. This invention created in 1822 by Charles Babbage was a mechanical calculator that would tabulate polynomial functions.…

    • 728 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Ethics

    • 399 Words
    • 2 Pages

    *The motivation for the creation of higher-level programming languages was because people were looking for ways to make coding faster, less error-prone and resemble human grammar and syntax more closely, and are often portable to different operating systems and machines.…

    • 399 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Thought there are numerous computer programming languages in the world today, we will focus on the three basic fundamental types of computer programming languages.…

    • 1318 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    as its name means, was one of the most simple but high-level programming language to…

    • 1671 Words
    • 7 Pages
    Good Essays
  • Good Essays

    Compiler helps to improve the performance by performing some optimization techniques, such as reducing the code size or increase memory re-use. In this section, we study the relation between compiler optimization and error propagation. Two loop transformation optimization, loop tiling and the loop unrolling are examined in detail.…

    • 763 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Cupl

    • 10116 Words
    • 41 Pages

    A TMEL – WinCUPL ............................................................ USER’S MANUAL 2 Table of Contents Section 1 Introduction to Programmable Logic ................................................ 1-1 1.1 What is Programmable Logic? ................................................ 1-1 1.2 Device Technologies and Packaging ...................................... 1-6 1.3 Programming Logic Devices ................................................... 1-7 1.4 Functionally Testing Logic Devices ......................................... 1-7 Section 2 Designing with the CUPL™ Language ............................................. 2-1 2.1 Declaration of Language Elements ......................................... 2-1 2.2 Usage of the Language Syntax ............................................... 2-2 2.3 Advanced Language Syntax ................................................. 2-14 Section 3 Using the CUPL Compiler ............................................................... 3-1 3.1 About The Compiler ................................................................ 3-1 3.2 Output File Format Descriptions .............................................. 3-6 Section 4 CUPL Tutorial .................................................................................. 4-1 4.1 Tutorial for Gates .................................................................... 4-1 4.2 Tutorial for COUNT10 ............................................................. 4-3 4.3 Tutorial for SQUARE.PLD ....................................................... 4-5 Section 5 CUPL Software Features ................................................................. 5-1 5.1 CUPL - PALexpert ................................................................... 5-1 5.2 CUPL - PLDmaster .................................................................. 5-1 5.3 CUPL - Total Designer ............................................................ 5-1 5.4 CUPL -…

    • 10116 Words
    • 41 Pages
    Powerful Essays
  • Satisfactory Essays

    Java is an object-oriented language similar to C++, but simplified to eliminate language features that cause common programming errors. Java source code files (files with a .java extension) are compiled into a format calledbytecode (files with a .class extension), which can then be executed by a Javainterpreter.…

    • 346 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Top Tech Trends of 2012

    • 511 Words
    • 4 Pages

    a.) Draw a DFA that accepts all strings in (a + b)* that do not contain bababb as a substring…

    • 511 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Compiler Design

    • 7419 Words
    • 30 Pages

    DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 2007-2008, EVEN SEMESTER PRINCIPLES OF COMPILER DESIGN-CS1352 TWO-MARK QUESTIONS 1. What does translator mean? A translator is a program that takes a input program on one programming language (source language) and produces output in another language (object language or target language). 2. What are the phases of a compiler? • Lexical analysis phase or scanning phase • Syntax analysis phase • Intermediate code generation • Code optimization • Code generation 3. What is the role of lexical analysis phase? Lexical analyzer reads the source program one character at a time, and grouped into a sequence of atomic units called tokens. Identifiers, keywords, constants, operators and punctuation symbols such as commas, parenthesis, are typical tokens. 4. Define lexeme? The character sequence forming a token is called lexeme for the token. 5. What are the two functions of parser?  It checks the tokens appearing in its input, which is output of the lexical analyzer.  It involves grouping the tokens of source program into grammatical phrases that are used by the compiler to synthesize the output. Usually grammatical phrases of the source program are represented by tree like structure called parse tree. 6. Mention the role of semantic analysis? Semantic analysis checks the source program for semantic errors and gathers information for the subsequent code-generation phase. It uses hierarchical structure to identify the operators and operands of expressions and statements. An important component of semantic analysis is type checking .In type checking the compiler checks that each operator has operands that are permitted by the source language specification.…

    • 7419 Words
    • 30 Pages
    Good Essays

Related Topics