Mercurial > octave
annotate libinterp/parse-tree/pt-eval.h @ 27204:9a3e92d02a03
eliminate direct access to call stack in variables functions
* pt-eval.h, pt-eval.cc (tree_evaluator::caller_function,
tree_evaluator::curr_fcn_unwind_protect_frame): New functions.
* variables.cc (curr_fcn_unwind_protect_frame, Fmlock, Fmunlock,
Fmislocked, F__varval__): Eliminate direct access to call stack.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 01 Apr 2019 18:21:27 +0000 |
parents | 79065f9d5553 |
children | 6648d1ae05fe |
rev | line source |
---|---|
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
26376
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
26113
diff
changeset
|
3 Copyright (C) 2009-2019 John W. Eaton |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 This file is part of Octave. |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24362
diff
changeset
|
7 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24362
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
10 (at your option) any later version. |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
15 GNU General Public License for more details. |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24362
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 */ |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20535
diff
changeset
|
23 #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
|
24 #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
|
25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20940
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20940
diff
changeset
|
27 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
28 #include <list> |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
29 #include <set> |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #include <stack> |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #include <string> |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 |
25360
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
33 #include "bp-table.h" |
23553
14723784b9f2
don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents:
23532
diff
changeset
|
34 #include "call-stack.h" |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
35 #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
|
36 #include "ovl.h" |
23753
c3828bd031cd
move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23750
diff
changeset
|
37 #include "profiler.h" |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
38 #include "pt-exp.h" |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 #include "pt-walk.h" |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 |
25360
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
41 class octave_user_code; |
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
42 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
43 namespace octave |
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
44 { |
27203
79065f9d5553
eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents:
27202
diff
changeset
|
45 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
|
46 class symbol_scope; |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
47 class tree_decl_elt; |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
48 class tree_expression; |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
49 |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
50 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
|
51 class interpreter; |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
52 class unwind_protect; |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
54 enum result_type |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
55 { |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
56 RT_UNDEFINED = 0, |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
57 RT_VALUE = 1, |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
58 RT_VALUE_LIST = 2 |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
59 }; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
60 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
61 // 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
|
62 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
63 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
|
64 { |
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
65 public: |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
67 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
|
68 { |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
69 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
|
70 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
|
71 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
|
72 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
|
73 }; |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
74 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
75 template <typename T> |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
76 class value_stack |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
77 { |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
78 public: |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
79 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
80 value_stack (void) = default; |
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 value_stack (const value_stack&) = default; |
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& operator = (const value_stack&) = 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 (void) = 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 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
|
89 |
23481
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
90 void pop (void) |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
91 { |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
92 m_stack.pop (); |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
93 } |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
94 |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
95 T val_pop (void) |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
96 { |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
97 T retval = m_stack.top (); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
98 m_stack.pop (); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
99 return retval; |
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 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
102 T top (void) const |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
103 { |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
104 return m_stack.top (); |
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 |
23481
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
107 size_t size (void) const |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
108 { |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
109 return m_stack.size (); |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
110 } |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
111 |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
112 bool empty (void) const |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
113 { |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
114 return m_stack.empty (); |
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 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
117 void clear (void) |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
118 { |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
119 while (! m_stack.empty ()) |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
120 m_stack.pop (); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
121 } |
23458
0f4ed33886de
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
122 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
123 private: |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
124 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
125 std::stack<T> m_stack; |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
126 }; |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
127 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
128 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
|
129 |
23532
084245f9bd03
pass reference to evaluator to octave_function call methods
John W. Eaton <jwe@octave.org>
parents:
23482
diff
changeset
|
130 tree_evaluator (interpreter& interp) |
25401
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
131 : m_interpreter (interp), m_statement_context (SC_OTHER), |
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
132 m_result_type (RT_UNDEFINED), m_expr_result_value (), |
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
133 m_expr_result_value_list (), m_lvalue_list_stack (), |
27016
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
134 m_nargout_stack (), 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
|
135 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
|
136 m_debug_mode (false), m_quiet_breakpoint_flag (false), |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
137 m_debugger_stack (), m_max_recursion_depth (256), |
26087
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
138 m_whos_line_format (" %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"), |
25377 | 139 m_silent_functions (false), m_string_fill_char (' '), |
140 m_PS4 ("+ "), m_dbstep_flag (0), 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
|
141 m_echo_state (false), m_echo_file_name (), m_echo_file_pos (1), |
25382
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
142 m_echo_files (), 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
|
143 m_breaking (0), m_continuing (0), m_returning (0), |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
144 m_indexed_object (nullptr), m_index_position (0), |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
145 m_num_indices (0) |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
146 { } |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
147 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
148 // No copying! |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
149 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
150 tree_evaluator (const tree_evaluator&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
151 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
152 tree_evaluator& operator = (const tree_evaluator&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
153 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
154 ~tree_evaluator (void) = default; |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
155 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
156 bool at_top_level (void) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
157 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
158 void reset (void); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
159 |
25404
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
160 int repl (bool interactive); |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
161 |
27015
4d9e1a832a55
move core of mfilename function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27014
diff
changeset
|
162 std::string mfilename (const std::string& opt = "") const; |
4d9e1a832a55
move core of mfilename function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27014
diff
changeset
|
163 |
26113
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
26094
diff
changeset
|
164 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
|
165 int& parse_status, int nargout); |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
26094
diff
changeset
|
166 |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
26094
diff
changeset
|
167 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
|
168 int& parse_status); |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
26094
diff
changeset
|
169 |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
26094
diff
changeset
|
170 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
|
171 int& parse_status, int nargout); |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
26094
diff
changeset
|
172 |
27019
6cb675912f2b
move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27018
diff
changeset
|
173 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
|
174 |
6cb675912f2b
move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27018
diff
changeset
|
175 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
|
176 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
|
177 |
27018
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
178 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
|
179 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
|
180 |
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
181 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
|
182 const std::string& try_code, |
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
183 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
|
184 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
185 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
|
186 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
187 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
|
188 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
189 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
|
190 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
191 void visit_boolean_expression (tree_boolean_expression&); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
192 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
193 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
|
194 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
195 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
|
196 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
197 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
|
198 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
199 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
|
200 |
23469
2699c5974844
handle global and persistent in tree_decl_command, not as separate classes
John W. Eaton <jwe@octave.org>
parents:
23458
diff
changeset
|
201 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
|
202 |
23469
2699c5974844
handle global and persistent in tree_decl_command, not as separate classes
John W. Eaton <jwe@octave.org>
parents:
23458
diff
changeset
|
203 void visit_decl_init_list (tree_decl_init_list&); |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
204 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
205 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
|
206 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
207 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
|
208 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
209 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
|
210 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
211 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
|
212 |
25400
d423ce60f5c8
evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents:
25382
diff
changeset
|
213 octave_value_list |
d423ce60f5c8
evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents:
25382
diff
changeset
|
214 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
|
215 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
|
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_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
|
218 |
25400
d423ce60f5c8
evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents:
25382
diff
changeset
|
219 octave_value_list |
26825
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26686
diff
changeset
|
220 execute_user_function (octave_user_function& user_function, |
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26686
diff
changeset
|
221 int nargout, const octave_value_list& args, |
6e9034836239
allow handles to nested functions to work (bug #39257)
John W. Eaton <jwe@octave.org>
parents:
26686
diff
changeset
|
222 stack_frame *closure_frames = nullptr); |
25400
d423ce60f5c8
evaluate script and function code in tree_evaluator methods
John W. Eaton <jwe@octave.org>
parents:
25382
diff
changeset
|
223 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
224 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
|
225 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
226 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
|
227 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
228 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
|
229 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
230 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
|
231 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
232 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
|
233 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
234 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
|
235 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
236 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
|
237 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
238 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
|
239 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
240 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
|
241 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
242 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
|
243 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
244 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
|
245 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
246 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
|
247 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
248 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
|
249 |
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
250 void visit_fcn_handle (tree_fcn_handle&); |
15035 | 251 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
252 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
|
253 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
254 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
|
255 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
256 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
|
257 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
258 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
|
259 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
260 void visit_return_list (tree_return_list&); |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
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_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
|
263 |
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
264 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
|
265 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
266 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
|
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_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
|
269 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
270 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
|
271 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
272 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
|
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_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
|
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 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
|
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_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
|
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_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
|
281 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
|
282 |
26686
581d01526b34
eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
283 void visit_superclass_ref (tree_superclass_ref&); |
581d01526b34
eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
284 void visit_metaclass_query (tree_metaclass_query&); |
581d01526b34
eliminate unnecessary tree_funcall class
John W. Eaton <jwe@octave.org>
parents:
26661
diff
changeset
|
285 |
23702
d396b5fd9199
move bind_ans to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23696
diff
changeset
|
286 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
|
287 |
23705
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
288 bool statement_printing_enabled (void); |
10186
095a1e670e68
make dbstep work with keyboard function
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
289 |
25360
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
290 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
|
291 |
25360
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
292 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
|
293 |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
294 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
|
295 |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
296 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
|
297 |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
298 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
|
299 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
300 // 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
|
301 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
|
302 { |
25401
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
303 SC_FUNCTION, // function body |
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
304 SC_SCRIPT, // script file |
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
305 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
|
306 }; |
11304 | 307 |
23481
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
308 Matrix ignored_fcn_outputs (void) const; |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
309 |
24349
4ced2bfd737e
deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
310 bool isargout (int nargout, int iout) const; |
4ced2bfd737e
deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
311 |
4ced2bfd737e
deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
312 void isargout (int nargout, int nout, bool *isargout) const; |
4ced2bfd737e
deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
313 |
4ced2bfd737e
deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
314 const std::list<octave_lvalue> * lvalue_list (void) const |
23481
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
315 { |
24349
4ced2bfd737e
deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
316 return (m_lvalue_list_stack.empty () |
4ced2bfd737e
deprecate defun_isargout functions
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
317 ? nullptr : m_lvalue_list_stack.top ()); |
23481
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
318 } |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
319 |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
320 void push_result (const octave_value& val) |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
321 { |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
322 m_result_type = RT_VALUE; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
323 m_expr_result_value = val; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
324 } |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
325 |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
326 void push_result (const octave_value_list& vals) |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
327 { |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
328 m_result_type = RT_VALUE_LIST; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
329 m_expr_result_value_list = vals; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
330 } |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
331 |
23481
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
332 octave_value evaluate (tree_expression *expr, int nargout = 1) |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
333 { |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
334 octave_value retval; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
335 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
336 m_nargout_stack.push (nargout); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
337 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
338 expr->accept (*this); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
339 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
340 m_nargout_stack.pop (); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
341 |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
342 switch (m_result_type) |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
343 { |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
344 case RT_UNDEFINED: |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
345 panic_impossible (); |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
346 break; |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
347 |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
348 case RT_VALUE: |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
349 retval = m_expr_result_value; |
25317
4a46c83bcb71
don't hold reference to expression result after evaluation is done
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
350 m_expr_result_value = octave_value (); |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
351 break; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
352 |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
353 case RT_VALUE_LIST: |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
354 retval = (m_expr_result_value_list.empty () |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
355 ? octave_value () : m_expr_result_value_list(0)); |
25317
4a46c83bcb71
don't hold reference to expression result after evaluation is done
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
356 m_expr_result_value_list = octave_value_list (); |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
357 break; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
358 } |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
359 |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
360 return retval; |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
361 } |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
362 |
23481
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
363 octave_value_list evaluate_n (tree_expression *expr, int nargout = 1) |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
364 { |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
365 octave_value_list retval; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
366 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
367 m_nargout_stack.push (nargout); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
368 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
369 expr->accept (*this); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
370 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
371 m_nargout_stack.pop (); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
372 |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
373 switch (m_result_type) |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
374 { |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
375 case RT_UNDEFINED: |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
376 panic_impossible (); |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
377 break; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
378 |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
379 case RT_VALUE: |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
380 retval = ovl (m_expr_result_value); |
25317
4a46c83bcb71
don't hold reference to expression result after evaluation is done
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
381 m_expr_result_value = octave_value (); |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
382 break; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
383 |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
384 case RT_VALUE_LIST: |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
385 retval = m_expr_result_value_list; |
25317
4a46c83bcb71
don't hold reference to expression result after evaluation is done
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
386 m_expr_result_value_list = octave_value_list (); |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
387 break; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
388 } |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
389 |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
390 return retval; |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
391 } |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
392 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
393 octave_value evaluate (tree_decl_elt *); |
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 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
|
396 const octave_value& value, bool global); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
397 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
398 octave_value global_varval (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
399 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
400 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
|
401 const octave_value& val = octave_value ()); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
402 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
403 octave_value top_level_varval (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
404 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
405 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
|
406 const octave_value& val = octave_value ()); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
407 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
408 bool is_variable (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
409 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
410 bool is_local_variable (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
411 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
412 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
|
413 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
414 bool is_defined (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
|
415 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
416 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
|
417 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
418 bool is_defined (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
|
419 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
420 bool is_global (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
421 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
422 octave_value varval (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
|
423 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
424 octave_value varval (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
425 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
426 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
|
427 const octave_value& val = octave_value ()); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
428 |
27014
daab1b311a98
move core of assignin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27005
diff
changeset
|
429 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
|
430 const octave_value& val = octave_value ()); |
daab1b311a98
move core of assignin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27005
diff
changeset
|
431 |
27017
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
432 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
|
433 const std::string& context = "", |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
434 bool verbose = false, bool require_file = true, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
435 const std::string& warn_for = ""); |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
436 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
437 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
|
438 const octave_value& val = octave_value ()); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
439 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
440 octave_value get_auto_fcn_var (stack_frame::auto_var_type avt) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
441 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
442 void define_parameter_list_from_arg_vector |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
443 (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
|
444 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
445 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
|
446 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
447 octave_value_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
|
448 convert_to_const_vector (tree_argument_list *arg_list, |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
449 const octave_value *object = nullptr); |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
450 |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
451 octave_value_list |
23916
85488effc0ff
refactor function value return code
John W. Eaton <jwe@octave.org>
parents:
23795
diff
changeset
|
452 convert_return_list_to_const_vector |
85488effc0ff
refactor function value return code
John W. Eaton <jwe@octave.org>
parents:
23795
diff
changeset
|
453 (tree_parameter_list *ret_list, int nargout, const Cell& varargout); |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
454 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
455 bool eval_decl_elt (tree_decl_elt *elt); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
456 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
457 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
|
458 const octave_value& val); |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
459 |
25360
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
460 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
|
461 |
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
462 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
|
463 |
27001
3cea1cfb37d3
move toward limiting direct access of call stack
John W. Eaton <jwe@octave.org>
parents:
26975
diff
changeset
|
464 profiler& get_profiler (void) { return m_profiler; } |
3cea1cfb37d3
move toward limiting direct access of call stack
John W. Eaton <jwe@octave.org>
parents:
26975
diff
changeset
|
465 |
23553
14723784b9f2
don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents:
23532
diff
changeset
|
466 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
|
467 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
468 const stack_frame& get_current_stack_frame (void) const |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
469 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
470 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
|
471 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
472 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
473 stack_frame& get_current_stack_frame (void) |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
474 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
475 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
|
476 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
477 |
27200
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
478 stack_frame * current_user_frame (void) const |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
479 { |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
480 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
|
481 } |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
482 |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
483 // 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
|
484 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
|
485 |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
486 // 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
|
487 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
|
488 |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
489 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
|
490 |
27204
9a3e92d02a03
eliminate direct access to call stack in variables functions
John W. Eaton <jwe@octave.org>
parents:
27203
diff
changeset
|
491 unwind_protect * curr_fcn_unwind_protect_frame (void) const; |
27200
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
492 |
27202
23962b243bad
eliminate direct access to call stack in help functions
John W. Eaton <jwe@octave.org>
parents:
27201
diff
changeset
|
493 // 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
|
494 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
|
495 |
27201
bd49997051ef
eliminate direct access to call stack in defun functions
John W. Eaton <jwe@octave.org>
parents:
27200
diff
changeset
|
496 octave_function * current_function (void) const; |
bd49997051ef
eliminate direct access to call stack in defun functions
John W. Eaton <jwe@octave.org>
parents:
27200
diff
changeset
|
497 |
27204
9a3e92d02a03
eliminate direct access to call stack in variables functions
John W. Eaton <jwe@octave.org>
parents:
27203
diff
changeset
|
498 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
|
499 |
27200
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
500 bool goto_frame (size_t n = 0, bool verbose = false); |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
501 |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
502 void restore_frame (size_t n); |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
503 |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
504 bool goto_frame_relative (int n, bool verbose = false); |
dc1edf932248
eliminate direct access to call_stack in input functions
John W. Eaton <jwe@octave.org>
parents:
27199
diff
changeset
|
505 |
27199
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
506 std::list<stack_frame *> |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
507 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
|
508 |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
509 std::list<stack_frame *> backtrace_frames () const; |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
510 |
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; |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
513 |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
514 octave_map backtrace (); |
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 |
27001
3cea1cfb37d3
move toward limiting direct access of call stack
John W. Eaton <jwe@octave.org>
parents:
26975
diff
changeset
|
518 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
|
519 void pop_scope (void); |
23753
c3828bd031cd
move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23750
diff
changeset
|
520 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
521 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
|
522 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
|
523 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
524 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
|
525 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
526 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
|
527 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
528 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
|
529 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
530 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
|
531 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
532 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
|
533 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
534 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
|
535 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
536 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
|
537 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
538 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
|
539 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
540 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
|
541 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
542 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
|
543 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
544 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
|
545 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
546 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
|
547 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
548 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
|
549 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
550 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
|
551 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
552 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
|
553 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
554 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
|
555 |
26975
de826e69a5ea
make breakpoints in classdef methods work (bug #45404, bug #46451)
John W. Eaton <jwe@octave.org>
parents:
26825
diff
changeset
|
556 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
|
557 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
|
558 |
27199
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
559 std::string current_function_name (void) const; |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
560 |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
561 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
|
562 |
27203
79065f9d5553
eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents:
27202
diff
changeset
|
563 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
|
564 |
79065f9d5553
eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents:
27202
diff
changeset
|
565 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
|
566 |
79065f9d5553
eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents:
27202
diff
changeset
|
567 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
|
568 |
79065f9d5553
eliminate direct access to call stack in load-save functions
John W. Eaton <jwe@octave.org>
parents:
27202
diff
changeset
|
569 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
|
570 |
27016
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
571 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
|
572 |
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
573 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
|
574 |
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
575 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
|
576 |
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
577 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
|
578 |
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
579 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
|
580 |
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
581 void remove_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
|
582 |
23705
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
583 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
|
584 |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
585 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
|
586 { |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
587 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
|
588 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
|
589 return val; |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
590 } |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
591 |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
592 octave_value |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
593 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
|
594 |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
595 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
|
596 |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
597 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
|
598 { |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
599 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
|
600 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
|
601 return val; |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
602 } |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
603 |
26087
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
604 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
|
605 |
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
606 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
|
607 |
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
608 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
|
609 { |
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
610 std::string val = m_whos_line_format; |
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
611 m_whos_line_format = s; |
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
612 return val; |
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
613 } |
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
614 |
23705
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
615 octave_value |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
616 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
|
617 |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
618 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
|
619 |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
620 size_t debug_frame (size_t n) |
25402
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
621 { |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
622 size_t val = m_debug_frame; |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
623 m_debug_frame = n; |
25402
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
624 return val; |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
625 } |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
626 |
27199
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
627 size_t current_call_stack_frame_number (void) const |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
628 { |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
629 return m_call_stack.current_frame (); |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
630 } |
f27002104c5b
eliminate direct access to call_stack in error functions
John W. Eaton <jwe@octave.org>
parents:
27037
diff
changeset
|
631 |
25402
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
632 bool debug_mode (void) const { return m_debug_mode; } |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
633 |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
634 bool debug_mode (bool flag) |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
635 { |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
636 bool val = m_debug_mode; |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
637 m_debug_mode = flag; |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
638 return val; |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
639 } |
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 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
|
642 |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
643 bool quiet_breakpoint_flag (bool flag) |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
644 { |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
645 bool val = m_quiet_breakpoint_flag; |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
646 m_quiet_breakpoint_flag = flag; |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
647 return val; |
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 |
23706
6683451b75b2
move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23705
diff
changeset
|
650 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
|
651 |
6683451b75b2
move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23705
diff
changeset
|
652 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
|
653 { |
6683451b75b2
move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23705
diff
changeset
|
654 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
|
655 m_string_fill_char = c; |
6683451b75b2
move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23705
diff
changeset
|
656 return val; |
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 |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
659 // The following functions are provided for convenience and forward |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
660 // to the corresponding functions in the debugger class for the |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
661 // current debugger (if any). |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
662 bool in_debug_repl (void) const; |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
663 bool in_debug_repl (bool flag); |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
664 bool exit_debug_repl (void) const; |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
665 bool exit_debug_repl (bool flag); |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
666 bool abort_debug_repl (void) const; |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
667 bool abort_debug_repl (bool flag); |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
668 |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
669 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
|
670 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
671 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
|
672 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
673 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
|
674 { |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
675 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
|
676 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
|
677 return val; |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
678 } |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
679 |
25382
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
680 const octave_value * indexed_object (void) const |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
681 { |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
682 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
|
683 } |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
684 |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
685 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
|
686 |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
687 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
|
688 |
25403
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
689 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
|
690 |
25404
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
691 int breaking (int n) |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
692 { |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
693 int val = m_breaking; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
694 m_breaking = n; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
695 return val; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
696 } |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
697 |
25403
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
698 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
|
699 |
25404
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
700 int continuing (int n) |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
701 { |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
702 int val = m_continuing; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
703 m_continuing = n; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
704 return val; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
705 } |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
706 |
25403
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
707 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
|
708 |
25404
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
709 int returning (int n) |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
710 { |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
711 int val = m_returning; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
712 m_returning = n; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
713 return val; |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
714 } |
e37d857716c3
move core of interpreter::main_loop to evaluator
John W. Eaton <jwe@octave.org>
parents:
25403
diff
changeset
|
715 |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
716 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
|
717 |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
718 int dbstep_flag (int val) |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
719 { |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
720 int old_val = m_dbstep_flag; |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
721 m_dbstep_flag = val; |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
722 return old_val; |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
723 } |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
724 |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
725 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
|
726 |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
727 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
|
728 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
729 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
|
730 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
731 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
|
732 { |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
733 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
|
734 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
|
735 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
|
736 } |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
737 |
23706
6683451b75b2
move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23705
diff
changeset
|
738 octave_value |
6683451b75b2
move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23705
diff
changeset
|
739 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
|
740 |
26094
8fb0df0c8772
eliminate duplicate final_index_error function
John W. Eaton <jwe@octave.org>
parents:
26087
diff
changeset
|
741 void final_index_error (index_exception& e, const tree_expression *expr); |
8fb0df0c8772
eliminate duplicate final_index_error function
John W. Eaton <jwe@octave.org>
parents:
26087
diff
changeset
|
742 |
27005
a1ea0e7aecde
move do_who inside call_stack, make accessible from evaluator
John W. Eaton <jwe@octave.org>
parents:
27001
diff
changeset
|
743 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
|
744 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
|
745 |
23729
06b3d1d54054
allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents:
23728
diff
changeset
|
746 void push_echo_state (unwind_protect& frame, int type, |
06b3d1d54054
allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents:
23728
diff
changeset
|
747 const std::string& file_name, size_t pos = 1); |
06b3d1d54054
allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents:
23728
diff
changeset
|
748 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
749 private: |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
750 |
23729
06b3d1d54054
allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents:
23728
diff
changeset
|
751 void set_echo_state (int type, const std::string& file_name, size_t pos); |
06b3d1d54054
allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents:
23728
diff
changeset
|
752 |
06b3d1d54054
allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents:
23728
diff
changeset
|
753 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
|
754 |
06b3d1d54054
allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents:
23728
diff
changeset
|
755 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
|
756 |
06b3d1d54054
allow echo state to be modified from inside functions
John W. Eaton <jwe@octave.org>
parents:
23728
diff
changeset
|
757 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
|
758 |
25360
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
759 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
|
760 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
761 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
|
762 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
|
763 |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
764 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
|
765 |
23482
c9937e865768
make isargout work again for nested function calls
John W. Eaton <jwe@octave.org>
parents:
23481
diff
changeset
|
766 octave_value_list |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
767 make_value_list (tree_argument_list *args, |
23482
c9937e865768
make isargout work again for nested function calls
John W. Eaton <jwe@octave.org>
parents:
23481
diff
changeset
|
768 const string_vector& arg_nm, |
c9937e865768
make isargout work again for nested function calls
John W. Eaton <jwe@octave.org>
parents:
23481
diff
changeset
|
769 const octave_value *object, bool rvalue = true); |
c9937e865768
make isargout work again for nested function calls
John W. Eaton <jwe@octave.org>
parents:
23481
diff
changeset
|
770 |
23481
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
771 std::list<octave_lvalue> make_lvalue_list (tree_argument_list *); |
73558a835b64
eliminate lvalue list arguments from evaluator functions
John W. Eaton <jwe@octave.org>
parents:
23469
diff
changeset
|
772 |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
773 // For unwind-protect. |
25653
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25404
diff
changeset
|
774 void uwp_set_echo_state (bool state, const std::string& file_name, |
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25404
diff
changeset
|
775 size_t pos); |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
776 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
777 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
|
778 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
779 void echo_code (size_t line); |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
780 |
25403
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
781 bool quit_loop_now (void); |
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
782 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
783 void bind_auto_fcn_vars (const string_vector& arg_names, int nargin, |
26039
d2aae3570c81
perform automatic function variable binding in tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25653
diff
changeset
|
784 int nargout, bool takes_varargs, |
d2aae3570c81
perform automatic function variable binding in tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25653
diff
changeset
|
785 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
|
786 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
787 void init_local_fcn_vars (octave_user_function& user_fcn); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
788 |
27016
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
789 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
|
790 |
23705
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
791 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
|
792 |
25401
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
793 // The context for the current evaluation. |
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
794 stmt_list_type m_statement_context; |
6f6479125d80
eliminate some globals from tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
25400
diff
changeset
|
795 |
24563
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
796 result_type m_result_type; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
797 octave_value m_expr_result_value; |
8f2c479eb125
eliminate unnecessary value stack in evaluator
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
798 octave_value_list m_expr_result_value_list; |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
799 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
800 value_stack<const std::list<octave_lvalue>*> m_lvalue_list_stack; |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
801 |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
802 value_stack<int> m_nargout_stack; |
10219
979fb2606c4f
new tree_evaluator::do_keyoard function
Ryan Rusaw <rrusaw@gmail.com>
parents:
10186
diff
changeset
|
803 |
27016
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
804 // 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
|
805 std::map<std::string, std::string> m_autoload_map; |
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
806 |
25360
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
807 bp_table m_bp_table; |
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
808 |
23553
14723784b9f2
don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents:
23532
diff
changeset
|
809 call_stack m_call_stack; |
14723784b9f2
don't use singleton for call_stack
John W. Eaton <jwe@octave.org>
parents:
23532
diff
changeset
|
810 |
23753
c3828bd031cd
move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23750
diff
changeset
|
811 profiler m_profiler; |
c3828bd031cd
move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23750
diff
changeset
|
812 |
25402
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
813 // The number of the stack frame we are currently debugging. |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
814 size_t m_debug_frame; |
25402
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
815 |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
816 bool m_debug_mode; |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
817 |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
818 bool m_quiet_breakpoint_flag; |
ef2b9d4abf4a
eliminate some global variables from tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25401
diff
changeset
|
819 |
27037
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
820 // 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
|
821 // 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
|
822 // 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
|
823 // 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
|
824 // 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
|
825 std::stack<debugger *> m_debugger_stack; |
8408acb7ca4f
make dbup/dbdown work again (bug #56020)
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
826 |
23705
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
827 // 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
|
828 // called recursively. |
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
829 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
|
830 |
26087
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
831 // 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
|
832 std::string m_whos_line_format; |
7656fcd0ff9f
move whos_line_format to evaluator
John W. Eaton <jwe@octave.org>
parents:
26039
diff
changeset
|
833 |
23705
4c597585ff52
move Vmax_recursion_depth and Vsilent_functions to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23702
diff
changeset
|
834 // 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
|
835 // 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
|
836 bool m_silent_functions; |
23706
6683451b75b2
move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23705
diff
changeset
|
837 |
6683451b75b2
move Vstring_fill_char to tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23705
diff
changeset
|
838 // 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
|
839 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
|
840 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
841 // 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
|
842 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
|
843 |
25360
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
844 // 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
|
845 // 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
|
846 // |
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
847 // 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
|
848 int m_dbstep_flag; |
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
849 |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
850 // 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
|
851 // |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
852 // 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
|
853 // 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
|
854 // |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
855 // 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
|
856 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
|
857 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
858 // Are we currently echoing commands? This state is set by the |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
859 // functions that execute fucntions and scripts. |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
860 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
|
861 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
862 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
|
863 |
b40b7243a782
new class for caching file contents for debug and echo
John W. Eaton <jwe@octave.org>
parents:
23723
diff
changeset
|
864 // Next line to echo, counting from 1. |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
865 size_t m_echo_file_pos; |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
866 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23706
diff
changeset
|
867 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
|
868 |
bc5f225bc578
eliminate some global accesses to the breakpoint table
John W. Eaton <jwe@octave.org>
parents:
25317
diff
changeset
|
869 // 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
|
870 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
|
871 |
25403
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
872 // 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
|
873 int m_breaking; |
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
874 |
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
875 // 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
|
876 int m_continuing; |
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
877 |
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
878 // 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
|
879 int m_returning; |
2b7d7a3f5f57
move returning, breaking, and continuing flags to evaluator
John W. Eaton <jwe@octave.org>
parents:
25402
diff
changeset
|
880 |
25382
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
881 // Used by END function. |
749d9e858553
move convert_to_const_vector from tree_argument_list to tree_evaluator
John W. Eaton <jwe@octave.org>
parents:
25381
diff
changeset
|
882 const octave_value *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
|
883 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
|
884 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
|
885 }; |
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
886 } |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
887 |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
888 #endif |