Mercurial > hg > octave-lyh
annotate src/genprops.awk @ 7826:68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Tue, 12 Feb 2008 16:37:56 +0100 |
parents | f2000f1971ab |
children | 4fb2db9c87dd |
rev | line source |
---|---|
7019 | 1 ## Copyright (C) 2007 John W. Eaton |
2 ## | |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by the | |
7 ## Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but WITHOUT | |
11 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 ## for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 ## | |
6874 | 19 ## This script is used to generate the graphics.h file from graphics.h.in. |
20 ## | |
21 ## Lines between the BEGIN_PROPERTIES and END_PROPERTIES markers have | |
22 ## one of the following formats: | |
23 ## | |
24 ## TYPE NAME | |
25 ## TYPE NAME QUALIFIERS | |
26 ## mutable TYPE NAME | |
27 ## mutable TYPE NAME QUALIFIERS | |
28 ## | |
29 ## For each property, we generate a declaration for the property. | |
30 ## | |
31 ## If QUALIFIERS is omitted, we generate the following functions directly | |
32 ## in the class declaration: | |
33 ## | |
6875 | 34 ## TYPE |
35 ## get_NAME (void) const | |
36 ## { | |
37 ## return NAME; | |
38 ## } | |
39 ## | |
40 ## void | |
41 ## set_NAME (const TYPE& val) | |
42 ## { | |
43 ## if (! error_state) | |
44 ## NAME = val; | |
45 ## } | |
46 ## | |
47 ## void | |
48 ## set_NAME (const octave_value& val) | |
49 ## { | |
50 ## set_NAME (TYPE (val)); | |
51 ## } | |
6874 | 52 ## |
53 ## If present, the QUALIFIERS string may include any of the characters | |
7379 | 54 ## g, G, m, s, S, o, O, h, which have the following meanings: |
6874 | 55 ## |
56 ## g: There is a custom inline definition for the get function, | |
57 ## so we don't emit one. | |
58 ## | |
59 ## G: There is a custom extern definition for the get function, | |
60 ## so we emit only the declaration. | |
61 ## | |
62 ## s: There is a custom inline definition for the type-specific set | |
63 ## function, so we don't emit one. | |
64 ## | |
65 ## S: There is a custom extern definition for the type-specific set | |
66 ## function, so we emit only the declaration. | |
67 ## | |
68 ## o: There is a custom inline definition for the octave_value version | |
69 ## of the set function, so we don't emit one. | |
70 ## | |
71 ## O: There is a custom extern definition for the octave_value version | |
72 ## of the set function, so we emit only the declaration. | |
73 ## | |
6904 | 74 ## a: The octave_value version of the set function will use assignment: |
75 ## | |
76 ## void | |
77 ## set_NAME (const octave_value& val) | |
78 ## { | |
79 ## TYPE tmp (NAME); | |
80 ## tmp = val; | |
81 ## set_NAME (tmp); | |
82 ## } | |
83 ## | |
84 ## This is useful for things like the radio_value classes which | |
85 ## use an overloaded assignment operator of the form | |
86 ## | |
87 ## radio_property& operator = (const octave_value& val); | |
88 ## | |
89 ## that preserves the list of possible values, which is different | |
90 ## from what would happen if we simply used the | |
91 ## | |
92 ## TYPE (const octave_value&) | |
93 ## | |
94 ## constructor, which creates a new radio_property and so cannot | |
95 ## preserve the old list of possible values. | |
96 ## | |
7214 | 97 ## l: Add the line |
98 ## | |
99 ## update_axis_limits ("NAME"); | |
100 ## | |
101 ## to the type-specific set function. | |
102 ## | |
6874 | 103 ## m: Add the line |
104 ## | |
105 ## set_NAMEmode ("manual"); | |
106 ## | |
107 ## to the type-specific set function. | |
108 ## | |
7379 | 109 ## h: Make the property hidden |
110 ## | |
7427 | 111 ## r: Make the property read-only. A read-only property is not |
112 ## settable from the global set (caseless_str, octave_value) | |
113 ## method, but still has set_X accessor. | |
114 ## | |
115 ## u: The property has an updater method. This effectively add | |
116 ## the line | |
117 ## | |
118 ## update_NAME (); | |
119 ## | |
120 ## to the type-specific set function. This line is added before | |
121 ## any other update call (like those added by the 'l' or 'm' | |
122 ## modifiers. | |
123 ## | |
6874 | 124 ## The 'o' and 'O' qualifiers are only useful when the the property type |
125 ## is something other than octave_value. | |
126 | |
7363 | 127 ## simple accessor |
128 | |
129 function emit_get_accessor (i, rtype, faccess) | |
130 { | |
131 printf (" %s get_%s (void) const", rtype, name[i]); | |
132 | |
133 if (emit_get[i] == "definition") | |
134 printf (" { return %s.%s (); }\n", name[i], faccess); | |
135 else | |
136 printf (";\n"); | |
137 } | |
138 | |
139 ## bool_property | |
140 | |
141 function emit_get_bool (i) | |
142 { | |
143 printf (" bool is_%s (void) const", name[i]); | |
144 | |
145 if (emit_get[i] == "definition") | |
146 printf (" { return %s.is_on (); }\n", name[i]); | |
147 else | |
148 printf (";\n"); | |
149 | |
150 emit_get_accessor(i, "std::string", "current_value"); | |
151 } | |
152 | |
153 ## radio_property | |
154 | |
155 function emit_get_radio (i) | |
156 { | |
157 printf (" bool %s_is (const std::string& v) const", name[i]); | |
158 | |
159 if (emit_get[i] == "definition") | |
160 printf (" { return %s.is (v); }\n", name[i]); | |
161 else | |
162 printf (";\n"); | |
163 | |
164 emit_get_accessor(i, "std::string", "current_value"); | |
165 } | |
166 | |
167 ## color_property | |
168 | |
169 function emit_get_color (i) | |
170 { | |
171 printf (" bool %s_is_rgb (void) const { return %s.is_rgb (); }\n", name[i], name[i]); | |
172 | |
173 printf (" bool %s_is (const std::string& v) const", name[i]); | |
174 | |
175 if (emit_get[i] == "definition") | |
176 printf (" { return %s.is (v); }\n", name[i]); | |
177 else | |
178 printf (";\n"); | |
179 | |
180 printf (" Matrix get_%s_rgb (void) const", name[i]); | |
181 | |
182 if (emit_get[i] == "definition") | |
183 printf (" { return (%s.is_rgb () ? %s.rgb () : Matrix ()); }\n", name[i], name[i]); | |
184 else | |
185 printf (";\n"); | |
186 | |
187 emit_get_accessor(i, "octave_value", "get"); | |
188 } | |
189 | |
190 ## callback_property | |
191 | |
192 function emit_get_callback (i) | |
193 { | |
7367 | 194 printf (" void execute_%s (const octave_value& data = octave_value ()) const", name[i]); |
7363 | 195 |
196 if (emit_get[i] == "definition") | |
7367 | 197 printf (" { %s.execute (data); }\n", name[i]); |
7363 | 198 else |
199 printf (";\n"); | |
200 | |
201 emit_get_accessor(i, "octave_value", "get"); | |
202 } | |
203 | |
204 ## data_property | |
205 | |
206 function emit_get_data (i) | |
207 { | |
208 emit_get_accessor(i, "NDArray", "array_value"); | |
209 | |
210 printf (" data_property get_%s_property (void) const { return %s; }\n", | |
211 name[i], name[i]); | |
212 } | |
213 | |
214 ## common section | |
215 | |
216 function emit_common_declarations () | |
217 { | |
218 printf ("public:\n"); | |
219 printf (" properties (const graphics_handle& mh, const graphics_handle& p);\n\n"); | |
220 printf (" ~properties (void) { }\n\n"); | |
7406 | 221 printf (" void set (const caseless_str& pname, const octave_value& val);\n\n"); |
7379 | 222 printf (" octave_value get (bool all = false) const;\n\n"); |
7406 | 223 printf (" octave_value get (const caseless_str& pname) const;\n\n"); |
7363 | 224 printf (" std::string graphics_object_name (void) const { return go_name; }\n\n"); |
225 printf (" static property_list::pval_map_type factory_defaults (void);\n\n"); | |
226 printf ("private:\n static std::string go_name;\n\n"); | |
227 } | |
228 | |
7225 | 229 function emit_declarations () |
6874 | 230 { |
7363 | 231 if (class_name) |
232 emit_common_declarations(); | |
233 | |
6874 | 234 if (idx > 0) |
7363 | 235 print "private:\n"; |
6874 | 236 |
237 for (i = 1; i <= idx; i++) | |
7363 | 238 printf (" %s%s %s;\n", mutable[i] ? "mutable " : "", type[i], name[i]); |
6874 | 239 |
240 if (idx > 0) | |
7363 | 241 print "\npublic:\n"; |
6874 | 242 |
243 for (i = 1; i <= idx; i++) | |
244 { | |
7363 | 245 if (emit_get[i]) |
246 { | |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7427
diff
changeset
|
247 if (type[i] == "array_property" \ |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7427
diff
changeset
|
248 || type[i] == "row_vector_property" \ |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7427
diff
changeset
|
249 || type[i] == "any_property") |
7363 | 250 emit_get_accessor(i, "octave_value", "get"); |
251 else if (type[i] == "handle_property") | |
252 emit_get_accessor(i, "graphics_handle", "handle_value"); | |
253 else if (type[i] == "string_property") | |
254 emit_get_accessor(i, "std::string", "string_value"); | |
255 else if (type[i] == "double_property") | |
256 emit_get_accessor(i, "double", "double_value"); | |
257 else if (type[i] == "data_property") | |
258 emit_get_data(i); | |
259 else if (type[i] == "bool_property") | |
260 emit_get_bool(i); | |
261 else if (type[i] == "radio_property") | |
262 emit_get_radio(i); | |
263 else if (type[i] == "color_property") | |
264 emit_get_color(i); | |
265 else if (type[i] == "callback_property") | |
266 emit_get_callback(i); | |
267 else | |
6874 | 268 { |
7363 | 269 printf (" %s get_%s (void) const", type[i], name[i]); |
6874 | 270 |
7363 | 271 if (emit_get[i] == "definition") |
272 printf (" { return %s; }\n", name[i]); | |
273 else | |
274 printf (";\n"); | |
6874 | 275 } |
7363 | 276 printf ("\n"); |
277 } | |
6874 | 278 } |
279 | |
280 if (idx > 0) | |
7363 | 281 printf ("\n"); |
6874 | 282 |
283 for (i = 1; i <= idx; i++) | |
284 { | |
7363 | 285 if (emit_set[i]) |
286 { | |
287 printf (" void set_%s (const octave_value& val)", name[i], type[i]); | |
6874 | 288 |
7363 | 289 if (emit_set[i] == "definition") |
290 { | |
291 printf ("\n {\n if (! error_state)\n {\n %s = val;\n", | |
292 name[i]); | |
7427 | 293 if (updater[i]) |
7826
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
294 printf (" update_%s ();\n", name[i]); |
7363 | 295 if (limits[i]) |
296 printf (" update_axis_limits (\"%s\");\n", name[i]); | |
297 if (mode[i]) | |
298 printf (" set_%smode (\"manual\");\n", name[i]); | |
299 printf (" mark_modified ();\n }\n }\n\n"); | |
6874 | 300 } |
7363 | 301 else |
302 printf (";\n\n"); | |
303 } | |
6874 | 304 |
7826
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
305 if (updater[i] == "extern") |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
306 { |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
307 printf (" void update_%s (void);\n\n", name[i]); |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
308 } |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
309 |
7363 | 310 ## if (emit_ov_set[i]) |
311 ## { | |
312 ## printf (" void set_%s (const octave_value& val)", name[i]); | |
313 ## | |
314 ## if (emit_ov_set[i] == "definition") | |
315 ## printf (" { set_%s (%s (val)); }\n\n", name[i], type[i]); | |
316 ## else if (emit_ov_set[i] == "assignment") | |
317 ## { | |
318 ## printf ("\n {\n %s tmp (%s);\n tmp = val;\n set_%s (tmp);\n };\n\n", | |
319 ## type[i], name[i], name[i], name[i]); | |
320 ## } | |
321 ## else | |
322 ## printf (";\n"); | |
323 ## } | |
6874 | 324 } |
325 | |
7363 | 326 ## if (idx > 0) |
327 ## print "\nprivate:"; | |
328 } | |
329 | |
330 function emit_source () | |
331 { | |
332 if (class_name) | |
333 { | |
334 printf ("// ******** %s ********\n\n", class_name) >> filename; | |
335 | |
336 ## constructor | |
337 | |
338 printf ("%s::properties::properties (const graphics_handle& mh, const graphics_handle& p)\n", class_name) >> filename; | |
339 printf (" : base_properties (go_name, mh, p),\n") >> filename; | |
340 | |
341 for (i = 1; i <= idx; i++) | |
342 { | |
7397 | 343 printf (" %s (\"%s\", mh, %s)", name[i], name[i], defval[i]) >> filename; |
7363 | 344 if (i < idx) |
345 printf (",") >> filename; | |
346 printf ("\n") >> filename; | |
347 } | |
348 | |
7379 | 349 printf ("{\n") >> filename; |
7363 | 350 |
7379 | 351 for (i = 1; i <= idx; i++) |
352 { | |
353 ## printf (" insert_static_property (\"%s\", %s);\n", name[i], name[i]) >> filename; | |
354 if (hidden[i]) | |
355 printf (" %s.set_hidden (true);\n", name[i]) >> filename; | |
356 } | |
7363 | 357 |
7379 | 358 printf (" init ();\n}\n\n") >> filename; |
7363 | 359 |
360 ## set method | |
361 | |
7406 | 362 printf ("void\n%s::properties::set (const caseless_str& pname, const octave_value& val)\n{\n", |
7363 | 363 class_name) >> filename; |
364 | |
365 for (i = 1; i <= idx; i++) | |
366 { | |
7403 | 367 if (! readonly[i]) |
7406 | 368 printf (" %sif (pname.compare (\"%s\"))\n set_%s (val);\n", |
7403 | 369 (i > 1 ? "else " : ""), name[i], name[i]) >> filename; |
7363 | 370 } |
371 | |
7406 | 372 printf (" else\n base_properties::set (pname, val);\n}\n\n") >> filename; |
7363 | 373 |
374 ## get "all" method | |
375 | |
7379 | 376 printf ("octave_value\n%s::properties::get (bool all) const\n{\n", class_name) >> filename; |
377 printf (" Octave_map m = base_properties::get (all).map_value ();\n\n") >> filename; | |
7363 | 378 |
379 for (i = 1; i <= idx; i++) | |
380 { | |
7379 | 381 if (hidden[i]) |
382 printf (" if (all)\n m.assign (\"%s\", get_%s ()%s);\n", name[i], name[i], | |
383 (type[i] == "handle_property" ? ".as_octave_value ()" : "")) >> filename; | |
384 else | |
385 printf (" m.assign (\"%s\", get_%s ()%s);\n", name[i], name[i], | |
386 (type[i] == "handle_property" ? ".as_octave_value ()" : "")) >> filename; | |
7363 | 387 } |
388 | |
389 printf ("\n return m;\n}\n\n") >> filename; | |
390 | |
391 ## get "one" method | |
392 | |
7406 | 393 printf ("octave_value\n%s::properties::get (const caseless_str& pname) const\n{\n", |
7363 | 394 class_name) >> filename; |
395 printf (" octave_value retval;\n\n") >> filename; | |
396 | |
397 for (i = 1; i<= idx; i++) | |
398 { | |
7406 | 399 printf (" %sif (pname.compare (\"%s\"))\n", |
7363 | 400 (i > 1 ? "else " : ""), name[i]) >> filename; |
401 printf (" retval = get_%s ()%s;\n", name[i], | |
402 (type[i] == "handle_property" ? ".as_octave_value ()" : "")) >> filename; | |
403 } | |
404 | |
7406 | 405 printf (" else\n retval = base_properties::get (pname);\n\n") >> filename; |
7363 | 406 printf (" return retval;\n}\n\n") >> filename; |
407 | |
408 ## factory defaults method | |
409 | |
410 printf ("property_list::pval_map_type\n%s::properties::factory_defaults (void)\n{\n", | |
411 class_name) >> filename; | |
412 printf (" property_list::pval_map_type m;\n\n") >> filename; | |
413 | |
414 for (i = 1; i <= idx; i++) | |
415 { | |
7397 | 416 dval = defval[i]; |
7363 | 417 if (type[i] == "radio_property" || type[i] == "color_property") |
7397 | 418 dval = gensub (/^.*\{(.*)\}.*$/, "\"\\1\"", "g", dval); |
419 if (! dval) | |
420 dval = "octave_value ()"; | |
7363 | 421 if (name[i] !~ /__.*/) |
7397 | 422 printf (" m[\"%s\"] = %s%s;\n", name[i], dval, |
7363 | 423 (type[i] == "handle_property" ? ".as_octave_value ()" : "")) >> filename; |
424 } | |
425 | |
426 printf ("\n return m;\n}\n\n") >> filename; | |
427 | |
428 ## go_name static field | |
429 | |
430 printf ("std::string %s::properties::go_name (\"%s\");\n\n", | |
431 class_name, class_name) >> filename; | |
432 } | |
6874 | 433 } |
434 | |
435 BEGIN { | |
7363 | 436 filename = "graphics-props.cc"; |
437 printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n"); | |
438 printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n") > filename; | |
439 } | |
440 | |
441 /BEGIN_PROPERTIES\(.*\)/ { | |
442 gather = 1; | |
443 idx = 0; | |
444 class_name = gensub (/^.*BEGIN_PROPERTIES\((.*)\)/, "\\1", "g"); | |
445 next; | |
6874 | 446 } |
447 | |
448 /BEGIN_PROPERTIES/ { | |
7363 | 449 gather = 1; |
450 idx = 0; | |
451 class_name = ""; | |
452 next; | |
6874 | 453 } |
454 | |
455 /END_PROPERTIES/ { | |
7363 | 456 emit_declarations(); |
457 emit_source(); | |
458 gather = 0; | |
459 next; | |
6874 | 460 } |
461 | |
462 { | |
463 if (gather) | |
7363 | 464 { |
7403 | 465 if (NF < 2 || /^[ \t]*\/\//) |
7363 | 466 next; |
6874 | 467 |
7363 | 468 idx++; |
6874 | 469 |
7363 | 470 field = 1; |
6874 | 471 |
7363 | 472 if ($field == "mutable") |
473 { | |
474 mutable[idx] = 1; | |
475 field++; | |
476 } | |
477 else | |
478 mutable[idx] = 0; | |
6874 | 479 |
7363 | 480 type[idx] = $(field++); |
481 name[idx] = $(field++); | |
6874 | 482 |
7363 | 483 limits[idx] = 0; |
484 mode[idx] = 0; | |
7403 | 485 hidden[idx] = 0; |
486 readonly[idx] = 0; | |
7363 | 487 emit_get[idx] = "definition"; |
488 emit_set[idx] = "definition"; | |
7397 | 489 defval[idx] = ""; |
7427 | 490 updater[idx] = ""; |
7363 | 491 ## if (type[idx] == "octave_value") |
492 ## emit_ov_set[idx] = ""; | |
493 ## else | |
494 ## emit_ov_set[idx] = "definition"; | |
6874 | 495 |
7363 | 496 if (NF >= field) |
497 { | |
498 if ($field != ",") | |
499 { | |
500 quals = $(field++); | |
7214 | 501 |
7363 | 502 if (index (quals, "l")) |
503 limits[idx] = 1; | |
6874 | 504 |
7363 | 505 if (index (quals, "m")) |
506 mode[idx] = 1; | |
507 | |
508 ## There is a custom inline definition for the get function, | |
509 ## so we don't emit anything. | |
510 if (index (quals, "g")) | |
511 emit_get[idx] = ""; | |
6874 | 512 |
7363 | 513 ## There is a custom extern definition for the get function, |
514 ## but we still emit the declaration. | |
515 if (index (quals, "G")) | |
516 emit_get[idx] = "declaration"; | |
6874 | 517 |
7363 | 518 ## There is a custom inline definition for the set function, |
519 ## so we don't emit anything. | |
520 if (index (quals, "s")) | |
521 emit_set[idx] = ""; | |
6874 | 522 |
7363 | 523 ## There is a custom extern definition for the set function, |
524 ## but we still emit the declaration. | |
525 if (index (quals, "S")) | |
526 emit_set[idx] = "declaration"; | |
7379 | 527 |
7403 | 528 ## The property is hidden |
529 if (index (quals, "h")) | |
530 hidden[idx] = 1; | |
531 | |
532 ## The property is read-only | |
533 if (index (quals, "r")) | |
534 readonly[idx] = 1; | |
6904 | 535 |
7826
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
536 ## There is an inline updater method that should be called |
7427 | 537 ## from the set method |
538 if (index (quals, "u")) | |
7826
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
539 updater[idx] = "inline"; |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
540 |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
541 ## There is an extern updater method that should be called |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
542 ## from the set method |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
543 if (index (quals, "U")) |
68550ad9ee9c
Add support for extern updaters. Add set_figure_position interface to graphics_backend.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7523
diff
changeset
|
544 updater[idx] = "extern"; |
7427 | 545 |
7363 | 546 ## ## emmit an asignment set function |
547 ## if (index (quals, "a")) | |
548 ## emit_ov_set[idx] = "assignment"; | |
549 ## | |
550 ## if (type[idx] != "octave_value") | |
551 ## { | |
552 ## ## The 'o' and 'O' qualifiers are only useful when the | |
553 ## ## the property type is something other than an | |
554 ## ## octave_value. | |
555 ## | |
556 ## ## There is a custom inline definition for the | |
557 ## ## octave_value version of the set function, so we | |
558 ## ## don't emit anything. | |
559 ## if (index (quals, "o")) | |
560 ## emit_ov_set[idx] = ""; | |
561 ## | |
562 ## ## There is a custom extern definition for the | |
563 ## ## octave_value version of the set function, but we | |
564 ## ## still emit the declaration. | |
565 ## if (index (quals, "O")) | |
566 ## emit_ov_set[idx] = "declaration"; | |
567 ## } | |
568 } | |
6874 | 569 |
7363 | 570 if (NF > field && $field == ",") |
571 { | |
572 field++; | |
6874 | 573 |
7363 | 574 for (i = field; i <= NF; i++) |
7397 | 575 defval[idx] = (defval[idx] (i > field ? " " : "") $i); |
7363 | 576 } |
6874 | 577 } |
7363 | 578 |
579 } | |
6874 | 580 else |
7363 | 581 print $0; |
6883 | 582 } |