Graphics Reference
In-Depth Information
APPENDIX B
Abstract Program Syntax
Control Structures:
Actions (either via simple statements or “procedure” calls): S;
The concatenation of
more
than one action will be surrounded by
begin—end
:
begin
S
1
; S
2
;...
end
;
Assignment is indicated via a “:=”.
Equality is indicated via “=”.
Selection:
if
B
then
S;
if
B
then
S
1
else
S
2
;
case
c
of
c
1
: S
1
;
.
.
. .
c
k
: S
k
;
end
;
:
Iteration:
while
B
do
S;
repeat
S
until
B;
for
i:
=
m
to
n
do
S;
Other:
Constructs that are clearly derived from corresponding
mathematical
expressions are also allowed such as
for each
x
in
X
do
S;
Comments are anything between a pair of curly brackets: { }