# [Soc 2006] phpAspect

- Thread: https://externals.io/message/23813
- Original archive: https://news-web.php.net/php.internals/23813
- Started by William Candillon on 2006-05-31T06:45:35+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #23813 — William Candillon — 2006-05-31T06:45:35+00:00

URL: https://externals.io/message/23813#23813

Hello everyone,

My name is William Candillon. I'm developing the phpAspect project
(http://phpaspect.org) for the Google Summer of Code 2006.
My mentor is Sebastian Bergmann.

Phpaspect is a PHP language extension which implements aspect-oriented
programming. The phpaspect compiler weaves aspects implementing
crosscutting concerns into PHP source code. The weaving process is
static (before source code execution) and based on Lex & Yacc
analysis. The woven PHP source code can be executed with any PHP 5
version.

This new version  that I'm writing for the google soc is written in C
and serialize automatically a PHP source code into an XML AST.
The aspects files are also serialized from PHP to XML AST.
Then I'll apply XSLT style sheet to the representation XML of the
aspects in order to generate a final XSLT style sheet which will
perform source code transformations on the business logic:
http://phpaspect.org/wiki/lib/exe/fetch.php?w=700&h=274&cache=cache&media=weaver2.png

Adopting this new approach will result in the following benefits. The
lexical and syntax analysis will be independent of any PHP version.
Existing XML tools like XSTL or XPath engine could be heavily reused
to make the implementation significantly shorter and improve weaving
performances.
Finally, it will introduce more flexibility in terms of the aspect
language. For example, I could use the power of Xpath expression to
introduce more logical operators in the aspect syntax. With this
architecture, the compatibility with PHP 6 and features like
namespaces will be very easy to implement.

I am open to any suggestions or comments about this project and the
implementing idea.

Best regards,

William

-- 
William Candillon
Telecom Lille Student
E-mail: wcandillon@elv.enic.fr
Tel: +33(0) 6 67 99 13 16
CV: http://wcandillon.netcv.org
Resume: http://wcandillon.en.netcv.org

---

## #23816 — Sebastian Bergmann — 2006-05-31T07:46:54+00:00

URL: https://externals.io/message/23813#23816 · In reply to: #23813

William Candillon wrote:
> I am open to any suggestions or comments about this project and the
> implementing idea.

 One idea that I have is to make the PHP->AST and AST->PHP parts usable
 outside the scope of PHPAspect. This would, for instance, give tool
 developers and IDE vendors a common base to build on, for instance
 refactoring tools.

-- 
Sebastian Bergmann                      http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
