#include <perms.h>
// Edinburgh IMP77 Compiler - Version 8.4
//
// 1 %begin
int main(int argc, char **argv) { /*%begin*/
_imp_initialise(argc, argv);
// 2 %recordformat rf(%integer a,b, %real r)
struct RF {
union {
struct {
int A;
int B;
float R;
};
};
};
// 3 %record(rf)%array ra(0:9)
struct RF RA[10];
struct _imp_dv RA_dv = {RA, sizeof(struct RF) /*, dims, <bounds> */};
// 4 %record(rf)%namearray rna(0:9)
struct RF *RNA[10];
struct _imp_dv RNA_dv = {RNA, sizeof(struct RF *) /*, dims, <bounds> */};
// 5 %integer x
int X;
// 6 x = ra(1)_a
X = RA[1].A;
// 7 ra(2)_b = x ;! should use "->" in C
RA[2].B = X;
// 8 x = rna(1)_a ;! should use "." in C
X = RNA[1]->A;
// 9 rna(2)_b = x
RNA[2]->B = X;
// 10 %endofprogram
_imp_stop(0);
return 0;
end_0:;
}