GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-eval.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2009-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_pt_eval_h)
27 #define octave_pt_eval_h 1
28 
29 #include "octave-config.h"
30 
31 #include <iosfwd>
32 #include <list>
33 #include <memory>
34 #include <set>
35 #include <stack>
36 #include <string>
37 
38 #include "bp-table.h"
39 #include "call-stack.h"
40 #include "oct-lvalue.h"
41 #include "ov.h"
42 #include "ovl.h"
43 #include "profiler.h"
44 #include "pt-walk.h"
45 #include "stack-frame.h"
46 
47 class octave_user_code;
48 
49 namespace octave
50 {
51  class symbol_info_list;
52  class symbol_scope;
53  class tree_decl_elt;
54  class tree_expression;
55 
56  class debugger;
57  class interpreter;
58  class unwind_protect;
59 
60  // How to evaluate the code that the parse trees represent.
61 
62  class OCTINTERP_API tree_evaluator : public tree_walker
63  {
64  public:
65 
67  {
68  ECHO_OFF = 0,
69  ECHO_SCRIPTS = 1,
70  ECHO_FUNCTIONS = 2,
71  ECHO_ALL = 4
72  };
73 
74  template <typename T>
76  {
77  public:
78 
79  value_stack (void) = default;
80 
81  value_stack (const value_stack&) = default;
82 
83  value_stack& operator = (const value_stack&) = default;
84 
85  ~value_stack (void) = default;
86 
87  void push (const T& val) { m_stack.push (val); }
88 
89  void pop (void)
90  {
91  m_stack.pop ();
92  }
93 
94  T val_pop (void)
95  {
96  T retval = m_stack.top ();
97  m_stack.pop ();
98  return retval;
99  }
100 
101  T top (void) const
102  {
103  return m_stack.top ();
104  }
105 
106  size_t size (void) const
107  {
108  return m_stack.size ();
109  }
110 
111  bool empty (void) const
112  {
113  return m_stack.empty ();
114  }
115 
116  void clear (void)
117  {
118  while (! m_stack.empty ())
119  m_stack.pop ();
120  }
121 
122  private:
123 
124  std::stack<T> m_stack;
125  };
126 
127  typedef void (*decl_elt_init_fcn) (tree_decl_elt&);
128 
130  : m_interpreter (interp), m_statement_context (SC_OTHER),
131  m_lvalue_list (nullptr), m_autoload_map (), m_bp_table (*this),
132  m_call_stack (*this), m_profiler (), m_debug_frame (0),
133  m_debug_mode (false), m_quiet_breakpoint_flag (false),
134  m_debugger_stack (), m_max_recursion_depth (256),
135  m_whos_line_format (" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"),
136  m_silent_functions (false), m_string_fill_char (' '),
137  m_PS4 ("+ "), m_dbstep_flag (0), m_echo (ECHO_OFF),
138  m_echo_state (false), m_echo_file_name (), m_echo_file_pos (1),
139  m_echo_files (), m_in_loop_command (false),
140  m_breaking (0), m_continuing (0), m_returning (0),
141  m_indexed_object (), m_index_list (), m_index_type (),
142  m_index_position (0), m_num_indices (0)
143  { }
144 
145  // No copying!
146 
147  tree_evaluator (const tree_evaluator&) = delete;
148 
149  tree_evaluator& operator = (const tree_evaluator&) = delete;
150 
151  ~tree_evaluator (void) = default;
152 
153  bool at_top_level (void) const;
154 
155  void eval (std::shared_ptr<tree_statement_list>& stmt_list,
156  bool interactive);
157 
158  std::string mfilename (const std::string& opt = "") const;
159 
160  octave_value_list eval_string (const std::string& eval_str, bool silent,
161  int& parse_status, int nargout);
162 
163  octave_value eval_string (const std::string& eval_str, bool silent,
164  int& parse_status);
165 
166  octave_value_list eval_string (const octave_value& arg, bool silent,
167  int& parse_status, int nargout);
168 
169  octave_value_list eval (const std::string& try_code, int nargout);
170 
171  octave_value_list eval (const std::string& try_code,
172  const std::string& catch_code, int nargout);
173 
174  octave_value_list evalin (const std::string& context,
175  const std::string& try_code, int nargout);
176 
177  octave_value_list evalin (const std::string& context,
178  const std::string& try_code,
179  const std::string& catch_code, int nargout);
180 
181  void visit_anon_fcn_handle (tree_anon_fcn_handle&);
182 
183  void visit_argument_list (tree_argument_list&);
184 
185  void visit_binary_expression (tree_binary_expression&);
186 
187  void visit_boolean_expression (tree_boolean_expression&);
188 
189  void visit_compound_binary_expression (tree_compound_binary_expression&);
190 
191  void visit_break_command (tree_break_command&);
192 
193  void visit_colon_expression (tree_colon_expression&);
194 
195  void visit_continue_command (tree_continue_command&);
196 
197  void visit_decl_command (tree_decl_command&);
198 
199  void visit_decl_elt (tree_decl_elt&);
200 
201  void visit_simple_for_command (tree_simple_for_command&);
202 
203  void visit_complex_for_command (tree_complex_for_command&);
204 
205  void visit_octave_user_script (octave_user_script&);
206 
208  execute_user_script (octave_user_script& user_script, int nargout,
209  const octave_value_list& args);
210 
211  void visit_octave_user_function (octave_user_function&);
212 
214  execute_user_function (octave_user_function& user_function,
215  int nargout, const octave_value_list& args);
216 
217  void visit_octave_user_function_header (octave_user_function&);
218 
219  void visit_octave_user_function_trailer (octave_user_function&);
220 
221  void visit_function_def (tree_function_def&);
222 
223  void visit_identifier (tree_identifier&);
224 
225  void visit_if_clause (tree_if_clause&);
226 
227  void visit_if_command (tree_if_command&);
228 
229  void visit_if_command_list (tree_if_command_list&);
230 
231  void visit_index_expression (tree_index_expression&);
232 
233  void visit_matrix (tree_matrix&);
234 
235  void visit_cell (tree_cell&);
236 
237  void visit_multi_assignment (tree_multi_assignment&);
238 
239  void visit_no_op_command (tree_no_op_command&);
240 
241  void visit_constant (tree_constant&);
242 
243  void visit_fcn_handle (tree_fcn_handle&);
244 
245  void visit_parameter_list (tree_parameter_list&);
246 
247  void visit_postfix_expression (tree_postfix_expression&);
248 
249  void visit_prefix_expression (tree_prefix_expression&);
250 
251  void visit_return_command (tree_return_command&);
252 
253  void visit_simple_assignment (tree_simple_assignment&);
254 
255  void visit_statement (tree_statement&);
256 
257  void visit_statement_list (tree_statement_list&);
258 
259  void visit_switch_case (tree_switch_case&);
260 
261  void visit_switch_case_list (tree_switch_case_list&);
262 
263  void visit_switch_command (tree_switch_command&);
264 
265  void visit_try_catch_command (tree_try_catch_command&);
266 
267  void do_unwind_protect_cleanup_code (tree_statement_list *list);
268 
269  void visit_unwind_protect_command (tree_unwind_protect_command&);
270 
271  void visit_while_command (tree_while_command&);
272  void visit_do_until_command (tree_do_until_command&);
273 
274  void visit_superclass_ref (tree_superclass_ref&);
275  void visit_metaclass_query (tree_metaclass_query&);
276 
277  void bind_ans (const octave_value& val, bool print);
278 
279  bool statement_printing_enabled (void);
280 
281  void reset_debug_state (void);
282 
283  void reset_debug_state (bool mode);
284 
285  void enter_debugger (const std::string& prompt = "debug> ");
286 
287  void keyboard (const std::string& prompt = "keyboard> ");
288 
289  void dbupdown (int n, bool verbose = false);
290 
291  // Possible types of evaluation contexts.
293  {
294  SC_FUNCTION, // function body
295  SC_SCRIPT, // script file
296  SC_OTHER // command-line input or eval string
297  };
298 
299  Matrix ignored_fcn_outputs (void) const;
300 
301  octave_value make_fcn_handle (const std::string& nm);
302 
303  octave_value evaluate (tree_decl_elt *);
304 
305  void install_variable (const std::string& name,
306  const octave_value& value, bool global);
307 
308  octave_value global_varval (const std::string& name) const;
309 
310  octave_value& global_varref (const std::string& name);
311 
312  void global_assign (const std::string& name,
313  const octave_value& val = octave_value ());
314 
315  octave_value top_level_varval (const std::string& name) const;
316 
317  void top_level_assign (const std::string& name,
318  const octave_value& val = octave_value ());
319 
320  bool is_variable (const std::string& name) const;
321 
322  bool is_local_variable (const std::string& name) const;
323 
324  bool is_variable (const tree_expression *expr) const;
325 
326  bool is_defined (const tree_expression *expr) const;
327 
328  bool is_variable (const symbol_record& sym) const;
329 
330  bool is_defined (const symbol_record& sym) const;
331 
332  bool is_global (const std::string& name) const;
333 
334  octave_value varval (const symbol_record& sym) const;
335 
336  octave_value varval (const std::string& name) const;
337 
338  void assign (const std::string& name,
339  const octave_value& val = octave_value ());
340 
341  void assignin (const std::string& context, const std::string& name,
342  const octave_value& val = octave_value ());
343 
344  void source_file (const std::string& file_name,
345  const std::string& context = "",
346  bool verbose = false, bool require_file = true);
347 
348  void set_auto_fcn_var (stack_frame::auto_var_type avt,
349  const octave_value& val = octave_value ());
350 
351  octave_value get_auto_fcn_var (stack_frame::auto_var_type avt) const;
352 
353  void define_parameter_list_from_arg_vector
354  (tree_parameter_list *param_list, const octave_value_list& args);
355 
356  void undefine_parameter_list (tree_parameter_list *param_list);
357 
358  octave_value_list convert_to_const_vector (tree_argument_list *arg_list);
359 
361  convert_return_list_to_const_vector
362  (tree_parameter_list *ret_list, int nargout,
363  const Matrix& ignored_outputs, const Cell& varargout);
364 
365  bool eval_decl_elt (tree_decl_elt *elt);
366 
367  bool switch_case_label_matches (tree_switch_case *expr,
368  const octave_value& val);
369 
370  interpreter& get_interpreter (void) { return m_interpreter; }
371 
372  bp_table& get_bp_table (void) { return m_bp_table; }
373 
374  profiler& get_profiler (void) { return m_profiler; }
375 
376  call_stack& get_call_stack (void) { return m_call_stack; }
377 
378  void push_stack_frame (const symbol_scope& scope);
379 
380  void push_stack_frame (octave_user_function *fcn,
381  const std::shared_ptr<stack_frame>& closure_frames = std::shared_ptr<stack_frame> ());
382 
383  void push_stack_frame (octave_user_function *fcn,
384  const stack_frame::local_vars_map& local_vars);
385 
386  void push_stack_frame (octave_user_script *script);
387 
388  void push_stack_frame (octave_function *fcn);
389 
390  void pop_stack_frame (void);
391 
392  std::shared_ptr<stack_frame> get_current_stack_frame (void) const
393  {
394  return m_call_stack.get_current_stack_frame ();
395  }
396 
397  std::shared_ptr<stack_frame> current_user_frame (void) const
398  {
399  return m_call_stack.current_user_frame ();
400  }
401 
402  // Current line in current function.
403  int current_line (void) const;
404 
405  // Current column in current function.
406  int current_column (void) const;
407 
408  // Line number in current function that we are debugging.
409  int debug_user_code_line (void) const;
410 
411  // Column number in current function that we are debugging.
412  int debug_user_code_column (void) const;
413 
414  void debug_where (std::ostream& os) const;
415 
416  octave_user_code * current_user_code (void) const;
417 
419 
420  // Current function that we are debugging.
421  octave_user_code * debug_user_code (void) const;
422 
423  octave_function * current_function (bool skip_first = false) const;
424 
425  octave_function * caller_function (void) const;
426 
427  bool goto_frame (size_t n = 0, bool verbose = false);
428 
429  void goto_caller_frame (void);
430 
431  void goto_base_frame (void);
432 
433  void restore_frame (size_t n);
434 
435  std::string get_dispatch_class (void) const;
436 
437  void set_dispatch_class (const std::string& class_name);
438 
439  bool is_class_method_executing (std::string& dispatch_class) const;
440 
441  bool is_class_constructor_executing (std::string& dispatch_class) const;
442 
443  std::list<std::shared_ptr<stack_frame>>
444  backtrace_frames (octave_idx_type& curr_user_frame) const;
445 
446  std::list<std::shared_ptr<stack_frame>> backtrace_frames () const;
447 
448  std::list<frame_info> backtrace_info (octave_idx_type& curr_user_frame,
449  bool print_subfn = true) const;
450 
451  std::list<frame_info> backtrace_info (void) const;
452 
453  octave_map backtrace (octave_idx_type& curr_user_frame,
454  bool print_subfn = true) const;
455 
456  octave_map backtrace (void) const;
457 
458  octave_map empty_backtrace (void) const;
459 
460  std::string backtrace_message (void) const;
461 
462  void push_dummy_scope (const std::string& name);
463  void pop_scope (void);
464 
465  symbol_scope get_top_scope (void) const;
466  symbol_scope get_current_scope (void) const;
467 
468  void mlock (bool skip_first = false) const;
469 
470  void munlock (bool skip_first = false) const;
471 
472  bool mislocked (bool skip_first = false) const;
473 
474  octave_value max_stack_depth (const octave_value_list& args, int nargout);
475 
476  // Useful for debugging
477  void display_call_stack (void) const;
478 
479  octave_value find (const std::string& name);
480 
481  void clear_objects (void);
482 
483  void clear_variable (const std::string& name);
484 
485  void clear_variable_pattern (const std::string& pattern);
486 
487  void clear_variable_regexp (const std::string& pattern);
488 
489  void clear_variables (void);
490 
491  void clear_global_variable (const std::string& name);
492 
493  void clear_global_variable_pattern (const std::string& pattern);
494 
495  void clear_global_variable_regexp (const std::string& pattern);
496 
497  void clear_global_variables (void);
498 
499  void clear_all (bool force = false);
500 
501  void clear_symbol (const std::string& name);
502 
503  void clear_symbol_pattern (const std::string& pattern);
504 
505  void clear_symbol_regexp (const std::string& pattern);
506 
507  std::list<std::string> global_variable_names (void) const;
508 
509  std::list<std::string> top_level_variable_names (void) const;
510 
511  std::list<std::string> variable_names (void) const;
512 
513  octave_user_code * get_user_code (const std::string& fname = "",
514  const std::string& class_name = "");
515 
516  std::string current_function_name (bool skip_first = false) const;
517 
518  bool in_user_code (void) const;
519 
520  symbol_info_list glob_symbol_info (const std::string& pattern) const;
521 
522  symbol_info_list regexp_symbol_info (const std::string& pattern) const;
523 
524  symbol_info_list get_symbol_info (void);
525 
526  symbol_info_list top_scope_symbol_info (void) const;
527 
528  octave_map get_autoload_map (void) const;
529 
530  std::string lookup_autoload (const std::string& nm) const;
531 
532  std::list<std::string> autoloaded_functions (void) const;
533 
534  std::list<std::string> reverse_lookup_autoload (const std::string& nm) const;
535 
536  void add_autoload (const std::string& fcn, const std::string& nm);
537 
538  void remove_autoload (const std::string& fcn, const std::string& nm);
539 
540  int max_recursion_depth (void) const { return m_max_recursion_depth; }
541 
543  {
544  int val = m_max_recursion_depth;
545  m_max_recursion_depth = n;
546  return val;
547  }
548 
550  max_recursion_depth (const octave_value_list& args, int nargout);
551 
552  bool silent_functions (void) const { return m_silent_functions; }
553 
554  bool silent_functions (bool b)
555  {
556  int val = m_silent_functions;
557  m_silent_functions = b;
558  return val;
559  }
560 
561  octave_value whos_line_format (const octave_value_list& args, int nargout);
562 
563  std::string whos_line_format (void) const { return m_whos_line_format; }
564 
565  std::string whos_line_format (const std::string& s)
566  {
567  std::string val = m_whos_line_format;
568  m_whos_line_format = s;
569  return val;
570  }
571 
573  silent_functions (const octave_value_list& args, int nargout);
574 
575  size_t debug_frame (void) const { return m_debug_frame; }
576 
577  size_t debug_frame (size_t n)
578  {
579  size_t val = m_debug_frame;
580  m_debug_frame = n;
581  return val;
582  }
583 
585  {
586  return m_call_stack.current_frame ();
587  }
588 
589  bool quiet_breakpoint_flag (void) const { return m_quiet_breakpoint_flag; }
590 
591  bool quiet_breakpoint_flag (bool flag)
592  {
593  bool val = m_quiet_breakpoint_flag;
594  m_quiet_breakpoint_flag = flag;
595  return val;
596  }
597 
598  char string_fill_char (void) const { return m_string_fill_char; }
599 
600  char string_fill_char (char c)
601  {
602  int val = m_string_fill_char;
603  m_string_fill_char = c;
604  return val;
605  }
606 
607  // The following functions are provided for convenience. They
608  // call the corresponding functions in the debugger class for the
609  // current debugger (if any).
610 
611  bool in_debug_repl (void) const;
612 
613  void dbcont (void);
614 
615  void dbquit (bool all = false);
616 
617  octave_value PS4 (const octave_value_list& args, int nargout);
618 
619  std::string PS4 (void) const { return m_PS4; }
620 
621  std::string PS4 (const std::string& s)
622  {
623  std::string val = m_PS4;
624  m_PS4 = s;
625  return val;
626  }
627 
629  {
630  return m_indexed_object;
631  }
632 
634  {
635  m_indexed_object = obj;
636  }
637 
638  const std::list<octave_value_list>& index_list (void) const
639  {
640  return m_index_list;
641  }
642 
643  void set_index_list (const std::string& index_type,
644  const std::list<octave_value_list>& index_list)
645  {
646  m_index_type = index_type;
647  m_index_list = index_list;
648  }
649 
650  void clear_index_list (void)
651  {
652  m_index_type = "";
653  m_index_list.clear ();
654  }
655 
656  void append_index_list (char type, const octave_value_list& idx)
657  {
658  m_index_type += type;
659  m_index_list.push_back (idx);
660  }
661 
662  const std::string& index_type (void) const
663  {
664  return m_index_type;
665  }
666 
667  int index_position (void) const { return m_index_position; }
668 
669  int num_indices (void) const { return m_num_indices; }
670 
671  octave_value_list evaluate_end_expression (const octave_value_list& args);
672 
673  const std::list<octave_lvalue> * lvalue_list (void) const
674  {
675  return m_lvalue_list;
676  }
677 
678  void set_lvalue_list (const std::list<octave_lvalue> *lst)
679  {
680  m_lvalue_list = lst;
681  }
682 
683  int breaking (void) const { return m_breaking; }
684 
685  int breaking (int n)
686  {
687  int val = m_breaking;
688  m_breaking = n;
689  return val;
690  }
691 
692  int continuing (void) const { return m_continuing; }
693 
694  int continuing (int n)
695  {
696  int val = m_continuing;
697  m_continuing = n;
698  return val;
699  }
700 
701  int returning (void) const { return m_returning; }
702 
703  int returning (int n)
704  {
705  int val = m_returning;
706  m_returning = n;
707  return val;
708  }
709 
710  int dbstep_flag (void) const { return m_dbstep_flag; }
711 
712  int dbstep_flag (int val)
713  {
714  int old_val = m_dbstep_flag;
715  m_dbstep_flag = val;
716  return old_val;
717  }
718 
719  void set_dbstep_flag (int step) { m_dbstep_flag = step; }
720 
721  octave_value echo (const octave_value_list& args, int nargout);
722 
723  int echo (void) const { return m_echo; }
724 
725  int echo (int val)
726  {
727  int old_val = m_echo;
728  m_echo = val;
729  return old_val;
730  }
731 
733  string_fill_char (const octave_value_list& args, int nargout);
734 
735  void final_index_error (index_exception& e, const tree_expression *expr);
736 
737  octave_value do_who (int argc, const string_vector& argv,
738  bool return_list, bool verbose = false);
739 
741  make_value_list (tree_argument_list *args, const string_vector& arg_nm);
742 
743  std::list<octave_lvalue> make_lvalue_list (tree_argument_list *);
744 
745  void push_echo_state (int type, const std::string& file_name,
746  size_t pos = 1);
747 
748  private:
749 
750  void set_echo_state (int type, const std::string& file_name, size_t pos);
751 
752  void maybe_set_echo_state (void);
753 
754  void push_echo_state_cleanup (unwind_protect& frame);
755 
756  bool maybe_push_echo_state_cleanup (void);
757 
758  void do_breakpoint (tree_statement& stmt);
759 
760  void do_breakpoint (bool is_breakpoint,
761  bool is_end_of_fcn_or_script = false);
762 
763  bool is_logically_true (tree_expression *expr, const char *warn_for);
764 
765  // For unwind-protect.
766  void uwp_set_echo_state (bool state, const std::string& file_name,
767  size_t pos);
768 
769  bool echo_this_file (const std::string& file, int type) const;
770 
771  void echo_code (size_t line);
772 
773  bool quit_loop_now (void);
774 
775  void bind_auto_fcn_vars (const string_vector& arg_names,
776  const Matrix& ignored_outputs, int nargin,
777  int nargout, bool takes_varargs,
778  const octave_value_list& va_args);
779 
780  std::string check_autoload_file (const std::string& nm) const;
781 
783 
784  // The context for the current evaluation.
786 
787  const std::list<octave_lvalue> *m_lvalue_list;
788 
789  // List of autoloads (function -> file mapping).
790  std::map<std::string, std::string> m_autoload_map;
791 
793 
795 
797 
798  // The number of the stack frame we are currently debugging.
800 
802 
804 
805  // When entering the debugger we push it on this stack. Managing
806  // debugger invocations this way allows us to handle recursive
807  // debugger calls. When we exit a debugger the object is popped
808  // from the stack and deleted and we resume working with the
809  // previous debugger (if any) that is now at the top of the stack.
810  std::stack<debugger *> m_debugger_stack;
811 
812  // Maximum nesting level for functions, scripts, or sourced files
813  // called recursively.
815 
816  // Defines layout for the whos/who -long command
817  std::string m_whos_line_format;
818 
819  // If TRUE, turn off printing of results in functions (as if a
820  // semicolon has been appended to each statement).
822 
823  // The character to fill with when creating string arrays.
825 
826  // String printed before echoed commands (enabled by --echo-commands).
827  std::string m_PS4;
828 
829  // If > 0, stop executing at the (N-1)th stopping point, counting
830  // from the the current execution point in the current frame.
831  //
832  // If < 0, stop executing at the next possible stopping point.
834 
835  // Echo commands as they are executed?
836  //
837  // 1 ==> echo commands read from script files
838  // 2 ==> echo commands from functions
839  //
840  // more than one state can be active at once.
841  int m_echo;
842 
843  // Are we currently echoing commands? This state is set by the
844  // functions that execute functions and scripts.
846 
847  std::string m_echo_file_name;
848 
849  // Next line to echo, counting from 1.
851 
852  std::map<std::string, bool> m_echo_files;
853 
854  // TRUE means we are evaluating some kind of looping construct.
856 
857  // Nonzero means we're breaking out of a loop or function body.
859 
860  // Nonzero means we're jumping to the end of a loop.
862 
863  // Nonzero means we're returning from a function.
865 
866  // The following are all used by the END function. Maybe they
867  // should be kept together in a separate object?
869  std::list<octave_value_list> m_index_list;
870  std::string m_index_type;
873  };
874 }
875 
876 #endif
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)
Definition: Quad.cc:80
Definition: Cell.h:43
Definition: dMatrix.h:42
std::map< std::string, octave_value > local_vars_map
Definition: stack-frame.h:112
value_stack(const value_stack &)=default
std::string whos_line_format(const std::string &s)
Definition: pt-eval.h:565
std::string PS4(const std::string &s)
Definition: pt-eval.h:621
size_t current_call_stack_frame_number(void) const
Definition: pt-eval.h:584
std::string m_index_type
Definition: pt-eval.h:870
int dbstep_flag(int val)
Definition: pt-eval.h:712
std::list< octave_value_list > m_index_list
Definition: pt-eval.h:869
void set_lvalue_list(const std::list< octave_lvalue > *lst)
Definition: pt-eval.h:678
void set_index_list(const std::string &index_type, const std::list< octave_value_list > &index_list)
Definition: pt-eval.h:643
const std::list< octave_lvalue > * lvalue_list(void) const
Definition: pt-eval.h:673
bool quiet_breakpoint_flag(void) const
Definition: pt-eval.h:589
int dbstep_flag(void) const
Definition: pt-eval.h:710
int continuing(void) const
Definition: pt-eval.h:692
int continuing(int n)
Definition: pt-eval.h:694
std::map< std::string, std::string > m_autoload_map
Definition: pt-eval.h:790
std::string PS4(void) const
Definition: pt-eval.h:619
octave_value m_indexed_object
Definition: pt-eval.h:868
std::stack< debugger * > m_debugger_stack
Definition: pt-eval.h:810
bool silent_functions(void) const
Definition: pt-eval.h:552
void append_index_list(char type, const octave_value_list &idx)
Definition: pt-eval.h:656
bool silent_functions(bool b)
Definition: pt-eval.h:554
const std::list< octave_lvalue > * m_lvalue_list
Definition: pt-eval.h:787
bp_table & get_bp_table(void)
Definition: pt-eval.h:372
std::string m_echo_file_name
Definition: pt-eval.h:847
void set_indexed_object(const octave_value &obj=octave_value())
Definition: pt-eval.h:633
std::map< std::string, bool > m_echo_files
Definition: pt-eval.h:852
void clear_index_list(void)
Definition: pt-eval.h:650
bool m_quiet_breakpoint_flag
Definition: pt-eval.h:803
std::string m_whos_line_format
Definition: pt-eval.h:817
int breaking(void) const
Definition: pt-eval.h:683
call_stack & get_call_stack(void)
Definition: pt-eval.h:376
bool quiet_breakpoint_flag(bool flag)
Definition: pt-eval.h:591
int num_indices(void) const
Definition: pt-eval.h:669
int max_recursion_depth(void) const
Definition: pt-eval.h:540
int echo(void) const
Definition: pt-eval.h:723
std::string whos_line_format(void) const
Definition: pt-eval.h:563
tree_evaluator(interpreter &interp)
Definition: pt-eval.h:129
int breaking(int n)
Definition: pt-eval.h:685
interpreter & m_interpreter
Definition: pt-eval.h:782
std::shared_ptr< stack_frame > get_current_stack_frame(void) const
Definition: pt-eval.h:392
size_t debug_frame(size_t n)
Definition: pt-eval.h:577
const std::list< octave_value_list > & index_list(void) const
Definition: pt-eval.h:638
int returning(void) const
Definition: pt-eval.h:701
const std::string & index_type(void) const
Definition: pt-eval.h:662
call_stack m_call_stack
Definition: pt-eval.h:794
size_t debug_frame(void) const
Definition: pt-eval.h:575
void set_dbstep_flag(int step)
Definition: pt-eval.h:719
stmt_list_type m_statement_context
Definition: pt-eval.h:785
std::string m_PS4
Definition: pt-eval.h:827
octave_value indexed_object(void) const
Definition: pt-eval.h:628
char string_fill_char(char c)
Definition: pt-eval.h:600
char string_fill_char(void) const
Definition: pt-eval.h:598
std::shared_ptr< stack_frame > current_user_frame(void) const
Definition: pt-eval.h:397
~tree_evaluator(void)=default
tree_evaluator(const tree_evaluator &)=delete
interpreter & get_interpreter(void)
Definition: pt-eval.h:370
int returning(int n)
Definition: pt-eval.h:703
int max_recursion_depth(int n)
Definition: pt-eval.h:542
int echo(int val)
Definition: pt-eval.h:725
int index_position(void) const
Definition: pt-eval.h:667
profiler & get_profiler(void)
Definition: pt-eval.h:374
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
Definition: colamd.cc:104
QString name
octave_idx_type n
Definition: mx-inlines.cc:753
static uint32_t state[624]
Definition: randmtzig.cc:190
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
Definition: oct-parse.cc:9714
static llvm::LLVMContext & context
Definition: jit-typeinfo.cc:80
octave_user_code * get_user_code(const std::string &fname)
Definition: bp-table.cc:1002
void source_file(const std::string &file_name, const std::string &context, bool verbose, bool require_file)
Definition: oct-parse.cc:9526
static octave_value make_fcn_handle(const octave_value &fcn, const std::string &meth_name, const std::string &class_name)
Definition: cdef-class.cc:66
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811
static octave::unwind_protect * curr_fcn_unwind_protect_frame(void)
Definition: variables.cc:584