Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82949 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90450 invoked from network); 17 Feb 2015 12:16:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 12:16:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.51 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 74.125.82.51 mail-wg0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:45574] helo=mail-wg0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/01-19463-41133E45 for ; Tue, 17 Feb 2015 07:16:22 -0500 Received: by mail-wg0-f51.google.com with SMTP id y19so34880975wgg.10 for ; Tue, 17 Feb 2015 04:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=S6FpoLQ5Qb0VoX0wHBU5E6mhNGQA5XOHpbgkEhUV6AI=; b=b1bxsRznZfOxOtE0Kmi+djsG8pkGchxgEPZxG0KAJGI1Rf8s5fdmQTXObrZrAihAo+ hyI/jQDEufuAhrV7q5WnC2m8ZvdOe+fAzxFWWkR2aN5ugn/+/LoYO8F5p20AXS2nEv/m VLeFxXiJra5W7WSBCzibfyHFvkObnhO+H6lsEHK6PLWv1Up7wAeb2XLWVY+XHF0v7lVB IHhC2U7oK57mrsnpMdJqM6sHEL2Zp6UccXsuCJWX9KnCXmysF/nMnHkJSTcMf/9T3C5E 6PjvOzVfUX5e2pEdRJHo9Izdg6wxtsmp/use0yflSB1Js1Ol4SizNK8Ip8BGJaDJ0/OU liTw== MIME-Version: 1.0 X-Received: by 10.181.13.14 with SMTP id eu14mr44857581wid.2.1424175377549; Tue, 17 Feb 2015 04:16:17 -0800 (PST) Received: by 10.194.154.229 with HTTP; Tue, 17 Feb 2015 04:16:17 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Feb 2015 15:16:17 +0300 Message-ID: To: Leigh Cc: PHP internals list Content-Type: multipart/alternative; boundary=f46d04388eb77a154b050f47abec Subject: Re: [PHP-DEV] [RFC][Discussion] Parser extension API From: lisachenko.it@gmail.com (Alexander Lisachenko) --f46d04388eb77a154b050f47abec Content-Type: text/plain; charset=UTF-8 2015-02-17 15:06 GMT+03:00 Leigh : > Does the AST provided by the internal parser provide all of the > information required to be able to turn it back into source code? > > Yes, this should be possible, via zend_emit_op*() and zend_compile*() 2015-02-17 15:06 GMT+03:00 Leigh : > Re: Extending the parser from PHP userland. > > This I don't like so much. > > To be honest I hoped this would be an API to extend the parser from > PHP extensions :) I think letting userland fiddle directly with the > compilation process is just asking for trouble. > Expected reaction ) However, it would be nice to have such API on userland too (on engine level this can be a hook too). This will give an instrument for building custom things on user side, but will keep PHP engine clear from a lot of stuff, which can be implemented by users. Nice example is Design-By-Contract validation, it can be easily done via parser hooks. --f46d04388eb77a154b050f47abec--