annotate libinterp/parse-tree/pt-stmt.h @ 22865:89756f2f085b

use c++11 style for deleting default copy constructor and assignment operator * octave-gui.h, resource-manager.h, shortcut-manager.h, base-text-renderer.h, c-file-ptr-stream.h, dynamic-ld.cc, dynamic-ld.h, event-queue.h, ft-text-renderer.cc, gl-render.cc, gl-render.h, graphics.cc, graphics.in.h, interpreter.h, mex.cc, mxarray.in.h, oct-fstrm.h, oct-iostrm.h, oct-prcstrm.h, oct-procbuf.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.h, octave-link.h, pager.h, profiler.h, sighandlers.cc, symtab.h, text-renderer.h, zfstream.h, __init_fltk__.cc, ov-builtin.h, ov-dld-fcn.h, ov-fcn.h, ov-mex-fcn.h, ov-typeinfo.h, ov-usr-fcn.h, octave.h, lex.h, parse.h, pt-arg-list.h, pt-array-list.h, pt-assign.h, pt-binop.h, pt-bp.h, pt-cbinop.h, pt-cell.h, pt-check.h, pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.h, pt-eval.h, pt-except.h, pt-exp.h, pt-fcn-handle.h, pt-funcall.h, pt-id.h, pt-idx.h, pt-jump.h, pt-loop.h, pt-mat.h, pt-misc.h, pt-pr-code.h, pt-select.h, pt-stmt.h, pt-unop.h, pt-walk.h, pt.h, token.h, Array.cc, idx-vector.h, oct-fftw.h, sparse-chol.cc, sparse-qr.cc, file-ops.h, mach-info.h, oct-env.h, action-container.h, cmd-edit.cc, cmd-edit.h, cmd-hist.h, oct-locbuf.h, oct-mutex.h, oct-shlib.cc, oct-sort.h, pathsearch.h, singleton-cleanup.h, unwind-prot.h, url-transfer.cc, url-transfer.h: Use C++11 style "= delete" declaration to declare copy constructors and assignment operators for classes that should not be copied.
author John W. Eaton <jwe@octave.org>
date Mon, 05 Dec 2016 22:59:37 -0500
parents 3a2b891d0b33
children f75d289645ec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
1 /*
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
2
22323
bac0d6f07a3e maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
3 Copyright (C) 1996-2016 John W. Eaton
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
4
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
6
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
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
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
9 the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
10 (at your option) any later version.
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
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.
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
16
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5861
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5861
diff changeset
19 <http://www.gnu.org/licenses/>.
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
20
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
21 */
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
22
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
23 #if ! defined (octave_pt_stmt_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17787
diff changeset
24 #define octave_pt_stmt_h 1
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
25
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21157
diff changeset
26 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21157
diff changeset
27
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
28 class octave_value_list;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
29
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
30 class tree_command;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
31 class tree_expression;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
32
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
33 class tree_walker;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
34
7552
6070c3bd69c4 Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents: 7336
diff changeset
35 #include <deque>
6070c3bd69c4 Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents: 7336
diff changeset
36
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4212
diff changeset
37 #include "base-list.h"
3665
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
38 #include "comment-list.h"
16530
7ca7e7d5eb91 remove breakpoints when clearing function
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
39 #include "debug.h"
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
40 #include "symtab.h"
14899
f25d2224fa02 Initial JIT support
Max Brister <max@2bass.com>
parents: 14138
diff changeset
41 #include "pt.h"
3665
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
42
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
43 // A statement is either a command to execute or an expression to
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
44 // evaluate.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
45
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
46 class
14899
f25d2224fa02 Initial JIT support
Max Brister <max@2bass.com>
parents: 14138
diff changeset
47 tree_statement : public tree
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
48 {
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
49 public:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
50
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
51 tree_statement (void)
8843
b9ce57a309a3 don't store breakpoint info in tree_statement object
John W. Eaton <jwe@octave.org>
parents: 8669
diff changeset
52 : cmd (0), expr (0), comm (0) { }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
53
3665
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
54 tree_statement (tree_command *c, octave_comment_list *cl)
8843
b9ce57a309a3 don't store breakpoint info in tree_statement object
John W. Eaton <jwe@octave.org>
parents: 8669
diff changeset
55 : cmd (c), expr (0), comm (cl) { }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
56
3665
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
57 tree_statement (tree_expression *e, octave_comment_list *cl)
8843
b9ce57a309a3 don't store breakpoint info in tree_statement object
John W. Eaton <jwe@octave.org>
parents: 8669
diff changeset
58 : cmd (0), expr (e), comm (cl) { }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
59
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
60 ~tree_statement (void);
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
61
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
62 void set_print_flag (bool print_flag);
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
63
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
64 bool print_result (void);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
65
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
66 bool is_command (void) const { return cmd != 0; }
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
67
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
68 bool is_expression (void) const { return expr != 0; }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
69
21157
94fc5f13d51b dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 20791
diff changeset
70 void set_breakpoint (const std::string& condition);
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
71
8843
b9ce57a309a3 don't store breakpoint info in tree_statement object
John W. Eaton <jwe@octave.org>
parents: 8669
diff changeset
72 void delete_breakpoint (void);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
73
21157
94fc5f13d51b dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 20791
diff changeset
74 bool is_breakpoint (bool check_valid = false) const;
94fc5f13d51b dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 20791
diff changeset
75 std::string bp_cond () const;
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
76
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
77 int line (void) const;
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
78 int column (void) const;
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
79
16627
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 16530
diff changeset
80 void set_location (int l, int c);
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 16530
diff changeset
81
8669
33783e94fb16 line number fixes and other evaluator tweaks
John W. Eaton <jwe@octave.org>
parents: 8658
diff changeset
82 void echo_code (void);
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
83
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
84 tree_command *command (void) { return cmd; }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
85
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
86 tree_expression *expression (void) { return expr; }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
87
3665
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
88 octave_comment_list *comment_text (void) { return comm; }
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
89
8471
02de6775f1fe parse.y: always append statements to list, but remove null statements after seeing separator
John W. Eaton <jwe@octave.org>
parents: 7767
diff changeset
90 bool is_null_statement (void) const { return ! (cmd || expr || comm); }
02de6775f1fe parse.y: always append statements to list, but remove null statements after seeing separator
John W. Eaton <jwe@octave.org>
parents: 7767
diff changeset
91
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
92 bool is_end_of_fcn_or_script (void) const;
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
93
16627
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 16530
diff changeset
94 bool is_end_of_file (void) const;
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 16530
diff changeset
95
4935
4fc993a4e072 [project @ 2004-08-06 03:17:12 by jwe]
jwe
parents: 4219
diff changeset
96 // Allow modification of this statement. Note that there is no
4fc993a4e072 [project @ 2004-08-06 03:17:12 by jwe]
jwe
parents: 4219
diff changeset
97 // checking. If you use these, are you sure you knwo what you are
4fc993a4e072 [project @ 2004-08-06 03:17:12 by jwe]
jwe
parents: 4219
diff changeset
98 // doing?
4fc993a4e072 [project @ 2004-08-06 03:17:12 by jwe]
jwe
parents: 4219
diff changeset
99
4fc993a4e072 [project @ 2004-08-06 03:17:12 by jwe]
jwe
parents: 4219
diff changeset
100 void set_command (tree_command *c) { cmd = c; }
4fc993a4e072 [project @ 2004-08-06 03:17:12 by jwe]
jwe
parents: 4219
diff changeset
101
4fc993a4e072 [project @ 2004-08-06 03:17:12 by jwe]
jwe
parents: 4219
diff changeset
102 void set_expression (tree_expression *e) { expr = e; }
4fc993a4e072 [project @ 2004-08-06 03:17:12 by jwe]
jwe
parents: 4219
diff changeset
103
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7736
diff changeset
104 tree_statement *dup (symbol_table::scope_id scope,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
105 symbol_table::context_id context) const;
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
106
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
107 void accept (tree_walker& tw);
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
108
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
109 private:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
110
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
111 // Only one of cmd or expr can be valid at once.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
112
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
113 // Command to execute.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
114 tree_command *cmd;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
115
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
116 // Expression to evaluate.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
117 tree_expression *expr;
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
118
3665
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
119 // Comment associated with this statement.
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
120 octave_comment_list *comm;
0689afb1d001 [project @ 2000-05-11 19:07:56 by jwe]
jwe
parents: 2988
diff changeset
121
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
122 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
123
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
124 tree_statement (const tree_statement&) = delete;
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
125
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
126 tree_statement& operator = (const tree_statement&) = delete;
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
127 };
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
128
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
129 // A list of statements to evaluate.
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
130
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
131 class
22333
2758af148ced move base_list and regexp classes to octave namespace
John W. Eaton <jwe@octave.org>
parents: 22323
diff changeset
132 tree_statement_list : public octave::base_list<tree_statement *>
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
133 {
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
134 public:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
135
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
136 tree_statement_list (void)
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
137 : function_body (false), anon_function_body (false),
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
138 script_body (false) { }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
139
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
140 tree_statement_list (tree_statement *s)
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
141 : function_body (false), anon_function_body (false),
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
142 script_body (false) { append (s); }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
143
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
144 ~tree_statement_list (void)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
145 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
146 while (! empty ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
147 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
148 iterator p = begin ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
149 delete *p;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
150 erase (p);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
151 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
152 }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
153
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
154 void mark_as_function_body (void) { function_body = true; }
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
155
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
156 void mark_as_anon_function_body (void) { anon_function_body = true; }
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
157
7736
a059b5679fbb implement dbstack
John W. Eaton <jwe@octave.org>
parents: 7734
diff changeset
158 void mark_as_script_body (void) { script_body = true; }
a059b5679fbb implement dbstack
John W. Eaton <jwe@octave.org>
parents: 7734
diff changeset
159
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
160 bool is_function_body (void) const { return function_body; }
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
161
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
162 bool is_anon_function_body (void) const { return anon_function_body; }
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
163
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
164 bool is_script_body (void) const { return script_body; }
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
165
21157
94fc5f13d51b dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 20791
diff changeset
166 int set_breakpoint (int line, const std::string& condition);
3770
bf6116ca10eb [project @ 2001-02-02 02:21:40 by jwe]
jwe
parents: 3707
diff changeset
167
bf6116ca10eb [project @ 2001-02-02 02:21:40 by jwe]
jwe
parents: 3707
diff changeset
168 void delete_breakpoint (int line);
bf6116ca10eb [project @ 2001-02-02 02:21:40 by jwe]
jwe
parents: 3707
diff changeset
169
bf6116ca10eb [project @ 2001-02-02 02:21:40 by jwe]
jwe
parents: 3707
diff changeset
170 octave_value_list list_breakpoints (void);
bf6116ca10eb [project @ 2001-02-02 02:21:40 by jwe]
jwe
parents: 3707
diff changeset
171
21157
94fc5f13d51b dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 20791
diff changeset
172 std::list<bp_type> breakpoints_and_conds (void);
94fc5f13d51b dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 20791
diff changeset
173
16530
7ca7e7d5eb91 remove breakpoints when clearing function
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
174 bp_table::intmap add_breakpoint (const std::string& file,
21157
94fc5f13d51b dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 20791
diff changeset
175 const bp_table::intmap& line,
94fc5f13d51b dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 20791
diff changeset
176 const std::string& condition);
16530
7ca7e7d5eb91 remove breakpoints when clearing function
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
177
7ca7e7d5eb91 remove breakpoints when clearing function
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
178 bp_table::intmap remove_all_breakpoints (const std::string& file);
7ca7e7d5eb91 remove breakpoints when clearing function
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
179
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7736
diff changeset
180 tree_statement_list *dup (symbol_table::scope_id scope,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
181 symbol_table::context_id context) const;
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
182
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
183 void accept (tree_walker& tw);
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
184
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
185 private:
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
186
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
187 // Does this list of statements make up the body of a function?
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
188 bool function_body;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
189
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
190 // Does this list of statements make up the body of a function?
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
191 bool anon_function_body;
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8471
diff changeset
192
7736
a059b5679fbb implement dbstack
John W. Eaton <jwe@octave.org>
parents: 7734
diff changeset
193 // Does this list of statements make up the body of a script?
a059b5679fbb implement dbstack
John W. Eaton <jwe@octave.org>
parents: 7734
diff changeset
194 bool script_body;
a059b5679fbb implement dbstack
John W. Eaton <jwe@octave.org>
parents: 7734
diff changeset
195
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
196 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
197
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
198 tree_statement_list (const tree_statement_list&) = delete;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
199
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
200 tree_statement_list& operator = (const tree_statement_list&) = delete;
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
201 };
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
202
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents:
diff changeset
203 #endif
22407
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22333
diff changeset
204