Re: [RFC][Discussion] Parser extension API
| From: | Dmitry Stogov | Date: | Thu, 19 Feb 2015 07:22:09 +0000 |
| Subject: | Re: [RFC][Discussion] Parser extension API | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83151@lists.php.net to get a copy of this message | ||
On Thu, Feb 19, 2015 at 8:42 AM, Sara Golemon <pollita@php.net> wrote:
> On Wed, Feb 18, 2015 at 11:22 AM, Dmitry Stogov <dmitry@zend.com> wrote:
> > I think the AST API shouldn't use "public" properties.
> > Using it, we will have to construct the whole tree of objects,
> duplicating
> > information from AST.
> > I would propose SimpleXML approach instead - construct object only for
> > node(s) we currently access.
> >
> > So at first we will construct just single object referring to AST root.
> > Then traversing it we will create and destroy objects for necessary
> nodes.
> >
> I'm not sure if you've seen my astkit extension, but it does this.
>
> https://github.com/sgolemon/astkit
>
I didn't see it before, and took just a quick look, but I like it.
Any special reason, why you didn't implement ArrayAccess interface for
children access?
For me it would look natural.
Thanks. Dmitry.
>
> -Sara
>