comparison src/pt-exp-base.h @ 1229:7d7c3eaa1d3b

[project @ 1995-04-10 01:04:13 by jwe]
author jwe
date Mon, 10 Apr 1995 01:04:46 +0000
parents 0326a802cd5c
children 0a5e9e8892a0
comparison
equal deleted inserted replaced
1228:38b876e46ff6 1229:7d7c3eaa1d3b
203 203
204 virtual Octave_object eval (int print, int nargout, 204 virtual Octave_object eval (int print, int nargout,
205 const Octave_object& args) = 0; 205 const Octave_object& args) = 0;
206 }; 206 };
207 207
208 // Used internally.
209
210 class
211 tree_oct_obj : public tree_multi_val_ret
212 {
213 public:
214 tree_oct_obj (int l = -1, int c = -1) : tree_multi_val_ret (l, c) { }
215
216 tree_oct_obj (const Octave_object& v, int l = -1, int c = -1)
217 : tree_multi_val_ret (l, c)
218 {
219 values = v;
220 }
221
222 tree_constant eval (int print);
223
224 Octave_object eval (int print, int nargout, const Octave_object& args);
225
226 void print_code (ostream& os) { }
227
228 private:
229 Octave_object values;
230 };
231
208 // A base class for objects that can be evaluated with argument lists. 232 // A base class for objects that can be evaluated with argument lists.
209 233
210 class 234 class
211 tree_fvc : public tree_multi_val_ret 235 tree_fvc : public tree_multi_val_ret
212 { 236 {
674 698
675 class 699 class
676 tree_multi_assignment_expression : public tree_multi_val_ret 700 tree_multi_assignment_expression : public tree_multi_val_ret
677 { 701 {
678 public: 702 public:
679 tree_multi_assignment_expression (int l = -1, int c = -1) 703 tree_multi_assignment_expression (int plhs = 0, int l = -1, int c = -1)
680 : tree_multi_val_ret (l, c) 704 : tree_multi_val_ret (l, c)
681 { 705 {
682 etype = tree_expression::multi_assignment; 706 etype = tree_expression::multi_assignment;
707 preserve = plhs;
683 lhs = 0; 708 lhs = 0;
684 rhs = 0; 709 rhs = 0;
685 } 710 }
686 711
687 tree_multi_assignment_expression (tree_return_list *lst, 712 tree_multi_assignment_expression (tree_return_list *lst,
688 tree_multi_val_ret *r, 713 tree_multi_val_ret *r,
714 int plhs = 0,
689 int l = -1, int c = -1) 715 int l = -1, int c = -1)
690 : tree_multi_val_ret (l, c) 716 : tree_multi_val_ret (l, c)
691 { 717 {
692 etype = tree_expression::multi_assignment; 718 etype = tree_expression::multi_assignment;
719 preserve = plhs;
693 lhs = lst; 720 lhs = lst;
694 rhs = r; 721 rhs = r;
695 } 722 }
696 723
697 ~tree_multi_assignment_expression (void); 724 ~tree_multi_assignment_expression (void);
706 void eval_error (void); 733 void eval_error (void);
707 734
708 void print_code (ostream& os); 735 void print_code (ostream& os);
709 736
710 private: 737 private:
738 int preserve;
711 tree_return_list *lhs; 739 tree_return_list *lhs;
712 tree_multi_val_ret *rhs; 740 tree_multi_val_ret *rhs;
713 }; 741 };
714 742
715 // Colon expressions. 743 // Colon expressions.