GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-colon.h
Go to the documentation of this file.
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_ov_colon_h)
27 #define octave_ov_colon_h 1
28 
29 #include "octave-config.h"
30 
31 #include <cstdlib>
32 
33 #include <iosfwd>
34 #include <string>
35 
36 #include "mx-base.h"
37 #include "str-vec.h"
38 
39 #include "error.h"
40 #include "ov-base.h"
41 #include "ov-typeinfo.h"
42 
43 class octave_value_list;
44 
45 // A type to represent ':' as used for indexing.
46 
47 class
49 {
50 public:
51 
53  : octave_base_value () { }
54 
56  : octave_base_value () { }
57 
58  ~octave_magic_colon (void) = default;
59 
60  octave_base_value * clone (void) const
61  { return new octave_magic_colon (*this); }
63  { return new octave_magic_colon (); }
64 
65  idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (':'); }
66 
67  bool is_defined (void) const { return true; }
68 
69  bool is_constant (void) const { return true; }
70 
71  bool is_magic_colon (void) const { return true; }
72 
73  void print (std::ostream& os, bool pr_as_read_syntax = false);
74 
75  void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
76 
77 private:
78 
80 };
81 
82 #endif
bool is_constant(void) const
Definition: ov-colon.h:69
octave_base_value * clone(void) const
Definition: ov-colon.h:60
idx_vector index_vector(bool=false) const
Definition: ov-colon.h:65
bool is_defined(void) const
Definition: ov-colon.h:67
octave_base_value * empty_clone(void) const
Definition: ov-colon.h:62
~octave_magic_colon(void)=default
octave_magic_colon(void)
Definition: ov-colon.h:52
bool is_magic_colon(void) const
Definition: ov-colon.h:71
octave_magic_colon(const octave_magic_colon &)
Definition: ov-colon.h:55
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:158