Pull in zend parser sources, doctored up
Summary:
Pulling in the parser and lexer from php-src; it's a bit of a mess since
everything is pretty tightly coupled with the Zend runtime environment; a hacky
header and some shims seem to make things work
Will update with changes; first revision is just the upstream sources that end
up being included
Big changes from upstream:
The lexer (`zend_language_scanner.l`) no longer contains anything that calls
into the Zend compiler.
Support for 32-bit integers is removed; I'm assuming we're on a 64-bit
platform. The Zend implementation goes to great pains to support both.
Support for different script encodings is removed--identifiers and the like
will be placed in the AST in the encoding they are provided to the lexer in.
The expected encoding is anything ASCII-compatible, so likely UTF-8.
`zvals` are reference-counted in the Zend environment; here they are
single-owner, i.e. `release` always deallocates. Memory management isn't such a
big deal since anything allocated in the AST won't be shared, as far as I can
tell. Might revisit this.
Reviewed By: mofarrell
Differential Revision:
D5259408
fbshipit-source-id:
d3f7000dd563b0b1187abff9faf06b6c163117ad