[PHP] [ANNOUNCE] php-grammar: EBNF grammar for PHP 8.5
[email protected] (Alwyn Bester)
| Newsgroups | php.general |
|---|---|
| Organization | Zoclee (Pty) Ltd |
| Message-ID | <[email protected]> |
Hi everyone,
I'd like to make the PHP community aware of a new open-source project
called *php-grammar*.
php-grammar provides versioned EBNF grammars and human-readable
specifications for PHP language syntax, intended primarily for
developers building parsers, language tooling, static analysis tools,
IDE support, formatters, transpilers, and similar projects.
The first completed grammar covers *PHP 8.5*.
The project provides:
* a machine-readable |.ebnf|grammar
* matching human-readable Markdown documentation
* independent grammars for each supported PHP version
* source-backed grammar definitions derived from the PHP parser and
related PHP source
* automated validation and conformance tests
* tooling for navigating and consuming the grammar programmatically
Website:
https://zoclee.com/php-grammar <https://zoclee.com/php-grammar>
GitHub:
https://github.com/zoclee/php-grammar
<https://github.com/zoclee/php-grammar>
The goal is to maintain a practical, openly available EBNF
representation of PHP syntax that can be consumed by third-party
tooling, while keeping each PHP version independently usable rather than
representing versions only as diffs.
php-grammar is an independent community project and is not an official
PHP specification.
I'd particularly appreciate feedback from anyone working on PHP parsers,
static analysis, IDEs, language servers, formatters, or other
syntax-related tooling. If you find grammar discrepancies or areas where
the representation could be more useful to tooling authors, please feel
free to open an issue or discussion on GitHub.
Thanks,
Alwyn