1 //////////////////////////////////////////////////////////////////////// 2 // 3 // Copyright (C) 1996-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_mat_h) 27 #define octave_pt_mat_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 "base-list.h" 37 #include "pt-array-list.h" 38 #include "pt-exp.h" 39 #include "pt-walk.h" 40 41 namespace octave 42 { 43 class symbol_scope; 44 class tree_argument_list; 45 46 // General matrices. This allows us to construct matrices from 47 // other matrices, variables, and functions. 48 49 class tree_matrix : public tree_array_list 50 { 51 public: 52 53 tree_matrix (tree_argument_list *row = nullptr, int l = -1, int c = -1) tree_array_list(row,l,c)54 : tree_array_list (row, l, c) 55 { } 56 57 // No copying! 58 59 tree_matrix (const tree_matrix&) = delete; 60 61 tree_matrix& operator = (const tree_matrix&) = delete; 62 63 ~tree_matrix (void) = default; 64 is_matrix(void)65 bool is_matrix (void) const { return true; } 66 rvalue_ok(void)67 bool rvalue_ok (void) const { return true; } 68 69 tree_expression * dup (symbol_scope& scope) const; 70 71 octave_value evaluate (tree_evaluator&, int nargout = 1); 72 73 octave_value_list evaluate_n (tree_evaluator& tw, int nargout = 1) 74 { 75 return ovl (evaluate (tw, nargout)); 76 } 77 accept(tree_walker & tw)78 void accept (tree_walker& tw) 79 { 80 tw.visit_matrix (*this); 81 } 82 }; 83 84 extern std::string 85 get_concat_class (const std::string& c1, const std::string& c2); 86 87 extern void 88 maybe_warn_string_concat (bool all_dq_strings_p, bool all_sq_strings_p); 89 } 90 91 #endif 92