5 our (@types, @order, %ops);
8 my (@members) = ("\"\"", "\"\"", 0, 0, 0, "{}", 0, 0);
9 print "{", join (', ', @members), "},\n";
11 for my $type (@types) {
12 next if $type->{ROLE} eq 'fixed';
14 my ($human_name) = $type->{HUMAN_NAME};
15 $human_name = "" if !defined $human_name;
17 my (@members) = ("\"$type->{NAME}\"", "\"\"",
18 0, "OP_$type->{NAME}", 0, "{}", 0, 0);
19 print "{", join (', ', @members), "},\n";
22 for my $opname (@order) {
23 my ($op) = $ops{$opname};
27 push (@members, "\"$op->{NAME}\"");
29 if ($op->{CATEGORY} eq 'function') {
30 my (@args, @opt_args);
31 for my $arg (@{$op->{ARGS}}) {
32 push (@args, $arg->{TYPE}{HUMAN_NAME}) if !defined $arg->{IDX};
35 if (my ($array) = array_arg ($op)) {
36 if (!defined $op->{MIN_VALID}) {
38 for (my $i = 0; $i < $array->{TIMES}; $i++) {
39 push (@array_args, $array->{TYPE}{HUMAN_NAME});
41 push (@args, @array_args);
42 @opt_args = @array_args;
44 for (my $i = 0; $i < $op->{MIN_VALID}; $i++) {
45 push (@args, $array->{TYPE}{HUMAN_NAME});
47 push (@opt_args, $array->{TYPE}{HUMAN_NAME});
50 my ($human) = "$op->{NAME}(" . join (', ', @args);
51 $human .= '[, ' . join (', ', @opt_args) . ']...' if @opt_args;
53 push (@members, "\"$human\"");
55 push (@members, "NULL");
59 push (@flags, "OPF_ABSORB_MISS") if defined $op->{ABSORB_MISS};
60 push (@flags, "OPF_ARRAY_OPERAND") if array_arg ($op);
61 push (@flags, "OPF_MIN_VALID") if defined $op->{MIN_VALID};
62 push (@flags, "OPF_NONOPTIMIZABLE") if !$op->{OPTIMIZABLE};
63 push (@flags, "OPF_EXTENSION") if $op->{EXTENSION};
64 push (@flags, "OPF_UNIMPLEMENTED") if $op->{UNIMPLEMENTED};
65 push (@flags, "OPF_PERM_ONLY") if $op->{PERM_ONLY};
66 push (@flags, "OPF_NO_ABBREV") if $op->{NO_ABBREV};
67 push (@members, @flags ? join (' | ', @flags) : 0);
69 push (@members, "OP_$op->{RETURNS}{NAME}");
71 push (@members, scalar (@{$op->{ARGS}}));
73 my (@arg_types) = map ("OP_$_->{TYPE}{NAME}", @{$op->{ARGS}});
74 push (@members, "{" . join (', ', @arg_types) . "}");
76 push (@members, $op->{MIN_VALID} || 0);
78 push (@members, array_arg ($op) ? ${array_arg ($op)}{TIMES} : 0);
80 print "{", join (', ', @members), "},\n";