Dear internals
After enviously looking at pythons grammar
(http://docs.python.org/dev/reference/grammar.html) I keep feeling
that PHP is missing out on a lot of interesting meta projects by not
having an official EBNF.Building your own PHP parser is very hard and is PhD (Paul Biggar:)
level stuff if you wan't to get all the edge cases right. Having the
official EBNF would make this easier.I know there is a lot of historical reasons for this and that creating
and maintaing said EBNF is a very serious task, one that is maybe too
big for a non-paying open source project.But still I have to ask if I'm the only one thinking about this or is
there something I'm being completely ignorant about?Happy newyear!
Rune Kaagaard
I see this post is already 15 years old, but having a well defined EBNF
grammar for PHP would invaluable for 3rd party tool designers.
We have just recently completed the first EBNF mapping for PHP 8.5 from
source code, and plan to also map all future versions of PHP. I
If there is enough interest we will also consider mapping older versions
of PHP.
You can browse, and download the EBNF in machine-readable and human
reabile format from this website:
https://zoclee.com/php-grammar
or from the GitHub repository at
https://github.com/zoclee/php-grammar
--
{Zoclee}
Kind regards,
Alwyn Bester