60 acc_s =
"class-restricted";
62 error (
"%s: method `%s' has %s access and cannot be run in this context",
63 from.c_str (), meth.
get_name ().c_str (), acc_s.c_str ());
76 acc_s =
"class-restricted";
79 error (
"%s: property `%s' has %s access and cannot be set in this context",
80 from.c_str (), prop.
get_name ().c_str (), acc_s.c_str ());
82 error (
"%s: property `%s' has %s access and cannot be obtained in this context",
83 from.c_str (), prop.
get_name ().c_str (), acc_s.c_str ());
89 std::string::size_type pos = nm.find_last_of (
'.');
91 if (pos != std::string::npos)
92 return nm.substr (pos + 1);
152 std::list<octave_value_list> idx (1, args);
154 std::string
type (
"(");
156 return val.
subsref (type, idx, nargout);
161 bool load_if_not_found =
true)
192 static std::list<cdef_class>
195 std::list<cdef_class> retval;
197 for (
int i = 0; i < cls_list.
numel (); i++)
202 retval.push_back (c);
214 to_ov (
const std::list<cdef_class>& class_list)
216 Cell cls (class_list.size (), 1);
219 for (std::list<cdef_class>::const_iterator it = class_list.begin ();
220 it != class_list.end (); ++it, ++i)
221 cls(i) =
to_ov (*it);
228 bool allow_equal =
true,
int max_depth = -1)
232 if (allow_equal && clsa == clsb)
234 else if (max_depth != 0)
244 max_depth < 0 ? max_depth : max_depth-1);
264 if (args.
length () == 1 && args(0).type_name () ==
"object")
281 in_constructor =
false;
303 std::string dummy_string;
319 const std::string& meth_name = std::string (),
320 const std::string& prop_name = std::string (),
321 bool is_prop_set =
false)
327 if (acc_s ==
"public")
337 if (acc_s ==
"private")
339 else if (acc_s ==
"protected")
350 if (! meth_name.empty ())
359 else if (! prop_name.empty ())
370 prop_name, is_prop_set);
411 error (
"invalid property/method access in class `%s'",
428 if (! uf || ! uf->
body ())
447 if (stack_fcn && stack_fcn == method_fcn)
466 if (pl && pl->
size () > 0)
474 return obj.
is (arg0_obj);
488 if (args.
length () == 1 && args(0).type_name () ==
"object")
503 if (args.
length () == 1 && args(0).type_name () ==
"object"
504 && args(0).class_name () ==
"meta.class")
521 if (args.
length () == 1 && args(0).type_name () ==
"object"
522 && args(0).class_name () ==
"meta.class")
541 std::string name = args(0).string_value ();
546 error (
"fromName: invalid class name, expected a string value");
549 error (
"fromName: invalid number of parameters");
559 if (args.
length () > 1 && args(0).type_name () ==
"object")
565 std::string meth_name = args(1).string_value ();
575 true,
"fevalStatic");
577 error (
"fevalStatic: method `%s' is not static",
581 error (
"fevalStatic: method not found: %s",
585 error (
"fevalStatic: invalid method name, expected a string value");
587 error (
"fevalStatic: invalid object, expected a meta.class object");
590 error (
"fevalStatic: invalid arguments");
600 if (args.
length () == 2 && args(0).type_name () ==
"object"
601 && args(0).class_name () ==
"meta.class")
607 std::string prop_name = args(1).string_value ();
616 retval(0) = prop.
get_value (
true,
"getConstant");
618 error (
"getConstant: property `%s' is not constant",
622 error (
"getConstant: property not found: %s",
626 error (
"getConstant: invalid property name, expected a string value");
629 error (
"getConstant: invalid object, expected a meta.class object");
632 error (
"getConstant: invalid arguments");
637 #define META_CLASS_CMP(OP, CLSA, CLSB, FUN) \
638 static octave_value_list \
639 class_ ## OP (const octave_value_list& args, int ) \
641 octave_value_list retval; \
643 if (args.length () == 2 \
644 && args(0).type_name () == "object" \
645 && args(1).type_name () == "object" \
646 && args(0).class_name () == "meta.class" \
647 && args(1).class_name () == "meta.class") \
649 cdef_class clsa = to_cdef (args(0)); \
651 cdef_class clsb = to_cdef (args(1)); \
654 retval(0) = FUN (CLSA, CLSB); \
656 error (#OP ": invalid objects, expected meta.class objects"); \
659 error (#OP ": invalid arguments"); \
676 if (args.length () == 1 && args(0).type_name () ==
"object")
680 retval(0) = prop.
get (
"DefaultValue");
682 if (! retval(0).is_defined ())
684 "no default value for property `%s'",
703 const std::list<cdef_class>& super_list = std::list<cdef_class> ())
708 cls.
put (
"Abstract",
false);
709 cls.
put (
"ConstructOnLoad",
false);
710 cls.
put (
"ContainingPackage",
Matrix ());
711 cls.
put (
"Description", std::string ());
712 cls.
put (
"DetailedDescription", std::string ());
714 cls.
put (
"Hidden",
false);
715 cls.
put (
"InferiorClasses",
Cell ());
717 cls.
put (
"Properties",
Cell ());
718 cls.
put (
"Sealed",
false);
720 if (name ==
"handle")
722 cls.
put (
"HandleCompatible",
true);
725 else if (super_list.empty ())
727 cls.
put (
"HandleCompatible",
false);
731 bool all_handle_compatible =
true;
732 bool has_handle_class =
false;
734 for (std::list<cdef_class>::const_iterator it = super_list.begin ();
735 it != super_list.end (); ++it)
737 all_handle_compatible = all_handle_compatible
738 && it->get (
"HandleCompatible").bool_value ();
739 has_handle_class = has_handle_class || it->is_handle_class ();
742 if (has_handle_class && ! all_handle_compatible)
743 ::error (
"%s: cannot mix handle and non-HandleCompatible classes",
747 cls.
put (
"HandleCompatible", all_handle_compatible);
748 if (has_handle_class)
765 return make_class (name, std::list<cdef_class> (1, super));
773 cls.
put (
"Sealed",
true);
782 const std::string& get_access =
"public",
784 const std::string& set_access =
"public")
789 prop.
put (
"Description", std::string ());
790 prop.
put (
"DetailedDescription", std::string ());
791 prop.
put (
"Abstract",
false);
792 prop.
put (
"Constant",
false);
793 prop.
put (
"GetAccess", get_access);
794 prop.
put (
"SetAccess", set_access);
795 prop.
put (
"Dependent",
false);
796 prop.
put (
"Transient",
false);
797 prop.
put (
"Hidden",
false);
798 prop.
put (
"GetObservable",
false);
799 prop.
put (
"SetObservable",
false);
800 prop.
put (
"GetMethod", get_method);
801 prop.
put (
"SetMethod", set_method);
802 prop.
put (
"DefiningClass",
to_ov (cls));
804 prop.
put (
"HasDefault",
false);
806 std::string class_name = cls.
get_name ();
808 if (! get_method.is_empty ())
810 if (! set_method.is_empty ())
824 const octave_value& fcn,
const std::string& m_access =
"public",
825 bool is_static =
false)
830 meth.
put (
"Abstract",
false);
831 meth.
put (
"Access", m_access);
832 meth.
put (
"DefiningClass",
to_ov (cls));
833 meth.
put (
"Description", std::string ());
834 meth.
put (
"DetailedDescription", std::string ());
835 meth.
put (
"Hidden",
false);
836 meth.
put (
"Sealed",
true);
837 meth.
put (
"Static", is_static);
853 bool is_static =
false)
857 return make_method (cls, name, fcn, m_access, is_static);
862 const std::string& parent = std::string ())
868 pack.
put (
"ContainingPackage",
Matrix ());
895 const std::list<octave_value_list>& idx,
918 retval = meth.
execute (args, nargout,
true,
"subsref");
927 retval =
object.subsref (type, idx, nargout, skip,
cdef_class ());
931 if (type.length () > skip && idx.size () > skip)
932 retval = retval(0).next_subsref (nargout, type, idx, skip);
940 const std::list<octave_value_list>& idx,
951 retval =
object.subsref (type, idx, 1, skip,
cdef_class (), auto_add);
955 if (type.length () > skip && idx.size () > skip)
956 retval = retval(0).next_subsref (1, type, idx, skip);
964 const std::list<octave_value_list>& idx,
989 retlist = meth.
execute (args, 1,
true,
"subsasgn");
993 if (retlist.
length () > 0)
996 ::error (
"overloaded method `subsasgn' did not return any value");
1003 retval =
object.
subsasgn (type, idx, rhs);
1010 const std::list<octave_value_list>& idx,
1013 if (type.length () == 1 && type[0] ==
'(')
1015 object =
object.make_array ();
1041 meth.
execute (args, 0,
true,
"disp");
1055 if (
object.is_array ())
1063 const std::string& name)
const
1083 arg_names[0] = name;
1087 meth.
execute (args, 0,
true,
"display");
1113 {
object.meta_release (); }
1119 const std::list<octave_value_list>& idx,
1121 {
return object.meta_subsref (type, idx, nargout); }
1125 const std::list<octave_value_list>& idx)
1129 retval =
subsref (type, idx, 1);
1139 std::list<octave_value_list> l (1, idx);
1140 std::string
type (
"(");
1142 return subsref (type, l, nargout);
1146 {
return object.meta_is_postfix_index_handled (type); }
1151 bool retval =
false;
1153 if (
object.is_class ())
1187 const std::list<octave_value_list>& idx,
1207 if (type.length () > skip && idx.size () > skip
1209 retval = retval(0).next_subsref (nargout, type, idx, skip);
1217 const std::list<octave_value_list>& idx)
1221 retval =
subsref (type, idx, 1);
1231 std::string meth_name;
1232 bool in_constructor;
1239 std::string mname =
args(0).string_value ();
1240 std::string cname =
args(1).string_value ();
1259 ::error (
"cannot call superclass constructor with "
1260 "variable `%s'", mname.c_str ());
1263 ::error (
"`%s' is not a direct superclass of `%s'",
1264 cname.c_str (), ctx.
get_name ().c_str ());
1268 if (mname == meth_name)
1286 retval = meth.
execute (idx, nargout,
true,
1289 ::error (
"no method `%s' found in superclass `%s'",
1290 meth_name.c_str (), cname.c_str ());
1293 ::error (
"`%s' is not a superclass of `%s'",
1294 cname.c_str (), ctx.
get_name ().c_str ());
1297 ::error (
"method name mismatch (`%s' != `%s')",
1298 mname.c_str (), meth_name.c_str ());
1303 ::error (
"superclass calls can only occur in methods or constructors");
1321 if (ret_list && ret_list->
length () == 1)
1322 return (ret_list->
front ()->
name () == nm);
1341 "struct: converting a classdef object into a struct "
1342 "overrides the access restrictions defined for properties. "
1343 "All properties are returned, including private and "
1350 std::map<std::string, cdef_property> props;
1354 for (std::map<std::string, cdef_property>::iterator it = props.begin ();
1355 it != props.end (); ++it)
1367 cvalue (i) = it->second.get_value (a_obj(i),
false);
1374 retval.
setfield (it->first, cvalue);
1379 it->second.get_value (*
this,
false));
1382 retval.
setfield (it->first, cvalue);
1406 const std::list<octave_value_list>& idx,
1407 int nargout,
size_t& skip,
1423 std::string name = (idx.front ())(0).string_value ();
1429 int _nargout = (type.length () > 2 ? 1 : nargout);
1435 if (type.length () > 1 && type[1] ==
'(')
1437 std::list<octave_value_list>::const_iterator it = idx.begin ();
1445 retval = meth.
execute (args, _nargout,
true,
"subsref");
1461 retval(0) = prop.
get_value (
true,
"subsref");
1472 error (
"subsref: unknown method or property: %s", name.c_str ());
1489 retval = new_obj.
subsref (type, idx, nargout, skip, cls, auto_add);
1494 error (
"object cannot be indexed with `%c'", type[0]);
1503 const std::list<octave_value_list>& idx,
1514 std::string name = (idx.front ())(0).string_value ();
1523 error (
"subsasgn: cannot assign constant property: %s",
1531 if (type.length () == 1)
1533 prop.
set_value (obj, rhs,
true,
"subsasgn");
1536 retval =
to_ov (obj);
1545 std::list<octave_value_list> args (idx);
1547 args.erase (args.begin ());
1550 type.substr (1), args, rhs);
1556 prop.
set_value (obj, val,
true,
"subsasgn");
1559 retval =
to_ov (obj);
1566 error (
"subsasgn: unknown property: %s", name.c_str ());
1591 error (
"subsasgn: object cannot be index with `%c'", type[0]);
1601 std::string cls_name = cls.
get_name ();
1616 const std::list<octave_value_list>& idx,
1634 ::error (
"can't index %s object(s) with empty parentheses",
1641 iv(i) = ival(i).index_vector ();
1643 is_scalar = is_scalar && iv(i).is_scalar ();
1660 retval(0) =
to_ov (ires(0));
1667 retval(0) =
to_ov (array_obj);
1675 if (type.size () == 1 && idx.size () == 1)
1707 ::error (
"can't perform indexing operation on array of %s objects",
1717 const std::list<octave_value_list>& idx,
1725 if (type.length () == 1)
1739 iv(i) = ival(i).index_vector ();
1741 is_scalar = is_scalar && iv(i).is_scalar ();
1751 rhs_mat(0) = rhs_obj;
1777 ::error (
"can't assign %s object into array of %s objects.",
1792 iv(i) = ival(i).index_vector ();
1796 is_scalar = is_scalar && iv(i).is_scalar ();
1799 error (
"subsasgn: invalid indexing for object array "
1800 "assignment, the index must reference a single "
1801 "object in the array.");
1809 if (a.
numel () != 1)
1810 error (
"subsasgn: invalid indexing for object array "
1817 int ignore_copies = 0;
1831 std::list<octave_value_list> next_idx (idx);
1833 next_idx.erase (next_idx.begin ());
1836 rhs, ignore_copies);
1850 if (! robj.
is (a(0)))
1868 error (
"subasgn: invalid assignment into array of %s "
1877 ::error (
"can't perform indexing operation on array of %s objects",
1894 int n = arr.
numel ();
1905 arr.
xelem (i) = obj;
1924 std::map< cdef_class, std::list<cdef_class> >::const_iterator it;
1929 || it->second.empty ())
1932 for (std::list<cdef_class>::const_iterator lit = it->second.begin ();
1933 lit != it->second.end (); ++lit)
1944 <<
" object (handle)" << std::endl;
1952 <<
" object (value)" << std::endl;
1959 object_count (0), meta (false)
1961 put (
"SuperClasses",
to_ov (superclasses));
1970 if (it == method_map.end ())
1988 Cell super_classes =
get (
"SuperClasses").cell_value ();
1990 for (
int i = 0; i < super_classes.
numel (); i++)
2017 (*it)->accept (*
this);
2051 if (of->
name () ==
"__superclass_reference__")
2055 if (args(0).string_value () == obj_name)
2057 std::string
class_name = args(1).string_value ();
2062 ctor_list.push_back (cls);
2070 {
return ctor_list; }
2124 method_map[meth.
get_name ()] = meth;
2144 if (ret_list && ret_list->
size () == 1)
2146 std::string obj_name = ret_list->
front ()->
name ();
2152 std::list<cdef_class> explicit_ctor_list
2153 = a.get_constructor_list ();
2155 for (std::list<cdef_class>::const_iterator
2156 it = explicit_ctor_list.begin ();
2161 std::cerr <<
"explicit superclass constructor: "
2162 << it->get_name () << std::endl;
2165 implicit_ctor_list.remove (*it);
2170 ::error (
"%s: invalid constructor output arguments",
2186 std::map<std::string,cdef_method> meths;
2188 find_methods (meths,
false);
2192 Cell c (meths.size (), 1);
2196 for (std::map<std::string,cdef_method>::const_iterator
2197 it = meths.begin (); it != meths.end (); ++it, ++idx)
2198 c (idx, 0) =
to_ov (it->second);
2209 bool only_inherited)
2211 load_all_methods ();
2215 for (it = method_map.begin (); it != method_map.end (); ++it)
2217 if (! it->second.is_constructor ())
2219 std::string nm = it->second.get_name ();
2221 if (meths.find (nm) == meths.end ())
2232 meths[nm] = it->second;
2239 Cell super_classes =
get (
"SuperClasses").cell_value ();
2241 for (
int i = 0; i < super_classes.
numel (); i++)
2257 if (it != property_map.end ())
2267 Cell super_classes =
get (
"SuperClasses").cell_value ();
2269 for (
int i = 0; i < super_classes.
numel (); i++)
2288 property_map[prop.
get_name ()] = prop;
2296 std::map<std::string,cdef_property> props;
2302 Cell c (props.size (), 1);
2306 for (std::map<std::string,cdef_property>::const_iterator
2307 it = props.begin (); it != props.end (); ++it, ++idx)
2308 c (idx, 0) =
to_ov (it->second);
2316 std::map<std::string, cdef_property>
2319 std::map<std::string,cdef_property> props;
2321 find_properties (props, mode);
2333 for (it = property_map.begin (); !
error_state && it != property_map.end ();
2336 std::string nm = it->second.get_name ();
2338 if (props.find (nm) == props.end ())
2349 props[nm] = it->second;
2355 Cell super_classes =
get (
"SuperClasses").cell_value ();
2375 load_all_methods ();
2380 if (! it->second.is_constructor ())
2382 std::string nm = it->second.get_name ();
2400 std::string nm = it->second.get_name ();
2416 Cell super_classes =
get (
"SuperClasses").cell_value ();
2432 std::set<std::string>
names;
2434 find_names (names,
false);
2441 for (std::set<std::string>::const_iterator it = names.begin ();
2442 it != names.end (); ++it, ++idx)
2445 return v.sort (
true);
2456 if (it != method_map.end ())
2471 Cell super_classes =
get (
"SuperClasses").cell_value ();
2473 for (
int i = 0; i < super_classes.
numel (); i++)
2484 const std::list<octave_value_list>& idx,
2497 std::cerr <<
"constructor" << std::endl;
2507 std::cerr <<
"static method/property" << std::endl;
2510 if (idx.front ().length () == 1)
2512 std::string nm = idx.front ()(0).string_value ();
2524 if (type.length () > 1 && idx.size () > 1
2527 args = *(++(idx.begin ()));
2531 retval = meth.
execute (args, (type.length () > skip
2532 ? 1 : nargout),
true,
2536 ::error (
"method `%s' is not static", nm.c_str ());
2545 retval(0) = prop.
get_value (
true,
"meta.class");
2547 ::error (
"property `%s' is not constant",
2551 ::error (
"no such method or property `%s'", nm.c_str ());
2555 ::error (
"invalid meta.class indexing, expected a method or property name");
2558 ::error (
"invalid meta.class indexing");
2562 ::error (
"invalid meta.class indexing");
2568 if (type.length () > skip && idx.size () > skip && ! retval.
empty ())
2569 retval = retval(0).next_subsref (nargout, type, idx, skip);
2587 get (
"SuperClasses").cell_value ());
2591 for (std::list<cdef_class>::iterator it = super_classes.begin ();
2592 !
error_state && it != super_classes.end (); ++it)
2593 it->initialize_object (obj);
2600 if (! it->second.get (
"Dependent").bool_value ())
2605 obj.
put (it->first, pvalue);
2626 for (std::list<cdef_class>::const_iterator it = implicit_ctor_list.begin ();
2627 !
error_state && it != implicit_ctor_list.end (); ++it)
2638 std::string cls_name =
get_name ();
2649 ctor_retval = ctor.
execute (ctor_args, 1,
true,
"constructor");
2653 if (ctor_retval.
length () == 1)
2654 obj =
to_cdef (ctor_retval(0));
2657 ::error (
"%s: invalid number of output arguments for classdef constructor",
2658 ctor_name.c_str ());
2696 if (! empty_class.
ok ())
2697 empty_class =
make_class (
"", std::list<cdef_class> ());
2704 if (! empty_class.
ok ())
2705 empty_class =
make_class (
"", std::list<cdef_class> ());
2706 if (! empty_property.
ok ())
2708 obj = empty_property;
2714 if (! empty_class.
ok ())
2715 empty_class =
make_class (
"", std::list<cdef_class> ());
2716 if (! empty_method.
ok ())
2724 if (! empty_package.
ok ())
2726 obj = empty_package;
2753 error (
"cannot instantiate object for abstract class `%s'",
2769 return std::string (
"public");
2770 else if (s ==
"protected")
2771 return std::string (
"protected");
2772 else if (s ==
"private")
2773 return std::string (
"private");
2788 else if (t->expression ())
2789 return t->expression ()->original_text ();
2791 return std::string (
"true");
2802 class_name = full_class_name = t->
ident ()->
name ();
2804 full_class_name = t->
package_name () +
"." + full_class_name;
2807 std::cerr <<
"class: " << full_class_name << std::endl;
2810 std::list<cdef_class> slist;
2818 std::string sclass_name = (*it)->class_name ();
2821 std::cerr <<
"superclass: " << sclass_name << std::endl;
2829 slist.push_back (sclass);
2832 ::error (
"`%s' cannot inherit from `%s', because it is sealed",
2833 full_class_name.c_str (), sclass_name.c_str ());
2855 retval.
put (
"ContainingPackage",
to_ov (pack));
2867 std::string aname = (*it)->ident ()->name ();
2871 std::cerr <<
"class attribute: " << aname <<
" = "
2875 retval.
put (aname, avalue);
2887 std::map<std::string, octave_value> set_methods;
2891 std::list<tree_classdef_methods_block *> mb_list = b->
methods_list ();
2894 it != mb_list.end (); ++it)
2896 std::map<std::string, octave_value> amap;
2899 std::cerr <<
"method block" << std::endl;
2904 if ((*it)->attribute_list ())
2907 (*it)->attribute_list ()->begin ();
2908 ait != (*it)->attribute_list ()->end (); ++ait)
2910 std::string aname = (*ait)->ident ()->name ();
2914 std::cerr <<
"method attribute: " << aname <<
" = "
2919 amap[aname] = avalue;
2925 if ((*it)->element_list ())
2928 (*it)->element_list ()->begin ();
2929 mit != (*it)->element_list ()->end (); ++mit)
2932 std::string mprefix = mname.substr (0, 4);
2934 if (mprefix ==
"get.")
2935 get_methods[mname.substr (4)] =
2937 else if (mprefix ==
"set.")
2938 set_methods[mname.substr (4)] =
2945 std::cerr << (mname == class_name ?
"constructor"
2947 <<
": " << mname << std::endl;
2950 for (std::map<std::string, octave_value>::iterator
2951 ait = amap.begin (); ait != amap.end (); ++ait)
2952 meth.
put (ait->first, ait->second);
2970 std::list<std::string> external_methods =
2973 for (std::list<std::string>::const_iterator
2974 it = external_methods.begin ();
2975 it != external_methods.end ();
2981 if (*it != class_name
3006 std::list<tree_classdef_properties_block *> pb_list
3010 it != pb_list.end (); ++it)
3012 std::map<std::string, octave_value> amap;
3015 std::cerr <<
"property block" << std::endl;
3020 if ((*it)->attribute_list ())
3023 (*it)->attribute_list ()->begin ();
3024 ait != (*it)->attribute_list ()->end (); ++ait)
3026 std::string aname = (*ait)->ident ()->name ();
3030 std::cerr <<
"property attribute: " << aname <<
" = "
3035 if (aname ==
"Access")
3037 amap[
"GetAccess"] = avalue;
3038 amap[
"SetAccess"] = avalue;
3041 amap[aname] = avalue;
3047 if ((*it)->element_list ())
3050 (*it)->element_list ()->begin ();
3051 pit != (*it)->element_list ()->end (); ++pit)
3053 std::string prop_name = (*pit)->ident ()->name ();
3058 std::cerr <<
"property: " << (*pit)->ident ()->name ()
3062 if ((*pit)->expression ())
3064 octave_value pvalue = (*pit)->expression ()->rvalue1 ();
3067 std::cerr <<
"property default: "
3072 prop.
put (
"DefaultValue", pvalue);
3079 for (std::map<std::string, octave_value>::iterator ait = amap.begin ();
3080 ait != amap.end (); ++ait)
3081 prop.
put (ait->first, ait->second);
3088 std::map<std::string, octave_value>::iterator git =
3089 get_methods.find (prop_name);
3091 if (git != get_methods.end ())
3094 prop.
put (
"GetMethod", git->second);
3095 get_methods.erase (git);
3098 std::map<std::string, octave_value>::iterator sit =
3099 set_methods.find (prop_name);
3101 if (sit != set_methods.end ())
3104 prop.
put (
"SetMethod", sit->second);
3105 set_methods.erase (sit);
3127 bool do_check_access,
3128 const std::string& who)
3132 if (do_check_access && ! check_get_access ())
3145 ::error (
"cannot reference properties of class `%s' for non-constructed object",
3156 retval = obj.
get (
get (
"Name").string_value ());
3161 args(0) =
to_ov (obj);
3174 const std::string& who)
3176 if (do_check_access && ! check_get_access ())
3183 return get (
"DefaultValue");
3196 bool do_check_access,
3197 const std::string& who)
3199 if (do_check_access && ! check_set_access ())
3212 ::error (
"cannot reference properties of class `%s' for non-constructed object",
3221 obj.
put (
get (
"Name").string_value (), val);
3226 args(0) =
to_ov (obj);
3233 if (args.
length () > 0 && args(0).is_defined ())
3235 if (args (0).is_classdef_object ())
3243 ::warning (
"set-method of property `%s' returned a non-classdef object",
3282 std::string cls_name = dispatch_type;
3283 std::string pack_name;
3285 size_t pos = cls_name.rfind (
'.');
3287 if (pos != std::string::npos)
3289 pack_name = cls_name.substr (0, pos);
3290 cls_name = cls_name.substr (pos + 1);
3293 std::string dir_name;
3295 dir_name, pack_name);
3297 if (! file_name.empty ())
3317 ::error (
"no definition found for method `%s' of class `%s'",
3318 get_name ().c_str (), dispatch_type.c_str ());
3324 int nargout,
bool do_check_access,
3325 const std::string& who)
3336 if (!
get (
"Abstract").bool_value ())
3342 retval =
execute_ov (
function, args, nargout);
3346 error (
"%s: cannot execute abstract method",
3347 get (
"Name").string_value ().c_str ());
3355 int nargout,
bool do_check_access,
3356 const std::string& who)
3367 if (!
get (
"Abstract").bool_value ())
3377 new_args(0) =
to_ov (obj);
3378 for (
int i = 0; i < args.
length (); i++)
3379 new_args(i+1) = args(i);
3381 retval =
execute_ov (
function, new_args, nargout);
3385 error (
"%s: cannot execute abstract method",
3386 get (
"Name").string_value ().c_str ());
3394 if (
function.is_function())
3395 return function.function_value ()->is_classdef_constructor ();
3413 (
const std::string& type,
const std::list<octave_value_list>& idx,
3421 retval = execute (idx.front (), type.length () > 1 ? 1 : nargout,
true);
3425 error (
"invalid meta.method indexing");
3431 if (type.length () > 1 && idx.size () > 1 && ! retval.
empty ())
3432 retval = retval(0).next_subsref (nargout, type, idx, 1);
3451 std::string name = args(0).string_value ();
3456 error (
"fromName: invalid package name, expected a string value");
3459 error (
"fromName: invalid number of parameters");
3469 if (args.
length () == 1 && args(0).type_name () ==
"object"
3470 && args(0).class_name () ==
"meta.package")
3485 if (args.
length () == 0 && args(0).type_name () ==
"object"
3486 && args(0).class_name () ==
"meta.package")
3501 if (args.
length () == 0 && args(0).type_name () ==
"object"
3502 && args(0).class_name () ==
"meta.package")
3515 std::map<std::string, cdef_package> toplevel_packages;
3522 for (std::list<std::string>::const_iterator it = names.begin ();
3523 it != names.end (); ++it)
3526 Cell c (toplevel_packages.size (), 1);
3530 for (std::map<std::string, cdef_package>::const_iterator it =
3531 toplevel_packages.begin ();
3532 it != toplevel_packages.end (); ++it)
3533 c(i++,0) =
to_ov (it->second);
3540 const std::string& nm)
3542 class_map[nm] = cls;
3549 const std::string& nm)
3551 function_map[nm] = fcn;
3556 const std::string& nm)
3558 package_map[nm] = pack;
3563 template<
class T1,
class T2>
3567 Cell retval (1, m.size ());
3570 for (
typename std::map<T1, T2>::const_iterator it = m.begin ();
3571 it != m.end (); ++it, ++i)
3573 retval(i) =
to_ov (it->second);
3585 {
return map2Cell (function_map); }
3594 std::string symbol_name =
get_name () +
"." + nm;
3601 (
const std::string& type,
const std::list<octave_value_list>& idx,
3609 if (idx.front ().length () == 1)
3611 std::string nm = idx.front ()(0).string_value ();
3616 std::cerr <<
"meta.package query: " << nm << std::endl;
3635 if (type.size () > 1
3646 if (type.size () > 1 && idx.size () > 1)
3647 retval = retval(0).next_subsref (nargout, type,
3651 else if (type.size () > 1 && idx.size () > 1)
3657 error (
"member `%s' in package `%s' does not exist",
3658 nm.c_str (),
get_name ().c_str ());
3661 error (
"invalid meta.package indexing, expected a symbol name");
3664 error (
"invalid meta.package indexing");
3668 error (
"invalid meta.package indexing");
3725 "public",
Matrix (),
"private"));
3729 "public",
Matrix (),
"private"));
3733 "public",
Matrix (),
"private"));
3738 "public",
Matrix (),
"private"));
3742 "public",
Matrix (),
"private"));
3747 "public",
Matrix (),
"private"));
3751 "public",
Matrix (),
"private"));
3796 "public",
Matrix (),
"private"));
3810 "public",
Matrix (),
"private"));
3814 "public",
Matrix (),
"private"));
3818 "public",
Matrix (),
"private"));
3822 "public",
Matrix (),
"private"));
3826 "public",
Matrix (),
"private"));
3830 "public",
Matrix (),
"private"));
3843 package_meta.
install_class (meta_dynproperty,
"dynproperty");
3875 bool error_if_not_found,
bool load_if_not_found)
3877 std::map<std::string, cdef_class>::iterator it = all_classes.find (name);
3879 if (it == all_classes.end ())
3881 if (load_if_not_found)
3885 size_t pos = name.rfind (
'.');
3887 if (pos == std::string::npos)
3891 std::string pack_name = name.substr (0, pos);
3893 cdef_package pack = do_find_package (pack_name,
false,
true);
3896 ov_cls = pack.
find (name.substr (pos+1));
3900 it = all_classes.find (name);
3904 if (it == all_classes.end ())
3906 if (error_if_not_found)
3907 error (
"class not found: %s", name.c_str ());
3919 all_classes.erase (it);
3931 cdef_class cls = find_class (class_name,
false,
false);
3946 bool error_if_not_found,
3947 bool load_if_not_found)
3951 std::map<std::string, cdef_package>::const_iterator it
3952 = all_packages.find (name);
3954 if (it != all_packages.end ())
3956 retval = it->second;
3959 error (
"invalid package `%s'", name.c_str ());
3965 size_t pos = name.find (
'.');
3967 if (pos == std::string::npos)
3971 std::string parent_name = name.substr (0, pos);
3976 else if (error_if_not_found)
3977 error (
"unknown package `%s'", name.c_str ());
3998 DEFUN (__meta_get_package__, args, ,
"")
4002 if (args.length () == 1)
4004 std::string cname = args(0).string_value ();
4009 error (
"invalid package name, expected a string value");
4017 DEFUN (__superclass_reference__, args, ,
4019 @deftypefn {Built-in Function} {} __superclass_reference__ ()\n\
4020 Undocumented internal function.\n\
4026 DEFUN (__meta_class_query__, args, ,
4028 @deftypefn {Built-in Function} {} __meta_class_query__ ()\n\
4029 Undocumented internal function.\n\
4035 std::cerr <<
"__meta_class_query__ ("
4036 << args(0).string_value () <<
")"
4040 if (args.length () == 1)
4042 std::string cls = args(0).string_value ();
4047 error (
"invalid class name, expected a string value");
4055 DEFUN (metaclass, args, ,
4057 @deftypefn {Built-in Function} {} metaclass (obj)\n\
4058 Returns the meta.class object corresponding to the class of @var{obj}.\n\
4063 if (args.length () == 1)
static octave_value_list class_ne(const octave_value_list &args, int)
void visit_postfix_expression(tree_postfix_expression &)
void visit_return_command(tree_return_command &)
bool called_from_builtin(void)
void warning_with_id(const char *id, const char *fmt,...)
static void install_built_in_function(const std::string &name, const octave_value &fcn)
octave_value find(const std::string &nm)
bool is_static(void) const
size_t length(void) const
void visit_argument_list(tree_argument_list &)
void visit_unwind_protect_command(tree_unwind_protect_command &)
octave_refcount< octave_idx_type > count
void visit_index_expression(tree_index_expression &t)
void visit_cell(tree_cell &)
void visit_octave_user_function(octave_user_function &)
Cell get_properties(int mode=property_normal)
bool is_direct_superclass(const cdef_class &clsa, const cdef_class &clsb)
octave_function * load_fcn_from_file(const std::string &file_name, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, const std::string &fcn_name, bool autoload)
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
std::string get_name(void) const
static void gripe_property_access(const std::string &from, const cdef_property &prop, bool is_set=false)
std::list< tree_classdef_methods_block * >::iterator methods_list_iterator
void visit_funcall(tree_funcall &t)
octave_value get_function(void) const
void install_method(const cdef_method &meth)
dim_vector dims(void) const
virtual bool is_postfix_index_handled(char type) const
static octave_value_list class_gt(const octave_value_list &args, int)
string_vector get_names(void)
octave_value_list(* fcn)(const octave_value_list &, int)
static octave_value_list class_le(const octave_value_list &args, int)
Cell get_functions(void) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout, size_t &skip, const cdef_class &context, bool auto_add=false)
tree_parameter_list * parameter_list(void)
void run_constructor(cdef_object &obj, const octave_value_list &args)
void print_with_name(std::ostream &os, const std::string &name, bool print_padding=true)
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout, size_t &skip, const cdef_class &context, bool auto_add)
OCTINTERP_API void print_usage(void)
octave_map map_value(void) const
bool is_function(void) const
octave_idx_type numel(void) const
Number of elements in the array.
void visit_persistent_command(tree_persistent_command &)
void install_class(const cdef_class &cls, const std::string &nm)
bool is_classdef_constructor(const std::string &cname=std::string()) const
octave_idx_type length(void) const
void accept(tree_walker &tw)
friend void install_classdef(void)
octave_value_list execute_ov(octave_value val, const octave_value_list &args, int nargout)
static octave_value_list class_lt(const octave_value_list &args, int)
bool is_defined(void) const
void find_properties(std::map< std::string, cdef_property > &props, int mode=0)
void mark_for_construction(const cdef_class &cls)
octave_function * get_method_function(const std::string &nm)
void put(const std::string &pname, const octave_value &val)
void visit_switch_case_list(tree_switch_case_list &)
static const cdef_class & meta_package(void)
static bool in_class_method(const cdef_class &cls)
Array< cdef_object > array
void find_methods(std::map< std::string, cdef_method > &meths, bool only_inherited)
void visit_statement(tree_statement &t)
static const cdef_class & meta_property(void)
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
static octave_value_list class_get_inferiorclasses(const octave_value_list &args, int)
tree_classdef_body * body(void)
octave_value get_value(const cdef_object &obj, bool do_check_access=true, const std::string &who=std::string())
std::string name(void) const
#define META_CLASS_CMP(OP, CLSA, CLSB, FUN)
void install_function(const octave_value &fcn, const std::string &nm)
void indent(std::ostream &os) const
static std::list< cdef_class > lookup_classes(const Cell &cls_list)
cdef_object & to_cdef_ref(const octave_value &val)
static string_vector names(const map_type &lst)
virtual bool is_anonymous_function_of_class(const std::string &=std::string()) const
void set_value(cdef_object &obj, const octave_value &val, bool do_check_access=true, const std::string &who=std::string())
static octave_function * current(void)
static octave_value_list class_getConstant(const octave_value_list &args, int)
std::list< tree_classdef_methods_block * > methods_list(void)
static octave_value_list class_get_properties(const octave_value_list &args, int)
void visit_identifier(tree_identifier &)
std::map< cdef_class, std::list< cdef_class > > ctor_list
tree_identifier * ident(void)
octave_function * function_value(bool=false)
static void register_class(const cdef_class &cls)
static cdef_package find_package(const std::string &name, bool error_if_not_found=true, bool load_if_not_found=true)
void visit_statement_list(tree_statement_list &t)
static void make_function_of_class(const std::string &class_name, const octave_value &fcn)
bool is_constructed(void) const
bool is_constructor(void) const
static std::string get_base_name(const std::string &nm)
tree_expression * expression(void)
bool is_recursive_set(const cdef_object &obj) const
void visit_parameter_list(tree_parameter_list &)
octave_value_list execute(const octave_value_list &args, int nargout, bool do_check_access=true, const std::string &who=std::string())
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
virtual string_vector map_keys(void) const
octave_value_list meta_subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
void fill_empty_values(void)
void newline(std::ostream &os) const
cdef_class do_find_class(const std::string &name, bool error_if_not_found, bool load_if_not_found)
static octave_value_list class_get_methods(const octave_value_list &args, int)
bool is_partially_constructed_for(const cdef_class &cls) const
std::string class_name(void) const
bool check_get_access(void) const
static octave_value varval(const std::string &name, scope_id scope=xcurrent_scope, context_id context=xdefault_context)
static octave_value_list handle_delete(const octave_value_list &, int)
Array< cdef_object > array_value(void) const
void visit_global_command(tree_global_command &)
std::map< std::string, cdef_property >::iterator property_iterator
void load_all_methods(void)
std::string dispatch_class(void) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
static octave_value compute_attribute_value(tree_classdef_attribute *t)
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
std::list< tree_classdef_properties_block * >::iterator properties_list_iterator
void initialize_object(cdef_object &obj)
std::map< std::string, cdef_property >::const_iterator property_const_iterator
bool is_handle_object(void) const
bool is_constructed_for(const cdef_class &cls) const
bool is_array(void) const
void mark_for_construction(const cdef_class &)
Cell cell_value(void) const
virtual bool is_class_method(const std::string &=std::string()) const
void install_method(const cdef_method &meth)
virtual octave_value undef_subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
virtual cdef_class get_class(void) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
void install_property(const cdef_property &prop)
octave_value_list do_multi_index_op(int nargout, const octave_value_list &idx)
std::list< tree_classdef_superclass * >::iterator iterator
cdef_class get_class(void) const
std::string get_name(void) const
virtual bool is_classdef_constructor(const std::string &=std::string()) const
Cell get_functions(void) const
octave_value value(void) const
void install_class(const cdef_class &cls, const std::string &nm)
static octave_value_list class_fromName(const octave_value_list &args, int)
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
void visit_constant(tree_constant &)
octave_value_list property_get_defaultvalue(const octave_value_list &args, int)
octave_refcount< octave_idx_type > refcount
ctor_analyzer(const std::string &ctor, const std::string &obj)
tree_expression * right_hand_side(void)
virtual octave_user_function * user_function_value(bool silent=false)
static cdef_class make_class(const std::string &name, const std::list< cdef_class > &super_list=std::list< cdef_class >())
static cdef_class make_meta_class(tree_classdef *t, bool is_at_folder=false)
static octave_value to_ov(const std::list< cdef_class > &class_list)
cdef_method find_method(const std::string &nm, bool local=false)
octave_function * get_constructor_function(void)
std::list< cdef_class > get_constructor_list(void) const
octave_idx_type numel(const octave_value_list &idx)
Cell get_classes(void) const
static bool is_dummy_method(const octave_value &fcn)
static llvm::LLVMContext & context
std::string string_value(bool force=false) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout, size_t &skip, const cdef_class &context, bool auto_add)
void stash_function_name(const std::string &s)
static cdef_method make_method(const cdef_class &cls, const std::string &name, const octave_value &fcn, const std::string &m_access="public", bool is_static=false)
void error_with_id(const char *id, const char *fmt,...)
tree_parameter_list * return_list(void)
void visit_prefix_expression(tree_prefix_expression &)
std::string name(void) const
void mark_as_external(const std::string &dtype)
void put(const std::string &pname, const octave_value &val)
static const cdef_class & meta_method(void)
bool is_string(void) const
bool check_access(void) const
octave_user_function * user_function_value(bool silent=false) const
bool is_strict_superclass(const cdef_class &clsa, const cdef_class &clsb)
static cdef_class _meta_method
static cdef_manager * instance
static cdef_package lookup_package(const std::string &name)
void visit_no_op_command(tree_no_op_command &)
std::list< cdef_class > implicit_ctor_list
void mark_as_class_method(void)
octave_value_list meta_subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
octave_value & assign(assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
octave_value get_value(bool do_check_access=true, const std::string &who=std::string())
Cell get_packages(void) const
static octave_value_list package_get_classes(const octave_value_list &args, int)
octave_value_list splice(octave_idx_type offset, octave_idx_type len, const octave_value_list &lst=octave_value_list()) const
bool is_constant(void) const
static cdef_package _meta
#define panic_impossible()
static octave_value_list package_fromName(const octave_value_list &args, int)
static cdef_class _meta_class
void visit_binary_expression(tree_binary_expression &)
octave_value find(const std::string &nm)
bool is_private_function(void) const
std::list< tree_classdef_properties_block * > properties_list(void)
void initialize_object(cdef_object &obj)
std::list< tree_statement * >::const_iterator const_iterator
void visit_switch_case(tree_switch_case &)
static std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name=std::string())
cdef_property make_attribute(const cdef_class &cls, const std::string &name)
static cdef_class _meta_package
static octave_value_list class_ge(const octave_value_list &args, int)
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
octave_value construct(const octave_value_list &args)
tree_expression * expression(void)
static cdef_class _meta_property
cdef_class get_class(void) const
static octave_value_list class_eq(const octave_value_list &args, int)
void mark_as_meta_class(void)
octave_value_list meta_subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
octave_value get(const std::string &pname) const
void install_package(const cdef_package &pack, const std::string &nm)
octave_value construct(const octave_value_list &args)
cdef_package do_find_package(const std::string &name, bool error_if_not_found, bool load_if_not_found)
static bool is_superclass(const cdef_class &clsa, const cdef_class &clsb, bool allow_equal=true, int max_depth=-1)
cdef_property find_property(const std::string &nm)
virtual bool print_name_tag(std::ostream &os, const std::string &name) const
bool is_scalar(const dim_vector &dim)
void visit_octave_user_script(octave_user_script &)
static cdef_property make_property(const cdef_class &cls, const std::string &name, const octave_value &get_method=Matrix(), const std::string &get_access="public", const octave_value &set_method=Matrix(), const std::string &set_access="public")
friend class octave_value
octave_lvalue lvalue(void)
void setfield(const std::string &key, const Cell &val)
octave_classdef_superclass_ref(const octave_value_list &a)
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
octave_function * function_value(bool silent=false) const
T & xelem(octave_idx_type n)
octave_value_list do_multi_index_op(int nargout, const octave_value_list &idx)
static std::list< std::string > methods(const std::string &class_name, const std::string &pack_name=std::string())
void visit_if_command_list(tree_if_command_list &)
std::string class_name(void) const
cdef_property find_property(const std::string &nm)
void warning(const char *fmt,...)
octave_value_list execute(const octave_value_list &args, int nargout, bool do_check_access=true, const std::string &who=std::string())
virtual std::string name(void) const
std::map< std::string, cdef_property > get_property_map(int mode)
std::string type_name(void) const
void mark_as_classdef_constructor(void)
virtual octave_value rvalue1(int nargout=1)
octave_value undef_subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
bool is_empty(void) const
static cdef_class make_meta_class(const std::string &name, const cdef_class &super)
octave_value make_idx_args(const std::string &type, const std::list< octave_value_list > &idx, const std::string &who)
bool check_set_access(void) const
Cell get_classes(void) const
void visit_function_def(tree_function_def &)
bool is_constructor(void) const
static octave_value_list class_fevalStatic(const octave_value_list &args, int nargout)
cdef_object to_cdef(const octave_value &val)
static void gripe_method_access(const std::string &from, const cdef_method &meth)
void mark_as_handle_class(void)
static const std::string t_name
static octave_value_list package_get_functions(const octave_value_list &args, int)
void set_class(const cdef_class &cls)
void run_constructor(cdef_object &obj, const octave_value_list &args)
bool bool_value(bool warn=false) const
cdef_object construct_object(const octave_value_list &args)
void find_names(std::set< std::string > &names, bool all)
static int register_type(const std::string &, const std::string &, const octave_value &)
void visit_fcn_handle(tree_fcn_handle &)
std::map< std::string, cdef_property > get_property_map(int mode=property_normal)
tree_expression * expression(void)
bool is_meta_class(void) const
static octave_value_list package_getAllPackages(const octave_value_list &, int)
void visit_anon_fcn_handle(tree_anon_fcn_handle &)
void visit_simple_assignment(tree_simple_assignment &t)
static void register_package(const cdef_package &pkg)
static octave_value make_fcn_handle(octave_builtin::fcn ff, const std::string &nm)
octave_function * do_find_package_symbol(const std::string &pack_name)
void delete_object(cdef_object obj)
bool is_constructed_object(const std::string nm)
octave_value function(void) const
~octave_classdef_superclass_ref(void)
void stash_dispatch_class(const std::string &nm)
cdef_class_rep * get_rep(void)
static bool check_access(const cdef_class &cls, const octave_value &acc, const std::string &meth_name=std::string(), const std::string &prop_name=std::string(), bool is_prop_set=false)
bool is_partially_constructed_for(const cdef_class &cls) const
std::string class_name(void) const
static octave_value_list class_get_superclasses(const octave_value_list &args, int)
bool print_name_tag(std::ostream &os, const std::string &name) const
tree_classdef_superclass_list * superclass_list(void)
bool is_user_function(void) const
Cell get_properties(int mode)
std::string get_name(void) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
void assign(const idx_vector &i, const Array< T > &rhs, const T &rfv)
Indexed assignment (always with resize & fill).
std::map< std::string, cdef_method >::const_iterator method_const_iterator
static std::string attribute_value_to_string(T *t, octave_value v)
cdef_object construct_object(const octave_value_list &args)
void delete_object(cdef_object obj)
void visit_multi_assignment(tree_multi_assignment &t)
static const cdef_class & meta_class(void)
void set_value(cdef_object &obj, const octave_value &val, bool do_check_access=true, const std::string &who=std::string())
std::map< std::string, cdef_method >::iterator method_iterator
Cell map2Cell(const std::map< T1, T2 > &m)
bool is_expression(void) const
void visit_matrix(tree_matrix &)
void mark_as_constructed(void)
static cdef_class lookup_class(const std::string &name, bool error_if_not_found=true, bool load_if_not_found=true)
static void unregister_class(const cdef_class &cls)
std::string class_name(void) const
cdef_method find_method(const std::string &nm, bool local=false)
void visit_complex_for_command(tree_complex_for_command &)
bool is_method_executing(const octave_value &ov, const cdef_object &obj)
void visit_try_catch_command(tree_try_catch_command &)
bool is_builtin(void) const
void visit_switch_command(tree_switch_command &)
void visit_simple_for_command(tree_simple_for_command &)
void visit_return_list(tree_return_list &)
void visit_while_command(tree_while_command &)
const std::string & package_name(void) const
static octave_value_list package_get_packages(const octave_value_list &args, int)
std::list< cdef_class > ctor_list
tree_statement_list * body(void)
bool is_handle_class(void) const
octave_function * do_find_method_symbol(const std::string &method_name, const std::string &class_name)
void install_property(const cdef_property &prop)
void visit_colon_expression(tree_colon_expression &)
tree_expression * right_hand_side(void)
~handle_cdef_object(void)
string_vector get_names(void)
cdef_object copy(void) const
void visit_do_until_command(tree_do_until_command &)
void visit_if_command(tree_if_command &)
virtual void accept(tree_walker &tw)=0
void visit_decl_init_list(tree_decl_init_list &)
tree_classdef_attribute_list * attribute_list(void)
static cdef_class get_class_context(std::string &name, bool &in_constructor)
void print(std::ostream &os, bool pr_as_read_syntax=false)
virtual void print_with_name(std::ostream &output_buf, const std::string &name, bool print_padding=true)
static void create_instance(void)
void visit_if_clause(tree_if_clause &)
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, size_t skip=1)
octave_value_list & prepend(const octave_value &val)
virtual bool is_identifier(void) const
static bool find_package(const std::string &package_name)
static std::list< std::string > get_all_package_names(bool only_top_level=true)
void visit_break_command(tree_break_command &)
Cell get_packages(void) const
bool is_constructed(void) const
void visit_decl_elt(tree_decl_elt &)
bool is_instance_of(const std::string &cls_name) const
void mark_as_class_constructor(void)
Array< T > index(const idx_vector &i) const
Indexing without resizing.
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs, int ignore_copies=0)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
void set_function(const octave_value &fcn)
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
void visit_continue_command(tree_continue_command &)
static cdef_class find_class(const std::string &name, bool error_if_not_found=true, bool load_if_not_found=true)
bool is_abstract(void) const
static void register_type(void)
static cdef_package make_package(const std::string &nm, const std::string &parent=std::string())
bool is(const cdef_object &obj) const
octave_value_list arguments(void) const
static octave_value find(const std::string &name, const octave_value_list &args=octave_value_list(), bool skip_variables=false, bool local_funcs=true)
void stash_name_tags(const string_vector &nm)