annotate src/genprops.awk @ 6909:fc55a5e1760b ss-2-9-14

[project @ 2007-09-17 20:47:40 by jwe]
author jwe
date Mon, 17 Sep 2007 20:47:41 +0000
parents 1758d3d3d266
children 4270ded9ddc6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
1 ## This script is used to generate the graphics.h file from graphics.h.in.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3 ## Lines between the BEGIN_PROPERTIES and END_PROPERTIES markers have
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4 ## one of the following formats:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6 ## TYPE NAME
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
7 ## TYPE NAME QUALIFIERS
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
8 ## mutable TYPE NAME
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
9 ## mutable TYPE NAME QUALIFIERS
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
10 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
11 ## For each property, we generate a declaration for the property.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
12 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
13 ## If QUALIFIERS is omitted, we generate the following functions directly
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
14 ## in the class declaration:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
15 ##
6875
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
16 ## TYPE
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
17 ## get_NAME (void) const
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
18 ## {
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
19 ## return NAME;
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
20 ## }
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
21 ##
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
22 ## void
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
23 ## set_NAME (const TYPE& val)
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
24 ## {
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
25 ## if (! error_state)
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
26 ## NAME = val;
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
27 ## }
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
28 ##
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
29 ## void
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
30 ## set_NAME (const octave_value& val)
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
31 ## {
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
32 ## set_NAME (TYPE (val));
1f843c5601b3 [project @ 2007-09-06 21:41:50 by jwe]
jwe
parents: 6874
diff changeset
33 ## }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
34 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
35 ## If present, the QUALIFIERS string may include any of the characters
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
36 ## g, G, m, s, S, o, O, which have the following meanings:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
37 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
38 ## g: There is a custom inline definition for the get function,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
39 ## so we don't emit one.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
40 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
41 ## G: There is a custom extern definition for the get function,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
42 ## so we emit only the declaration.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
43 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
44 ## s: There is a custom inline definition for the type-specific set
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
45 ## function, so we don't emit one.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
46 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
47 ## S: There is a custom extern definition for the type-specific set
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
48 ## function, so we emit only the declaration.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
49 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
50 ## o: There is a custom inline definition for the octave_value version
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
51 ## of the set function, so we don't emit one.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
52 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
53 ## O: There is a custom extern definition for the octave_value version
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
54 ## of the set function, so we emit only the declaration.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
55 ##
6904
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
56 ## a: The octave_value version of the set function will use assignment:
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
57 ##
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
58 ## void
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
59 ## set_NAME (const octave_value& val)
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
60 ## {
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
61 ## TYPE tmp (NAME);
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
62 ## tmp = val;
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
63 ## set_NAME (tmp);
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
64 ## }
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
65 ##
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
66 ## This is useful for things like the radio_value classes which
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
67 ## use an overloaded assignment operator of the form
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
68 ##
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
69 ## radio_property& operator = (const octave_value& val);
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
70 ##
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
71 ## that preserves the list of possible values, which is different
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
72 ## from what would happen if we simply used the
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
73 ##
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
74 ## TYPE (const octave_value&)
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
75 ##
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
76 ## constructor, which creates a new radio_property and so cannot
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
77 ## preserve the old list of possible values.
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
78 ##
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
79 ## m: Add the line
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
80 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
81 ## set_NAMEmode ("manual");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
82 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
83 ## to the type-specific set function.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
84 ##
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
85 ## The 'o' and 'O' qualifiers are only useful when the the property type
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
86 ## is something other than octave_value.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
87
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
88 function emit_decls ()
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
89 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
90 if (idx > 0)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
91 print "private:\n";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
92
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
93 for (i = 1; i <= idx; i++)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
94 printf (" %s%s %s;\n", mutable[i] ? "mutable " : "", type[i], name[i]);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
95
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
96 if (idx > 0)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
97 print "\npublic:\n";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
98
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
99 for (i = 1; i <= idx; i++)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
100 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
101 if (emit_get[i])
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
102 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
103 printf (" %s get_%s (void) const", type[i], name[i]);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
104
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
105 if (emit_get[i] == "defn")
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
106 printf (" { return %s; }\n", name[i]);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
107 else
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
108 printf (";\n");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
109 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
110 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
111
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
112 if (idx > 0)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
113 printf ("\n");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
114
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
115 for (i = 1; i <= idx; i++)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
116 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
117 if (emit_set[i])
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
118 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
119 printf (" void set_%s (const %s& val)", name[i], type[i]);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
120
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
121 if (emit_set[i] == "defn")
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
122 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
123 printf ("\n {\n if (! error_state)\n {\n %s = val;\n",
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
124 name[i]);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
125 if (mode[i])
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
126 printf (" set_%smode (\"manual\");\n", name[i]);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
127 printf (" mark_modified ();\n }\n }\n\n");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
128 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
129 else
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
130 printf (";\n");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
131 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
132
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
133 if (emit_ov_set[i])
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
134 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
135 printf (" void set_%s (const octave_value& val)", name[i]);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
136
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
137 if (emit_ov_set[i] == "defn")
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
138 printf (" { set_%s (%s (val)); }\n\n", name[i], type[i]);
6904
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
139 else if (emit_ov_set[i] == "asign")
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
140 {
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
141 printf ("\n {\n %s tmp (%s);\n tmp = val;\n set_%s (tmp);\n };\n\n",
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
142 type[i], name[i], name[i], name[i]);
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
143 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
144 else
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
145 printf (";\n");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
146 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
147 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
148
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
149 if (idx > 0)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
150 print "\nprivate:";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
151 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
152
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
153 BEGIN {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
154 printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
155 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
156
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
157 /BEGIN_PROPERTIES/ {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
158 gather = 1;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
159 idx = 0;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
160 next;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
161 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
162
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
163 /END_PROPERTIES/ {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
164 emit_decls();
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
165 gather = 0;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
166 next;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
167 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
168
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
169 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
170 if (gather)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
171 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
172 if (NF < 2 || NF > 4)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
173 next;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
174
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
175 idx++;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
176
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
177 field = 1;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
178
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
179 if ($field == "mutable")
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
180 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
181 mutable[idx] = 1;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
182 field++;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
183 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
184 else
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
185 mutable[idx] = 0;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
186
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
187 type[idx] = $(field++);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
188 name[idx] = $(field++);
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
189
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
190 mode[idx] = 0;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
191 emit_get[idx] = "defn";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
192 emit_set[idx] = "defn";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
193 if (type[idx] == "octave_value")
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
194 emit_ov_set[idx] = "";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
195 else
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
196 emit_ov_set[idx] = "defn";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
197
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
198 if (NF == field)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
199 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
200 quals = $field;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
201
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
202 if (index (quals, "m"))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
203 mode[idx] = 1;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
204
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
205 ## There is a custom inline definition for the get function,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
206 ## so we don't emit anything.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
207 if (index (quals, "g"))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
208 emit_get[idx] = "";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
209
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
210 ## There is a custom extern definition for the get function,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
211 ## but we still emit the declaration.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
212 if (index (quals, "G"))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
213 emit_get[idx] = "decl";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
214
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
215 ## There is a custom inline definition for the set function,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
216 ## so we don't emit anything.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
217 if (index (quals, "s"))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
218 emit_set[idx] = "";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
219
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
220 ## There is a custom extern definition for the set function,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
221 ## but we still emit the declaration.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
222 if (index (quals, "S"))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
223 emit_set[idx] = "decl";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
224
6904
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
225 ## emmit an asignment set function
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
226 if (index (quals, "a"))
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
227 emit_ov_set[idx] = "asign";
1758d3d3d266 [project @ 2007-09-14 20:08:56 by jwe]
jwe
parents: 6883
diff changeset
228
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
229 if (type[idx] != "octave_value")
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
230 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
231 ## The 'o' and 'O' qualifiers are only useful when the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
232 ## the property type is something other than an
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
233 ## octave_value.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
234
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
235 ## There is a custom inline definition for the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
236 ## octave_value version of the set function, so we
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
237 ## don't emit anything.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
238 if (index (quals, "o"))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
239 emit_ov_set[idx] = "";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
240
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
241 ## There is a custom extern definition for the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
242 ## octave_value version of the set function, but we
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
243 ## still emit the declaration.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
244 if (index (quals, "O"))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
245 emit_ov_set[idx] = "decl";
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
246 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
247 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
248
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
249 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
250 else
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
251 print $0;
6883
037c8b622a01 [project @ 2007-09-10 20:13:27 by jwe]
jwe
parents: 6875
diff changeset
252 }