9 for my $opname (@order) {
10 my ($op) = $ops{$opname};
12 if ($op->{UNIMPLEMENTED}) {
13 print "case $opname:\n";
14 print " abort ();\n\n";
20 for my $arg (@{$op->{ARGS}}) {
21 my ($name) = $arg->{NAME};
22 my ($type) = $arg->{TYPE};
23 my ($c_type) = c_type ($type);
24 my ($idx) = $arg->{IDX};
25 push (@args, "arg_$arg->{NAME}");
26 if (!defined ($idx)) {
27 my ($decl) = "${c_type}arg_$name";
28 if ($type->{ROLE} eq 'any') {
29 unshift (@decls, "$decl = *--$type->{STACK}");
30 } elsif ($type->{ROLE} eq 'leaf') {
31 push (@decls, "$decl = op++->$type->{ATOM}");
36 my ($stack) = $type->{STACK};
37 defined $stack or die;
39 "$c_type*arg_$arg->{NAME} = $stack -= arg_$idx");
40 unshift (@decls, "size_t arg_$arg->{IDX} = op++->integer");
42 my ($idx) = "arg_$idx";
43 if ($arg->{TIMES} != 1) {
44 $idx .= " / $arg->{TIMES}";
49 for my $aux (@{$op->{AUX}}) {
50 my ($type) = $aux->{TYPE};
51 my ($name) = $aux->{NAME};
52 if ($type->{ROLE} eq 'leaf') {
53 my ($c_type) = c_type ($type);
54 push (@decls, "${c_type}aux_$name = op++->$type->{ATOM}");
55 push (@args, "aux_$name");
56 } elsif ($type->{ROLE} eq 'fixed') {
57 push (@args, $type->{FIXED_VALUE});
61 my ($sysmis_cond) = make_sysmis_decl ($op, "op++->integer");
62 push (@decls, $sysmis_cond) if defined $sysmis_cond;
64 my ($result) = "eval_$op->{OPNAME} (" . join (', ', @args) . ")";
66 my ($stack) = $op->{RETURNS}{STACK};
68 print "case $opname:\n";
71 print " $_;\n" foreach @decls;
72 if (defined $sysmis_cond) {
73 my ($miss_ret) = $op->{RETURNS}{MISSING_VALUE};
74 print " *$stack++ = force_sysmis ? $miss_ret : $result;\n";
76 print " *$stack++ = $result;\n";
80 print " *$stack++ = $result;\n";