
61
#a1 is a integer array variable, has a length of 8 and is initialized to 0.
a2 = Array(8, FLO);
# a2 is a floating-point array variable, has a length of 8 and is initialized to 0.0.
a3 = Array(7, INT, [1,2,3,4,5]);
# a3 is a integer array variable, has a length of 7 and is initialized to [1,2,3,4,5,0,0].
a4 = Array(3, INT, [1,2,3,4,5]);
# a4 is a integer array variable, has a length of 3 and is initialized to [1,2,3].
a5 = Array(4, FLO, [1,2,3]);
# a5 is a floating-point array variable, has a length of 4 and is initialized to
[1.0,2.0,3.0, 0.0].
a6 = Array(a1);
# copies the content of a1 (an array variable) into a6, which is an array variable.
8.3 Expression
An expression in the system refers to a set of operations with some return values. It
is a recursive definition.
In this document, expression is represented by exp, and operator is represented by
op.
8.3.1 Arithmetic Operation Expression
The system supports four types of arithmetic operations, namely addition (+),
subtraction (-), multiplication (*) and division (/). An arithmetic operation
expression returns arithmetic constants.
8.3.2 Relational Operation Expression
The system supports relational operations. The relational operators in the system
are >, <, >=, <=, == and !=. A relational operation expression returns constant 0 or
1.
8.3.3 Logical Operation Expression
The system supports logical operations. The logical operators in the system are and,
or and not.
exp1 and exp2
#if exp1 !=0 and exp2 != 0, the expression returns 1. Otherwise, the expression
returns 0.
exp1 or exp2
#if exp1 !=0 or exp2 != 0, the expression returns 1. Otherwise, the expression
returns 0.
not exp1