diff libinterp/parse-tree/oct-parse.in.yy @ 16698:13b3b92ea99c classdef

Implement property accessors. * libinterp/parse-tree/oct-parse.in.yy: Prepend "get." or "set." to property accessor methods names. * libinterp/octave-value/ov-classdef.h (cdef_property_rep::is_recursive_set): Delete method. * libinterp/octave-value/ov-classdef.cc (cdef_property::cdef_property_rep::is_recursive_set): Delete method. (is_method_executing): New static utility function. (cdef_property::cdef_property_rep::get_value, cdef_property::cdef_property_rep::set)value): Use it to check whether the accessor method is already executing for the same object. (cdef_class::make_meta_class): Associate property accessors to their corresponding properties. (make_fcn_handle(octave_value, string)): New static overload.
author Michael Goffioul <michael.goffioul@gmail.com>
date Fri, 24 May 2013 15:41:52 -0400
parents e1c6ad54259f
children 498b2dd1bd56
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy	Thu May 23 21:41:51 2013 -0400
+++ b/libinterp/parse-tree/oct-parse.in.yy	Fri May 24 15:41:52 2013 -0400
@@ -1234,6 +1234,11 @@
 
                     delete $1;
 
+                    if (lexer.parsing_classdef_get_method)
+                      fname.insert (0, "get.");
+                    else if (lexer.parsing_classdef_set_method)
+                      fname.insert (0, "set.");
+
                     if (! ($$ = parser.frob_function (fname, $2)))
                       ABORT_PARSE;
                   }