EBNF grammar definitions for PHP?

Azmisov picture Azmisov · Jan 19, 2012 · Viewed 9.3k times · Source

I am wondering if someone has compiled an EBNF for PHP somewhere. I found both this site and this site. Both seem like they are incomplete, though. This question is very similar, but it's a year old. I would like to know if there has been any progress made.

Answer

NikiC picture NikiC · Jan 19, 2012

You may want to have a look at the yacc grammar PHP uses internally. I know, it's not EBNF, but maybe it's okay for your needs.

You may also want to look at the re2c lexer definition.