SPL to HP C/XL Migration Guide (30231-90001)

4-4
ARRAY Declaration
Table 4-3. ARRAY Declaration
---------------------------------------------------------------------------------------------
|||
| SPL | HP C/XL Equivalent |
|||
---------------------------------------------------------------------------------------------
|||
|
array-declaration
:|
array-declaration
:|
|||
| [GLOBAL] [
type
] ARRAY | 1b, 1d with
lower
<> 0. |
|||
|[
global-array-defn
,] [...] | [static] [
type
]|
||
array-id "
[
" cells "
]
"
[
init
];|
|{
global-array-defn
||
|
init-global-array-defn
}; | |
| | 1a, 1c; 1b, 1d with
lower
<> 0. |
|||
|
global-array-defn
: | [static] [
type
]|
||
array-ref "
[
" cells "
]
"
[
init
];|
| 1a.
array-id
(
lower
:
upper
)| |
|||
| 1b.
array-id
(
lower
:
upper
) = DB | [static] [
type
]*
array-id
|
|||
| 2a.
array-id
(@)=DB | =&
array-ref "
[
" index "
]
"
;|
|||
| 2b.
array-id
(@)=DB+
offset
|
init
:|
||=
"
{
" value
[,...]
"
}
"
|
| 3a.
array-id
(*)=DB | |
||
index
:|
| 3b.
array-id
(*)=DB+
offset
| is the cell number in
array-ref
of the |
| | cell that corresponds to cell zero in the |
| 4a.
array-id
(@) | SPL array. |
|||
| 4b.
array-id
(@) =
register sign offset
|___________________ |
|||
|5.
array-id
(*) | The other SPL formats establish an |
| | equivalence relative to other declared data |
|6.
array-id
(*) =
register sign offset
| (not just arrays). Depending on their |
| | actual use, they may be converted to HP |
| 7a.
array-id
(*) =
ref-id
| C/XL pointer or union types, or #define |
| | directives. If their relationships are |
| 7b.
array-id
(*) =
ref-id sign offset
| fairly simple, pointers can be used. Some |
| | suggestions follow: |
|8.
array-id
(*) =
ref-id
(
index
)| |
| | 2. union |
|||
|
init-global-array-defn
:|
"
{
"
|
|||
| 1c.
array-id
(
lower
:
upper
)| [
type
]*
array-id
;|
|||
|:=
value-group
[,...] | [
type
]*
other-id
;|
|||
| 1d.
array-id
(
lower
:
upper
) = DB | : |
|||
|:=
value-group
[,...] |
"
}
"
|
|||
| | 4. [
type
]*
array-id
|
|
value-group
:| |
| | 5. [
type
]*
array-id
|
|{
initial-value
||
|
repeat-factor
(
initial-value
[,...] )}| 7. [
type
]*
array-id
=&
ref-id
|
|||
| | 8. [
type
]*
array-id
|
|||
||=&
ref-id "
[
" index "
]
"
|
|||
---------------------------------------------------------------------------------------------