Mercurial > octave-nkf
comparison liboctave/mk-ops.awk @ 5030:160365410ad4
[project @ 2004-09-24 03:22:23 by jwe]
author | jwe |
---|---|
date | Fri, 24 Sep 2004 03:22:24 +0000 |
parents | 269c3d6c0569 |
children | fabb1be5fd84 |
comparison
equal
deleted
inserted
replaced
5029:1ec26bdb120c | 5030:160365410ad4 |
---|---|
24 } { | 24 } { |
25 if (declare_types) | 25 if (declare_types) |
26 { | 26 { |
27 ntypes++; | 27 ntypes++; |
28 | 28 |
29 if (NF == 5) | 29 if (NF == 6) |
30 { | 30 { |
31 scalar_zero_val[ntypes] = $6; | |
31 fwd_decl_ok[ntypes] = $5 == "YES"; | 32 fwd_decl_ok[ntypes] = $5 == "YES"; |
32 header[ntypes] = $4 == "NONE" ? "" : $4; | 33 header[ntypes] = $4 == "NONE" ? "" : $4; |
33 class[ntypes] = $3; | 34 class[ntypes] = $3; |
34 type[ntypes] = $2; | 35 type[ntypes] = $2; |
35 tag[ntypes] = $1; | 36 tag[ntypes] = $1; |
60 lhs_conv = ""; | 61 lhs_conv = ""; |
61 | 62 |
62 if (rhs_conv == "NONE") | 63 if (rhs_conv == "NONE") |
63 rhs_conv = ""; | 64 rhs_conv = ""; |
64 | 65 |
65 zero_val = (NF > n) ? $(++n) : ""; | |
66 | |
67 k = 0 | 66 k = 0 |
68 while (NF > n) | 67 while (NF > n) |
69 bool_headers[k++] = $(++n); | 68 bool_headers[k++] = $(++n); |
70 | 69 |
71 cc_file = sprintf ("%s-%s-%s.cc", prefix, lhs_tag, rhs_tag); | 70 cc_file = sprintf ("%s-%s-%s.cc", prefix, lhs_tag, rhs_tag); |
96 rhs_num = rev_tag[rhs_tag]; | 95 rhs_num = rev_tag[rhs_tag]; |
97 | 96 |
98 result_type = type[result_num]; | 97 result_type = type[result_num]; |
99 lhs_type = type[lhs_num]; | 98 lhs_type = type[lhs_num]; |
100 rhs_type = type[rhs_num]; | 99 rhs_type = type[rhs_num]; |
100 | |
101 result_scalar_zero_val = scalar_zero_val[result_num]; | |
102 lhs_scalar_zero_val = scalar_zero_val[lhs_num]; | |
103 rhs_scalar_zero_val = scalar_zero_val[rhs_num]; | |
101 | 104 |
102 result_header = header[result_num]; | 105 result_header = header[result_num]; |
103 lhs_header = header[lhs_num]; | 106 lhs_header = header[lhs_num]; |
104 rhs_header = header[rhs_num]; | 107 rhs_header = header[rhs_num]; |
105 | 108 |
183 if (bin_ops) | 186 if (bin_ops) |
184 { | 187 { |
185 if ((lhs_class == "DM" && rhs_class == "M") || (lhs_class == "M" && rhs_class == "DM")) | 188 if ((lhs_class == "DM" && rhs_class == "M") || (lhs_class == "M" && rhs_class == "DM")) |
186 printf ("%s%s_BIN_OPS (%s, %s, %s, %s)\n", | 189 printf ("%s%s_BIN_OPS (%s, %s, %s, %s)\n", |
187 lhs_class, rhs_class, result_type, | 190 lhs_class, rhs_class, result_type, |
188 lhs_type, rhs_type, zero_val) >> cc_file | 191 lhs_type, rhs_type, result_scalar_zero_val) >> cc_file |
189 else | 192 else |
190 printf ("%s%s_BIN_OPS (%s, %s, %s)\n", | 193 printf ("%s%s_BIN_OPS (%s, %s, %s)\n", |
191 lhs_class, rhs_class, result_type, | 194 lhs_class, rhs_class, result_type, |
192 lhs_type, rhs_type) >> cc_file | 195 lhs_type, rhs_type) >> cc_file |
193 } | 196 } |
195 if (cmp_ops) | 198 if (cmp_ops) |
196 printf ("%s%s_CMP_OPS (%s, %s, %s, %s)\n", lhs_class, rhs_class, | 199 printf ("%s%s_CMP_OPS (%s, %s, %s, %s)\n", lhs_class, rhs_class, |
197 lhs_type, lhs_conv, rhs_type, rhs_conv) >> cc_file | 200 lhs_type, lhs_conv, rhs_type, rhs_conv) >> cc_file |
198 | 201 |
199 if (bool_ops) | 202 if (bool_ops) |
200 printf ("%s%s_BOOL_OPS (%s, %s, %s)\n", lhs_class, rhs_class, | 203 printf ("%s%s_BOOL_OPS2 (%s, %s, %s, %s)\n", lhs_class, rhs_class, |
201 lhs_type, rhs_type, zero_val) >> cc_file | 204 lhs_type, rhs_type, lhs_scalar_zero_val, |
205 rhs_scalar_zero_val) >> cc_file | |
202 | 206 |
203 | 207 |
204 close (cc_file); | 208 close (cc_file); |
205 } | 209 } |
206 else | 210 else |