comparison src/ov-usr-fcn.h @ 3219:30770ba4457a

[project @ 1998-11-13 03:44:31 by jwe]
author jwe
date Fri, 13 Nov 1998 03:44:36 +0000
parents e4bbfc196e53
children d54ef0aa6e82
comparison
equal deleted inserted replaced
3218:2c91af0db179 3219:30770ba4457a
57 tree_statement_list *cl = 0, 57 tree_statement_list *cl = 0,
58 symbol_table *st = 0); 58 symbol_table *st = 0);
59 59
60 ~octave_user_function (void); 60 ~octave_user_function (void);
61 61
62 void *operator new (size_t size)
63 { return allocator.alloc (size); }
64
65 void operator delete (void *p, size_t size)
66 { allocator.free (p, size); }
67
68 octave_function *function_value (bool) { return this; } 62 octave_function *function_value (bool) { return this; }
69 63
70 octave_user_function *define_param_list (tree_parameter_list *t); 64 octave_user_function *define_param_list (tree_parameter_list *t);
71 65
72 octave_user_function *define_ret_list (tree_parameter_list *t); 66 octave_user_function *define_ret_list (tree_parameter_list *t);
127 121
128 tree_statement_list *body (void) { return cmd_list; } 122 tree_statement_list *body (void) { return cmd_list; }
129 123
130 void accept (tree_walker& tw); 124 void accept (tree_walker& tw);
131 125
132 int type_id (void) const { return t_id; }
133
134 string type_name (void) const { return t_name; }
135
136 static int static_type_id (void) { return t_id; }
137
138 static void register_type (void)
139 { t_id = octave_value_typeinfo::register_type (t_name); }
140
141 private: 126 private:
142 127
143 octave_user_function (void); 128 octave_user_function (void);
144 129
145 octave_user_function (const octave_user_function& m); 130 octave_user_function (const octave_user_function& m);
204 symbol_record *nargin_sr; 189 symbol_record *nargin_sr;
205 190
206 // The symbol record for nargout in the local symbol table. 191 // The symbol record for nargout in the local symbol table.
207 symbol_record *nargout_sr; 192 symbol_record *nargout_sr;
208 193
209 // For custom memory management.
210 static octave_allocator allocator;
211
212 // Type id of list objects, set by register_type().
213 static int t_id;
214
215 // Type name of list objects, defined in ov-list.cc.
216 static const string t_name;
217
218 void print_code_function_header (void); 194 void print_code_function_header (void);
219 195
220 void print_code_function_trailer (void); 196 void print_code_function_trailer (void);
221 197
222 void install_automatic_vars (void); 198 void install_automatic_vars (void);
223 199
224 void bind_automatic_vars (const string_vector& arg_names, int nargin, 200 void bind_automatic_vars (const string_vector& arg_names, int nargin,
225 int nargout); 201 int nargout);
202
203 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
204
205 DECLARE_OCTAVE_ALLOCATOR
226 }; 206 };
227 207
228 #endif 208 #endif
229 209
230 /* 210 /*