GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-cell.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1999-2024 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_cell_h)
27 #define octave_pt_cell_h 1
28 
29 #include "octave-config.h"
30 
31 #include <iosfwd>
32 
33 class octave_value;
34 class octave_value_list;
35 
36 #include "pt-mat.h"
37 #include "pt-walk.h"
38 
40 
41 class symbol_scope;
42 class tree_argument_list;
43 
44 // General cells.
45 
46 class tree_cell : public tree_array_list
47 {
48 public:
49 
50  tree_cell (tree_argument_list *row = nullptr, int l = -1, int c = -1)
51  : tree_array_list (row, l, c)
52  { }
53 
54  OCTAVE_DISABLE_COPY_MOVE (tree_cell)
55 
56  ~tree_cell () = default;
57 
58  bool iscell () const { return true; }
59 
60  bool rvalue_ok () const { return true; }
61 
62  tree_expression * dup (symbol_scope& scope) const;
63 
64  octave_value evaluate (tree_evaluator&, int nargout = 1);
65 
67  {
68  return ovl (evaluate (tw, nargout));
69  }
70 
71  void accept (tree_walker& tw)
72  {
73  tw.visit_cell (*this);
74  }
75 };
76 
77 OCTAVE_END_NAMESPACE(octave)
78 
79 #endif
octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)
Definition: pt-cell.h:66
tree_cell(tree_argument_list *row=nullptr, int l=-1, int c=-1)
Definition: pt-cell.h:50
bool rvalue_ok() const
Definition: pt-cell.h:60
tree_expression * dup(symbol_scope &scope) const
Definition: pt-cell.cc:42
~tree_cell()=default
void accept(tree_walker &tw)
Definition: pt-cell.h:71
bool iscell() const
Definition: pt-cell.h:58
octave_value evaluate(tree_evaluator &, int nargout=1)
Definition: pt-cell.cc:52
virtual void visit_cell(tree_cell &)
Definition: pt-walk.cc:469
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
Definition: ovl.h:219