26#if defined (HAVE_CONFIG_H)
32#include <condition_variable>
116 void repl (
const std::string& prompt =
"debug> ");
154 unwind_action act (server_mode_fptr, &tw,
true);
190 command_editor::run_event_hooks ();
196 catch (
const interrupt_exception&)
205 catch (
const index_exception& e)
209 std::cerr <<
"error: unhandled index exception: "
210 << e.message () <<
" -- trying to return to prompt"
238 catch (
const std::bad_alloc&)
242 std::cerr <<
"error: out of memory -- trying to return to prompt"
246 while (exit_status == 0);
248 if (exit_status == EOF)
261 unwind_protect frame;
278 std::string fcn_file_nm, fcn_nm;
283 fcn_nm = fcn_file_nm.empty () ? caller->
name () : fcn_file_nm;
288 std::ostringstream buf;
294 if (! fcn_nm.empty ())
298 static char ctrl_z =
'Z' & 0x1f;
300 buf << ctrl_z << ctrl_z << fcn_nm <<
':' << curr_debug_line;
312 frm->display_stopped_in_message (buf);
320 fcn_nm, curr_debug_line);
324 std::string line_buf;
329 if (! line_buf.empty ())
330 buf << curr_debug_line <<
": " << line_buf;
336 command_editor::erase_empty_line (
true);
338 std::string stopped_in_msg = buf.str ();
342 if (! stopped_in_msg.empty ())
351 std::shared_ptr<push_parser>
360 if (! stopped_in_msg.empty ())
361 std::cerr << stopped_in_msg << std::endl;
363 std::string tmp_prompt = prompt_arg;
365 tmp_prompt =
"[" + std::to_string (
m_level) +
"]" + prompt_arg;
368 input_sys.
PS1 (tmp_prompt);
388 frame.add (forced_interactive_fptr, app,
395#if defined (OCTAVE_ENABLE_COMMAND_LINE_PUSH_PARSER)
419 debug_parser.reset ();
421#if defined (OCTAVE_ENABLE_COMMAND_LINE_PUSH_PARSER)
426 = command_editor::decode_prompt_string (tmp_prompt);
431 std::string input_line = reader.
get_input (prompt, eof);
439 retval = debug_parser.run (input_line,
false);
441 prompt = command_editor::decode_prompt_string (input_sys.
PS2 ());
447 int retval = debug_parser.run ();
450 if (command_editor::interrupt (
false))
462 std::shared_ptr<tree_statement_list> stmt_list
463 = debug_parser.statement_list ();
466 stmt_list->accept (tw);
550 fname = fcn->
name ();
553 if (opt ==
"fullpathext")
557 std::size_t epos = fname.rfind (
'.');
560 epos = std::string::npos;
562 if (epos != std::string::npos)
563 fname = fname.substr (0, epos);
565 if (opt ==
"fullpath")
568 if (dpos != std::string::npos)
569 fname = fname.substr (dpos+1);
575 bool& incomplete_parse)
577 incomplete_parse =
false;
602 if (command_history::add (
input))
609 std::shared_ptr<tree_statement_list>
610 stmt_list =
m_parser->statement_list ();
614 command_editor::increment_current_command_number ();
620 else if (
m_parser->at_end_of_input ())
624 incomplete_parse =
true;
641 std::unique_lock<std::mutex> lock (mtx);
642 std::condition_variable cv;
643 bool incomplete_parse =
false;
644 bool evaluation_pending =
false;
645 bool exiting =
false;
656 std::string ps = incomplete_parse ? input_sys.
PS2 () : input_sys.
PS1 ();
658 std::cout << command_editor::decode_prompt_string (ps);
661 std::getline (std::cin,
input);
666 incomplete_parse =
false;
667 evaluation_pending =
true;
675 std::lock_guard<std::mutex> local_lock (mtx);
681 catch (
const exit_exception&)
683 evaluation_pending =
false;
699 evaluation_pending =
false;
704 evaluation_pending =
false;
706 throw exit_exception (1);
711 evaluation_pending =
false;
716 evaluation_pending =
false;
723 cv.wait (lock, [&] {
return ! evaluation_pending; });
743#if defined (OCTAVE_ENABLE_COMMAND_LINE_PUSH_PARSER)
744 static bool use_command_line_push_parser =
true;
746 static bool use_command_line_push_parser =
false;
754 std::shared_ptr<base_parser> repl_parser;
758 if (use_command_line_push_parser)
764 repl_parser = std::shared_ptr<base_parser> (pp);
769 repl_parser = std::shared_ptr<base_parser> (pp);
775 repl_parser = std::shared_ptr<base_parser> (pp);
784 repl_parser->reset ();
792 exit_status = repl_parser->run ();
794 if (exit_status == 0)
796 std::shared_ptr<tree_statement_list>
797 stmt_list = repl_parser->statement_list ();
801 command_editor::increment_current_command_number ();
805 else if (repl_parser->at_end_of_input ())
812 catch (
const interrupt_exception&)
820 catch (
const index_exception& ie)
824 std::cerr <<
"error: unhandled index exception: "
825 << ie.message () <<
" -- trying to return to prompt"
850 catch (
const std::bad_alloc&)
854 std::cerr <<
"error: out of memory -- trying to return to prompt"
858 while (exit_status == 0);
860 if (exit_status == EOF)
879 std::shared_ptr<push_parser> parser (
new push_parser (
m_interpreter));
880 unwind_protect_var<std::shared_ptr<push_parser>> upv2 (
m_parser, parser);
902 command_editor::run_event_hooks ();
908 catch (
const interrupt_exception&)
918 catch (
const index_exception& e)
923 std::cerr <<
"error: unhandled index exception: "
924 << e.message () <<
" -- trying to return to prompt"
952 catch (
const exit_exception& xe)
957 catch (
const std::bad_alloc&)
962 std::cerr <<
"error: out of memory -- trying to return to prompt"
984 stmt_list->accept (*
this);
1013 int& parse_status,
int nargout)
1021 eval_parser.reset ();
1030 eval_parser.disallow_command_syntax ();
1032 parse_status = eval_parser.run ();
1034 if (parse_status == 0)
1036 std::shared_ptr<tree_statement_list> stmt_list
1037 = eval_parser.statement_list ();
1041 tree_statement *stmt =
nullptr;
1043 if (stmt_list->length () == 1
1044 && (stmt = stmt_list->front ())
1045 && stmt->is_expression ())
1047 tree_expression *expr = stmt->expression ();
1050 expr->set_print_flag (
false);
1052 retval = expr->evaluate_n (*
this, nargout);
1054 bool do_bind_ans =
false;
1056 if (expr->is_identifier ())
1059 do_bind_ans = ! expr->is_assignment_expression ();
1061 if (do_bind_ans && ! retval.
empty ())
1062 bind_ans (retval(0), expr->print_result ());
1067 else if (nargout == 0)
1068 stmt_list->accept (*
this);
1070 error (
"eval: invalid use of statement list");
1075 else if (eval_parser.at_end_of_input ())
1079 while (parse_status == 0);
1085 bool silent,
int& parse_status)
1098 bool silent,
int& parse_status,
1101 std::string s = arg.
xstring_value (
"eval: expecting string argument");
1103 return eval_string (s, silent, parse_status, nargout);
1109 int parse_status = 0;
1111 return eval_string (try_code, nargout > 0, parse_status, nargout);
1115 const std::string& catch_code,
1122 int parse_status = 0;
1124 bool execution_error =
false;
1130 tmp =
eval_string (try_code, nargout > 0, parse_status, nargout);
1137 execution_error =
true;
1140 if (parse_status != 0 || execution_error)
1142 tmp =
eval_string (catch_code, nargout > 0, parse_status, nargout);
1154 if (execution_error)
1162 const std::string& try_code,
1165 unwind_action act ([=] (std::size_t frm)
1170 if (context ==
"caller")
1172 else if (context ==
"base")
1175 error (R
"(evalin: CONTEXT must be "caller" or "base")");
1177 int parse_status = 0;
1179 return eval_string (try_code, nargout > 0, parse_status, nargout);
1183 const std::string& try_code,
1184 const std::string& catch_code,
1189 unwind_action act1 ([=] (std::size_t frm)
1194 if (context ==
"caller")
1196 else if (context ==
"base")
1199 error (R
"(evalin: CONTEXT must be "caller" or "base")");
1203 int parse_status = 0;
1205 bool execution_error =
false;
1211 tmp =
eval_string (try_code, nargout > 0, parse_status, nargout);
1218 execution_error =
true;
1221 if (parse_status != 0 || execution_error)
1223 tmp =
eval_string (catch_code, nargout > 0, parse_status, nargout);
1235 if (execution_error)
1257 warning (
"function arguments validation blocks are not supported; INCORRECT RESULTS ARE POSSIBLE");
1313 int line = cmd.line ();
1326 error (
"break must appear in a loop in the same file as loop command");
1340 int line = cmd.line ();
1379 unwind_protect frame;
1381 frame.add (command_history::ignore_entries,
1382 command_history::ignoring_entries ());
1384 command_history::ignore_entries (
false);
1416 frame.add ([=] (
void)
1423 dbgr->
repl (prompt);
1450 for (
const auto& lval : *lvalues)
1451 nbh += lval.is_black_hole ();
1460 for (
const auto& lval : *lvalues)
1462 if (lval.is_black_hole ())
1488 std::size_t
len =
name.length ();
1490 if (
len == 3 &&
name ==
".**")
1526 else if (
name[1] ==
'=')
1547 else if (
name ==
"**")
1560 return "ctranspose";
1620 bool name_is_operator = fcn_name !=
name;
1622 std::size_t pos = fcn_name.find (
'.');
1624 if (pos != std::string::npos)
1643 std::string meth_nm = fcn_name.substr (pos+1);
1645 if (meth_nm.find (
'.') == std::string::npos)
1647 std::string obj_nm = fcn_name.substr (0, pos);
1654 if (
object.
is_defined () &&
object.is_classdef_object ())
1666 cdef_method meth = cls.find_method (meth_nm);
1676 if (meth.is_static ())
1677 fcn_name = class_nm +
'.' + meth_nm;
1726 bool skip_first = name_is_operator;
1735 if (! name_is_operator)
1740 std::shared_ptr<stack_frame> frame
1756 && (fcn_name == curr_fcn->
name ()
1758 frame = frame->access_link ();
1859 tree_identifier *
id = elt->ident ();
1867 std::shared_ptr<stack_frame> frame
1870 return frame->is_variable (
name);
1876 std::shared_ptr<stack_frame> frame
1879 return frame->is_local_variable (
name);
1885 if (expr->is_identifier ())
1887 const tree_identifier *
id
1888 =
dynamic_cast<const tree_identifier *
> (expr);
1890 if (id->is_black_hole ())
1902 if (expr->is_identifier ())
1904 const tree_identifier *
id
1905 =
dynamic_cast<const tree_identifier *
> (expr);
1916 std::shared_ptr<stack_frame> frame
1919 return frame->is_variable (sym);
1925 std::shared_ptr<stack_frame> frame
1928 return frame->is_defined (sym);
1933 std::shared_ptr<stack_frame> frame
1936 return frame->is_global (
name);
1942 std::shared_ptr<stack_frame> frame
1945 return frame->varval (sym);
1951 std::shared_ptr<stack_frame> frame
1954 return frame->varval (
name);
1961 std::shared_ptr<stack_frame> frame
1964 return frame->install_variable (
name, value, global);
2002 std::shared_ptr<stack_frame> frame
2005 frame->assign (
name, val);
2016 unwind_action act ([=] (std::size_t frm)
2021 if (context ==
"caller")
2023 else if (context ==
"base")
2026 error (R
"(assignin: CONTEXT must be "caller" or "base")");
2035 error (
"assignin: invalid assignment to keyword '%s'",
2041 error (
"assignin: invalid variable name '%s'",
name.c_str ());
2046 const std::string& context,
2047 bool verbose,
bool require_file)
2082 static std::map<std::string, int> source_call_depth;
2084 std::string file_full_name
2090 std::string dir_name = file_full_name.substr (0, pos);
2094 unwind_protect frame;
2096 if (source_call_depth.find (file_full_name) == source_call_depth.end ())
2097 source_call_depth[file_full_name] = -1;
2099 frame.protect_var (source_call_depth[file_full_name]);
2101 source_call_depth[file_full_name]++;
2104 error (
"max_recursion_depth exceeded");
2106 if (! context.empty ())
2111 if (context ==
"caller")
2113 else if (context ==
"base")
2116 error (R
"(source: CONTEXT must be "caller" or "base")");
2122 dir_end = (dir_end == std::string::npos) ? 0 : dir_end + 1;
2124 std::size_t extension = file_name.find_last_of (
'.');
2125 if (extension == std::string::npos)
2126 extension = file_name.length ();
2128 std::string symbol = file_name.substr (dir_end, extension - dir_end);
2164 file_name, dir_name,
"",
"",
2165 require_file,
true,
false,
false);
2169 error (ee,
"source: error sourcing file '%s'",
2170 file_full_name.c_str ());
2180 error (
"source: %s is not a script", full_name.c_str ());
2184 octave_stdout <<
"executing commands from " << full_name <<
" ... ";
2213 if (! param_list || param_list->varargs_only ())
2218 for (tree_decl_elt *elt : *param_list)
2222 octave_lvalue ref = elt->lvalue (*
this);
2226 if (args(i).
is_defined () && args(i).is_magic_colon ())
2229 error (
"no default value for argument %d", i+1);
2232 ref.define (args(i));
2242 for (tree_decl_elt *elt : *param_list)
2244 octave_lvalue ref = elt->lvalue (*
this);
2297 std::list<octave_value> arg_vals;
2299 for (
auto elt : *args)
2313 arg_vals.push_back (tmp_ovl(i));
2316 arg_vals.push_back (tmp);
2324 (tree_parameter_list *ret_list,
int nargout,
const Matrix& ignored_outputs,
2325 const Cell& varargout)
2328 int len = ret_list->length ();
2337 int num_ignored = ignored_outputs.
numel ();
2338 int ignored = num_ignored > 0 ? ignored_outputs(k) - 1 : -1;
2342 int nout = nargout > 0 ? nargout : 1;
2345 for (tree_decl_elt *elt : *ret_list)
2347 if (nargout == 0 && !
is_defined (elt->ident ()))
2350 if (ignored >= 0 && i == ignored)
2354 ignored = k < num_ignored ? ignored_outputs(k) - 1 : -1;
2369 for (tree_decl_elt *elt : *ret_list)
2371 if (ignored >= 0 && i == ignored)
2375 ignored = k < num_ignored ? ignored_outputs(k) - 1 : -1;
2382 retval(i++) = varargout(j);
2392 bool retval =
false;
2394 tree_identifier *
id = elt->ident ();
2395 tree_expression *expr = elt->expression ();
2399 octave_lvalue ult =
id->lvalue (*
this);
2415 tree_expression *label = expr->case_label ();
2421 if (label_value.
iscell ())
2429 bool match = val.
is_equal (cell(i,j));
2449 const std::shared_ptr<stack_frame>& closure_frames)
2455 const stack_frame::local_vars_map& local_vars,
2456 const std::shared_ptr<stack_frame>& closure_frames)
2500 frm->display_stopped_in_message (os);
2570 std::list<std::shared_ptr<stack_frame>>
2576 std::list<std::shared_ptr<stack_frame>>
2582 std::list<frame_info>
2584 bool print_subfn)
const
2596 bool print_subfn)
const
2615 std::ostringstream buf;
2617 for (
const auto& frm : frames)
2619 buf <<
" " << frm.fcn_name ();
2621 int line = frm.line ();
2625 buf <<
" at line " << line;
2627 int column = frm.column ();
2630 buf <<
" column " << column;
2641 symbol_scope dummy_scope (
name +
"$dummy");
2666 error (
"mlock: invalid use outside a function");
2670 warning (
"mlock: locking built-in function has no effect");
2682 error (
"munlock: invalid use outside a function");
2686 warning (
"munlock: unlocking built-in function has no effect");
2698 error (
"mislocked: invalid use outside a function");
2716 std::shared_ptr<stack_frame> frame
2740 std::shared_ptr<stack_frame> frame
2743 frame->clear_objects ();
2748 std::shared_ptr<stack_frame> frame
2751 frame->clear_variable (
name);
2756 std::shared_ptr<stack_frame> frame
2759 frame->clear_variable_pattern (pattern);
2764 std::shared_ptr<stack_frame> frame
2767 frame->clear_variable_regexp (pattern);
2772 std::shared_ptr<stack_frame> frame
2775 frame->clear_variables ();
2865 const std::string& class_name)
2873 std::string
name = fname;
2877 auto beg =
name.begin () + 2;
2878 auto end =
name.end () - 1;
2882 std::size_t name_len =
name.length ();
2884 if (name_len > 2 &&
name.substr (name_len-2) ==
".m")
2885 name =
name.substr (0, name_len-2);
2893 std::size_t p2 = std::string::npos;
2899 if (p1 == std::string::npos)
2902 std::string dispatch_type =
name.substr (1, p1-1);
2904 p2 =
name.find (
'>', p1);
2906 std::string method =
name.substr (p1+1, p2-1);
2910 else if (! class_name.empty ())
2914 fcn = cdm.find_method (class_name,
name);
2922 p2 =
name.find (
'>');
2924 std::string main_fcn =
name.substr (0, p2);
2930 std::string subfuns;
2932 if (p2 != std::string::npos)
2933 subfuns =
name.substr (p2+1);
2938 if (! user_code || subfuns.empty ())
2958 return curfcn->
name ();
2974 int line = cmd.line ();
2987 tree_decl_init_list *init_list = cmd.initializer_list ();
2990 init_list->accept (*
this);
2996 tree_identifier *
id = elt.ident ();
3000 if (elt.is_global ())
3002 else if (elt.is_persistent ())
3005 error (
"declaration list element not global or persistent");
3007 octave_lvalue ult =
id->lvalue (*
this);
3009 if (ult.is_undefined ())
3011 tree_expression *expr = elt.expression ();
3016 init_val = expr->evaluate (*
this);
3025 template <
typename T>
3029 tree_statement_list *loop_body)
3035 "FOR loop limit is infinite, will stop after %"
3036 OCTAVE_IDX_TYPE_FORMAT
" steps", steps);
3048 loop_body->accept (*
this);
3058 int line = cmd.line ();
3076 tree_expression *expr = cmd.control_expr ();
3083 tree_expression *lhs = cmd.left_hand_side ();
3085 octave_lvalue ult = lhs->lvalue (*
this);
3087 tree_statement_list *loop_body = cmd.body ();
3166 loop_body->accept (*
this);
3189 if (rhs.
ndims () > 2)
3192 if (nrows > 0 && steps > 0)
3222 loop_body->accept (*
this);
3237 error (
"invalid type in for loop expression near line %d, column %d",
3238 cmd.line (), cmd.column ());
3244 int line = cmd.line ();
3259 tree_expression *expr = cmd.control_expr ();
3267 error (
"in statement 'for [X, Y] = VAL', VAL must be a structure");
3273 tree_argument_list *lhs = cmd.left_hand_side ();
3275 auto p = lhs->begin ();
3277 tree_expression *elt = *p++;
3279 octave_lvalue val_ref = elt->lvalue (*
this);
3283 octave_lvalue key_ref = elt->lvalue (*
this);
3287 tree_statement_list *loop_body = cmd.body ();
3298 std::string key = keys[i];
3310 loop_body->accept (*
this);
3321 tree_statement_list *body = cmd.body ();
3324 body->accept (*
this);
3343 if (args.
length () != 0 || nargout != 0)
3344 error (
"invalid call to script %s", file_name.c_str ());
3346 tree_statement_list *cmd_list = user_script.
body ();
3355 error (
"max_recursion_depth exceeded");
3366 cmd_list->accept (*
this);
3397 int nargin = args.
length ();
3403 ret_args = args.
slice (0, 1,
true);
3405 args = args.
slice (1, nargin,
true);
3414 tree_parameter_list *param_list =
user_function.parameter_list ();
3416 bool takes_varargs =
false;
3421 takes_varargs = param_list->takes_varargs ();
3422 max_inputs = param_list->length ();
3425 if (! takes_varargs && nargin > max_inputs)
3430 name =
"@<anonymous>";
3433 "%s: function called with too many inputs",
3439 tree_parameter_list *ret_list =
user_function.return_list ();
3441 if (ret_list && ! ret_list->takes_varargs ())
3443 int max_outputs = ret_list->length ();
3445 if (nargout > max_outputs)
3450 "%s: function called with too many outputs",
3465 error (
"%s: invalid classdef constructor, no output argument defined",
3475 error (
"max_recursion_depth exceeded");
3498 assert (cmd_list->length () == 1);
3500 tree_statement *stmt = cmd_list->front ();
3502 tree_expression *expr = stmt->expression ();
3508 retval = expr->evaluate_n (*
this, nargout);
3512 cmd_list->accept (*
this);
3527 if (ret_list->takes_varargs ())
3532 varargout = varargout_varval.
xcell_value (
"varargout must be a cell array object");
3564 std::string nm =
f->name ();
3594 int line = cmd.line ();
3604 tree_if_command_list *lst = cmd.cmd_list ();
3607 lst->accept (*
this);
3613 for (tree_if_clause *tic : lst)
3615 tree_expression *expr = tic->condition ();
3626 tree_statement_list *stmt_lst = tic->commands ();
3629 stmt_lst->accept (*
this);
3665 int line = cmd.line ();
3711 int line = cmd.line ();
3740 tree_command *cmd = stmt.command ();
3741 tree_expression *expr = stmt.expression ();
3753 unwind_protect_var<const std::list<octave_lvalue> *>
3756 cmd->accept (*
this);
3762 int line = stmt.line ();
3785 bool do_bind_ans =
false;
3787 if (expr->is_identifier ())
3790 do_bind_ans = ! expr->is_assignment_expression ();
3793 bind_ans (tmp_result, expr->print_result ()
3798 catch (
const std::bad_alloc&)
3806 "out of memory or dimension too large for Octave's index type");
3808 catch (
const interrupt_exception&)
3853 auto p = lst.begin ();
3855 if (p != lst.end ())
3859 tree_statement *elt = *p++;
3862 error (
"invalid statement found in statement list!");
3866 elt->accept (*
this);
3874 if (p == lst.end ())
3914 int line = cmd.line ();
3924 tree_expression *expr = cmd.switch_value ();
3927 error (
"missing value in switch command near line %d, column %d",
3928 cmd.line (), cmd.column ());
3932 tree_switch_case_list *lst = cmd.case_list ();
3936 for (tree_switch_case *t : *lst)
3940 tree_statement_list *stmt_lst = t->commands ();
3943 stmt_lst->accept (*
this);
3956 int line = cmd.line ();
3963 bool execution_error =
false;
3966 tree_statement_list *try_code = cmd.body ();
3972 unwind_protect frame;
3981 try_code->accept (*
this);
3985 execution_error =
true;
4002 if (execution_error)
4004 tree_statement_list *catch_code = cmd.cleanup ();
4008 tree_identifier *expr_id = cmd.identifier ();
4012 octave_lvalue ult = expr_id->lvalue (*
this);
4018 catch_code->accept (*
this);
4026 unwind_protect frame;
4054 list->accept (*
this);
4111 int line = cmd.line ();
4118 tree_statement_list *cleanup_code = cmd.cleanup ();
4120 tree_statement_list *unwind_protect_code = cmd.body ();
4122 if (unwind_protect_code)
4126 unwind_protect_code->accept (*
this);
4147 catch (
const interrupt_exception&)
4164 int line = cmd.line ();
4176 tree_expression *expr = cmd.condition ();
4191 tree_statement_list *loop_body = cmd.body ();
4194 loop_body->accept (*
this);
4207 int line = cmd.line ();
4219 tree_expression *expr = cmd.condition ();
4229 tree_statement_list *loop_body = cmd.body ();
4232 loop_body->accept (*
this);
4259 static std::string ans =
"ans";
4285 feval (
"display", args);
4295 stmt.is_end_of_fcn_or_script ());
4300 bool is_end_of_fcn_or_script)
4302 bool break_on_this_statement =
false;
4305 break_on_this_statement =
true;
4318 break_on_this_statement =
true;
4335 break_on_this_statement =
true;
4342 break_on_this_statement =
true;
4354 if (is_end_of_fcn_or_script
4359 if (! break_on_this_statement)
4364 if (break_on_this_statement)
4374 const char *warn_for)
4376 bool expr_value =
false;
4385 error (
"%s: undefined value used in conditional expression", warn_for);
4395 "max_recursion_depth", 0);
4430 func_names(i) = fcn_fname.first;
4431 file_names(i) = fcn_fname.second;
4438 m.
assign (
"function", func_names);
4439 m.
assign (
"file", file_names);
4462 std::list<std::string> names;
4465 names.push_back (fcn_fname.first);
4470 std::list<std::string>
4473 std::list<std::string> names;
4476 if (nm == fcn_fname.second)
4477 names.push_back (fcn_fname.first);
4483 const std::string& nm)
4491 const std::string& nm)
4507 "whos_line_format");
4514 "silent_functions");
4521 "string_fill_char");
4529 const tree_expression *expr)
4531 std::string extra_message;
4535 std::string var = expr->name ();
4547 if (fp && fp->
name () == var)
4549 =
" (note: variable '" + var +
"' shadows function)";
4553 std::string msg = ie.message () + extra_message;
4560 bool return_list,
bool verbose)
4573 unwind_protect_var<const std::list<octave_lvalue> *>
4576 int len = args->length ();
4583 std::list<octave_value> arg_vals;
4587 for (
auto elt : *args)
4603 arg_vals.push_back (tmp_ovl(i));
4606 arg_vals.push_back (tmp);
4620 std::list<octave_lvalue>
4623 std::list<octave_lvalue> retval;
4625 for (tree_expression *elt : *lhs)
4626 retval.push_back (elt->lvalue (*
this));
4736 std::string arg0 = argv[0];
4740 else if (arg0 ==
"off")
4748 error (
"echo: no such file %s", arg0.c_str ());
4775 p->second = ! p->second;
4784 std::string arg0 = argv[0];
4785 std::string arg1 = argv[1];
4787 if (arg1 ==
"on" || arg1 ==
"off")
4788 std::swap (arg0, arg1);
4803 error (
"echo: no such file %s", arg1.c_str ());
4809 else if (arg0 ==
"off")
4822 error (
"echo: no such file %s", arg1.c_str ());
4866 int ndims = dv.
ndims ();
4868 if (num_indices < ndims)
4870 for (
int i = num_indices; i < ndims; i++)
4871 dv(num_indices-1) *= dv(i);
4873 if (num_indices == 1)
4881 ndims = num_indices;
4886 return (index_position < ndims
4893 int nargin = args.
length ();
4895 if (nargin != 0 && nargin != 3)
4901 = args(1).xidx_type_value (
"end: K must be integer value");
4904 error (
"end: K must be greater than zero");
4907 = args(2).xidx_type_value (
"end: N must be integer value");
4910 error (
"end: N must be greater than zero");
4922 error (
"invalid use of 'end': may only be used to index existing value");
4939 unwind_action act ([=] (std::size_t frm)
4961 catch (
const index_exception&)
4963 error (
"error evaluating partial expression for END");
4973 std::string dispatch_class = expr_result.
class_name ();
5028 std::string prefix = command_editor::decode_prompt_string (
m_PS4);
5038 std::deque<std::string> lines
5041 for (
auto& elt : lines)
5065 const Matrix& ignored_outputs,
5066 int nargin,
int nargout,
5086 std::string full_name = nm;
5096 if (! fname.empty ())
5101 sys::file_stat fs (fname + nm);
5105 full_name = fname + nm;
5113 "autoload: '%s' is not an absolute filename",
5119DEFMETHOD (max_recursion_depth, interp, args, nargout,
5154DEFMETHOD (whos_line_format, interp, args, nargout,
5235DEFMETHOD (silent_functions, interp, args, nargout,
5269DEFMETHOD (string_fill_char, interp, args, nargout,
5337 return tw.
PS4 (args, nargout);
5383 return tw.
echo (args, nargout);
F77_RET_T const F77_DBLE const F77_DBLE const F77_INT const F77_DBLE const F77_DBLE const F77_DBLE F77_DBLE F77_DBLE F77_INT F77_INT const F77_INT const F77_INT F77_INT F77_INT F77_DBLE *F77_RET_T const F77_DBLE const F77_INT const F77_DBLE const F77_DBLE F77_DBLE F77_DBLE F77_INT F77_INT const F77_INT const F77_INT F77_INT F77_INT F77_DBLE *F77_RET_T const F77_REAL const F77_REAL const F77_INT const F77_REAL const F77_REAL const F77_REAL F77_REAL F77_REAL F77_INT F77_INT const F77_INT const F77_INT F77_INT F77_INT F77_REAL *F77_RET_T const F77_REAL const F77_INT const F77_REAL const F77_REAL F77_REAL F77_REAL F77_INT F77_INT const F77_INT const F77_INT F77_INT F77_INT F77_REAL *static F77_INT user_function(const double &x, int &, double &result)
octave_idx_type numel(void) const
Number of elements in the array.
octave_idx_type rows(void) const
octave_idx_type columns(void) const
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
static bool forced_interactive(void)
void forced_interactive(bool arg)
static application * app(void)
void set_dispatch_class(const std::string &class_name)
octave_value do_who(int argc, const string_vector &argv, bool return_list, bool verbose=false)
octave_value get_top_level_value(const std::string &name) const
octave_value global_varval(const std::string &name) const
std::list< frame_info > backtrace_info(octave_idx_type &curr_user_frame, bool print_subfn=true) const
octave_map backtrace(octave_idx_type &curr_user_frame, bool print_subfn=true) const
symbol_scope current_scope(void) const
octave_value & global_varref(const std::string &name)
void set_top_level_value(const std::string &name, const octave_value &value)
void goto_base_frame(void)
octave_value get_auto_fcn_var(stack_frame::auto_var_type avt) const
symbol_info_list top_scope_symbol_info(void) const
std::string get_dispatch_class(void) const
symbol_info_list regexp_symbol_info(const std::string &pattern) const
void make_global(const symbol_record &sym)
octave_user_code * current_user_code(void) const
int current_line(void) const
symbol_info_list get_symbol_info(void)
symbol_info_list glob_symbol_info(const std::string &pattern) const
void restore_frame(std::size_t n)
bool is_class_method_executing(std::string &dispatch_class) const
bool goto_frame(std::size_t n=0, bool verbose=false)
void set_auto_fcn_var(stack_frame::auto_var_type avt, const octave_value &val)
int current_column(void) const
void clear_global_variables(void)
int current_user_code_line(void) const
std::size_t current_frame(void) const
std::list< std::string > variable_names(void) const
std::list< std::shared_ptr< stack_frame > > backtrace_frames(octave_idx_type &curr_user_frame) const
void set_location(int l, int c)
bool is_class_constructor_executing(std::string &dispatch_class) const
octave_function * current_function(bool skip_first=false) const
std::shared_ptr< stack_frame > get_current_stack_frame(void) const
void clear_global_variable_pattern(const std::string &pattern)
std::shared_ptr< stack_frame > current_user_frame(void) const
void push(const symbol_scope &scope)
octave_user_code * debug_user_code(void) const
std::list< std::string > top_level_variable_names(void) const
void clear_global_variable(const std::string &name)
std::size_t find_current_user_frame(void) const
std::list< std::string > global_variable_names(void) const
int debug_user_code_line(void) const
std::size_t dbupdown(std::size_t start, int n, bool verbose)
bool at_top_level(void) const
std::size_t size(void) const
int debug_user_code_column(void) const
unwind_protect * curr_fcn_unwind_protect_frame(void)
void clear_global_variable_regexp(const std::string &pattern)
void goto_caller_frame(void)
octave_map empty_backtrace(void) const
symbol_scope top_scope(void) const
void make_persistent(const symbol_record &sym)
octave_value max_stack_depth(const octave_value_list &args, int nargout)
void dbquit(bool all=false)
bool quitting_debugger(void) const
interpreter & m_interpreter
execution_mode m_execution_mode
void repl(const std::string &prompt="debug> ")
bool in_debug_repl(void) const
std::size_t m_debug_frame
debugger(interpreter &interp, std::size_t level)
Vector representing the dimensions (size) of an Array.
void resize(int n, int fill_value=0)
octave_idx_type ndims(void) const
Number of dimensions.
OCTAVE_API dim_vector redim(int n) const
Force certain dimensionality, preserving numel ().
OCTINTERP_API octave_value last_error_id(const octave_value_list &args, int nargout)
OCTINTERP_API octave_value debug_on_warning(const octave_value_list &args, int nargout)
OCTINTERP_API void display_exception(const execution_exception &ee, std::ostream &os) const
void set_debug_on_warning(bool flag)
OCTINTERP_API octave_value debug_on_caught(const octave_value_list &args, int nargout)
OCTINTERP_API void save_exception(const execution_exception &ee)
OCTINTERP_API octave_value debug_on_error(const octave_value_list &args, int nargout)
OCTINTERP_API octave_value last_error_message(const octave_value_list &args, int nargout)
octave_map last_error_stack(void) const
void set_debug_on_error(bool flag)
Provides threadsafe access to octave.
void append_history(const std::string &hist_entry)
void push_event_queue(void)
OCTINTERP_API void set_workspace(void)
void enter_debugger_event(const std::string &fcn_name, const std::string &fcn_file_name, int line)
void pop_event_queue(void)
OCTINTERP_API void post_event(const fcn_callback &fcn)
void execute_in_debugger_event(const std::string &file, int line)
void pre_input_event(void)
bool in_top_level_repl(void) const
error_system & get_error_system(void)
bool server_mode(void) const
load_path & get_load_path(void)
tree_evaluator & get_evaluator(void)
symbol_table & get_symbol_table(void)
event_manager & get_event_manager(void)
void parse_and_execute(const std::string &input, bool &incomplete_parse)
input_system & get_input_system(void)
cdef_manager & get_cdef_manager(void)
octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
bool interactive(void) const
void recover_from_exception(void)
std::string find_file(const std::string &file) const
OCTAVE_API void stamp(void)
virtual bool is_user_code(void) const
virtual bool is_user_function(void) const
virtual bool is_builtin_function(void) const
octave_classdef * classdef_object_value(bool=false)
octave::cdef_object get_object(void) const
std::string class_name(void) const
std::string dispatch_class(void) const
bool is_private_function(void) const
bool is_class_method(const std::string &cname="") const
bool is_class_constructor(const std::string &cname="") const
virtual bool is_subfunction(void) const
virtual std::list< std::string > parent_fcn_names(void) const
bool islocked(void) const
virtual std::string parent_fcn_name(void) const
virtual octave_value_list call(octave::tree_evaluator &tw, int nargout=0, const octave_value_list &args=octave_value_list())
std::string name(void) const
virtual bool is_nested_function(void) const
const Cell & contents(const_iterator p) const
void assign(const std::string &k, const Cell &val)
string_vector keys(void) const
void assign(const std::string &k, const octave_value &val)
std::string fcn_file_name(void) const
std::string get_code_line(std::size_t line)
octave::tree_statement_list * body(void)
std::deque< std::string > get_code_lines(std::size_t line, std::size_t num_lines)
virtual octave_value find_subfunction(const std::string &) const
Cell cell_value(void) const
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
void stash_name_tags(const string_vector &nm)
octave_idx_type length(void) const
string_vector name_tags(void) const
octave_value_list slice(octave_idx_type offset, octave_idx_type len, bool tags=false) const
string_vector make_argv(const std::string &="") const
bool is_function(void) const
OCTINTERP_API octave_value_list list_value(void) const
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
OCTINTERP_API std::string xstring_value(const char *fmt,...) const
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
OCTINTERP_API octave_function * function_value(bool silent=false) const
bool is_uint16_type(void) const
bool is_int8_type(void) const
OCTINTERP_API Cell xcell_value(const char *fmt,...) const
bool is_scalar_type(void) const
bool is_cs_list(void) const
bool is_string(void) const
bool is_user_code(void) const
OCTINTERP_API octave_value storable_value(void) const
bool is_defined(void) const
bool is_double_type(void) const
Cell cell_value(void) const
bool is_equal(const octave_value &) const
std::string class_name(void) const
bool is_uint32_type(void) const
bool is_int64_type(void) const
bool isstruct(void) const
octave_value reshape(const dim_vector &dv) const
OCTINTERP_API octave_value & assign(assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
bool is_matrix_type(void) const
bool is_int32_type(void) const
bool is_uint64_type(void) const
bool is_int16_type(void) const
octave::range< double > range_value(void) const
bool is_range(void) const
bool is_single_type(void) const
OCTINTERP_API octave_map map_value(void) const
bool isobject(void) const
bool is_undefined(void) const
OCTINTERP_API octave_user_code * user_code_value(bool silent=false) const
bool is_uint8_type(void) const
dim_vector dims(void) const
~quit_debug_exception(void)=default
quit_debug_exception & operator=(const quit_debug_exception &)=default
quit_debug_exception(const quit_debug_exception &)=default
quit_debug_exception(bool all=false)
octave_idx_type numel(void) const
octave_value find_scoped_function(const std::string &name, const symbol_scope &search_scope)
octave_value find_method(const std::string &name, const std::string &dispatch_type)
void clear_function(const std::string &name)
void clear_function_pattern(const std::string &pat)
void clear_functions(bool force=false)
void install_cmdline_function(const std::string &name, const octave_value &fcn)
void clear_dld_function(const std::string &name)
octave_value find_function(const std::string &name, const symbol_scope &search_scope=symbol_scope())
octave_value find_user_function(const std::string &name)
void clear_function_regexp(const std::string &pat)
octave_value fcn_table_find(const std::string &name, const octave_value_list &args=ovl(), const symbol_scope &search_scope=symbol_scope())
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
bool switch_case_label_matches(tree_switch_case *expr, const octave_value &val)
void reset_debug_state(void)
std::size_t m_debug_frame
octave_value_list execute_user_function(octave_user_function &user_function, int nargout, const octave_value_list &args)
std::stack< debugger * > m_debugger_stack
void visit_break_command(tree_break_command &)
bool is_global(const std::string &name) const
void goto_caller_frame(void)
void visit_octave_user_function(octave_user_function &)
void visit_unwind_protect_command(tree_unwind_protect_command &)
bool mislocked(bool skip_first=false) const
std::list< std::string > autoloaded_functions(void) const
symbol_info_list get_symbol_info(void)
void bind_ans(const octave_value &val, bool print)
void visit_return_command(tree_return_command &)
bool statement_printing_enabled(void)
void clear_all(bool force=false)
void visit_statement_list(tree_statement_list &)
octave_value evaluate(tree_decl_elt *)
void visit_anon_fcn_handle(tree_anon_fcn_handle &)
void source_file(const std::string &file_name, const std::string &context="", bool verbose=false, bool require_file=true)
void visit_cell(tree_cell &)
void push_echo_state_cleanup(unwind_protect &frame)
int dbstep_flag(void) const
std::list< octave_value_list > m_index_list
octave_value echo(const octave_value_list &args, int nargout)
std::list< frame_info > backtrace_info(void) const
octave_value_list evaluate_end_expression(const octave_value_list &args)
void add_autoload(const std::string &fcn, const std::string &nm)
void visit_constant(tree_constant &)
void keyboard(const std::string &prompt="keyboard> ")
void visit_superclass_ref(tree_superclass_ref &)
void visit_simple_assignment(tree_simple_assignment &)
interpreter & m_interpreter
octave_value & global_varref(const std::string &name)
void do_breakpoint(tree_statement &stmt)
octave_map empty_backtrace(void) const
symbol_scope get_current_scope(void) const
void final_index_error(index_exception &ie, const tree_expression *expr)
symbol_scope get_top_scope(void) const
char string_fill_char(void) const
bool at_top_level(void) const
void visit_args_block_validation_list(tree_args_block_validation_list &)
void debug_where(std::ostream &os) const
void goto_base_frame(void)
octave_user_code * current_user_code(void) const
void clear_global_variable(const std::string &name)
void set_dispatch_class(const std::string &class_name)
void visit_boolean_expression(tree_boolean_expression &)
bool goto_frame(std::size_t n=0, bool verbose=false)
void visit_switch_case(tree_switch_case &)
stmt_list_type m_statement_context
void munlock(bool skip_first=false) const
octave_user_code * get_user_code(const std::string &fname="", const std::string &class_name="")
void visit_arg_validation(tree_arg_validation &)
void pop_stack_frame(void)
octave_value get_auto_fcn_var(stack_frame::auto_var_type avt) const
void remove_autoload(const std::string &fcn, const std::string &nm)
Matrix ignored_fcn_outputs(void) const
int max_recursion_depth(void) const
bool is_logically_true(tree_expression *expr, const char *warn_for)
void visit_octave_user_function_header(octave_user_function &)
void visit_arg_size_spec(tree_arg_size_spec &)
void visit_multi_assignment(tree_multi_assignment &)
void visit_continue_command(tree_continue_command &)
octave_value find(const std::string &name)
void visit_while_command(tree_while_command &)
void visit_do_until_command(tree_do_until_command &)
std::size_t debug_frame(void) const
void visit_index_expression(tree_index_expression &)
void visit_postfix_expression(tree_postfix_expression &)
std::list< std::shared_ptr< stack_frame > > backtrace_frames() const
std::size_t current_call_stack_frame_number(void) const
void display_call_stack(void) const
void define_parameter_list_from_arg_vector(tree_parameter_list *param_list, const octave_value_list &args)
octave_map get_autoload_map(void) const
bool is_local_variable(const std::string &name) const
void visit_decl_command(tree_decl_command &)
octave_function * caller_function(void) const
void visit_arg_validation_fcns(tree_arg_validation_fcns &)
int debug_user_code_column(void) const
octave_map backtrace(void) const
void visit_function_def(tree_function_def &)
void visit_switch_command(tree_switch_command &)
void clear_symbol_pattern(const std::string &pattern)
void clear_symbol(const std::string &name)
std::list< std::string > top_level_variable_names(void) const
std::map< std::string, std::string > m_autoload_map
void visit_arguments_block(tree_arguments_block &)
void dbquit(bool all=false)
void restore_frame(std::size_t n)
int returning(void) const
void visit_if_command(tree_if_command &)
bool is_class_method_executing(std::string &dispatch_class) const
void visit_spmd_command(tree_spmd_command &)
octave_value_list convert_to_const_vector(tree_argument_list *arg_list)
octave_value m_indexed_object
octave_user_code * debug_user_code(void) const
void visit_try_catch_command(tree_try_catch_command &)
unwind_protect * curr_fcn_unwind_protect_frame(void)
int index_position(void) const
void clear_global_variables(void)
void clear_variables(void)
bool echo_this_file(const std::string &file, int type) const
void visit_colon_expression(tree_colon_expression &)
std::string PS4(void) const
int current_line(void) const
void push_dummy_scope(const std::string &name)
void visit_simple_for_command(tree_simple_for_command &)
octave_value_list make_value_list(tree_argument_list *args, const string_vector &arg_nm)
std::shared_ptr< push_parser > m_parser
int num_indices(void) const
void clear_variable(const std::string &name)
void visit_matrix(tree_matrix &)
bool is_variable(const std::string &name) const
bool is_class_constructor_executing(std::string &dispatch_class) const
void visit_octave_user_script(octave_user_script &)
std::string lookup_autoload(const std::string &nm) const
std::list< std::string > global_variable_names(void) const
void visit_if_clause(tree_if_clause &)
std::list< std::string > reverse_lookup_autoload(const std::string &nm) const
void visit_args_block_attribute_list(tree_args_block_attribute_list &)
bool in_debug_repl(void) const
bool maybe_push_echo_state_cleanup(void)
bool quiet_breakpoint_flag(void) const
octave_value do_who(int argc, const string_vector &argv, bool return_list, bool verbose=false)
void set_parser(const std::shared_ptr< push_parser > &parser)
int debug_user_code_line(void) const
symbol_info_list glob_symbol_info(const std::string &pattern) const
bool in_user_code(void) const
void clear_global_variable_pattern(const std::string &pattern)
bool m_break_on_next_stmt
void visit_argument_list(tree_argument_list &)
void assign(const std::string &name, const octave_value &val=octave_value())
int current_column(void) const
void assignin(const std::string &context, const std::string &name, const octave_value &val=octave_value())
const std::list< octave_lvalue > * m_lvalue_list
void visit_statement(tree_statement &)
void bind_auto_fcn_vars(const string_vector &arg_names, const Matrix &ignored_outputs, int nargin, int nargout, bool takes_varargs, const octave_value_list &va_args)
octave_value top_level_varval(const std::string &name) const
std::string backtrace_message(void) const
void dbupdown(int n, bool verbose=false)
void undefine_parameter_list(tree_parameter_list *param_list)
std::string check_autoload_file(const std::string &nm) const
octave_value max_stack_depth(const octave_value_list &args, int nargout)
void visit_identifier(tree_identifier &)
bool server_mode(void) const
void clear_symbol_regexp(const std::string &pattern)
int m_max_recursion_depth
void visit_octave_user_function_trailer(octave_user_function &)
void push_echo_state(int type, const std::string &file_name, int pos=1)
void visit_fcn_handle(tree_fcn_handle &)
octave_value_list execute_user_script(octave_user_script &user_script, int nargout, const octave_value_list &args)
void uwp_set_echo_state(bool state, const std::string &file_name, int pos)
void eval(std::shared_ptr< tree_statement_list > &stmt_list, bool interactive)
symbol_info_list top_scope_symbol_info(void) const
octave_value_list evalin(const std::string &context, const std::string &try_code, int nargout)
bool is_defined(const tree_expression *expr) const
octave_value global_varval(const std::string &name) const
void top_level_assign(const std::string &name, const octave_value &val=octave_value())
void install_variable(const std::string &name, const octave_value &value, bool global)
void visit_binary_expression(tree_binary_expression &)
void set_echo_state(int type, const std::string &file_name, int pos)
std::string m_echo_file_name
std::shared_ptr< push_parser > get_parser(void)
std::list< std::string > variable_names(void) const
symbol_info_list regexp_symbol_info(const std::string &pattern) const
void set_auto_fcn_var(stack_frame::auto_var_type avt, const octave_value &val=octave_value())
void get_line_and_eval(void)
bool eval_decl_elt(tree_decl_elt *elt)
void maybe_set_echo_state(void)
void clear_global_variable_regexp(const std::string &pattern)
void visit_decl_elt(tree_decl_elt &)
void execute_range_loop(const range< T > &rng, int line, octave_lvalue &ult, tree_statement_list *loop_body)
void parse_and_execute(const std::string &input, bool &incomplete_parse)
void visit_parameter_list(tree_parameter_list &)
std::list< octave_lvalue > make_lvalue_list(tree_argument_list *)
void enter_debugger(const std::string &prompt="debug> ")
std::string m_whos_line_format
void visit_complex_for_command(tree_complex_for_command &)
octave_value whos_line_format(const octave_value_list &args, int nargout)
void global_assign(const std::string &name, const octave_value &val=octave_value())
octave_value make_fcn_handle(const std::string &nm)
void mlock(bool skip_first=false) const
void visit_metaclass_query(tree_metaclass_query &)
void visit_compound_binary_expression(tree_compound_binary_expression &)
octave_value_list convert_return_list_to_const_vector(tree_parameter_list *ret_list, int nargout, const Matrix &ignored_outputs, const Cell &varargout)
void do_unwind_protect_cleanup_code(tree_statement_list *list)
octave_value varval(const symbol_record &sym) const
void visit_switch_case_list(tree_switch_case_list &)
octave_value PS4(const octave_value_list &args, int nargout)
void push_stack_frame(const symbol_scope &scope)
std::string mfilename(const std::string &opt="") const
bool silent_functions(void) const
std::string whos_line_format(void) const
void visit_prefix_expression(tree_prefix_expression &)
int continuing(void) const
std::string get_dispatch_class(void) const
std::shared_ptr< stack_frame > current_user_frame(void) const
void clear_variable_regexp(const std::string &pattern)
void visit_no_op_command(tree_no_op_command &)
octave_function * current_function(bool skip_first=false) const
void clear_variable_pattern(const std::string &pattern)
std::string current_function_name(bool skip_first=false) const
std::map< std::string, bool > m_echo_files
void visit_if_command_list(tree_if_command_list &)
OCTINTERP_API void print_usage(void)
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
void interpreter_try(unwind_protect &frame)
void error_with_id(const char *id, const char *fmt,...)
void warning(const char *fmt,...)
void warning_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
#define panic_impossible()
void err_indexed_cs_list(void)
OCTAVE_NAMESPACE_BEGIN bool iskeyword(const std::string &s)
F77_RET_T const F77_DBLE const F77_DBLE * f
std::string tilde_expand(const std::string &name)
std::string dir_sep_str(void)
std::string canonicalize_file_name(const std::string &name)
static uint32_t state[624]
class OCTINTERP_API cdef_class
class OCTINTERP_API cdef_object
int release_unreferenced_dynamic_libraries(void)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
octave_value parse_fcn_file(interpreter &interp, const std::string &full_file, const std::string &file, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, bool require_file, bool force_script, bool autoload, bool relative_lookup)
static int input(yyscan_t yyscanner)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
static std::string get_operator_function_name(const std::string &name)
static octave_value end_value(const octave_value &value, octave_idx_type index_position, octave_idx_type num_indices)
sig_atomic_t octave_interrupt_state
static bool absolute_pathname(const std::string &s)
static const char dir_sep_char
static std::string dir_sep_chars
static string_vector make_absolute(const string_vector &sv)
void sleep(double seconds, bool do_graphics_events)
OCTAVE_NAMESPACE_BEGIN bool valid_identifier(const char *s)
std::string fcn_file_in_path(const std::string &name)
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)