26 #if ! defined (octave_ov_usr_fcn_h)
27 #define octave_ov_usr_fcn_h 1
29 #include "octave-config.h"
50 class tree_parameter_list;
51 class tree_statement_list;
53 class tree_expression;
55 #if defined (HAVE_LLVM)
56 class jit_function_info;
69 const std::string& ds =
"")
71 t_parsed (static_cast<time_t> (0)),
72 t_checked (static_cast<time_t> (0)),
73 m_file_info (nullptr), cmd_list (cmds)
76 m_scope.set_user_code (
this);
91 std::string get_code_line (
size_t line);
93 std::deque<std::string> get_code_lines (
size_t line,
size_t num_lines);
95 void cache_function_text (
const std::string&
text,
107 mark_fcn_file_up_to_date (t);
121 virtual std::map<std::string, octave_value> subfunctions (
void)
const;
129 void get_file_info (
void);
164 const std::string& ds =
"");
168 const std::string& ds =
"");
241 location_line =
line;
242 location_column = col;
250 end_location_line =
line;
251 end_location_column = col;
257 void maybe_relocate_end (
void);
267 std::string profiler_name (
void)
const;
278 return m_scope.parent_fcn_names ();
281 void mark_as_system_fcn_file (
void);
287 void erase_subfunctions (
void);
289 bool takes_varargs (
void)
const;
291 bool takes_var_return (
void)
const;
293 void mark_as_private_function (
const std::string& cname =
"");
295 void lock_subfunctions (
void);
297 void unlock_subfunctions (
void);
299 std::map<std::string, octave_value> subfunctions (
void)
const;
301 octave_value find_subfunction (
const std::string& subfuns)
const;
303 bool has_subfunctions (
void)
const;
305 void stash_subfunction_names (
const std::list<std::string>& names);
307 std::list<std::string> subfunction_names (
void)
const;
326 (
const std::string& cname =
"")
const
328 return anonymous_function
330 ? (! dispatch_class ().empty ())
331 : cname == dispatch_class ())
340 return is_inline_function () || is_anonymous_function ();
353 return (class_constructor == legacy
354 ? (cname.empty () ?
true : cname == dispatch_class ()) :
false);
361 return (class_constructor == classdef
362 ? (cname.empty () ?
true : cname == dispatch_class ()) :
false);
369 return (class_method == legacy
370 ? (cname.empty () ?
true : cname == dispatch_class ()) :
false);
377 return (class_method == classdef
378 ? (cname.empty () ?
true : cname == dispatch_class ()) :
false);
406 bool subsasgn_optimization_ok (
void);
410 #if defined (HAVE_LLVM)
420 enum class_method_type
427 std::string ctor_type_str (
void)
const;
428 std::string method_type_str (
void)
const;
481 #if defined (HAVE_LLVM)
485 void maybe_relocate_end_internal (
void);
487 void print_code_function_header (
const std::string& prefix);
489 void print_code_function_trailer (
const std::string& prefix);
494 void restore_warning_states (
void);
std::shared_ptr< symbol_scope_rep > parent_scope(void) const
void stash_fcn_file_name(const std::string &nm)
std::string fcn_file_name(void) const
octave_user_code(const octave_user_code &f)=delete
octave::tree_statement_list * body(void)
void mark_fcn_file_up_to_date(const octave::sys::time &t)
octave::sys::time time_checked(void) const
virtual octave_value find_subfunction(const std::string &) const
octave::file_info * m_file_info
octave::sys::time time_parsed(void) const
void stash_fcn_file_time(const octave::sys::time &t)
octave::symbol_scope scope(void)
bool is_user_code(void) const
octave::sys::time t_parsed
octave::symbol_scope m_scope
octave_user_code(const std::string &fnm="", const std::string &nm="", const octave::symbol_scope &scope=octave::symbol_scope(), octave::tree_statement_list *cmds=nullptr, const std::string &ds="")
octave::sys::time t_checked
octave::tree_statement_list * cmd_list
octave::symbol_scope parent_fcn_scope(void) const
std::string parent_fcn_name(void) const
octave::jit_function_info * get_info(void)
octave::tree_parameter_list * ret_list
bool is_legacy_method(const std::string &cname="") const
void stash_trailing_comment(octave::comment_list *tc)
void stash_function_name(const std::string &s)
bool is_nested_function(void) const
octave::comment_list * trail_comm
bool is_special_expr(void) const
void mark_as_anonymous_function(void)
octave::tree_parameter_list * return_list(void)
octave_function * function_value(bool=false)
int ending_line(void) const
bool is_classdef_constructor(const std::string &cname="") const
octave::tree_parameter_list * parameter_list(void)
class_method_type class_constructor
octave_user_function * define_param_list(octave::tree_parameter_list *t)
bool is_user_function(void) const
void mark_as_classdef_method(void)
bool is_system_fcn_file(void) const
octave_user_function * user_function_value(bool=false)
bool is_legacy_constructor(const std::string &cname="") const
bool is_classdef_method(const std::string &cname="") const
int ending_column(void) const
int beginning_column(void) const
void mark_as_classdef_constructor(void)
octave::jit_function_info * jit_info
void mark_as_legacy_constructor(void)
bool is_anonymous_function_of_class(const std::string &cname="") const
octave_user_code * user_code_value(bool=false)
bool is_inline_function(void) const
void stash_parent_fcn_name(const std::string &p)
void stash_info(octave::jit_function_info *info)
octave::comment_list * lead_comm
std::list< std::string > parent_fcn_names(void) const
void stash_leading_comment(octave::comment_list *lc)
bool is_subfunction(void) const
bool is_parent_function(void) const
int beginning_line(void) const
void stash_fcn_location(int line, int col)
void stash_fcn_end_location(int line, int col)
octave_user_function(const octave_user_function &fn)=delete
void mark_as_legacy_method(void)
void mark_as_subfunction(void)
void mark_as_inline_function(void)
octave::comment_list * trailing_comment(void)
octave::tree_parameter_list * param_list
bool is_anonymous_function(void) const
class_method_type class_method
void mark_as_nested_function(void)
octave::comment_list * leading_comment(void)
~octave_user_script(void)=default
bool is_user_script(void) const
octave_user_script(const octave_user_script &f)=delete
octave_user_code * user_code_value(bool=false)
octave_function * function_value(bool=false)
octave_user_script * user_script_value(bool=false)
F77_RET_T const F77_DBLE const F77_DBLE * f
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA