Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83022 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29349 invoked from network); 18 Feb 2015 06:22:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 06:22:57 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.44 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.44 mail-yh0-f44.google.com Received: from [209.85.213.44] ([209.85.213.44:38120] helo=mail-yh0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/11-18888-0CF24E45 for ; Wed, 18 Feb 2015 01:22:57 -0500 Received: by yhzz6 with SMTP id z6so1633260yhz.5 for ; Tue, 17 Feb 2015 22:22:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=eEuBh6NjUlPBhsO+8v/ySVFVGldqtiWdjzA3e4XsNw4=; b=B5bnyRh2p3wKs1vLjkhYR92WPGHkdUNsHezaIPr5TRwzLbRQmnFD5ehuKBEaULe0pj XDSyKOjcIxnFW4GWiDBmU3tVH+70XSEInD7DEPNQKzGb+v/ePSju+Cdq2NhnM9eXvEFP ENoJmStsFgosgHZWCdU3jVDFX8D4yDh1UqDi34/H082JbQm6T3r1xhF/libChzm4eGeg bx8dvdlhzE/N5IsmhMeIfGRSuaiKcUs7wIIBtE7Cv7wMqYLieq1esUjXKoIoPARXbdao +SspmwdW6yJI2XrSDWUcgRxDsiq9P4ddATtZPgT6uZsftfVxnlyG4JGkdJ9gjFhmWAnl 509Q== X-Gm-Message-State: ALoCoQm3uJtRJwgUkmRtS4ys7EGhyR1KiYY2mf7C7T+DQ9snfDcESLeUWVjE1qb1CbM2u3+qs377dzdgC7By31llCt+7JC5qCBAHxpg0SlLAvWOxG9XN+NMj946bbMou7Wlpb5fA2AhAyaNHSC3se4NTqOyMrvtLZw== MIME-Version: 1.0 X-Received: by 10.220.185.193 with SMTP id cp1mr21457575vcb.80.1424240574363; Tue, 17 Feb 2015 22:22:54 -0800 (PST) Received: by 10.52.74.73 with HTTP; Tue, 17 Feb 2015 22:22:54 -0800 (PST) In-Reply-To: References: Date: Wed, 18 Feb 2015 10:22:54 +0400 Message-ID: To: Alexander Lisachenko , Nikita Popov Cc: PHP internals list Content-Type: multipart/alternative; boundary=089e01538610829697050f56d9f5 Subject: Re: [PHP-DEV] [RFC][Discussion] Parser extension API From: dmitry@zend.com (Dmitry Stogov) --089e01538610829697050f56d9f5 Content-Type: text/plain; charset=UTF-8 Hi, On Tue, Feb 17, 2015 at 2:46 PM, Alexander Lisachenko < lisachenko.it@gmail.com> wrote: > Hello, internals! > > I want to introduce a RFC for providing a userland API for accessing an > Abstract Syntax Tree of the source code and to provide userland parser > hooks for source code modification: > https://wiki.php.net/rfc/parser-extension-api > > Thanks! > The first part, describing https://github.com/nikic/php-ast , looks fine. I see no problems including this extension into PHP-7.0 core distribution. May be even making it required (like ext/reflection). Nikita, what do you think? The second part looks very interesting, however it has some uncovered questions. - API for AST modification - AST validation (someone may insert "break" node in "parameter-list"). If you have enough experience, I would suggest you to try writing an external extension that would implement this idea. If you'll need some modification in PHP core (e.g adding callbacks), we may consider including them in PHP-7.0. Thanks. Dmitry. --089e01538610829697050f56d9f5--