47 arg_nm (), dyn_field () { }
53 arg_nm (), dyn_field ()
62 arg_nm (), dyn_field ()
71 arg_nm (), dyn_field ()
82 dyn_field.push_back (static_cast<tree_expression *> (0));
85 error (
"invalid use of empty argument (~) in index expression");
91 args.push_back (static_cast<tree_argument_list *> (0));
94 dyn_field.push_back (static_cast<tree_expression *> (0));
100 args.push_back (static_cast<tree_argument_list *> (0));
110 while (!
args.empty ())
112 std::list<tree_argument_list *>::iterator p =
args.begin ();
119 std::list<tree_expression *>::iterator p =
dyn_field.begin ();
128 for (std::list<tree_argument_list *>::const_iterator p =
args.begin ();
162 int n = arg_values.
length ();
170 for (
int i = 0; i < n; i++)
171 retval(0,i) = arg_values(i);
186 if (rvalue &&
object && args->
has_magic_end () &&
object->is_undefined ())
205 (std::list<string_vector>::const_iterator p_arg_nm,
206 std::list<tree_expression *>::const_iterator p_dyn_field)
const
208 std::string fn = (*p_arg_nm)(0);
223 error (
"dynamic structure field names must be character strings");
236 int n =
args.size ();
238 Cell type_field (n, 1);
239 Cell subs_field (n, 1);
241 std::list<tree_argument_list *>::const_iterator p_args =
args.begin ();
242 std::list<string_vector>::const_iterator p_arg_nm =
arg_nm.begin ();
243 std::list<tree_expression *>::const_iterator p_dyn_field =
dyn_field.begin ();
247 for (
int i = 0; i < n; i++)
275 m.
assign (
"type", type_field);
276 m.
assign (
"subs", subs_field);
289 const std::list<octave_lvalue> *lvalue_list)
300 bool have_args =
false;
310 size_t n = al ? al->
length () : 0;
316 first_args = al -> convert_to_const_vector ();
320 first_expr_val =
id->do_lookup (first_args);
333 std::list<octave_value_list> idx;
335 int n =
args.size ();
337 std::list<tree_argument_list *>::iterator p_args =
args.begin ();
338 std::list<string_vector>::iterator p_arg_nm =
arg_nm.begin ();
339 std::list<tree_expression *>::iterator p_dyn_field =
dyn_field.begin ();
341 for (
int i = 0; i < n; i++)
352 bool force_split =
type[i-1] ==
'(' &&
type[i] !=
'.';
367 = tmp.
subsref (
type.substr (tmpi, i - tmpi), idx, nargout);
386 idx.push_back (first_args);
415 retval = tmp.
subsref (
type.substr (tmpi, n - tmpi), idx, nargout,
440 std::list<octave_value_list> idx;
441 std::string tmp_type;
443 int n =
args.size ();
445 std::list<tree_argument_list *>::iterator p_args =
args.begin ();
446 std::list<string_vector>::iterator p_arg_nm =
arg_nm.begin ();
447 std::list<tree_expression *>::iterator p_dyn_field =
dyn_field.begin ();
456 std::list<octave_value_list> tmpidx;
458 for (
int i = 0; i < n; i++)
460 if (retval.
numel () != 1)
464 tmp = tmp.
subsref (
type.substr (tmpi, i - tmpi), tmpidx,
true);
478 idx.push_back (tidx);
482 if (
type[i+1] ==
'.')
484 tmpidx.push_back (tidx);
488 error (
"() must be followed by . or close the index chain");
516 idx.push_back (tidx);
517 tmpidx.push_back (tidx);
532 if (i > 0 &&
type[i-1] ==
'(')
551 tmpidx.push_back (tidx);
565 tmpidx.push_back (tidx);
572 idx.push_back (tidx);
580 if (idx.back ().empty ())
581 error (
"invalid empty index list");
645 std::list<tree_argument_list *> new_args;
647 for (std::list<tree_argument_list *>::const_iterator p =
args.begin ();
653 new_args.push_back (elt ? elt->
dup (scope, context) : 0);
656 new_idx_expr->
args = new_args;
662 std::list<tree_expression *> new_dyn_field;
664 for (std::list<tree_expression *>::const_iterator p =
dyn_field.begin ();
670 new_dyn_field.push_back (elt ? elt->
dup (scope, context) : 0);