2012-01-19 48 views

回答

9

你可能想看看在yacc grammar PHP uses internally。我知道,這不是EBNF,但也許它可以滿足您的需求。您可能還需要查看re2c lexer definition

+0

語法鏈接似乎已破,但我認爲該文件也在[GitHub]上(https://github.com/php/php-src /blob/master/Zend/zend_language_parser.y)。 –

+0

@FabianLauer謝謝,鏈接已更新。 LXR再次喜怒無常... – NikiC

0

的ANTLR3語法可她:

http://code.google.com/p/phpparser/ 

上面的語法不與ANTLR4,目前ANTLR版本兼容。