Dec 232017
Turbo Pascal routine to correctly format Pascal source.
File PFORMAT.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Turbo Pascal routine to correctly format Pascal source.
File Name File Size Zip Size Zip Type
PFORMAT.DOC 4224 1608 deflated
PFORMAT.PAS 26752 6386 deflated

Download File PFORMAT.ZIP Here

Contents of the PFORMAT.DOC file

p F O R M A T
rel 1.01
16 November 1984

Author: Andy Decepida PC1171

Function : pFORMAT reads in an ASCII text file, assumed to
contain a syntactically correct Turbo Pascal
program (source), and generates a copy with
alterations in the case of the letters that
comprise both the contained reserved words and non-
reserved words as per the user's choice.

pFORMAT will NOT (as of this release) indent
logical and physical blocks in a proper hierarchy.

The user is proffered several choices for the formatting of the
output file. These are outlined below.

Options available for PASCAL reserved words (including Turbo
Intrinsics and extensions:

o UPPER-CASE/Capitalize all reserved words;
o LOWER-CASE all reserved words; or,
o Keep the reserved words in an AS-IS (read from the
original file) state.

Options available for Turbo Pascal intrinsics and extensions
to Pascal:

o UPPER-CASE/Capitalize all intrinsics & extensions;
o LOWER-CASE all intrinsics and extensions;
o Keep the intrinsics and extensions in an AS-IS
state; or,
o Use the BORLAND manual type setting of the
intrinsics and extensions (e.g., "TextColor" instead
or "textcolor" or "TEXTCOLOR").

Options available for user-defined identifiers (excluding
text enclosed in the string delimiter [the apostrophe] and
text enclosed in comment delimiters [either the
opening/closing brace or the parentheses-asterisk

o AS-IS.

REMARKS: This is a slow program, don't expect too much from it
in terms of speed. However, for what it will do for you it is

pFORMAT was originally written by the author in UCSD
Pascal for the IBM implementation of the p-SYSTEM. For those of
you who know what that means, this is an improvement in speed as
it is. When & if the author manages to familiarize himself with
BLOCKREAD & BLOCKWRITE, we'll talk more speed then.

pFORMAT can handle strings and comments properly
(that is, the program will leave them as is!). Single- and
multi-line comments are both accomodated. Hint, hint...if you
wish a portion of your code to be untouched by pFORMAT (say you
want to visually isolate/highlight some lines) comment them out
prior to submission to this program.

"pFORMAT" stands for p(retty)-FORMAT(ter.

Finally, pFORMAT is being released by the author to
the public domain via PCCanada and other BBS's. It is
requested by the author that the ethics that have applied to
other public domain programs/utilities be applied to pFORMAT.
Failing that, be guided by your conscience.

andy j s decepida
16 Nov 1984 wcBgF8zuGM{{VjmgPwhv&r=+5

 December 23, 2017  Add comments

Leave a Reply