Asterix is a strongly typed language. There are basic types (bool, char, int, and real), and compound types, as described below.
A value of type int denotes a signed integer. The minimum and maximum values of an int depends on the implementation, but the maximum is at least 32767, and the minimum at most -32768.
A value of type char is in the range '000' to '377'.
The range of values of type real is machine and implementation dependent.
A value of type bool is either true or false.
|array of type|
An array is a sequence of values of a base type, type. A variable of an array type is a reference to an array, which must be dynamically allocated by a call to the new operator, and destroyed with a delete statement. The size of an array is not part of its type, but must be specified when using the new operator. If the size of the array is , the array can be indexed by a value . There are no multi-dimensional arrays, but the base type of an array may be an array. This way even non-rectangular data structures can be composed. string is a shorthand for array of char. Unlike C strings, Asterix strings are not terminated by '0'.
There is an implicit type, the null type. No variables of the null type can be declared, but the null constant is of the null type.
Two expressions are assignment compatible if and only if one of the following rules holds:
K.G. Langendoen 2010-01-08