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_index_h) |
|
24 #define octave_tree_index_h 1 |
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 class tree_argument_list; |
|
31 |
|
32 class tree_walker; |
|
33 |
|
34 class octave_value; |
|
35 class octave_value_list; |
|
36 class octave_lvalue; |
|
37 |
|
38 #include "str-vec.h" |
|
39 |
|
40 #include "pt-exp.h" |
|
41 |
|
42 // Index expressions. |
|
43 |
|
44 class |
|
45 tree_index_expression : public tree_expression |
|
46 { |
|
47 public: |
|
48 |
|
49 tree_index_expression (tree_expression *e = 0, tree_argument_list *lst = 0, |
|
50 int l = -1, int c = -1) |
|
51 : tree_expression (l, c), expr (e), list (lst), arg_nm () { } |
|
52 |
|
53 ~tree_index_expression (void); |
|
54 |
|
55 bool is_index_expression (void) const |
|
56 { return true; } |
|
57 |
|
58 tree_expression *expression (void) |
|
59 { return expr; } |
|
60 |
|
61 tree_argument_list *arg_list (void) |
|
62 { return list; } |
|
63 |
|
64 bool rvalue_ok (void) const |
|
65 { return true; } |
|
66 |
|
67 octave_value rvalue (void); |
|
68 |
|
69 octave_value_list rvalue (int nargout); |
|
70 |
|
71 octave_lvalue lvalue (void); |
|
72 |
|
73 void eval_error (void); |
|
74 |
|
75 void accept (tree_walker& tw); |
|
76 |
|
77 private: |
|
78 |
|
79 tree_expression *expr; |
|
80 |
|
81 tree_argument_list *list; |
|
82 |
|
83 string_vector arg_nm; |
2988
|
84 |
|
85 // No copying! |
|
86 |
|
87 tree_index_expression (const tree_index_expression&); |
|
88 |
|
89 tree_index_expression& operator = (const tree_index_expression&); |
2980
|
90 }; |
|
91 |
|
92 #endif |
|
93 |
|
94 /* |
|
95 ;;; Local Variables: *** |
|
96 ;;; mode: C++ *** |
|
97 ;;; End: *** |
|
98 */ |