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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_magic_colon_h) |
|
24 #define octave_magic_colon_h 1 |
|
25 |
|
26 #include <cstdlib> |
|
27 |
3503
|
28 #include <iostream> |
2376
|
29 #include <string> |
|
30 |
|
31 #include "mx-base.h" |
|
32 #include "str-vec.h" |
|
33 |
|
34 #include "error.h" |
|
35 #include "ov-base.h" |
|
36 #include "ov-typeinfo.h" |
|
37 |
|
38 class Octave_map; |
|
39 class octave_value_list; |
|
40 |
|
41 class tree_walker; |
|
42 |
2477
|
43 // A type to represent `:' as used for indexing. |
2376
|
44 |
|
45 class |
|
46 octave_magic_colon : public octave_base_value |
|
47 { |
|
48 public: |
|
49 |
|
50 octave_magic_colon (void) |
|
51 : octave_base_value () { } |
|
52 |
|
53 octave_magic_colon (const octave_magic_colon&) |
|
54 : octave_base_value () { } |
|
55 |
|
56 ~octave_magic_colon (void) { } |
|
57 |
|
58 octave_value *clone (void) { return new octave_magic_colon (*this); } |
|
59 |
|
60 idx_vector index_vector (void) const { return idx_vector (':'); } |
|
61 |
|
62 bool is_defined (void) const { return true; } |
|
63 |
2974
|
64 bool is_constant (void) const { return true; } |
|
65 |
2376
|
66 bool is_magic_colon (void) const { return true; } |
|
67 |
|
68 bool valid_as_scalar_index (void) const { return true; } |
|
69 |
|
70 bool valid_as_zero_index (void) const { return false; } |
|
71 |
2901
|
72 void print (ostream& os, bool pr_as_read_syntax = false) const; |
|
73 |
|
74 void print_raw (ostream& os, bool pr_as_read_syntax = false) const; |
2466
|
75 |
2376
|
76 private: |
|
77 |
3219
|
78 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2376
|
79 }; |
|
80 |
|
81 #endif |
|
82 |
|
83 /* |
|
84 ;;; Local Variables: *** |
|
85 ;;; mode: C++ *** |
|
86 ;;; End: *** |
|
87 */ |