Menu

The Pascal Language

Trevor Blight

The Pascal Language

-- There's lots of tutorials & learning material on the internet.

Note that p5c follows iso standard pascal and is slightly different to the popular turbo pascal. Try to favour learning material that makes the differences clear.
Start with these:
http://www.operationpurify.bluefile.cz/pascal
https://www.cmpe.boun.edu.tr/~say/c150/pascal/firstpascal.htm
http://xoomer.virgilio.it/gciabu/engl/pascal/pstart.htm
http://www.dsi.unive.it/~franz/pascal/pstart.htm
http://physinfo.ulb.ac.be/cit_courseware/pascal/pstart.htm

Here's a set of lecture notes on standard pascal:
http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/17/017/17017761.pdf?r=1
All very relevant for p5c up to Appendix B.

The following tutorials are also very good, but assume turbo pascal. Some of their examples need modifying as explained below.

http://www.tutorialspoint.com/pascal/index.htm
http://en.wikibooks.org/wiki/Pascal_Programming
http://www.pascal-programming.info/index.php
http://www.taoyue.com/tutorials/pascal/index.html

One important difference is that iso pascal needs header parameters for input & output if the program reads from standard input and writes to standard output.
Here's the hello world program in iso standard pascal:

    program hello(input, output);  {input & output parameters needed for iso pascal}
    begin
        writeln('hello world');
        writeln('press enter to exit program'); {this might or might not be needed}
        readln;
    end.

reference material

  • The classic reference to iso pascal is "Pascal User Manual and Report" by Jensen & Wirth.

  • pascal language reference manual , from Hewlett Packard
    This is a good technical level description of ISO pascal (also known as ANSI Pascal).
    Each feature in p5c pascal has an excellent description in this reference.
    Note that this document describes features that are a superset of iso pascal, and hence are not present in p5c pascal.
    Ch 1 provides the only guide as to which features belong to the superset.

The following documents can be found at http://pascal-central.com/docs/

  • pascal-programming.pdf
    good for getting started and building up to large projects. Assumes codewarior pascal, so some features of the language are not the same as iso pascal.

  • iso7185
    THE pascal standard, for uber geeks. There's an online version here

  • pascal1973.pdf
    early version of Jensen & Wirth

  • pascal reference manual
    open VMS pascal reference manual. Contains a good technical level description of iso pascal. Note that this describes a highly professional version of pascal of which iso pascal is only a small subset. It clearly differentiates between standard pascal and the extensions. If you need another description of some feature in p5c pascal, it can almost certainly be found here.

There's more useful reference material on standard pascal here
This site is a gold mine of infomation on pascal and closely related languages. It contains the sources for
a few versions of pascal, including PASCAL-M a version of pascal for small machines.

Here's a summary of the pascal rules, taken from the p5 project.

Contents

the pascal language
using the p5c compiler
p5x - pascal extensions
implementation notes


Related

Wiki: -quick summary
Wiki: Home
Wiki: The Pascal Language
Wiki: implementation notes
Wiki: pascal rules
Wiki: using the p5c compiler
Wiki: using the p5x compiler

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.