Pull in zend parser sources, doctored up
commit0d80144dfdfad7a2ea9e5f478e890f38c439dd2d
authorJoseph Griego <jgriego@fb.com>
Mon, 19 Jun 2017 22:06:16 +0000 (19 15:06 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 19 Jun 2017 22:13:08 +0000 (19 15:13 -0700)
tree5da0459420c508c4e122a1fdfb76e4fe585fecf2
parent284d98459c582af4f0de4ecbc2633aa894c859ba
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
25 files changed:
hphp/php7/zend/zend.cpp [new file with mode: 0644]
hphp/php7/zend/zend.h [new file with mode: 0644]
hphp/php7/zend/zend_arena.h [new file with mode: 0644]
hphp/php7/zend/zend_ast.c [new file with mode: 0644]
hphp/php7/zend/zend_ast.h [new file with mode: 0644]
hphp/php7/zend/zend_errors.h [new file with mode: 0644]
hphp/php7/zend/zend_language_parser.c [new file with mode: 0644]
hphp/php7/zend/zend_language_parser.h [new file with mode: 0644]
hphp/php7/zend/zend_language_parser.y [new file with mode: 0644]
hphp/php7/zend/zend_language_scanner.c [new file with mode: 0644]
hphp/php7/zend/zend_language_scanner.h [new file with mode: 0644]
hphp/php7/zend/zend_language_scanner.l [new file with mode: 0644]
hphp/php7/zend/zend_language_scanner_defs.h [new file with mode: 0644]
hphp/php7/zend/zend_long.h [new file with mode: 0644]
hphp/php7/zend/zend_multiply.h [new file with mode: 0644]
hphp/php7/zend/zend_portability.h [new file with mode: 0644]
hphp/php7/zend/zend_ptr_stack.c [new file with mode: 0644]
hphp/php7/zend/zend_ptr_stack.h [new file with mode: 0644]
hphp/php7/zend/zend_stack.c [new file with mode: 0644]
hphp/php7/zend/zend_stack.h [new file with mode: 0644]
hphp/php7/zend/zend_strtod.c [new file with mode: 0644]
hphp/php7/zend/zend_strtod.h [new file with mode: 0644]
hphp/php7/zend/zend_strtod_int.h [new file with mode: 0644]
hphp/php7/zend/zend_types.h [new file with mode: 0644]
hphp/php7/zend/zend_vm_opcodes.h [new file with mode: 0644]