I didn't change the zend_language_scanner.l, attached is the (.txt) diff that I had at the original time of writing, I'll give that a try.
I am planning to go by the RFC mentioned below, I've already been emailing with that original author who tells me most of the feedback he received during its initial inception has been integrated into the RFC. Does anyone have any feedback about that RFC as it is now? The one thing I would like to see different about how it works vs c# is that if $Seconds were defined as a getter/setter, $this->Seconds from within the getter/setter would access the data storage, rather than the getter/setter function so that one does not have to defined an additional datastore for each and every getter/setter. -----Original Message----- From: Hannes Magnusson [mailto:hannes.magnus...@gmail.com] Sent: Monday, November 07, 2011 8:04 AM To: Hartmut Holzgraefe; php-...@zerocue.com Cc: internals@lists.php.net Subject: Re: [PHP-DEV] Help w/ Parser On Mon, Nov 7, 2011 at 12:31, Hartmut Holzgraefe <hartmut.holzgra...@gmail.com> wrote: > On 11/07/2011 10:12 AM, Keloran wrote: >> >> this looks cool if you get it to work > > +1 want have! :) Same here. As long as someone doesn't think this creates precedence for importing C# features and thinks implementing partial classes will be cool :) Btw; https://wiki.php.net/rfc/propertygetsetsyntax ..and only text/plain attachments come through. -Hannes
Index: Zend/zend_language_parser.y =================================================================== --- Zend/zend_language_parser.y (revision 318862) +++ Zend/zend_language_parser.y (working copy) @@ -179,6 +179,8 @@ %token T_CLASS "class (T_CLASS)" %token T_TRAIT "trait (T_TRAIT)" %token T_INTERFACE "interface (T_INTERFACE)" +%token T_GET "get (T_GET)" +%token T_SET "set (T_SET)" %token T_EXTENDS "extends (T_EXTENDS)" %token T_IMPLEMENTS "implements (T_IMPLEMENTS)" %token T_OBJECT_OPERATOR "-> (T_OBJECT_OPERATOR)" @@ -666,8 +668,14 @@ | T_FINAL { Z_LVAL($$.u.constant) = ZEND_ACC_FINAL; } ; +getter_setter_declaration: + T_GET '{' '}' + | T_SET '{' '}' +; + class_variable_declaration: - class_variable_declaration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL, CG(access_type) TSRMLS_CC); } + T_VARIABLE '{' getter_setter_declaration '}' + | class_variable_declaration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL, CG(access_type) TSRMLS_CC); } | class_variable_declaration ',' T_VARIABLE '=' static_scalar { zend_do_declare_property(&$3, &$5, CG(access_type) TSRMLS_CC); } | T_VARIABLE { zend_do_declare_property(&$1, NULL, CG(access_type) TSRMLS_CC); } | T_VARIABLE '=' static_scalar { zend_do_declare_property(&$1, &$3, CG(access_type) TSRMLS_CC); }
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php