Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88453 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32632 invoked from network); 23 Sep 2015 20:35:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2015 20:35:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=codekestrel@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=codekestrel@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.212.173 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:36693] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/C2-13106-22D03065 for ; Wed, 23 Sep 2015 16:35:46 -0400 Received: by wicgb1 with SMTP id gb1so222793686wic.1 for ; Wed, 23 Sep 2015 13:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=kTbwuGQKgIpWKvu6k9h2g7H3YiMlzIrGBLdyKHQdg50=; b=YCVq+a6HdxiS9r0Fjw+yFBGicE91aE1atUoodCJgfasJ2tiE4spfgNZ9eqiiZLDXmD +3YUw7w4gS4TzSrWSqkVQjQ9ZPk0qpAa7KS4iCnLQ3oOVQSLoHMmuNIXTJoRwexgE2uo FFiIC/jmRSdMNwY9UB95+5EbgxdZleTt0N0BAS0bi1vhwnma4dWAof9nZKcWu+Ki02KF 3a4C1j1tUkMKkzs4MpYkt/1snrZvqLO1zHqrcAzaANQnaDMLfDd10h9pNnI8no7hCjCX wYDVRueX5+qD2EiUiCjY81TCffeKqPFOqFiV2/wVoxNQy1pwjsnHex+jnAQh9Tii1rkV gFuQ== MIME-Version: 1.0 X-Received: by 10.180.23.231 with SMTP id p7mr6109574wif.30.1443040542810; Wed, 23 Sep 2015 13:35:42 -0700 (PDT) Received: by 10.27.104.197 with HTTP; Wed, 23 Sep 2015 13:35:42 -0700 (PDT) Date: Wed, 23 Sep 2015 21:35:42 +0100 Message-ID: To: internals@lists.php.net, mail@dasprids.de Content-Type: multipart/alternative; boundary=089e010d891cf368830520700e57 Subject: Re: Implementing Generics, and none scalar default properties. From: codekestrel@googlemail.com (Dominic Grostate) --089e010d891cf368830520700e57 Content-Type: text/plain; charset=UTF-8 > So far I only wrote up the RFC and kicked off a discussion here on the > mailing list about it. As I wrote several times already, I'd appreciate > someone tackling the implementation side to get a patch working! > Cheers, Hi Ben, I think there is something wrong with how I set up my ML subscription, I had to go to the newgroup to get this as it didn't show up in my inbox. Anyway, ye, I'm having a crack at it, although slow since it my first go at php-src. I've run into a bit of a problem though. I managed to get the syntax working for class declarations: class_declaration_statement: class_modifiers T_CLASS { $$ = CG(zend_lineno); } T_STRING generics extends_from implements_list backup_doc_comment '{' class_statement_list '}' { $$ = zend_ast_create_decl(ZEND_AST_CLASS, $1, $3, $8, zend_ast_get_str($4), $6, $7, $10, $5); } | T_CLASS { $$ = CG(zend_lineno); } T_STRING generics extends_from implements_list backup_doc_comment '{' class_statement_list '}' { $$ = zend_ast_create_decl(ZEND_AST_CLASS, 0, $2, $7, zend_ast_get_str($3), $5, $6, $9, $4); } ; class SampleMap { } So far so good, but function calls are more complicated. I'm getting error: shift/reduce conflicts My guess is this due to the following scenario: (10); While the intention might be to call a "function" const_a with the generic type const_b and 10 as an argument, it is also identical to a comparison expression. The example above throws: Parse error: syntax error, unexpected '>' since the expression is erroneous , so should that allowa generic type to be included to the syntax? --089e010d891cf368830520700e57--