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, |
3215
|
50 int l = -1, int c = -1); |
2980
|
51 |
|
52 ~tree_index_expression (void); |
|
53 |
|
54 bool is_index_expression (void) const |
|
55 { return true; } |
|
56 |
3523
|
57 std::string name (void) const; |
2991
|
58 |
2980
|
59 tree_expression *expression (void) |
|
60 { return expr; } |
|
61 |
|
62 tree_argument_list *arg_list (void) |
|
63 { return list; } |
|
64 |
3010
|
65 bool lvalue_ok (void) const |
|
66 { return expr->lvalue_ok (); } |
|
67 |
2980
|
68 bool rvalue_ok (void) const |
|
69 { return true; } |
|
70 |
|
71 octave_value rvalue (void); |
|
72 |
|
73 octave_value_list rvalue (int nargout); |
|
74 |
|
75 octave_lvalue lvalue (void); |
|
76 |
|
77 void eval_error (void); |
|
78 |
|
79 void accept (tree_walker& tw); |
|
80 |
|
81 private: |
|
82 |
|
83 tree_expression *expr; |
|
84 |
|
85 tree_argument_list *list; |
|
86 |
|
87 string_vector arg_nm; |
2988
|
88 |
|
89 // No copying! |
|
90 |
|
91 tree_index_expression (const tree_index_expression&); |
|
92 |
|
93 tree_index_expression& operator = (const tree_index_expression&); |
2980
|
94 }; |
|
95 |
|
96 #endif |
|
97 |
|
98 /* |
|
99 ;;; Local Variables: *** |
|
100 ;;; mode: C++ *** |
|
101 ;;; End: *** |
|
102 */ |