GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
pt-array-list.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2013-2025 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 <list>
32
33#include "pt-arg-list.h"
34#include "pt-exp.h"
35
37
38class symbol_scope;
39class tree_walker;
40
41// Base class for cell arrays and matrices.
42
44 public std::list<tree_argument_list *>
45{
46public:
47
48 typedef std::list<tree_argument_list *>::iterator iterator;
49 typedef std::list<tree_argument_list *>::const_iterator const_iterator;
50
51protected:
52
54 {
55 if (row)
56 push_back (row);
57 }
58
59public:
60
61 OCTAVE_DISABLE_COPY_MOVE (tree_array_list)
62
64
65 // The delimiter list for a cell array should never be empty. But
66 // better safe than sorry, I guess.
67
68 filepos beg_pos () const { return m_delims.empty () ? filepos () : m_delims.beg_pos (); }
69 filepos end_pos () const { return m_delims.empty () ? filepos () : m_delims.end_pos (); }
70
71 bool all_elements_are_constant () const;
72
73 // FIXME: should we import the functions from the base class and
74 // overload them here, or should we use a different name so we don't
75 // have to do this? Without the using declaration or a name change,
76 // the base class functions will be hidden. That may be OK, but it
77 // can also cause some confusion.
79
80 void copy_base (const tree_array_list& array_list);
81
82 void copy_base (const tree_array_list& array_list,
83 symbol_scope& scope);
84
85 tree_expression * dup (symbol_scope& scope) const;
86
87 void accept (tree_walker& tw);
88};
89
90OCTAVE_END_NAMESPACE(octave)
91
92#endif
tree_array_list(tree_argument_list *row=nullptr)
filepos end_pos() const
tree_expression * dup(symbol_scope &scope) const
void accept(tree_walker &tw)
void copy_base(const tree_array_list &array_list)
filepos beg_pos() const
std::list< tree_argument_list * >::iterator iterator
std::list< tree_argument_list * >::const_iterator const_iterator
bool all_elements_are_constant() const
filepos beg_pos() const
filepos end_pos() const
tree_delimiter_list m_delims
Definition pt-exp.h:164
virtual void copy_base(const tree_expression &e)
Definition pt-exp.h:137
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn