Mercurial > hg > octave-nkf
comparison src/pt-assign.h @ 10230:0a5a769b8fc0
disallow computed multiple assignment
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 30 Jan 2010 19:28:25 +0100 |
parents | cd96d29c5efa |
children | f3b65e1ae355 |
comparison
equal
deleted
inserted
replaced
10229:02ae72071221 | 10230:0a5a769b8fc0 |
---|---|
116 class | 116 class |
117 tree_multi_assignment : public tree_expression | 117 tree_multi_assignment : public tree_expression |
118 { | 118 { |
119 public: | 119 public: |
120 | 120 |
121 tree_multi_assignment (bool plhs = false, int l = -1, int c = -1, | 121 tree_multi_assignment (bool plhs = false, int l = -1, int c = -1) |
122 octave_value::assign_op t = octave_value::op_asn_eq) | 122 : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs), |
123 : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs), etype(t), | |
124 first_execution (true) { } | 123 first_execution (true) { } |
125 | 124 |
126 tree_multi_assignment (tree_argument_list *lst, tree_expression *r, | 125 tree_multi_assignment (tree_argument_list *lst, tree_expression *r, |
127 bool plhs = false, int l = -1, int c = -1, | 126 bool plhs = false, int l = -1, int c = -1); |
128 octave_value::assign_op t = octave_value::op_asn_eq); | |
129 | 127 |
130 ~tree_multi_assignment (void); | 128 ~tree_multi_assignment (void); |
131 | 129 |
132 bool has_magic_end (void) const { return (rhs && rhs->has_magic_end ()); } | 130 bool has_magic_end (void) const { return (rhs && rhs->has_magic_end ()); } |
133 | 131 |
148 tree_expression *dup (symbol_table::scope_id scope, | 146 tree_expression *dup (symbol_table::scope_id scope, |
149 symbol_table::context_id context) const; | 147 symbol_table::context_id context) const; |
150 | 148 |
151 void accept (tree_walker& tw); | 149 void accept (tree_walker& tw); |
152 | 150 |
153 octave_value::assign_op op_type (void) const { return etype; } | 151 octave_value::assign_op op_type (void) const { return octave_value::op_asn_eq; } |
154 | 152 |
155 private: | 153 private: |
156 | 154 |
157 // The left hand side of the assignment. | 155 // The left hand side of the assignment. |
158 tree_argument_list *lhs; | 156 tree_argument_list *lhs; |
161 tree_expression *rhs; | 159 tree_expression *rhs; |
162 | 160 |
163 // True if we should not delete the lhs. | 161 // True if we should not delete the lhs. |
164 bool preserve; | 162 bool preserve; |
165 | 163 |
166 // The type of the expression. | |
167 octave_value::assign_op etype; | |
168 | |
169 // true only on first rvalue() call. | 164 // true only on first rvalue() call. |
170 bool first_execution; | 165 bool first_execution; |
171 | 166 |
172 // No copying! | 167 // No copying! |
173 | 168 |