Node:Highlights, Next:News, Previous:Welcome, Up:Top
The GNU Pascal Compiler (GPC) is, as the name says, the Pascal compiler of the GNU family (see GNU). This means:
The compiler supports the following language standards and quasi-standards:
Get
and Put
procedures. Read ahead from files without temporary variables.
[Example] This allows you, for instance, to
validate numeric input from text files before reading without
conversion through strings. [Example]
goto
. (Yes, goto
has its place when it is not
restricted to the current routine.) [Example]
New
.
[Example]
ReadStr
and WriteStr
. Read from and write to strings
with the full comfort of ReadLn
/WriteLn
.
[Example]
for Ch in ['A' .. 'Z', 'a' .. 'z'] do ...
[Example]
Card
)
Succ
and Pred
functions
(foo := Succ (bar, 5);
).
pow
and **
) for real
and complex numbers.
base#number
.
MinReal
, MaxReal
, EpsReal
, MaxChar
constants.
absolute
variables portable. [Example]
![]() (PNG, 21 kB) |
Random
function can produce the same sequence of
pseudo-random numbers as BP does - if you need that instead of the
much more elaborate default algorithm.
Ports
unit lets you access CPU I/O ports on systems where
this makes sense. [Example]
GPC for BP
unit which provides some of GPC's features
for BP, and some routines to access sets of large memory blocks in a
uniform way under GPC and BP (even in real mode).
[Example]
binobj
utility.
[Example]
abstract
object types and methods
is
and as
operators to test object type
membership
//
SetLength
procedure for strings makes it unnecessary
to use dirty tricks like assignments to the "zeroth character".
Initialize
and Finalize
for low-level handling
of variables.
+
.
{$L foo.c}
make it easy to
maintain projects written in multiple languages, e.g., including
code written in other languages into Pascal programs
[Example (Pascal part)]
[Example (C part)],
BitSizeOf
and ConvertFromBigEndian
help you to deal with different data sizes and endianesses.
[Example]
DirSeparator
,
PathSeparator
, GetTempDirectory
help you to write
programs that look and feel "at home" on all operating systems.
PExecute
routine lets you execute child processes in a
portable way that takes full advantage of multitasking environments.
[Example]
FSplit
or FSearch
or FExpand
know
about the specifics of the various different operating systems.
[Example]
FormatTime
function lets you format date and time values,
according to various formatting rules.
[Example]
Pipe
unit gives you inter-process communication even under
plain DOS. [Example]
[Demo process for the example]
RegEx
unit you can do searches with regular
expressions. [Example]
GMP
) unit allows you to do
arithmetics with integer, real, and rational numbers of arbitrary
precision.
[Example: factorial]
[Example: fibonacci]
[Example: power]
[Example: real power]
[Example: pi]
ReadDir
, StatFS
or
FileLock
provide an efficient, easy-to-use and portable
interface to the operating system. [Example]
[Example] [Example]
DosUnix
unit compensates for some of the incompatibilities
between two families of operating systems.
[Example]
MD5
unit to compute MD5 message digests, according to RFC
1321. [Example]
FileUtils
unit which provides some higher-level file and
directory handling routines. [Example]
StringUtils
unit which provides some higher-level string
handling routines. [Example]
Intl
unit for internationalization.
[Example] [Example]
Trap
unit to trap runtime errors and handle them within
your program. [Example]
TFDD
unit that provides some tricks with text files, e.g. a
"tee" file which causes everything written to it to be written to
two other files. [Example]
HeapMon
unit to help you find memory leaks in your
programs.
The demo programs mentioned above are available both on the WWW and in GPC source and binary distributions.
Co-workers welcome!
Able, committed programmers are always welcome in the GNU Pascal team. If you want to be independent of companies that you must pay for getting a compiler with more restrictive licensing conditions that only runs on one operating system, be invited to join the development team, Acknowledgments.