Hi,
I always heard that people that uses SitePoint forums are the best PHP developers over the web... maybe you can help me then.
The question is quite simple: I'm looking for a complete PHP Grammar.
Researching over web... I found one: http://www.mare.ee/indrek/sablecc/php4.sablecc3.txt
But it does not follow correctly the grammar nomenclature and it's a little bit messy.
I'm more confortable with this kind of grammar definition (last 2 pages): http://www.dc.ufscar.br/~jose/course...20Language.pdf
I'm interested to find more resources, to make a comparison and start my own compiler. Currently, all my compiler job is done using a hack, that parses each token returned by token_get_all and after the whole process generates a cached file, to not recompile again at each execution (smart cache technique).
Sounds weird, but my approach stands for a PHP Grammar, that I'll build the AST using PHP to parse PHP code and compile into PHP. The usage of this compiler will be my currently package, Transparent PHP AOP (available at: http://www.phpclasses.org/browse/package/3215.html), to make it more flexible and allow on schedule things, such as programming by contract. I have a tight schedule and I do not have enough time to build my own grammar version for it.
If possible, I'd like to listen from you of URLs or even your own notes about it.
I do not want to use 3rd party code, so please do not refer me to existent generic compilers. I just want the PHP Grammar.
Best regards,
Guilherme Blanco
MSN: guilhermeblanco#hotmail.com
GTalk: guilhermeblanco
São Carlos - SP/Brazil





Bookmarks