Mercurial > octave
annotate libinterp/parse-tree/pt-array-list.h @ 27919:1891570abac8
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2020.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 22:29:51 -0500 |
parents | b442ec6dda5c |
children | bd51beb6205e |
rev | line source |
---|---|
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
3 Copyright (C) 2013-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
4 |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
5 See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
6 or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
7 |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 This file is part of Octave. |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24362
diff
changeset
|
11 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
|
12 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
|
13 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
|
14 (at your option) any later version. |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
16 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
|
17 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
19 GNU General Public License for more details. |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 You should have received a copy of the GNU General Public License |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 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
|
23 <https://www.gnu.org/licenses/>. |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 */ |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
27 #if ! defined (octave_pt_array_list_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
16273
diff
changeset
|
28 #define octave_pt_array_list_h 1 |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
30 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
31 |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 #include "base-list.h" |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 #include "pt-arg-list.h" |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 #include "pt-exp.h" |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
36 namespace octave |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
37 { |
24362
3fc24b792a24
avoid including symtab.h, symscope.h, or symrec.h unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
38 class symbol_scope; |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23423
diff
changeset
|
39 class tree_walker; |
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23423
diff
changeset
|
40 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
41 // Base class for cell arrays and matrices. |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
43 class tree_array_list : public tree_expression, |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
44 public base_list<tree_argument_list *> |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
45 { |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
46 public: |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
48 typedef base_list<tree_argument_list *>::iterator iterator; |
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
49 typedef base_list<tree_argument_list *>::const_iterator const_iterator; |
16273
c5e5f6ccac5d
9/10 commits reworking the lexer
John W. Eaton <jwe@octave.org>
parents:
16237
diff
changeset
|
50 |
23423
50fc8edb007b
protect tree_unop and tree_array_list constructors
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
51 protected: |
50fc8edb007b
protect tree_unop and tree_array_list constructors
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
52 |
23457
21baad6b35c4
maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents:
23446
diff
changeset
|
53 tree_array_list (tree_argument_list *row = nullptr, int l = -1, int c = -1) |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
54 : tree_expression (l, c), base_list<tree_argument_list *> () |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
55 { |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
56 if (row) |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
57 append (row); |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
58 } |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 |
23423
50fc8edb007b
protect tree_unop and tree_array_list constructors
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
60 public: |
50fc8edb007b
protect tree_unop and tree_array_list constructors
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
61 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
62 // No copying! |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
63 |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
64 tree_array_list (const tree_array_list&) = delete; |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
66 tree_array_list& operator = (const tree_array_list&) = delete; |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
68 ~tree_array_list (void); |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
70 bool all_elements_are_constant (void) const; |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
71 |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
72 bool has_magic_end (void) const; |
21333
c4690d9ff566
avoid warnings about overloading virtual functions from a base class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
73 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
74 // FIXME: should we import the functions from the base class and |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
75 // overload them here, or should we use a different name so we don't |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
76 // have to do this? Without the using declaration or a name change, |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
77 // the base class functions will be hidden. That may be OK, but it |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
78 // can also cause some confusion. |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
79 using tree_expression::copy_base; |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
81 void copy_base (const tree_array_list& array_list); |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
83 void copy_base (const tree_array_list& array_list, |
24270
bc3819b7cca1
don't use symbol_table:: nesting for symbol_record, symbol_scope, or fcn_info
John W. Eaton <jwe@octave.org>
parents:
23696
diff
changeset
|
84 symbol_scope& scope); |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 |
24270
bc3819b7cca1
don't use symbol_table:: nesting for symbol_record, symbol_scope, or fcn_info
John W. Eaton <jwe@octave.org>
parents:
23696
diff
changeset
|
86 tree_expression * dup (symbol_scope& scope) const; |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
88 void accept (tree_walker& tw); |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
89 }; |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
90 } |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
92 #endif |