Mercurial > octave
annotate libinterp/parse-tree/pt-array-list.h @ 23219:3ac9f9ecfae5 stable
maint: Update copyright dates.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 Feb 2017 12:39:29 -0500 |
parents | e9a0469dedd9 |
children | 092078913d54 |
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 |
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
3 Copyright (C) 2013-2017 John W. Eaton |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 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
|
6 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 option) any later version. |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 for more details. |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 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
|
18 along with Octave; see the file COPYING. If not, see |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
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 */ |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
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:
19697
diff
changeset
|
23 #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
|
24 #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
|
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 |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 #include "base-list.h" |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include "pt-arg-list.h" |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #include "pt-exp.h" |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #include "symtab.h" |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 // Base class for cell arrays and matrices. |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 class |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 tree_array_list : public tree_expression, |
22333
2758af148ced
move base_list and regexp classes to octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
37 public octave::base_list<tree_argument_list *> |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 { |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 public: |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 |
22333
2758af148ced
move base_list and regexp classes to octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
41 typedef octave::base_list<tree_argument_list *>::iterator iterator; |
2758af148ced
move base_list and regexp classes to octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
42 typedef octave::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
|
43 |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 tree_array_list (tree_argument_list *row = 0, int l = -1, int c = -1) |
22333
2758af148ced
move base_list and regexp classes to octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
45 : tree_expression (l, c), octave::base_list<tree_argument_list *> () |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 { |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 if (row) |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 append (row); |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 } |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 ~tree_array_list (void); |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 bool all_elements_are_constant (void) const; |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 bool has_magic_end (void) const; |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
21333
c4690d9ff566
avoid warnings about overloading virtual functions from a base class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
57 // FIXME: should we import the functions from the base class and |
c4690d9ff566
avoid warnings about overloading virtual functions from a base class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
58 // overload them here, or should we use a different name so we don't |
c4690d9ff566
avoid warnings about overloading virtual functions from a base class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
59 // have to do this? Without the using declaration or a name change, |
c4690d9ff566
avoid warnings about overloading virtual functions from a base class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
60 // the base class functions will be hidden. That may be OK, but it |
c4690d9ff566
avoid warnings about overloading virtual functions from a base class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
61 // can also cause some confusion. |
c4690d9ff566
avoid warnings about overloading virtual functions from a base class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
62 using tree_expression::copy_base; |
c4690d9ff566
avoid warnings about overloading virtual functions from a base class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
63 |
16237
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 void copy_base (const tree_array_list& array_list); |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 void copy_base (const tree_array_list& array_list, |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 symbol_table::scope_id scope, |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 symbol_table::context_id context); |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 tree_expression *dup (symbol_table::scope_id scope, |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 symbol_table::context_id context) const; |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 void accept (tree_walker& tw); |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 private: |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 // No copying! |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 tree_array_list (const tree_array_list&); |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 tree_array_list& operator = (const tree_array_list&); |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 }; |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 |
70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 #endif |