Presentation is loading. Please wait.

Presentation is loading. Please wait.

PASCAL. HISTORY OF PASCAL Developed by Niklaus Wirth a member of the International Federation of Information Processing(IFIP) To provide features that.

Similar presentations


Presentation on theme: "PASCAL. HISTORY OF PASCAL Developed by Niklaus Wirth a member of the International Federation of Information Processing(IFIP) To provide features that."— Presentation transcript:

1 PASCAL

2 HISTORY OF PASCAL Developed by Niklaus Wirth a member of the International Federation of Information Processing(IFIP) To provide features that were lacking in other languages of the time Pascal was named after the mathmatician Blaise Pasca, descendent from ALGOL 60 which Wirth helped develop. Pascal draws programming components from ALGOL 68, ALGOL –W. Original Published definition for the Pascal language appeared in 1971 with latter revisions published in 1973. Designed to teach programming techniques and topics to college students from the late 1960’s to the late 1980’s.

3 TURBO PASCAL Is a software development system that includes a compiler and an Integrated Development Environment(IDE) for the Pascal programming language running MS-DOS. Developed by Borland while the original cheap and widely known version was sold as TURBO PASCAL. Borland released three old versions of Turbo Pascal free of charge because of their historical interest versions 1.0, 3.02, 5.5 for MS-DOS, Macintosh

4

5 Brief Description Wirth’s intention was to create an efficient language(regarding both compilation speed and generated code) based on structured programming. Pascal has important features included records, enumerations, subranges, dynamically allocated variables with associated pointers, and sets. Pascal has a strong typing on all objects – meaning that one type of data cannot be converted or interpreted as another without explicit conversion Other Languages that influenced Pascal’s development were COBOL, SIMULA 67, ALGOL-W Pascal like many programming languages allows nested procedure definitions to any level of depth, allows most kinds of definitions and declaration inside procedures and functions.

6 Implementations The first Pascal compiler was designed in Zurich for the CDC 6000 series mainframe computer family. Niklaus Wirth reports that a first attempt to implement it in Fortran in 1969 was unsuccessful due to Fortran's inadequacy to express complex data structures.compilerZurichCDC 6000 seriesmainframe computerFortran The second attempt was formulated in the Pascal language itself and was operational by mid-1970. Many Pascal compilers since have been similarly self-hosting, that is, the compiler is itself written in Pascal, and the compiler is usually capable of recompiling itself when new features are added to the language, or when the compiler is to be ported to a new environment. The GNU Pascal compiler is one notable exception, being written in C.self-hostingportedGNU Pascal

7 Language Constructs Included the traditional array of Algol like control structures with reserved words such as if,then,else,while, for. Hello World Program Program HelloWorld(output); begin writeln('Hello, world!') end.

8 Data Types

9 Scalar Types Pascal's scalar types are real, integer, character, boolean and enumerations, a new type constructor introduced with Pascal:realintegercharacterbooleanenumerations

10 Subrange Types Subranges of any ordinal type (any simple type except real) can be made:

11 Set Types A set is a fundamental concept for modern mathematics, and they may be used in a great many algorithms. Such a feature is highly useful and may be faster than an equivalent construct in a language that does not support sets. For example, for many Pascal compilers: if i in [5..10] then executes faster than if (i>4) and (i<11) then

12 Type Declarations Types can be defined from other types using type declarations: type x = Integer; y = x;... Further, complex types can be constructed from simple types: type a = Array [1..10] of Integer; b = record x: Integer; y: Char end; c = File of a;

13 File Type As shown in the example above, Pascal files are sequences of components. Every file has a buffer variable which is denoted by f^. The procedures get (for reading) and put (for writing) move the buffer variable to the next element. Read is introduced such that read(f, x) is the same as x:=f^; get(f);. Write is introduced such that write(f, x) is the same as f^ := x; put(f); The type text is predefined as file of char. While the buffer variable could be used to inspect the next character that would be used (check for a digit before reading an integer), this concept lead to serious problems with interactive programs with early implementations, but was solved later with the "lazy I/O" concept.files In Jensen & Wirth Pascal, strings are represented as packed arrays of chars; they therefore have fixed length and are usually space-padded. Some dialects have a custom string type.

14 Pointer Types Pascal supports the use of pointers:pointers type a = ^b; b = record a: Integer; b: Char; c: a end; var pointertob: a;

15 Control Structures Pascal is a structured programming language, meaning that the flow of control is structured into standard statements, ideally without 'go to' commands.structured programminggo to

16 Procedures and Functions Procedures and functions can nest to any depth, and the 'program' construct is the logical outermost block. Each procedure or function can have its own declarations of goto labels, constants, types, variables, and other procedures and functions, which must all be in that order. This ordering requirement was originally intended to allow efficient single- pass compilation. However, in some dialects the strict ordering requirement of declaration sections is not required.

17

18 Semicolon as Statement Separators Pascal adopted many language syntax features from the ALGOL language, including the use of a semicolon as a statement separator. no semicolon is needed before the end keyword of a record type declaration, a block, or a case statement; before theuntil keyword of a repeat statement; and before the else keyword of an if statement.ALGOL (* skip blanks *) while GetChar() = ' ' do ; if alarm then; begin; SendMayday; EjectPilot; end;

19 Compilers and Interpreters Delphi is CodeGear's (formerly Borland) flagship RAD (Rapid Application Development) product. DelphiRapid Application Development Free Pascal is a multi-platform compiler written in Pascal (it is Self- hosting). It is aimed at providing a convenient and powerful compiler, both able to compile legacy applications and to be the means of developing new ones. Free PascalSelf- hosting Lazarus is a Delphi-like visual cross-platform IDE for RAD (Rapid Application Development). Based on FreePascal, Lazarus is available for numerous platforms including Linux, FreeBSD, Mac OS Xand Microsoft Windows. LazarusRapid Application DevelopmentFreePascalLinuxFreeBSDMac OS XMicrosoft Windows Pascal (programming language) - Wikipedia, the free encyclopedia

20 Object Pascal Branch of object-oriented derivatives of Pascal mostly known as the primary programming language of Delphi Pascal compilers run very fast while producing highly optimized code

21


Download ppt "PASCAL. HISTORY OF PASCAL Developed by Niklaus Wirth a member of the International Federation of Information Processing(IFIP) To provide features that."

Similar presentations


Ads by Google