comparison src/pt-arg-list.cc @ 5846:db0598f94c0f

[project @ 2006-06-07 18:16:16 by jwe]
author jwe
date Wed, 07 Jun 2006 18:16:16 +0000
parents ace8d8d26933
children 415ae81d331b
comparison
equal deleted inserted replaced
5845:8b4a99ae3b5e 5846:db0598f94c0f
30 30
31 #include "str-vec.h" 31 #include "str-vec.h"
32 32
33 #include "defun.h" 33 #include "defun.h"
34 #include "error.h" 34 #include "error.h"
35 #include "oct-lvalue.h"
35 #include "oct-obj.h" 36 #include "oct-obj.h"
36 #include "ov.h" 37 #include "ov.h"
37 #include "ov-usr-fcn.h" 38 #include "ov-usr-fcn.h"
38 #include "pt-arg-list.h" 39 #include "pt-arg-list.h"
39 #include "pt-exp.h" 40 #include "pt-exp.h"
73 { 74 {
74 octave_base_list<tree_expression *>::append (s); 75 octave_base_list<tree_expression *>::append (s);
75 76
76 if (! list_includes_magic_end && s && s->has_magic_end ()) 77 if (! list_includes_magic_end && s && s->has_magic_end ())
77 list_includes_magic_end = true; 78 list_includes_magic_end = true;
78 }
79
80 int
81 tree_argument_list::nargout_count (void) const
82 {
83 int retval = 0;
84
85 for (const_iterator p = begin (); p != end (); p++)
86 {
87 tree_expression *elt = *p;
88
89 // FIXME -- need to be able to determine whether elt is
90 // an expression that could evaluate to a cs-list object, and if
91 // so, how many elements are in that list. Ugly!
92
93 retval++;
94 }
95
96 return retval;
97 } 79 }
98 80
99 bool 81 bool
100 tree_argument_list::all_elements_are_constant (void) const 82 tree_argument_list::all_elements_are_constant (void) const
101 { 83 {
258 unwind_protect::run_frame ("convert_to_const_vector"); 240 unwind_protect::run_frame ("convert_to_const_vector");
259 241
260 return args; 242 return args;
261 } 243 }
262 244
245 std::list<octave_lvalue>
246 tree_argument_list::lvalue_list (void)
247 {
248 std::list<octave_lvalue> retval;
249
250 for (tree_argument_list::iterator p = begin ();
251 p != end ();
252 p++)
253 {
254 tree_expression *elt = *p;
255
256 retval.push_back (elt->lvalue ());
257 }
258
259 return retval;
260 }
261
263 string_vector 262 string_vector
264 tree_argument_list::get_arg_names (void) const 263 tree_argument_list::get_arg_names (void) const
265 { 264 {
266 int len = length (); 265 int len = length ();
267 266