Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32136 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22271 invoked by uid 1010); 9 Sep 2007 18:48:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22256 invoked from network); 9 Sep 2007 18:48:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2007 18:48:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=nlopess@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=nlopess@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.55.154.25 as permitted sender) X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.25 relay5.ptmail.sapo.pt Linux 2.4/2.6 Received: from [212.55.154.25] ([212.55.154.25:46163] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/54-17175-11044E64 for ; Sun, 09 Sep 2007 14:48:50 -0400 Received: (qmail 2587 invoked from network); 9 Sep 2007 18:48:46 -0000 Received: from unknown (HELO http13) (10.134.35.198) by relay6 with SMTP; 9 Sep 2007 18:48:46 -0000 Received: (qmail 30816 invoked by uid 64140); 9 Sep 2007 18:48:46 -0000 Received: from 82.155.73.43 ([82.155.73.43]) by w13.mail.sapo.pt (Horde MIME library) with HTTP; Sun, 09 Sep 2007 19:48:46 +0100 Message-ID: <20070909194846.ardmd8xsg8owo0kk@w13.mail.sapo.pt> Date: Sun, 09 Sep 2007 19:48:46 +0100 To: Stanislav Malyshev Cc: internals@lists.php.net, andi@php.net, dmitry@php.net References: <20070908121843.21wh7zk5k0g8s8cg@w13.mail.sapo.pt> <46E2E7D6.6090906@zend.com> <20070908195002.i184g0pk0k48gcg8@w13.mail.sapo.pt> <46E2EF4F.2000709@zend.com> In-Reply-To: <46E2EF4F.2000709@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.2-cvs) X-Originating-IP: 82.155.73.43 X-PTMail-Version: 3.1.5 Subject: Re: Re: [PHP-DEV] constant folding optimization From: nlopess@php.net (Nuno Lopes) >> Well we don't support that syntax at this moment. If you are saying >> that we could add support for such syntax.. it does seem a good >> idea, but in that case we would need to modify a few rules of the >> grammar (like adding a const_expr production, and allow >> static_scalar derive it, etc..). > > Right, that's what I had in mind. That doesn't seem to break > anything and allows also a little more freedom. let's see if anyone > objects. I tried implementing this and it seems much more complicated than what I though. I modified the static_scalar rule of the grammar and I got hundreds of reduce/reduce and shift/reduce ambiguities. Ignoring the warnings, well.. didn't work (the parser then couldn't process the run-tests.php script). Nuno P.S.: I already spoted a few more places where we can produce better byte-code (including more simple constant folding).. but one thing at a time :)