GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-array-list.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2013-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_pt_array_list_h)
27 #define octave_pt_array_list_h 1
28 
29 #include "octave-config.h"
30 
31 #include "base-list.h"
32 #include "pt-arg-list.h"
33 #include "pt-exp.h"
34 
35 namespace octave
36 {
37  class symbol_scope;
38  class tree_walker;
39 
40  // Base class for cell arrays and matrices.
41 
43  public base_list<tree_argument_list *>
44  {
45  public:
46 
49 
50  protected:
51 
52  tree_array_list (tree_argument_list *row = nullptr, int l = -1, int c = -1)
54  {
55  if (row)
56  append (row);
57  }
58 
59  public:
60 
61  // No copying!
62 
63  tree_array_list (const tree_array_list&) = delete;
64 
66 
67  ~tree_array_list (void);
68 
69  bool all_elements_are_constant (void) const;
70 
71  // FIXME: should we import the functions from the base class and
72  // overload them here, or should we use a different name so we don't
73  // have to do this? Without the using declaration or a name change,
74  // the base class functions will be hidden. That may be OK, but it
75  // can also cause some confusion.
77 
78  void copy_base (const tree_array_list& array_list);
79 
80  void copy_base (const tree_array_list& array_list,
81  symbol_scope& scope);
82 
83  tree_expression * dup (symbol_scope& scope) const;
84 
85  void accept (tree_walker& tw);
86  };
87 }
88 
89 #endif
void append(const tree_argument_list * &s)
Definition: base-list.h:92
bool all_elements_are_constant(void) const
virtual void copy_base(const tree_expression &e)
Definition: pt-exp.h:131
tree_array_list(tree_argument_list *row=nullptr, int l=-1, int c=-1)
Definition: pt-array-list.h:52
tree_array_list & operator=(const tree_array_list &)=delete
base_list< tree_argument_list * >::const_iterator const_iterator
Definition: pt-array-list.h:48
base_list< tree_argument_list * >::iterator iterator
Definition: pt-array-list.h:47
tree_expression * dup(symbol_scope &scope) const
void accept(tree_walker &tw)
tree_array_list(const tree_array_list &)=delete
virtual void copy_base(const tree_expression &e)
Definition: pt-exp.h:131