PI(1) — USER COMMANDS
NAME
pi − Pascal interpreter code translator
SYNOPSIS
pi [ −b ] [ −l ] [ −L ] [ −n ] [ −o name ] [ −p ] [ −s ] [ −t ] [ −u ] [ −w ] [ −z ]
[ −i name ... ] name.p
DESCRIPTION
Pi translates the program in the file name.p leaving interpreter code in the file obj in the current directory. The interpreter code can be executed using px. Pix performs the functions of pi and px for ‘load and go’ Pascal.
Both pi and pc(1) support ISO Level 1 Standard Pascal, including conformant array parameters. Deviations from the ISO Standard are noted under BUGS below.
OPTIONS
The following flags are interpreted by pi; the associated options can also be controlled in comments within the program; see the Pascal User’s Manual in the Sun Fortran and Pascal Manual for details.
−b Buffer the file output in units of disk blocks, rather than lines.
−i name
Enable the listing for any specified procedures, functions, and include files.
−l Make a program listing during translation.
−L Map all identifiers and keywords to lower case.
−n Begin each listed include file on a new page with a banner line.
−o name
Name the final output file name instead of a.out.
−p Suppress the post-mortem control flow backtrace if an error occurs; suppress statement limit counting.
−s Accept standard Pascal only; non-standard constructs cause warning diagnostics.
−t Suppress runtime tests of subrange variables and treat assert statements as comments.
−u Card image mode; only the first 72 characters of input lines are used.
−w Suppress warning diagnostics.
−z Allow execution profiling with pxp by generating statement counters, and arranging for the creation of the profile data file pmon.out when the resulting object is executed.
FILES
file.pinput file
file.iinclude file(s)
/usr/lib/pi3.∗stringstext of the error messages
/usr/lib/how_pi∗basic usage explanation
objinterpreter code output
SEE ALSO
pix(1), px(1), pxp(1), pxref(1)
Pascal Programmer’s Guide
DIAGNOSTICS
For a basic explanation do
tutorial% pi
In the diagnostic output of the translator, lines containing syntax errors are listed with a flag indicating the point of error. Diagnostic messages indicate the action which the recovery mechanism took in order to be able to continue parsing. Some diagnostics indicate only that the input is ‘malformed.’ This occurs if the recovery can find no simple correction to make the input syntactically valid.
Semantic error diagnostics indicate a line in the source text near the point of error. Some errors evoke more than one diagnostic to help pinpoint the error; the follow-up messages begin with an ellipsis ‘...’.
The first character of each error message indicates its class:
EFatal error; no code will be generated.
eNon-fatal error.
wWarning − a potential problem.
sNon-standard Pascal construct warning.
If a severe error occurs which inhibits further processing, the translator will give a diagnostic and then ‘QUIT’.
BUGS
The keyword packed is recognized but has no effect. The ISO standard requires packed and unpacked structures to be distinguished for portability reasons.
Binary set operators are required to have operands with identical types; the ISO standard allows different types, as long as the underlying base types are compatible.
For clarity, semantic errors should be flagged at an appropriate place in the source text, and multiple instances of the ‘same’ semantic error should be summarized at the end of a procedure or function rather than evoking many diagnostics.
When include files are present, diagnostics relating to the last procedure in one file may appear after the beginning of the listing of the next.
Sun Release 3.2 — Last change: 7 November 1984