Libraries |
|
Base idx array | Source Code |
|
|
Abstract data types | |||||
type |
|
array [
const func type: array [ (in integer: minIdx) .. ] (in type: baseType)
-
Abstract data type, describing arrays with a fixed minimum integer index. A base array type defines the minimum allowed index. All arrays declared with this type have the same minimum index. All abstract base array types are incompatible to each other. A type declaration is needed to use the same fixed size array type at several places. E.g.:
const type: nameList is array [1 .. ] string;
afterwards nameList can be used in declarations. E.g.:
var nameList: aNameList is nameList.value;
- Parameters:
- minIdx - Minimum index of the array type.
- baseType - Type of the array elements.
Operator Summary | |||||
void |
| ||||
void |
| ||||
arrayType |
| ||||
baseType |
| ||||
arrayType |
| ||||
arrayType |
| ||||
arrayType |
| ||||
arrayType |
|
Function Summary | |||||
void |
| ||||
void |
| ||||
baseType |
| ||||
arrayType |
| ||||
integer |
| ||||
integer |
| ||||
integer |
| ||||
integer |
| ||||
void |
| ||||
void |
| ||||
void |
| ||||
void |
| ||||
void |
| ||||
void |
| ||||
baseType |
|
Operator Detail |
&:=
const proc: (inout arrayType: arr) &:= (in arrayType: extension)
-
Append the array extension to the array arr.
- Raises:
- MEMORY_ERROR - Not enough memory for the concatenated array.
&:=
const proc: (inout arrayType: arr) &:= (in baseType: element)
-
Append the given element to the array arr.
- Raises:
- MEMORY_ERROR - Not enough memory for the concatenated array.
&
const func arrayType: (in arrayType: arr1) & (in arrayType: arr2)
-
Concatenate two arrays.
- Returns:
- the result of the concatenation.
[
const func baseType: (in arrayType: arr) [ (in integer: index) ]
[
const func arrayType: (in arrayType: arr) [ (in integer: start) .. ]
-
Get a sub array beginning at the position start.
- Returns:
- the sub array beginning at the start position.
- Raises:
- INDEX_ERROR - The start position is less than minIdx(arr).
- MEMORY_ERROR - Not enough memory to represent the result.
[ ..
const func arrayType: (in arrayType: arr) [ .. (in integer: stop) ]
-
Get a sub array ending at the position stop.
- Returns:
- the sub array ending at the stop position.
- Raises:
- INDEX_ERROR - The stop position is less than pred(minIdx(arr)).
- MEMORY_ERROR - Not enough memory to represent the result.
[
const func arrayType: (in arrayType: arr) [ (in integer: start) .. (in integer: stop) ]
-
Get a sub array from the position start to the position stop.
- Returns:
- the sub array from position start to stop.
- Raises:
- INDEX_ERROR - The start position is less than minIdx(arr1), or the stop position is less than pred(start).
- MEMORY_ERROR - Not enough memory to represent the result.
[
const func arrayType: (in arrayType: arr) [ (in integer: start) len (in integer: length) ]
-
Get a sub array from the position start with maximum length len.
- Returns:
- the sub array from position start with maximum length len.
- Raises:
- INDEX_ERROR - The start position is less than minIdx(arr), or the length is negative.
- MEMORY_ERROR - Not enough memory to represent the result.
Function Detail |
insert
const proc: insert (inout arrayType: arr, in integer: index, in baseType: element)
insert
const proc: insert (inout arrayType: arr, in integer: index, in arrayType: elements)
remove
const func baseType: remove (inout arrayType: arr, in integer: index)
remove
const func arrayType: remove (inout arrayType: arr, in integer: index, in integer: length)
-
Remove the sub-array with index and length from arr. The elements after the removed sub-array are moved forward. This function is tuned for performance and the movement works without copying elements.
- Returns:
- the removed sub-array.
length
const func integer: length (in arrayType: arr)
-
Determine the length of the array arr.
- Returns:
- the length of the array.
minIdx
const integer: minIdx (attr arrayType)
-
Minimum index of all arrays declared with arrayType. All arrays declared with arrayType have this minimum index.
- Returns:
- the length of the array.
minIdx
const integer: minIdx (in arrayType: arr)
-
Minimum index of array arr. The minimum index of a fixed size array does not depend on the value.
- Returns:
- the minimum index of the array.
maxIdx
const func integer: maxIdx (in arrayType: arr)
-
Maximum index of array arr.
- Returns:
- the maximum index of the array.
for
const proc: for (inout baseType: forVar) range (in arrayType: arr) do (in proc: statements) end for
-
For-loop where forVar loops over the elements of the array arr.
for key
const proc: for key (inout integer: keyVar) range (in arrayType: arr) do (in proc: statements) end for
-
For-loop where keyVar loops over the indices of the array arr.
for
const proc: for (inout baseType: forVar) key (inout integer: keyVar) range (in arrayType: arr) do (in proc: statements) end for
-
For-loop where forVar and keyVar loop over the array arr. The variable forVar loops over the elements of arr and keyVar loops over the indices of arr.
for
const proc: for (inout baseType: forVar) range (in arrayType: arr) until (ref func boolean: condition) do (in proc: statements) end for
-
For-loop where forVar loops over the elements of the array arr. Additionally a condition is checked before the statements in the loop body are executed.
for key
const proc: for key (inout integer: keyVar) range (in arrayType: arr) until (ref func boolean: condition) do (in proc: statements) end for
-
For-loop where keyVar loops over the indices of the array arr. Additionally a condition is checked before the statements in the loop body are executed.
for
const proc: for (inout baseType: forVar) key (inout integer: keyVar) range (in arrayType: arr) until (ref func boolean: condition) do (in proc: statements) end for
-
For-loop where forVar and keyVar loop over the array arr. The variable forVar loops over the elements of arr and keyVar loops over the indices of arr. Additionally a condition is checked before the statements in the loop body are executed.
rand
const func baseType: rand (in arrayType: arr)
-
Select a random element from arr. The pseudo-random indices of the elements are uniform distributed.
- Returns:
- a random element from arr.
- Raises:
- RANGE_ERROR - If arr is empty.
|
|