Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82947 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87115 invoked from network); 17 Feb 2015 12:06:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 12:06:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.176 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 209.85.220.176 mail-vc0-f176.google.com Received: from [209.85.220.176] ([209.85.220.176:56234] helo=mail-vc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/50-19463-CAE23E45 for ; Tue, 17 Feb 2015 07:06:05 -0500 Received: by mail-vc0-f176.google.com with SMTP id la4so12327530vcb.7 for ; Tue, 17 Feb 2015 04:06:01 -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=u70f/EcMG9wDOpwc94RVakhX7zo20y5jfWVjQ0LNXVg=; b=XKywJv21llXQrAeG8Ayvl/d1XGxIq59GqrK1xqNvL6P4qdEclGCmVa1g6XKoh/W89N vRJeNZ+P8MfurnwMVknieMbdeA01eA2KgeGEKuk4A0k59rjRGHtKQMnUydkGbXqyo0fd MXyM+tLN0tRbwFtX5RD/BpDSeQw+m3OLQWw1X1FnrTMxSuoIGe2Z8pwrCI2gUMWCsXXA I9aRTsGfgYu03v046mbyP2fPGfMeR9qkI/0rTZPlQwTnvdcVUj/V58L7L6ZdfvFlIx/Q gTLxPSpGBuYzDUg3pvS+5DDnSx2EOVmho8yQO35HZxjESsfA4XeqLvIYrVduR/Ic9pnD XbzQ== MIME-Version: 1.0 X-Received: by 10.52.103.75 with SMTP id fu11mr15854077vdb.5.1424174761384; Tue, 17 Feb 2015 04:06:01 -0800 (PST) Received: by 10.52.179.168 with HTTP; Tue, 17 Feb 2015 04:06:01 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Feb 2015 12:06:01 +0000 Message-ID: To: Alexander Lisachenko Cc: PHP internals list Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][Discussion] Parser extension API From: leight@gmail.com (Leigh) On 17 February 2015 at 11:46, Alexander Lisachenko 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! Re: Userland representation of AST. I use Nikita's PHP-Parser for static analysis already, so my first reaction is that I like the idea of being able to obtain the canonical AST from the engine, that is automatically updated as new features are added. Does the AST provided by the internal parser provide all of the information required to be able to turn it back into source code? 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.