annotate libinterp/parse-tree/pt-eval.h @ 30919:4ed7dfe28584

move eval of anon fcn handles and built-in and mex functions to pt-eval.cc For consistency with the evaluation of user-defined functions and scripts, move the evaluation of anonymous function handles and built-in and mex functions to the tree_evaluator class in pt-eval.cc. * pt-eval.h, pt-eval.cc (tree_evaluator::evaluate_anon_fcn_handle, tree_evaluator::execute_builtin_function, tree_evaluator::execute_mex_function): New functions extracted from tree_anon_fcn_handle::evalueate, octave_builtin::execute and octave_mex_function::execute, respectively. * ov-builtin.cc (octave_builtin::execute): Forward to tree_evaluator::execute_builtin_function. * ov-mex-fcn.cc (octave_mex_function::execute): Forward to tree_evaluator::execute_mex_function. * pt-fcn-handle.cc (tree_anon_fcn_handle::evaluate): Forward to tree_evaluator::evaluate_anon_fcn_handle. * mex.cc: Move call_mex inside octave namespace. * mex-private.h: New file. * libinterp/corefcn/module.mk: Update.
author John W. Eaton <jwe@octave.org>
date Fri, 08 Apr 2022 14:11:05 -0400
parents 796f54d4ddbf
children 47cbc69e66cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29960
diff changeset
3 // Copyright (C) 2009-2022 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 20535
diff changeset
26 #if ! defined (octave_pt_eval_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17744
diff changeset
27 #define octave_pt_eval_h 1
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20940
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20940
diff changeset
30
27205
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
31 #include <iosfwd>
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
32 #include <list>
27519
804e5d42b728 move reader and parser from evaluator repl to interpreter main_loop
John W. Eaton <jwe@octave.org>
parents: 27507
diff changeset
33 #include <memory>
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
34 #include <set>
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 #include <stack>
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 #include <string>
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
38 #include "bp-table.h"
23553
14723784b9f2 don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents: 23532
diff changeset
39 #include "call-stack.h"
27371
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
40 #include "oct-lvalue.h"
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
41 #include "ov.h"
20940
48b2ad5ee801 maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents: 20824
diff changeset
42 #include "ovl.h"
23753
c3828bd031cd move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23750
diff changeset
43 #include "profiler.h"
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 #include "pt-walk.h"
28430
5bfa8e018704 store local init vars for anonymous functions in handle, not function object
John W. Eaton <jwe@octave.org>
parents: 28429
diff changeset
45 #include "stack-frame.h"
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46
30919
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
47 class octave_builtin;
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
48 class octave_mex_function;
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
49 class octave_user_code;
30919
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
50 class octave_user_function;
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
51 class octave_user_script;
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
52
29960
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29856
diff changeset
53 OCTAVE_NAMESPACE_BEGIN
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29856
diff changeset
54
27203
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
55 class symbol_info_list;
24362
3fc24b792a24 avoid including symtab.h, symscope.h, or symrec.h unnecessarily
John W. Eaton <jwe@octave.org>
parents: 24361
diff changeset
56 class symbol_scope;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
57 class tree_decl_elt;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
58 class tree_expression;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
59
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
60 class debugger;
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
61 class interpreter;
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
62 class push_parser;
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
63 class unwind_protect;
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
65 // How to evaluate the code that the parse trees represent.
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
67 class OCTINTERP_API tree_evaluator : public tree_walker
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
68 {
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
69 public:
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
71 enum echo_state
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
72 {
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
73 ECHO_OFF = 0,
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
74 ECHO_SCRIPTS = 1,
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
75 ECHO_FUNCTIONS = 2,
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
76 ECHO_ALL = 4
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
77 };
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
78
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
79 template <typename T>
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
80 class value_stack
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
81 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
82 public:
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
83
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
84 value_stack (void) = default;
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
85
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
86 value_stack (const value_stack&) = default;
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
87
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
88 value_stack& operator = (const value_stack&) = default;
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
89
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
90 ~value_stack (void) = default;
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
91
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
92 void push (const T& val) { m_stack.push (val); }
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
93
23481
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
94 void pop (void)
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
95 {
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
96 m_stack.pop ();
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
97 }
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
98
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
99 T val_pop (void)
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
100 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
101 T retval = m_stack.top ();
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
102 m_stack.pop ();
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
103 return retval;
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
104 }
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
105
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
106 T top (void) const
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
107 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
108 return m_stack.top ();
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
109 }
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
110
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29477
diff changeset
111 std::size_t size (void) const
23481
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
112 {
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
113 return m_stack.size ();
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
114 }
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
115
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
116 bool empty (void) const
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
117 {
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
118 return m_stack.empty ();
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
119 }
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
120
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
121 void clear (void)
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
122 {
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
123 while (! m_stack.empty ())
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
124 m_stack.pop ();
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
125 }
23458
0f4ed33886de maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 23457
diff changeset
126
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
127 private:
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
128
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
129 std::stack<T> m_stack;
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
130 };
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
131
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
132 typedef void (*decl_elt_init_fcn) (tree_decl_elt&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133
23532
084245f9bd03 pass reference to evaluator to octave_function call methods
John W. Eaton <jwe@octave.org>
parents: 23482
diff changeset
134 tree_evaluator (interpreter& interp)
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
135 : m_interpreter (interp), m_parser (), m_statement_context (SC_OTHER),
27371
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
136 m_lvalue_list (nullptr), m_autoload_map (), m_bp_table (*this),
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
137 m_call_stack (*this), m_profiler (), m_debug_frame (0),
27016
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
138 m_debug_mode (false), m_quiet_breakpoint_flag (false),
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
139 m_debugger_stack (), m_exit_status (0), m_max_recursion_depth (256),
29856
56b3e2af0298 Add 's'=sparse attribute for whos function (bug #60687)
Rik <rik@octave.org>
parents: 29848
diff changeset
140 m_whos_line_format (" %la:5; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"),
29306
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
141 m_silent_functions (false), m_string_fill_char (' '), m_PS4 ("+ "),
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
142 m_dbstep_flag (0), m_break_on_next_stmt (false), m_echo (ECHO_OFF),
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
143 m_echo_state (false), m_echo_file_name (), m_echo_file_pos (1),
29846
78cb255c78a4 move top-level REPL from interpreter to evaluator
John W. Eaton <jwe@octave.org>
parents: 29656
diff changeset
144 m_echo_files (), m_in_top_level_repl (false),
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
145 m_server_mode (false), m_in_loop_command (false),
25403
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
146 m_breaking (0), m_continuing (0), m_returning (0),
28804
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
147 m_indexed_object (), m_index_list (), m_index_type (),
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
148 m_index_position (0), m_num_indices (0)
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
149 { }
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
151 // No copying!
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
153 tree_evaluator (const tree_evaluator&) = delete;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
154
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
155 tree_evaluator& operator = (const tree_evaluator&) = delete;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
156
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22865
diff changeset
157 ~tree_evaluator (void) = default;
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
159 std::shared_ptr<push_parser> get_parser (void)
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
160 {
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
161 return m_parser;
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
162 }
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
163
29282
0280fd549502 make debugging possible in server mode
John W. Eaton <jwe@octave.org>
parents: 29281
diff changeset
164 void set_parser (const std::shared_ptr<push_parser>& parser)
0280fd549502 make debugging possible in server mode
John W. Eaton <jwe@octave.org>
parents: 29281
diff changeset
165 {
0280fd549502 make debugging possible in server mode
John W. Eaton <jwe@octave.org>
parents: 29281
diff changeset
166 m_parser = parser;
0280fd549502 make debugging possible in server mode
John W. Eaton <jwe@octave.org>
parents: 29281
diff changeset
167 }
0280fd549502 make debugging possible in server mode
John W. Eaton <jwe@octave.org>
parents: 29281
diff changeset
168
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
169 bool at_top_level (void) const;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
170
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
171 std::string mfilename (const std::string& opt = "") const;
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
172
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
173 // Parse a line of input. If input ends at a complete statement
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
174 // boundary, execute the resulting parse tree. Useful to handle
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
175 // parsing user input when running in server mode.
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
176
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
177 void parse_and_execute (const std::string& input, bool& incomplete_parse);
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
178
29619
5cf985f5760a move get_line_and_eval to parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 29572
diff changeset
179 void get_line_and_eval (void);
5cf985f5760a move get_line_and_eval to parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 29572
diff changeset
180
29846
78cb255c78a4 move top-level REPL from interpreter to evaluator
John W. Eaton <jwe@octave.org>
parents: 29656
diff changeset
181 int repl (void);
78cb255c78a4 move top-level REPL from interpreter to evaluator
John W. Eaton <jwe@octave.org>
parents: 29656
diff changeset
182
78cb255c78a4 move top-level REPL from interpreter to evaluator
John W. Eaton <jwe@octave.org>
parents: 29656
diff changeset
183 bool in_top_level_repl (void) const { return m_in_top_level_repl; }
78cb255c78a4 move top-level REPL from interpreter to evaluator
John W. Eaton <jwe@octave.org>
parents: 29656
diff changeset
184
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
185 int server_loop (void);
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
186
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
187 bool server_mode (void) const { return m_server_mode; }
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
188
29282
0280fd549502 make debugging possible in server mode
John W. Eaton <jwe@octave.org>
parents: 29281
diff changeset
189 void server_mode (bool arg) { m_server_mode = arg; }
0280fd549502 make debugging possible in server mode
John W. Eaton <jwe@octave.org>
parents: 29281
diff changeset
190
27519
804e5d42b728 move reader and parser from evaluator repl to interpreter main_loop
John W. Eaton <jwe@octave.org>
parents: 27507
diff changeset
191 void eval (std::shared_ptr<tree_statement_list>& stmt_list,
804e5d42b728 move reader and parser from evaluator repl to interpreter main_loop
John W. Eaton <jwe@octave.org>
parents: 27507
diff changeset
192 bool interactive);
25404
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
193
26113
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
194 octave_value_list eval_string (const std::string& eval_str, bool silent,
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
195 int& parse_status, int nargout);
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
196
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
197 octave_value eval_string (const std::string& eval_str, bool silent,
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
198 int& parse_status);
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
199
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
200 octave_value_list eval_string (const octave_value& arg, bool silent,
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
201 int& parse_status, int nargout);
8a15f3bace49 move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents: 26094
diff changeset
202
27019
6cb675912f2b move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27018
diff changeset
203 octave_value_list eval (const std::string& try_code, int nargout);
6cb675912f2b move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27018
diff changeset
204
6cb675912f2b move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27018
diff changeset
205 octave_value_list eval (const std::string& try_code,
6cb675912f2b move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27018
diff changeset
206 const std::string& catch_code, int nargout);
6cb675912f2b move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27018
diff changeset
207
27018
a20ead51515d move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27017
diff changeset
208 octave_value_list evalin (const std::string& context,
a20ead51515d move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27017
diff changeset
209 const std::string& try_code, int nargout);
a20ead51515d move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27017
diff changeset
210
a20ead51515d move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27017
diff changeset
211 octave_value_list evalin (const std::string& context,
a20ead51515d move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27017
diff changeset
212 const std::string& try_code,
a20ead51515d move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27017
diff changeset
213 const std::string& catch_code, int nargout);
a20ead51515d move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27017
diff changeset
214
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
215 void visit_anon_fcn_handle (tree_anon_fcn_handle&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
216
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
217 void visit_argument_list (tree_argument_list&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
218
29724
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
219 void visit_arguments_block (tree_arguments_block&);
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
220
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
221 void visit_args_block_attribute_list (tree_args_block_attribute_list&);
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
222
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
223 void visit_args_block_validation_list (tree_args_block_validation_list&);
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
224
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
225 void visit_arg_validation (tree_arg_validation&);
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
226
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
227 void visit_arg_size_spec (tree_arg_size_spec&);
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
228
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
229 void visit_arg_validation_fcns (tree_arg_validation_fcns&);
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29657
diff changeset
230
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
231 void visit_binary_expression (tree_binary_expression&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
232
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
233 void visit_boolean_expression (tree_boolean_expression&);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
234
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
235 void visit_compound_binary_expression (tree_compound_binary_expression&);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
236
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
237 void visit_break_command (tree_break_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
238
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
239 void visit_colon_expression (tree_colon_expression&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
240
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
241 void visit_continue_command (tree_continue_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
242
23469
2699c5974844 handle global and persistent in tree_decl_command, not as separate classes
John W. Eaton <jwe@octave.org>
parents: 23458
diff changeset
243 void visit_decl_command (tree_decl_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
244
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
245 void visit_decl_elt (tree_decl_elt&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
246
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
247 void visit_simple_for_command (tree_simple_for_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
248
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
249 void visit_complex_for_command (tree_complex_for_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
250
28518
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28433
diff changeset
251 void visit_spmd_command (tree_spmd_command&);
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28433
diff changeset
252
30919
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
253 octave_value evaluate_anon_fcn_handle (tree_anon_fcn_handle& afh);
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
254
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
255 octave_value_list
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
256 execute_builtin_function (octave_builtin& builtin_function, int nargout,
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
257 const octave_value_list& args);
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
258 octave_value_list
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
259 execute_mex_function (octave_mex_function& mex_function, int nargout,
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
260 const octave_value_list& args);
4ed7dfe28584 move eval of anon fcn handles and built-in and mex functions to pt-eval.cc
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
261
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
262 void visit_octave_user_script (octave_user_script&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
263
25400
d423ce60f5c8 evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents: 25382
diff changeset
264 octave_value_list
d423ce60f5c8 evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents: 25382
diff changeset
265 execute_user_script (octave_user_script& user_script, int nargout,
d423ce60f5c8 evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents: 25382
diff changeset
266 const octave_value_list& args);
d423ce60f5c8 evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents: 25382
diff changeset
267
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
268 void visit_octave_user_function (octave_user_function&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
269
25400
d423ce60f5c8 evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents: 25382
diff changeset
270 octave_value_list
26825
6e9034836239 allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents: 26686
diff changeset
271 execute_user_function (octave_user_function& user_function,
28429
8eb8ba8aff9a refactor octave_function call method
John W. Eaton <jwe@octave.org>
parents: 28426
diff changeset
272 int nargout, const octave_value_list& args);
25400
d423ce60f5c8 evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents: 25382
diff changeset
273
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
274 void visit_octave_user_function_header (octave_user_function&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
275
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
276 void visit_octave_user_function_trailer (octave_user_function&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
277
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
278 void visit_function_def (tree_function_def&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
279
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
280 void visit_identifier (tree_identifier&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
281
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
282 void visit_if_clause (tree_if_clause&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
283
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
284 void visit_if_command (tree_if_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
285
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
286 void visit_if_command_list (tree_if_command_list&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
287
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
288 void visit_index_expression (tree_index_expression&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
289
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
290 void visit_matrix (tree_matrix&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
291
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
292 void visit_cell (tree_cell&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
293
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
294 void visit_multi_assignment (tree_multi_assignment&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
295
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
296 void visit_no_op_command (tree_no_op_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
297
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
298 void visit_constant (tree_constant&);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
299
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
300 void visit_fcn_handle (tree_fcn_handle&);
15035
a820a990968e new tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 14294
diff changeset
301
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
302 void visit_parameter_list (tree_parameter_list&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
303
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
304 void visit_postfix_expression (tree_postfix_expression&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
305
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
306 void visit_prefix_expression (tree_prefix_expression&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
307
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
308 void visit_return_command (tree_return_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
309
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
310 void visit_simple_assignment (tree_simple_assignment&);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
311
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
312 void visit_statement (tree_statement&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
313
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
314 void visit_statement_list (tree_statement_list&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
315
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
316 void visit_switch_case (tree_switch_case&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
317
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
318 void visit_switch_case_list (tree_switch_case_list&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
319
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
320 void visit_switch_command (tree_switch_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
321
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
322 void visit_try_catch_command (tree_try_catch_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
323
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
324 void do_unwind_protect_cleanup_code (tree_statement_list *list);
10066
2cd940306a06 make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents: 9484
diff changeset
325
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
326 void visit_unwind_protect_command (tree_unwind_protect_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
327
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
328 void visit_while_command (tree_while_command&);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
329 void visit_do_until_command (tree_do_until_command&);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
330
26686
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26661
diff changeset
331 void visit_superclass_ref (tree_superclass_ref&);
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26661
diff changeset
332 void visit_metaclass_query (tree_metaclass_query&);
581d01526b34 eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents: 26661
diff changeset
333
23702
d396b5fd9199 move bind_ans to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23696
diff changeset
334 void bind_ans (const octave_value& val, bool print);
d396b5fd9199 move bind_ans to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23696
diff changeset
335
23705
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
336 bool statement_printing_enabled (void);
10186
095a1e670e68 make dbstep work with keyboard function
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
337
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
338 void reset_debug_state (void);
15606
fb9dffe5fbfb The silent_functions flag no longer modifies the parse tree
Max Brister <max@2bass.com>
parents: 15195
diff changeset
339
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
340 void reset_debug_state (bool mode);
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
341
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
342 void enter_debugger (const std::string& prompt = "debug> ");
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
343
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
344 void keyboard (const std::string& prompt = "keyboard> ");
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
345
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
346 void dbupdown (int n, bool verbose = false);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
347
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
348 // Possible types of evaluation contexts.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
349 enum stmt_list_type
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
350 {
25401
6f6479125d80 eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 25400
diff changeset
351 SC_FUNCTION, // function body
6f6479125d80 eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 25400
diff changeset
352 SC_SCRIPT, // script file
6f6479125d80 eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 25400
diff changeset
353 SC_OTHER // command-line input or eval string
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
354 };
11304
c9fefa096ce2 echo commands in scripts
John W. Eaton <jwe@octave.org>
parents: 10578
diff changeset
355
23481
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
356 Matrix ignored_fcn_outputs (void) const;
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
357
28433
d05a4194f1ad move make_fcn_handle to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 28430
diff changeset
358 octave_value make_fcn_handle (const std::string& nm);
d05a4194f1ad move make_fcn_handle to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 28430
diff changeset
359
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
360 octave_value evaluate (tree_decl_elt *);
24349
4ced2bfd737e deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents: 24270
diff changeset
361
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
362 void install_variable (const std::string& name,
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
363 const octave_value& value, bool global);
24349
4ced2bfd737e deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents: 24270
diff changeset
364
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
365 octave_value global_varval (const std::string& name) const;
23481
73558a835b64 eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents: 23469
diff changeset
366
27211
8c27802a76c4 store reference to evaluator instead of call stack in stack frame
John W. Eaton <jwe@octave.org>
parents: 27210
diff changeset
367 octave_value& global_varref (const std::string& name);
8c27802a76c4 store reference to evaluator instead of call stack in stack frame
John W. Eaton <jwe@octave.org>
parents: 27210
diff changeset
368
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
369 void global_assign (const std::string& name,
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
370 const octave_value& val = octave_value ());
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
371
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
372 octave_value top_level_varval (const std::string& name) const;
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
373
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
374 void top_level_assign (const std::string& name,
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
375 const octave_value& val = octave_value ());
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
376
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
377 bool is_variable (const std::string& name) const;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
378
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
379 bool is_local_variable (const std::string& name) const;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
380
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
381 bool is_variable (const tree_expression *expr) const;
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
382
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
383 bool is_defined (const tree_expression *expr) const;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
384
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
385 bool is_variable (const symbol_record& sym) const;
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
386
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
387 bool is_defined (const symbol_record& sym) const;
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
388
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
389 bool is_global (const std::string& name) const;
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
390
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
391 octave_value varval (const symbol_record& sym) const;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
392
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
393 octave_value varval (const std::string& name) const;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
394
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
395 void assign (const std::string& name,
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
396 const octave_value& val = octave_value ());
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
397
27014
daab1b311a98 move core of assignin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27005
diff changeset
398 void assignin (const std::string& context, const std::string& name,
daab1b311a98 move core of assignin function to evaluator
John W. Eaton <jwe@octave.org>
parents: 27005
diff changeset
399 const octave_value& val = octave_value ());
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
400
27017
24b7e6326e26 move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents: 27016
diff changeset
401 void source_file (const std::string& file_name,
24b7e6326e26 move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents: 27016
diff changeset
402 const std::string& context = "",
27507
2d537a089e5d eliminate warn_for argument for source_file and parse_fcn_file functions
John W. Eaton <jwe@octave.org>
parents: 27471
diff changeset
403 bool verbose = false, bool require_file = true);
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
404
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
405 void set_auto_fcn_var (stack_frame::auto_var_type avt,
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
406 const octave_value& val = octave_value ());
24563
8f2c479eb125 eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
407
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
408 octave_value get_auto_fcn_var (stack_frame::auto_var_type avt) const;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
409
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
410 void define_parameter_list_from_arg_vector
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
411 (tree_parameter_list *param_list, const octave_value_list& args);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
412
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
413 void undefine_parameter_list (tree_parameter_list *param_list);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
414
28804
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
415 octave_value_list convert_to_const_vector (tree_argument_list *arg_list);
25382
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
416
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
417 octave_value_list
23916
85488effc0ff refactor function value return code
John W. Eaton <jwe@octave.org>
parents: 23795
diff changeset
418 convert_return_list_to_const_vector
28540
ea5a632b2553 improve error checking for undefined function outputs (bug #58686, #58695)
John W. Eaton <jwe@octave.org>
parents: 28433
diff changeset
419 (tree_parameter_list *ret_list, int nargout,
ea5a632b2553 improve error checking for undefined function outputs (bug #58686, #58695)
John W. Eaton <jwe@octave.org>
parents: 28433
diff changeset
420 const Matrix& ignored_outputs, const Cell& varargout);
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
421
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
422 bool eval_decl_elt (tree_decl_elt *elt);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
423
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
424 bool switch_case_label_matches (tree_switch_case *expr,
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
425 const octave_value& val);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
426
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
427 interpreter& get_interpreter (void) { return m_interpreter; }
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
428
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
429 bp_table& get_bp_table (void) { return m_bp_table; }
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
430
23753
c3828bd031cd move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23750
diff changeset
431 profiler& get_profiler (void) { return m_profiler; }
c3828bd031cd move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23750
diff changeset
432
23553
14723784b9f2 don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents: 23532
diff changeset
433 call_stack& get_call_stack (void) { return m_call_stack; }
14723784b9f2 don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents: 23532
diff changeset
434
27210
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
435 void push_stack_frame (const symbol_scope& scope);
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
436
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
437 void push_stack_frame (octave_user_function *fcn,
28426
9a3deb17b4ea use shared_ptr for stack frames in call stack and for accesss and static links
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
438 const std::shared_ptr<stack_frame>& closure_frames = std::shared_ptr<stack_frame> ());
27210
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
439
28430
5bfa8e018704 store local init vars for anonymous functions in handle, not function object
John W. Eaton <jwe@octave.org>
parents: 28429
diff changeset
440 void push_stack_frame (octave_user_function *fcn,
29477
34d06c73b48d hold references to closure frames in anon functions if needed (bug #60237)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
441 const stack_frame::local_vars_map& local_vars,
34d06c73b48d hold references to closure frames in anon functions if needed (bug #60237)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
442 const std::shared_ptr<stack_frame>& closure_frames = std::shared_ptr<stack_frame> ());
28430
5bfa8e018704 store local init vars for anonymous functions in handle, not function object
John W. Eaton <jwe@octave.org>
parents: 28429
diff changeset
443
28429
8eb8ba8aff9a refactor octave_function call method
John W. Eaton <jwe@octave.org>
parents: 28426
diff changeset
444 void push_stack_frame (octave_user_script *script);
27210
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
445
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
446 void push_stack_frame (octave_function *fcn);
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
447
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
448 void pop_stack_frame (void);
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
449
28426
9a3deb17b4ea use shared_ptr for stack frames in call stack and for accesss and static links
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
450 std::shared_ptr<stack_frame> get_current_stack_frame (void) const
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
451 {
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
452 return m_call_stack.get_current_stack_frame ();
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
453 }
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
454
28426
9a3deb17b4ea use shared_ptr for stack frames in call stack and for accesss and static links
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
455 std::shared_ptr<stack_frame> current_user_frame (void) const
27200
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
456 {
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
457 return m_call_stack.current_user_frame ();
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
458 }
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
459
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
460 // Current line in current function.
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
461 int current_line (void) const;
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
462
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
463 // Current column in current function.
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
464 int current_column (void) const;
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
465
27205
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
466 // Line number in current function that we are debugging.
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
467 int debug_user_code_line (void) const;
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
468
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
469 // Column number in current function that we are debugging.
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
470 int debug_user_code_column (void) const;
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
471
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
472 void debug_where (std::ostream& os) const;
6648d1ae05fe eliminate direct access to call stack in debug functions
John W. Eaton <jwe@octave.org>
parents: 27204
diff changeset
473
27200
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
474 octave_user_code * current_user_code (void) const;
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
475
28429
8eb8ba8aff9a refactor octave_function call method
John W. Eaton <jwe@octave.org>
parents: 28426
diff changeset
476 unwind_protect * curr_fcn_unwind_protect_frame (void);
27200
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
477
27202
23962b243bad eliminate direct access to call stack in help functions
John W. Eaton <jwe@octave.org>
parents: 27201
diff changeset
478 // Current function that we are debugging.
23962b243bad eliminate direct access to call stack in help functions
John W. Eaton <jwe@octave.org>
parents: 27201
diff changeset
479 octave_user_code * debug_user_code (void) const;
23962b243bad eliminate direct access to call stack in help functions
John W. Eaton <jwe@octave.org>
parents: 27201
diff changeset
480
27873
020d0e8f7ac6 reafactor mlock, munlock, and mislocked functions
John W. Eaton <jwe@octave.org>
parents: 27725
diff changeset
481 octave_function * current_function (bool skip_first = false) const;
27201
bd49997051ef eliminate direct access to call stack in defun functions
John W. Eaton <jwe@octave.org>
parents: 27200
diff changeset
482
27204
9a3e92d02a03 eliminate direct access to call stack in variables functions
John W. Eaton <jwe@octave.org>
parents: 27203
diff changeset
483 octave_function * caller_function (void) const;
9a3e92d02a03 eliminate direct access to call stack in variables functions
John W. Eaton <jwe@octave.org>
parents: 27203
diff changeset
484
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29477
diff changeset
485 bool goto_frame (std::size_t n = 0, bool verbose = false);
27200
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
486
27206
4e4a9d7b436e eliminate direct access to call stack in mex functions
John W. Eaton <jwe@octave.org>
parents: 27205
diff changeset
487 void goto_caller_frame (void);
4e4a9d7b436e eliminate direct access to call stack in mex functions
John W. Eaton <jwe@octave.org>
parents: 27205
diff changeset
488
4e4a9d7b436e eliminate direct access to call stack in mex functions
John W. Eaton <jwe@octave.org>
parents: 27205
diff changeset
489 void goto_base_frame (void);
4e4a9d7b436e eliminate direct access to call stack in mex functions
John W. Eaton <jwe@octave.org>
parents: 27205
diff changeset
490
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29477
diff changeset
491 void restore_frame (std::size_t n);
27200
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
492
27210
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
493 std::string get_dispatch_class (void) const;
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
494
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
495 void set_dispatch_class (const std::string& class_name);
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
496
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
497 bool is_class_method_executing (std::string& dispatch_class) const;
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
498
bd684aad1821 eliminate some direct access to call stack in legacy class and function objects
John W. Eaton <jwe@octave.org>
parents: 27208
diff changeset
499 bool is_class_constructor_executing (std::string& dispatch_class) const;
27200
dc1edf932248 eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents: 27199
diff changeset
500
28426
9a3deb17b4ea use shared_ptr for stack frames in call stack and for accesss and static links
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
501 std::list<std::shared_ptr<stack_frame>>
27199
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
502 backtrace_frames (octave_idx_type& curr_user_frame) const;
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
503
28426
9a3deb17b4ea use shared_ptr for stack frames in call stack and for accesss and static links
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
504 std::list<std::shared_ptr<stack_frame>> backtrace_frames () const;
27199
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
505
27471
fd32c1a9b1bd revamp error handling
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
506 std::list<frame_info> backtrace_info (octave_idx_type& curr_user_frame,
fd32c1a9b1bd revamp error handling
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
507 bool print_subfn = true) const;
fd32c1a9b1bd revamp error handling
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
508
fd32c1a9b1bd revamp error handling
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
509 std::list<frame_info> backtrace_info (void) const;
fd32c1a9b1bd revamp error handling
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
510
27199
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
511 octave_map backtrace (octave_idx_type& curr_user_frame,
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
512 bool print_subfn = true) const;
24037
21915520ac7b use more direct method for non-local symbol access (bug #38236)
John W. Eaton <jwe@octave.org>
parents: 23916
diff changeset
513
27471
fd32c1a9b1bd revamp error handling
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
514 octave_map backtrace (void) const;
27199
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
515
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
516 octave_map empty_backtrace (void) const;
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
517
27471
fd32c1a9b1bd revamp error handling
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
518 std::string backtrace_message (void) const;
fd32c1a9b1bd revamp error handling
John W. Eaton <jwe@octave.org>
parents: 27371
diff changeset
519
27001
3cea1cfb37d3 move toward limiting direct access of call stack
John W. Eaton <jwe@octave.org>
parents: 26975
diff changeset
520 void push_dummy_scope (const std::string& name);
3cea1cfb37d3 move toward limiting direct access of call stack
John W. Eaton <jwe@octave.org>
parents: 26975
diff changeset
521 void pop_scope (void);
23753
c3828bd031cd move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23750
diff changeset
522
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
523 symbol_scope get_top_scope (void) const;
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
524 symbol_scope get_current_scope (void) const;
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
525
27873
020d0e8f7ac6 reafactor mlock, munlock, and mislocked functions
John W. Eaton <jwe@octave.org>
parents: 27725
diff changeset
526 void mlock (bool skip_first = false) const;
020d0e8f7ac6 reafactor mlock, munlock, and mislocked functions
John W. Eaton <jwe@octave.org>
parents: 27725
diff changeset
527
020d0e8f7ac6 reafactor mlock, munlock, and mislocked functions
John W. Eaton <jwe@octave.org>
parents: 27725
diff changeset
528 void munlock (bool skip_first = false) const;
020d0e8f7ac6 reafactor mlock, munlock, and mislocked functions
John W. Eaton <jwe@octave.org>
parents: 27725
diff changeset
529
020d0e8f7ac6 reafactor mlock, munlock, and mislocked functions
John W. Eaton <jwe@octave.org>
parents: 27725
diff changeset
530 bool mislocked (bool skip_first = false) const;
27212
f84c5528e932 eliminate direct access to call stack in interpreter::mlock
John W. Eaton <jwe@octave.org>
parents: 27211
diff changeset
531
27211
8c27802a76c4 store reference to evaluator instead of call stack in stack frame
John W. Eaton <jwe@octave.org>
parents: 27210
diff changeset
532 octave_value max_stack_depth (const octave_value_list& args, int nargout);
8c27802a76c4 store reference to evaluator instead of call stack in stack frame
John W. Eaton <jwe@octave.org>
parents: 27210
diff changeset
533
8c27802a76c4 store reference to evaluator instead of call stack in stack frame
John W. Eaton <jwe@octave.org>
parents: 27210
diff changeset
534 // Useful for debugging
8c27802a76c4 store reference to evaluator instead of call stack in stack frame
John W. Eaton <jwe@octave.org>
parents: 27210
diff changeset
535 void display_call_stack (void) const;
8c27802a76c4 store reference to evaluator instead of call stack in stack frame
John W. Eaton <jwe@octave.org>
parents: 27210
diff changeset
536
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
537 octave_value find (const std::string& name);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
538
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
539 void clear_objects (void);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
540
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
541 void clear_variable (const std::string& name);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
542
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
543 void clear_variable_pattern (const std::string& pattern);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
544
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
545 void clear_variable_regexp (const std::string& pattern);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
546
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
547 void clear_variables (void);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
548
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
549 void clear_global_variable (const std::string& name);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
550
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
551 void clear_global_variable_pattern (const std::string& pattern);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
552
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
553 void clear_global_variable_regexp (const std::string& pattern);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
554
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
555 void clear_global_variables (void);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
556
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
557 void clear_all (bool force = false);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
558
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
559 void clear_symbol (const std::string& name);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
560
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
561 void clear_symbol_pattern (const std::string& pattern);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
562
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
563 void clear_symbol_regexp (const std::string& pattern);
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
564
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
565 std::list<std::string> global_variable_names (void) const;
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
566
27594
e091e09d26f0 restore some symbol table functions for backward compatibility
John W. Eaton <jwe@octave.org>
parents: 27519
diff changeset
567 std::list<std::string> top_level_variable_names (void) const;
e091e09d26f0 restore some symbol table functions for backward compatibility
John W. Eaton <jwe@octave.org>
parents: 27519
diff changeset
568
26661
cf9e10ce3351 move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents: 26377
diff changeset
569 std::list<std::string> variable_names (void) const;
24037
21915520ac7b use more direct method for non-local symbol access (bug #38236)
John W. Eaton <jwe@octave.org>
parents: 23916
diff changeset
570
26975
de826e69a5ea make breakpoints in classdef methods work (bug #45404, bug #46451)
John W. Eaton <jwe@octave.org>
parents: 26825
diff changeset
571 octave_user_code * get_user_code (const std::string& fname = "",
de826e69a5ea make breakpoints in classdef methods work (bug #45404, bug #46451)
John W. Eaton <jwe@octave.org>
parents: 26825
diff changeset
572 const std::string& class_name = "");
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
573
27873
020d0e8f7ac6 reafactor mlock, munlock, and mislocked functions
John W. Eaton <jwe@octave.org>
parents: 27725
diff changeset
574 std::string current_function_name (bool skip_first = false) const;
27199
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
575
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
576 bool in_user_code (void) const;
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
577
27203
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
578 symbol_info_list glob_symbol_info (const std::string& pattern) const;
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
579
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
580 symbol_info_list regexp_symbol_info (const std::string& pattern) const;
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
581
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
582 symbol_info_list get_symbol_info (void);
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
583
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
584 symbol_info_list top_scope_symbol_info (void) const;
79065f9d5553 eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents: 27202
diff changeset
585
27016
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
586 octave_map get_autoload_map (void) const;
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
587
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
588 std::string lookup_autoload (const std::string& nm) const;
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
589
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
590 std::list<std::string> autoloaded_functions (void) const;
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
591
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
592 std::list<std::string> reverse_lookup_autoload (const std::string& nm) const;
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
593
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
594 void add_autoload (const std::string& fcn, const std::string& nm);
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
595
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
596 void remove_autoload (const std::string& fcn, const std::string& nm);
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
597
23705
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
598 int max_recursion_depth (void) const { return m_max_recursion_depth; }
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
599
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
600 int max_recursion_depth (int n)
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
601 {
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
602 int val = m_max_recursion_depth;
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
603 m_max_recursion_depth = n;
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
604 return val;
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
605 }
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
606
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
607 octave_value
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
608 max_recursion_depth (const octave_value_list& args, int nargout);
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
609
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
610 bool silent_functions (void) const { return m_silent_functions; }
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
611
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
612 bool silent_functions (bool b)
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
613 {
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
614 int val = m_silent_functions;
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
615 m_silent_functions = b;
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
616 return val;
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
617 }
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
618
26087
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
619 octave_value whos_line_format (const octave_value_list& args, int nargout);
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
620
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
621 std::string whos_line_format (void) const { return m_whos_line_format; }
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
622
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
623 std::string whos_line_format (const std::string& s)
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
624 {
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
625 std::string val = m_whos_line_format;
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
626 m_whos_line_format = s;
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
627 return val;
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
628 }
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
629
23705
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
630 octave_value
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
631 silent_functions (const octave_value_list& args, int nargout);
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
632
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29477
diff changeset
633 std::size_t debug_frame (void) const { return m_debug_frame; }
25402
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
634
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29477
diff changeset
635 std::size_t debug_frame (std::size_t n)
25402
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
636 {
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29477
diff changeset
637 std::size_t val = m_debug_frame;
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
638 m_debug_frame = n;
25402
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
639 return val;
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
640 }
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
641
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29477
diff changeset
642 std::size_t current_call_stack_frame_number (void) const
25402
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
643 {
27199
f27002104c5b eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents: 27037
diff changeset
644 return m_call_stack.current_frame ();
25402
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
645 }
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
646
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
647 bool quiet_breakpoint_flag (void) const { return m_quiet_breakpoint_flag; }
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
648
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
649 bool quiet_breakpoint_flag (bool flag)
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
650 {
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
651 bool val = m_quiet_breakpoint_flag;
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
652 m_quiet_breakpoint_flag = flag;
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
653 return val;
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
654 }
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
655
23706
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
656 char string_fill_char (void) const { return m_string_fill_char; }
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
657
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
658 char string_fill_char (char c)
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
659 {
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
660 int val = m_string_fill_char;
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
661 m_string_fill_char = c;
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
662 return val;
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
663 }
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
664
27282
49c60d16866f improve dbquit and dbcont behavior
John W. Eaton <jwe@octave.org>
parents: 27234
diff changeset
665 // The following functions are provided for convenience. They
49c60d16866f improve dbquit and dbcont behavior
John W. Eaton <jwe@octave.org>
parents: 27234
diff changeset
666 // call the corresponding functions in the debugger class for the
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
667 // current debugger (if any).
27282
49c60d16866f improve dbquit and dbcont behavior
John W. Eaton <jwe@octave.org>
parents: 27234
diff changeset
668
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
669 bool in_debug_repl (void) const;
27282
49c60d16866f improve dbquit and dbcont behavior
John W. Eaton <jwe@octave.org>
parents: 27234
diff changeset
670
49c60d16866f improve dbquit and dbcont behavior
John W. Eaton <jwe@octave.org>
parents: 27234
diff changeset
671 void dbcont (void);
49c60d16866f improve dbquit and dbcont behavior
John W. Eaton <jwe@octave.org>
parents: 27234
diff changeset
672
29306
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
673 // Return true if we are in the debug repl and m_execution_mode is
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
674 // set to exit the debugger. Otherwise, do nothing.
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
675
27282
49c60d16866f improve dbquit and dbcont behavior
John W. Eaton <jwe@octave.org>
parents: 27234
diff changeset
676 void dbquit (bool all = false);
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
677
29446
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
678 // Add EXPR to the set of expressions that may be evaluated when the
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
679 // debugger stops at a breakpoint.
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
680 void add_debug_watch_expression (const std::string& expr)
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
681 {
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
682 m_debug_watch_expressions.insert (expr);
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
683 }
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
684
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
685 // Remove EXPR from the set of expressions that may be evaluated
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
686 // when the debugger stops at a breakpoint.
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
687 void remove_debug_watch_expression (const std::string& expr)
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
688 {
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
689 m_debug_watch_expressions.erase (expr);
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
690 }
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
691
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
692 // Clear the set of expressions that may be evaluated when the
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
693 // debugger stops at a breakpoint.
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
694 void clear_debug_watch_expressions (void)
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
695 {
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
696 m_debug_watch_expressions.clear ();
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
697 }
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
698
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
699 // Return the set of expressions that may be evaluated when the
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
700 // debugger stops at a breakpoint.
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
701 std::set<std::string> debug_watch_expressions (void) const
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
702 {
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
703 return m_debug_watch_expressions;
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
704 }
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
705
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
706 octave_value PS4 (const octave_value_list& args, int nargout);
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
707
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
708 std::string PS4 (void) const { return m_PS4; }
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
709
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
710 std::string PS4 (const std::string& s)
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
711 {
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
712 std::string val = m_PS4;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
713 m_PS4 = s;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
714 return val;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
715 }
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
716
28726
0a4dcea2987a stash (shallow) copy of indexed object instead of pointer
John W. Eaton <jwe@octave.org>
parents: 28540
diff changeset
717 octave_value indexed_object (void) const
25382
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
718 {
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
719 return m_indexed_object;
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
720 }
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
721
28804
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
722 void set_indexed_object (const octave_value& obj = octave_value ())
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
723 {
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
724 m_indexed_object = obj;
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
725 }
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
726
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
727 const std::list<octave_value_list>& index_list (void) const
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
728 {
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
729 return m_index_list;
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
730 }
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
731
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
732 void set_index_list (const std::string& index_type,
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
733 const std::list<octave_value_list>& index_list)
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
734 {
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
735 m_index_type = index_type;
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
736 m_index_list = index_list;
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
737 }
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
738
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
739 void clear_index_list (void)
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
740 {
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
741 m_index_type = "";
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
742 m_index_list.clear ();
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
743 }
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
744
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
745 void append_index_list (char type, const octave_value_list& idx)
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
746 {
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
747 m_index_type += type;
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
748 m_index_list.push_back (idx);
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
749 }
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
750
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
751 const std::string& index_type (void) const
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
752 {
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
753 return m_index_type;
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
754 }
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
755
25382
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
756 int index_position (void) const { return m_index_position; }
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
757
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
758 int num_indices (void) const { return m_num_indices; }
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
759
28804
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
760 octave_value_list evaluate_end_expression (const octave_value_list& args);
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
761
27371
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
762 const std::list<octave_lvalue> * lvalue_list (void) const
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
763 {
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
764 return m_lvalue_list;
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
765 }
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
766
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
767 void set_lvalue_list (const std::list<octave_lvalue> *lst)
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
768 {
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
769 m_lvalue_list = lst;
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
770 }
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
771
25403
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
772 int breaking (void) const { return m_breaking; }
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
773
25404
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
774 int breaking (int n)
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
775 {
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
776 int val = m_breaking;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
777 m_breaking = n;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
778 return val;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
779 }
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
780
25403
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
781 int continuing (void) const { return m_continuing; }
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
782
25404
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
783 int continuing (int n)
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
784 {
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
785 int val = m_continuing;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
786 m_continuing = n;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
787 return val;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
788 }
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
789
25403
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
790 int returning (void) const { return m_returning; }
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
791
25404
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
792 int returning (int n)
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
793 {
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
794 int val = m_returning;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
795 m_returning = n;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
796 return val;
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
797 }
e37d857716c3 move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents: 25403
diff changeset
798
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
799 int dbstep_flag (void) const { return m_dbstep_flag; }
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
800
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
801 int dbstep_flag (int val)
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
802 {
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
803 int old_val = m_dbstep_flag;
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
804 m_dbstep_flag = val;
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
805 return old_val;
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
806 }
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
807
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
808 void set_dbstep_flag (int step) { m_dbstep_flag = step; }
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
809
29306
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
810 bool break_on_next_statement (void) const
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
811 {
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
812 return m_break_on_next_stmt;
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
813 }
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
814
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
815 bool break_on_next_statement (bool val)
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
816 {
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
817 bool old_val = m_break_on_next_stmt;
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
818 m_break_on_next_stmt = val;
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
819 return old_val;
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
820 }
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
821
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
822 void set_break_on_next_statement (bool val)
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
823 {
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
824 m_break_on_next_stmt = val;
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
825 }
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
826
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
827 octave_value echo (const octave_value_list& args, int nargout);
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
828
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
829 int echo (void) const { return m_echo; }
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
830
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
831 int echo (int val)
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
832 {
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
833 int old_val = m_echo;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
834 m_echo = val;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
835 return old_val;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
836 }
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
837
23706
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
838 octave_value
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
839 string_fill_char (const octave_value_list& args, int nargout);
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
840
29171
254ee9af5014 maint: More updates to standardize exception naming scheme.
Rik <rik@octave.org>
parents: 28806
diff changeset
841 void final_index_error (index_exception& ie, const tree_expression *expr);
26094
8fb0df0c8772 eliminate duplicate final_index_error function
John W. Eaton <jwe@octave.org>
parents: 26087
diff changeset
842
27005
a1ea0e7aecde move do_who inside call_stack, make accessible from evaluator
John W. Eaton <jwe@octave.org>
parents: 27001
diff changeset
843 octave_value do_who (int argc, const string_vector& argv,
a1ea0e7aecde move do_who inside call_stack, make accessible from evaluator
John W. Eaton <jwe@octave.org>
parents: 27001
diff changeset
844 bool return_list, bool verbose = false);
a1ea0e7aecde move do_who inside call_stack, make accessible from evaluator
John W. Eaton <jwe@octave.org>
parents: 27001
diff changeset
845
27371
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
846 octave_value_list
28804
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
847 make_value_list (tree_argument_list *args, const string_vector& arg_nm);
27371
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
848
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
849 std::list<octave_lvalue> make_lvalue_list (tree_argument_list *);
fcaecdbc8d8a don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27370
diff changeset
850
29339
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
851 void push_echo_state (int type, const std::string& file_name, int pos = 1);
23729
06b3d1d54054 allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents: 23728
diff changeset
852
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
853 private:
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
854
28646
e26201931ea3 new template class for octave_range objects
John W. Eaton <jwe@octave.org>
parents: 28541
diff changeset
855 template <typename T>
29339
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
856 void execute_range_loop (const range<T>& rng, int line,
28646
e26201931ea3 new template class for octave_range objects
John W. Eaton <jwe@octave.org>
parents: 28541
diff changeset
857 octave_lvalue& ult,
e26201931ea3 new template class for octave_range objects
John W. Eaton <jwe@octave.org>
parents: 28541
diff changeset
858 tree_statement_list *loop_body);
e26201931ea3 new template class for octave_range objects
John W. Eaton <jwe@octave.org>
parents: 28541
diff changeset
859
29339
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
860 void set_echo_state (int type, const std::string& file_name, int pos);
23729
06b3d1d54054 allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents: 23728
diff changeset
861
06b3d1d54054 allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents: 23728
diff changeset
862 void maybe_set_echo_state (void);
06b3d1d54054 allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents: 23728
diff changeset
863
06b3d1d54054 allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents: 23728
diff changeset
864 void push_echo_state_cleanup (unwind_protect& frame);
06b3d1d54054 allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents: 23728
diff changeset
865
06b3d1d54054 allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents: 23728
diff changeset
866 bool maybe_push_echo_state_cleanup (void);
06b3d1d54054 allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents: 23728
diff changeset
867
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
868 void do_breakpoint (tree_statement& stmt);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
869
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
870 void do_breakpoint (bool is_breakpoint,
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
871 bool is_end_of_fcn_or_script = false);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
872
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
873 bool is_logically_true (tree_expression *expr, const char *warn_for);
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
874
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
875 // For unwind-protect.
29339
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
876 void uwp_set_echo_state (bool state, const std::string& file_name, int pos);
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
877
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
878 bool echo_this_file (const std::string& file, int type) const;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
879
29339
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
880 void echo_code (int line);
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
881
25403
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
882 bool quit_loop_now (void);
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
883
28540
ea5a632b2553 improve error checking for undefined function outputs (bug #58686, #58695)
John W. Eaton <jwe@octave.org>
parents: 28433
diff changeset
884 void bind_auto_fcn_vars (const string_vector& arg_names,
ea5a632b2553 improve error checking for undefined function outputs (bug #58686, #58695)
John W. Eaton <jwe@octave.org>
parents: 28433
diff changeset
885 const Matrix& ignored_outputs, int nargin,
26039
d2aae3570c81 perform automatic function variable binding in tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25653
diff changeset
886 int nargout, bool takes_varargs,
d2aae3570c81 perform automatic function variable binding in tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25653
diff changeset
887 const octave_value_list& va_args);
d2aae3570c81 perform automatic function variable binding in tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25653
diff changeset
888
27016
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
889 std::string check_autoload_file (const std::string& nm) const;
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
890
23705
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
891 interpreter& m_interpreter;
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
892
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
893 std::shared_ptr<push_parser> m_parser;
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
894
25401
6f6479125d80 eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 25400
diff changeset
895 // The context for the current evaluation.
6f6479125d80 eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 25400
diff changeset
896 stmt_list_type m_statement_context;
6f6479125d80 eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 25400
diff changeset
897
27370
a2d3fa82b730 don't use stack to save and restore lvalue list value in evaluator (bug #56752)
John W. Eaton <jwe@octave.org>
parents: 27369
diff changeset
898 const std::list<octave_lvalue> *m_lvalue_list;
23435
c452180ab672 begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
899
27016
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
900 // List of autoloads (function -> file mapping).
9b261300a001 move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents: 27015
diff changeset
901 std::map<std::string, std::string> m_autoload_map;
10219
979fb2606c4f new tree_evaluator::do_keyoard function
Ryan Rusaw <rrusaw@gmail.com>
parents: 10186
diff changeset
902
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
903 bp_table m_bp_table;
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
904
23553
14723784b9f2 don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents: 23532
diff changeset
905 call_stack m_call_stack;
14723784b9f2 don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents: 23532
diff changeset
906
23753
c3828bd031cd move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23750
diff changeset
907 profiler m_profiler;
c3828bd031cd move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23750
diff changeset
908
25402
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
909 // The number of the stack frame we are currently debugging.
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29477
diff changeset
910 std::size_t m_debug_frame;
25402
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
911
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
912 bool m_debug_mode;
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
913
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
914 bool m_quiet_breakpoint_flag;
ef2b9d4abf4a eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25401
diff changeset
915
27037
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
916 // When entering the debugger we push it on this stack. Managing
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
917 // debugger invocations this way allows us to handle recursive
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
918 // debugger calls. When we exit a debugger the object is popped
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
919 // from the stack and deleted and we resume working with the
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
920 // previous debugger (if any) that is now at the top of the stack.
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
921 std::stack<debugger *> m_debugger_stack;
8408acb7ca4f make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents: 27019
diff changeset
922
29446
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
923 std::set<std::string> m_debug_watch_expressions;
435fc29162c0 maintain a set of watch expressions for possible use in tracing/debugging
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
924
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
925 int m_exit_status;
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
926
23705
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
927 // Maximum nesting level for functions, scripts, or sourced files
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
928 // called recursively.
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
929 int m_max_recursion_depth;
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
930
26087
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
931 // Defines layout for the whos/who -long command
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
932 std::string m_whos_line_format;
7656fcd0ff9f move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents: 26039
diff changeset
933
23705
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
934 // If TRUE, turn off printing of results in functions (as if a
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
935 // semicolon has been appended to each statement).
4c597585ff52 move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23702
diff changeset
936 bool m_silent_functions;
23706
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
937
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
938 // The character to fill with when creating string arrays.
6683451b75b2 move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23705
diff changeset
939 char m_string_fill_char;
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
940
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
941 // String printed before echoed commands (enabled by --echo-commands).
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
942 std::string m_PS4;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
943
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
944 // If > 0, stop executing at the (N-1)th stopping point, counting
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
945 // from the the current execution point in the current frame.
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
946 //
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
947 // If < 0, stop executing at the next possible stopping point.
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
948 int m_dbstep_flag;
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
949
29306
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
950 // If TRUE, and we are not stopping for another reason (dbstep or a
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
951 // breakpoint) then stop at next statement and enter the debugger.
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
952 bool m_break_on_next_stmt;
0231189f630d provide interpreter methods for pausing, resuming, and stopping evaluation
John W. Eaton <jwe@octave.org>
parents: 29282
diff changeset
953
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
954 // Echo commands as they are executed?
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
955 //
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
956 // 1 ==> echo commands read from script files
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
957 // 2 ==> echo commands from functions
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
958 //
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
959 // more than one state can be active at once.
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
960 int m_echo;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
961
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
962 // Are we currently echoing commands? This state is set by the
27956
2310164737b3 fix many spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
963 // functions that execute functions and scripts.
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
964 bool m_echo_state;
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
965
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
966 std::string m_echo_file_name;
23728
b40b7243a782 new class for caching file contents for debug and echo
John W. Eaton <jwe@octave.org>
parents: 23723
diff changeset
967
29339
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
968 // Next line to echo, counting from 1. We use int here because the
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
969 // parser does. It also initializes line and column numbers to the
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
970 // invalid value -1 and that can cause trouble if cast to an
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
971 // unsigned value. When updating this value and echoing ranges of
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
972 // code, we also check to ensure that the line numbers stored in the
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
973 // parse tree are valid. It would be better to ensure that the
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
974 // parser always stores valid position info, but that's more
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
975 // difficult to always do correctly.
93530bb4bd6f improve behavior of echo (bug #56068)
John W. Eaton <jwe@octave.org>
parents: 29306
diff changeset
976 int m_echo_file_pos;
23723
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
977
ab8831d346c1 revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 23706
diff changeset
978 std::map<std::string, bool> m_echo_files;
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
979
29846
78cb255c78a4 move top-level REPL from interpreter to evaluator
John W. Eaton <jwe@octave.org>
parents: 29656
diff changeset
980 // TRUE if we are in the top level interactive read eval print loop.
78cb255c78a4 move top-level REPL from interpreter to evaluator
John W. Eaton <jwe@octave.org>
parents: 29656
diff changeset
981 bool m_in_top_level_repl;
78cb255c78a4 move top-level REPL from interpreter to evaluator
John W. Eaton <jwe@octave.org>
parents: 29656
diff changeset
982
29281
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
983 // TRUE means we are executing in the server_loop function.
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
984 bool m_server_mode;
6dd456257d81 move some eval-related functions from interpreter to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents: 29171
diff changeset
985
25360
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
986 // TRUE means we are evaluating some kind of looping construct.
bc5f225bc578 eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents: 25317
diff changeset
987 bool m_in_loop_command;
25382
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
988
25403
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
989 // Nonzero means we're breaking out of a loop or function body.
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
990 int m_breaking;
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
991
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
992 // Nonzero means we're jumping to the end of a loop.
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
993 int m_continuing;
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
994
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
995 // Nonzero means we're returning from a function.
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
996 int m_returning;
2b7d7a3f5f57 move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents: 25402
diff changeset
997
28804
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
998 // The following are all used by the END function. Maybe they
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
999 // should be kept together in a separate object?
28726
0a4dcea2987a stash (shallow) copy of indexed object instead of pointer
John W. Eaton <jwe@octave.org>
parents: 28540
diff changeset
1000 octave_value m_indexed_object;
28804
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
1001 std::list<octave_value_list> m_index_list;
3719f5d452d4 refactor implementation of END indexing in interpreter (bug #58953)
John W. Eaton <jwe@octave.org> and Fernando Alvarruiz
parents: 28726
diff changeset
1002 std::string m_index_type;
25382
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
1003 int m_index_position;
749d9e858553 move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents: 25381
diff changeset
1004 int m_num_indices;
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
1005 };
29960
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29856
diff changeset
1006
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29856
diff changeset
1007 OCTAVE_NAMESPACE_END
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1008
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1009 #endif