2376
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
2376
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
2376
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_magic_colon_h) |
|
25 #define octave_magic_colon_h 1 |
|
26 |
|
27 #include <cstdlib> |
|
28 |
3503
|
29 #include <iostream> |
2376
|
30 #include <string> |
|
31 |
|
32 #include "mx-base.h" |
|
33 #include "str-vec.h" |
|
34 |
|
35 #include "error.h" |
|
36 #include "ov-base.h" |
|
37 #include "ov-typeinfo.h" |
|
38 |
|
39 class Octave_map; |
|
40 class octave_value_list; |
|
41 |
|
42 class tree_walker; |
|
43 |
2477
|
44 // A type to represent `:' as used for indexing. |
2376
|
45 |
|
46 class |
|
47 octave_magic_colon : public octave_base_value |
|
48 { |
|
49 public: |
|
50 |
|
51 octave_magic_colon (void) |
|
52 : octave_base_value () { } |
|
53 |
|
54 octave_magic_colon (const octave_magic_colon&) |
|
55 : octave_base_value () { } |
|
56 |
|
57 ~octave_magic_colon (void) { } |
|
58 |
3933
|
59 octave_value *clone (void) const { return new octave_magic_colon (*this); } |
|
60 octave_value *empty_clone (void) const { return new octave_magic_colon (); } |
2376
|
61 |
|
62 idx_vector index_vector (void) const { return idx_vector (':'); } |
|
63 |
|
64 bool is_defined (void) const { return true; } |
|
65 |
2974
|
66 bool is_constant (void) const { return true; } |
|
67 |
2376
|
68 bool is_magic_colon (void) const { return true; } |
|
69 |
|
70 bool valid_as_scalar_index (void) const { return true; } |
|
71 |
|
72 bool valid_as_zero_index (void) const { return false; } |
|
73 |
3523
|
74 void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
2901
|
75 |
3523
|
76 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
2466
|
77 |
2376
|
78 private: |
|
79 |
3219
|
80 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2376
|
81 }; |
|
82 |
|
83 #endif |
|
84 |
|
85 /* |
|
86 ;;; Local Variables: *** |
|
87 ;;; mode: C++ *** |
|
88 ;;; End: *** |
|
89 */ |