xref: /original-bsd/usr.bin/pascal/pi/pi.1 (revision c3e32dec)
1.\" Copyright (c) 1980, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)pi.1	8.1 (Berkeley) 06/06/93
7.\"
8.Dd
9.Dt PI 1
10.Os BSD 4
11.Sh NAME
12.Nm pi
13.Nd Pascal interpreter code translator
14.Sh SYNOPSIS
15.Nm \&pi
16.Op Fl blnpstuwz
17.Op Fl i Ar name ...
18.Ar name.p
19.Sh DESCRIPTION
20.Nm \&Pi
21translates the program in the file
22.Ar name.p
23leaving interpreter code in the file
24.Pa obj
25in the current directory.
26The interpreter code can be executed using
27.Nm \&px .
28.Nm \&Pix
29performs the functions of
30.Nm \&pi
31and
32.Nm \&px
33for `load and go' Pascal.
34.Pp
35The following flags are interpreted by
36.Nm \&pi ;
37the associated options can also be controlled in comments within the program
38as described in the
39.%T "Berkeley Pascal User's Manual" .
40.Bl -tag -width indent
41.It Fl b
42Block buffer the file
43.Ar output .
44.It Fl i
45Enable the listing for
46any specified procedures and functions and while processing any specified
47.Ic include
48files.
49.It Fl l
50Make a program listing during translation.
51.It Fl n
52Begin each listed
53.Ic include
54file on a new page with a banner line.
55.It Fl p
56Suppress the post-mortem control flow backtrace
57if an error occurs;
58suppress statement limit counting.
59.It Fl s
60Accept standard Pascal only;
61non-standard constructs cause warning diagnostics.
62.It Fl t
63Suppress runtime tests of subrange variables and treat
64.Ic assert
65statements as comments.
66.It Fl u
67Card image mode;
68only the first 72 characters of input lines are used.
69.It Fl w
70Suppress warning diagnostics.
71.It Fl z
72Allow execution profiling with
73.Nm pxp
74by generating statement counters, and arranging for the
75creation of the profile data file
76.Pa pmon.out
77when the resulting object is executed.
78.El
79.Sh FILES
80.Bl -tag -width /usr/lib/pi1.*strings -compact
81.It Pa file.p
82Input file.
83.It Pa file.i
84Include file(s).
85.It Pa /usr/lib/pi2.*strings
86Text of the error messages.
87.It Pa /usr/lib/how_pi*
88Basic usage explanation.
89.It Pa obj
90Interpreter code output.
91.El
92.Sh SEE ALSO
93.Xr pix 1 ,
94.Xr \&px 1 ,
95.Xr pxp 1 ,
96.Xr pxref 1
97.Rs
98.%T "Berkeley Pascal User's Manual"
99.Re
100.Sh DIAGNOSTICS
101For a basic explanation do
102.Bd -literal -offset indent
103pi
104.Ed
105.Pp
106In the diagnostic output of the translator,
107lines containing syntax errors are listed with a flag indicating the
108point of error.
109Diagnostic messages indicate the action which the recovery mechanism
110took in order to be able to continue parsing.
111Some diagnostics indicate only that the input is `malformed.'
112This occurs if the recovery can find no simple correction to make the input
113syntactically valid.
114.Pp
115Semantic error diagnostics indicate a line in the source text near the
116point of error.
117Some errors evoke more than one diagnostic to help pinpoint the error;
118the follow-up messages begin with an ellipsis `...'.
119.Pp
120The first character of each error message indicates its class:
121.Pp
122.Bl -tag -width indent -compact -offset indent
123.It Li E
124Fatal error; no code will be generated.
125.It Li e
126Non-fatal error.
127.It Li w
128Warning \- a potential problem.
129.It Li s
130Non-standard Pascal construct warning.
131.El
132.Pp
133If a severe error occurs which inhibits further processing,
134the translator will give a diagnostic and then
135.Sq Dv QUIT .
136.Sh BUGS
137The keyword
138.Ic packed
139is recognized but has no effect.
140.Pp
141For clarity,
142semantic errors should be flagged at an appropriate place in the source text,
143and multiple instances of the `same' semantic error should be summarized
144at the end of a
145.Ic procedure
146or
147.Ic function
148rather than evoking many diagnostics.
149.Pp
150When
151.Ic include
152files are present,
153diagnostics relating to the last procedure in one file may appear after the
154beginning of the listing of the next.
155.\" .Sh ENVIRONMENT
156.Sh HISTORY
157The
158.Nm \&Pi
159command appeared in
160.Bx 3.0 .
161