2980
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
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_tree_colon_h) |
|
24 #define octave_tree_colon 1 |
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <string> |
|
31 |
|
32 class tree_walker; |
|
33 |
|
34 class octave_value; |
|
35 class octave_value_list; |
|
36 class octave_lvalue; |
|
37 |
|
38 #include "pt-exp.h" |
|
39 |
|
40 // Colon expressions. |
|
41 |
|
42 class |
|
43 tree_colon_expression : public tree_expression |
|
44 { |
|
45 public: |
|
46 |
|
47 tree_colon_expression (int l = -1, int c = -1) |
|
48 : tree_expression (l, c), op_base (0), op_limit (0), op_increment (0) { } |
|
49 |
|
50 tree_colon_expression (tree_expression *e, int l = -1, int c = -1) |
|
51 : tree_expression (l, c), op_base (e), op_limit (0), op_increment (0) { } |
|
52 |
|
53 ~tree_colon_expression (void) |
|
54 { |
|
55 delete op_base; |
|
56 delete op_limit; |
|
57 delete op_increment; |
|
58 } |
|
59 |
|
60 tree_colon_expression *append (tree_expression *t); |
|
61 |
|
62 bool rvalue_ok (void) const |
|
63 { return true; } |
|
64 |
|
65 octave_value rvalue (void); |
|
66 |
|
67 octave_value_list rvalue (int nargout); |
|
68 |
|
69 void eval_error (const string& s = string ()); |
|
70 |
|
71 tree_expression *base (void) { return op_base; } |
|
72 |
|
73 tree_expression *limit (void) { return op_limit; } |
|
74 |
|
75 tree_expression *increment (void) { return op_increment; } |
|
76 |
|
77 void accept (tree_walker& tw); |
|
78 |
|
79 private: |
|
80 |
|
81 // The components of the expression. |
|
82 tree_expression *op_base; |
|
83 tree_expression *op_limit; |
|
84 tree_expression *op_increment; |
2988
|
85 |
|
86 // No copying! |
|
87 |
|
88 tree_colon_expression (const tree_colon_expression&); |
|
89 |
|
90 tree_colon_expression& operator = (const tree_colon_expression&); |
2980
|
91 }; |
|
92 |
|
93 #endif |
|
94 |
|
95 /* |
|
96 ;;; Local Variables: *** |
|
97 ;;; mode: C++ *** |
|
98 ;;; End: *** |
|
99 */ |