Mercurial > hg > octave-lyh
comparison src/genprops.awk @ 8247:e41f420875db
set name of root_figure object to root
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 20 Oct 2008 12:22:28 -0400 |
parents | 6b3a965b6c7d |
children | 8cb2a144f321 |
comparison
equal
deleted
inserted
replaced
8246:db19494c7c2a | 8247:e41f420875db |
---|---|
556 | 556 |
557 ## go_name static field | 557 ## go_name static field |
558 | 558 |
559 if (! base) | 559 if (! base) |
560 printf ("std::string %s::properties::go_name (\"%s\");\n\n", | 560 printf ("std::string %s::properties::go_name (\"%s\");\n\n", |
561 class_name, class_name) >> filename; | 561 class_name, object_name) >> filename; |
562 } | 562 } |
563 } | 563 } |
564 | 564 |
565 BEGIN { | 565 BEGIN { |
566 filename = "graphics-props.cc"; | 566 filename = "graphics-props.cc"; |
567 printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n"); | 567 printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n"); |
568 printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n") > filename; | 568 printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n") > filename; |
569 pcount = 0; | 569 pcount = 0; |
570 } | 570 } |
571 | 571 |
572 /BEGIN_PROPERTIES\(.*\)/ { | 572 /BEGIN_PROPERTIES *\(.*\)/ { |
573 gather = 1; | 573 gather = 1; |
574 idx = 0; | 574 idx = 0; |
575 str = $0; | 575 str = $0; |
576 k = index (str, "BEGIN_PROPERTIES("); | 576 beg = index (str, "(") + 1; |
577 str = substr (str, k + 17); | 577 len = index (str, ")") - beg; |
578 l = index (str, ")"); | 578 args = substr (str, beg, len); |
579 class_name = substr (str, 1, l-1); | 579 n = split (args, arg_list, ","); |
580 if (n > 0) | |
581 class_name = arg_list[1]; | |
582 if (n > 1) | |
583 object_name = arg_list[2]; | |
584 else | |
585 object_name = class_name; | |
586 gsub (/ /, "", class_name); | |
587 gsub (/ /, "", object_name); | |
580 base = 0; | 588 base = 0; |
581 next; | 589 next; |
582 } | 590 } |
583 | 591 |
584 /BEGIN_PROPERTIES/ { | 592 /BEGIN_PROPERTIES/ { |