annotate libinterp/parse-tree/pt-cmd.h @ 22869:f75d289645ec

make deleted functions public * 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-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: Declare deleted copy constructors and assignment operators public.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Dec 2016 12:40:45 -0500
parents 87e3163f6c87
children 4e3d47dc7e25
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
1 /*
2c4d694b87e9 [project @ 1994-07-06 14:55:23 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) 1994-2016 John W. Eaton
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
4
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
6
2c4d694b87e9 [project @ 1994-07-06 14:55:23 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.
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 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.
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
16
2c4d694b87e9 [project @ 1994-07-06 14:55:23 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/>.
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
20
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
21 */
2c4d694b87e9 [project @ 1994-07-06 14:55:23 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_cmd_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_cmd_h 1
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
25
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
26 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
27
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents: 2979
diff changeset
28 #include <string>
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
29
2124
97a566037a75 [project @ 1996-05-12 07:16:36 by jwe]
jwe
parents: 2086
diff changeset
30 class tree_walker;
97a566037a75 [project @ 1996-05-12 07:16:36 by jwe]
jwe
parents: 2086
diff changeset
31
7715
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
32 #include "ov-fcn.h"
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
33 #include "pt.h"
3770
bf6116ca10eb [project @ 2001-02-02 02:21:40 by jwe]
jwe
parents: 3523
diff changeset
34 #include "pt-bp.h"
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
35 #include "symtab.h"
578
d169be9237fb [project @ 1994-08-03 20:06:54 by jwe]
jwe
parents: 529
diff changeset
36
d169be9237fb [project @ 1994-08-03 20:06:54 by jwe]
jwe
parents: 529
diff changeset
37 // A base class for commands.
d169be9237fb [project @ 1994-08-03 20:06:54 by jwe]
jwe
parents: 529
diff changeset
38
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
39 class
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
40 tree_command : public tree
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
41 {
578
d169be9237fb [project @ 1994-08-03 20:06:54 by jwe]
jwe
parents: 529
diff changeset
42 public:
2124
97a566037a75 [project @ 1996-05-12 07:16:36 by jwe]
jwe
parents: 2086
diff changeset
43
2982
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents: 2979
diff changeset
44 tree_command (int l = -1, int c = -1)
20f5cec4f11c [project @ 1997-05-16 03:29:26 by jwe]
jwe
parents: 2979
diff changeset
45 : tree (l, c) { }
578
d169be9237fb [project @ 1994-08-03 20:06:54 by jwe]
jwe
parents: 529
diff changeset
46
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
47 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
48
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
49 tree_command (const tree_command&) = delete;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2982
diff changeset
50
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
51 tree_command& operator = (const tree_command&) = delete;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
52
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
53 virtual ~tree_command (void) = default;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
54
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
55 virtual tree_command *dup (symbol_table::scope_id,
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
56 symbol_table::context_id context) const = 0;
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
57 };
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
58
2620
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
59 // No-op.
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
60
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
61 class
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
62 tree_no_op_command : public tree_command
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
63 {
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
64 public:
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
65
16627
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
66 tree_no_op_command (const std::string& cmd = "no_op", bool e = false,
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
67 int l = -1, int c = -1)
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
68 : tree_command (l, c), eof (e), orig_cmd (cmd) { }
2620
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
69
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
70 // No copying!
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
71
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
72 tree_no_op_command (const tree_no_op_command&) = delete;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
73
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
74 tree_no_op_command& operator = (const tree_no_op_command&) = delete;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
75
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22865
diff changeset
76 ~tree_no_op_command (void) = default;
2620
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
77
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7715
diff changeset
78 tree_command *dup (symbol_table::scope_id scope,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
79 symbol_table::context_id context) const;
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
80
2620
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
81 void accept (tree_walker& tw);
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
82
16627
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
83 bool is_end_of_fcn_or_script (void) const
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
84 {
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
85 return (orig_cmd == "endfunction" || orig_cmd == "endscript");
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
86 }
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
87
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
88 bool is_end_of_file (void) const { return eof; }
8844
c84a5b6377c4 better handling of end of script/function no-op command
John W. Eaton <jwe@octave.org>
parents: 8658
diff changeset
89
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2988
diff changeset
90 std::string original_command (void) { return orig_cmd; }
2620
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
91
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
92 private:
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
93
8844
c84a5b6377c4 better handling of end of script/function no-op command
John W. Eaton <jwe@octave.org>
parents: 8658
diff changeset
94 bool eof;
c84a5b6377c4 better handling of end of script/function no-op command
John W. Eaton <jwe@octave.org>
parents: 8658
diff changeset
95
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 2988
diff changeset
96 std::string orig_cmd;
2620
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
97 };
5c773d4745d6 [project @ 1997-01-23 16:26:25 by jwe]
jwe
parents: 2124
diff changeset
98
7715
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
99 // Function definition.
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
100
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
101 class
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
102 tree_function_def : public tree_command
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
103 {
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
104 public:
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
105
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
106 tree_function_def (octave_function *f, int l = -1, int c = -1)
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
107 : tree_command (l, c), fcn (f) { }
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
108
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
109 // No copying!
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
110
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
111 tree_function_def (const tree_function_def&) = delete;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
112
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
113 tree_function_def& operator = (const tree_function_def&) = delete;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
114
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22865
diff changeset
115 ~tree_function_def (void) = default;
7715
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
116
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7715
diff changeset
117 tree_command *dup (symbol_table::scope_id scope,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
118 symbol_table::context_id context) const;
7715
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
119
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
120 void accept (tree_walker& tw);
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
121
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 7767
diff changeset
122 octave_value function (void) { return fcn; }
7715
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
123
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
124 private:
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
125
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
126 octave_value fcn;
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
127
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
128 tree_function_def (const octave_value& v, int l = -1, int c = -1)
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
129 : tree_command (l, c), fcn (v) { }
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
130 };
5b4d278ec828 parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
131
494
2c4d694b87e9 [project @ 1994-07-06 14:55:23 by jwe]
jwe
parents:
diff changeset
132 #endif
22407
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
133