Mercurial > octave-nkf
comparison libinterp/octave-value/ov-usr-fcn.h @ 16644:856cb7cba231 classdef
maint: periodic merge of default to classdef
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 12 May 2013 21:45:57 -0400 |
parents | 2ed5bc680c71 de91b1621260 |
children | 93b3d03b05e7 |
comparison
equal
deleted
inserted
replaced
16595:8abae9ea4cb5 | 16644:856cb7cba231 |
---|---|
57 | 57 |
58 ~octave_user_code (void) { } | 58 ~octave_user_code (void) { } |
59 | 59 |
60 bool is_user_code (void) const { return true; } | 60 bool is_user_code (void) const { return true; } |
61 | 61 |
62 virtual std::map<std::string, octave_value> subfunctions (void) const; | |
63 | |
62 virtual tree_statement_list *body (void) = 0; | 64 virtual tree_statement_list *body (void) = 0; |
63 | 65 |
64 protected: | 66 protected: |
65 | 67 |
66 octave_user_code (const std::string& nm, | 68 octave_user_code (const std::string& nm, |
204 { | 206 { |
205 location_line = line; | 207 location_line = line; |
206 location_column = col; | 208 location_column = col; |
207 } | 209 } |
208 | 210 |
211 int beginning_line (void) const { return location_line; } | |
212 int beginning_column (void) const { return location_column; } | |
213 | |
214 void stash_fcn_end_location (int line, int col) | |
215 { | |
216 end_location_line = line; | |
217 end_location_column = col; | |
218 } | |
219 | |
220 int ending_line (void) const { return end_location_line; } | |
221 int ending_column (void) const { return end_location_column; } | |
222 | |
223 void maybe_relocate_end (void); | |
224 | |
209 void stash_parent_fcn_name (const std::string& p) { parent_name = p; } | 225 void stash_parent_fcn_name (const std::string& p) { parent_name = p; } |
210 | 226 |
211 void stash_parent_fcn_scope (symbol_table::scope_id ps) { parent_scope = ps; } | 227 void stash_parent_fcn_scope (symbol_table::scope_id ps) { parent_scope = ps; } |
212 | 228 |
213 void stash_leading_comment (octave_comment_list *lc) { lead_comm = lc; } | 229 void stash_leading_comment (octave_comment_list *lc) { lead_comm = lc; } |
259 } | 275 } |
260 | 276 |
261 void lock_subfunctions (void); | 277 void lock_subfunctions (void); |
262 | 278 |
263 void unlock_subfunctions (void); | 279 void unlock_subfunctions (void); |
280 | |
281 std::map<std::string, octave_value> subfunctions (void) const; | |
282 | |
283 bool has_subfunctions (void) const; | |
284 | |
285 void stash_subfunction_names (const std::list<std::string>& names); | |
286 | |
287 std::list<std::string> subfunction_names (void) const | |
288 { | |
289 return subfcn_names; | |
290 } | |
264 | 291 |
265 octave_value_list all_va_args (const octave_value_list& args); | 292 octave_value_list all_va_args (const octave_value_list& args); |
266 | 293 |
267 void stash_function_name (const std::string& s) { my_name = s; } | 294 void stash_function_name (const std::string& s) { my_name = s; } |
268 | 295 |
415 std::string file_name; | 442 std::string file_name; |
416 | 443 |
417 // Location where this function was defined. | 444 // Location where this function was defined. |
418 int location_line; | 445 int location_line; |
419 int location_column; | 446 int location_column; |
447 int end_location_line; | |
448 int end_location_column; | |
420 | 449 |
421 // The name of the parent function, if any. | 450 // The name of the parent function, if any. |
422 std::string parent_name; | 451 std::string parent_name; |
452 | |
453 // The list of subfunctions (if any) in the order they appear in the | |
454 // file. | |
455 std::list<std::string> subfcn_names; | |
423 | 456 |
424 // The time the file was parsed. | 457 // The time the file was parsed. |
425 octave_time t_parsed; | 458 octave_time t_parsed; |
426 | 459 |
427 // The time the file was last checked to see if it needs to be | 460 // The time the file was last checked to see if it needs to be |
467 | 500 |
468 #ifdef HAVE_LLVM | 501 #ifdef HAVE_LLVM |
469 jit_function_info *jit_info; | 502 jit_function_info *jit_info; |
470 #endif | 503 #endif |
471 | 504 |
505 void maybe_relocate_end_internal (void); | |
506 | |
472 void print_code_function_header (void); | 507 void print_code_function_header (void); |
473 | 508 |
474 void print_code_function_trailer (void); | 509 void print_code_function_trailer (void); |
475 | 510 |
476 void bind_automatic_vars (const string_vector& arg_names, int nargin, | 511 void bind_automatic_vars (const string_vector& arg_names, int nargin, |