In this appendix, we list the various templates issued by Alice. The templates are laid out when the appropriate keywords or operators are recognized.
{Comment}
program program-name(input,output); {Comment that says what the routine does} Declarations begin Statement end.
label Label;
type Name = Type; {Comment}
const Name = Constant; {Comment}
var Name : Type; {Comment}
procedure proc-name(Parameter); {Comment that says what the routine does} Declarations begin Statement end;
function func-name(Parameter) : Type-Name; {Comment that says what the routine does} Declarations begin Statement end;
Name = (Name);
lower-bound .. upper-bound
packed Structured-Type
array [range] of Type
set of Simple-Type
file of file-element-type
^Type-Name
record Field-Declaration; end;
field-name : Type
case tag-name : tag-type of Variant end;
parm-name : Type-Name
var parm-name : Type-Name
function func-name(Parameter) : Type;
procedure proc-name(Parameter);
Label-Number :
goto label;
Procedure Name(Value);
Function Name(Value)
Variable := Value;
if Condition then begin Statement end;
if Condition then begin Statement end else begin Statement end;
for variable := start to finish do begin Statement end;
for variable := start downto finish do begin Statement end;
while Condition do begin Statement end;
repeat Statement until Condition;
with record-variable do begin Statement end;
case Value of Case-Instance end;
begin Statement end;
Constant : begin Statement end;
else begin Statement end;
Variable[Subscript]
Variable^
Variable.Field
The templates that follow are all used for expressions. The format depends on the first character (operator) that is typed in.
(Value)
[Value]
not Value
+Value
Value + Value
Value - Value
Value or Value
Value * Value
Value / Value
Value div Value
Value mod Value
Value and Value
Value = Value
Value <> Value
Value < Value
Value > Value
Value >= Value
Value <= Value
Value in Value
Value .. Value