+ All Categories

PASCAL

Date post: 22-Feb-2016
Category:
Upload: dionne
View: 52 times
Download: 0 times
Share this document with a friend
Description:
PASCAL . 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 - PowerPoint PPT Presentation
Popular Tags:
21
PASCAL
Transcript
Page 1: PASCAL

PASCAL

Page 2: PASCAL

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.

Page 3: PASCAL

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

Page 4: PASCAL
Page 5: PASCAL

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.

Page 6: PASCAL

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.

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.

Page 7: PASCAL

Language ConstructsIncluded the traditional array of

Algol like control structures with reserved words such as if,then,else,while, for.

Hello World ProgramProgram

HelloWorld(output); begin

writeln('Hello, world!') end.

Page 8: PASCAL

Data Types

Page 9: PASCAL

Scalar Types Pascal's scalar types are real, integer, character, boolean

 and enumerations, a new type constructor introduced with Pascal:

Page 10: PASCAL

Subrange TypesSubranges of any ordinal type

(any simple type except real) can be made:

Page 11: PASCAL

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] thenexecutes faster thanif (i>4) and (i<11) then

Page 12: PASCAL

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;

Page 13: PASCAL

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.

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.

Page 14: PASCAL

Pointer TypesPascal supports the use of pointers:

type a = ^b; b = record

a: Integer; b: Char; c: a

end; var

pointertob: a;

Page 15: PASCAL

Control Structures Pascal is a structured programming language, meaning that

the flow of control is structured into standard statements, ideally without 'go to' commands.

Page 16: PASCAL

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.

Page 17: PASCAL
Page 18: PASCAL

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.

(* skip blanks *) while GetChar() = ' ' do ;

if alarm then; begin;

SendMayday; EjectPilot;

end;

Page 19: PASCAL

Compilers and Interpreters

Delphi is CodeGear's (formerly Borland) flagship RAD (Rapid Application Development) product.

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.

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.

Pascal (programming language) - Wikipedia, the free encyclopedia

Page 20: PASCAL

Object PascalBranch 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

Page 21: PASCAL

Recommended