definition of zendparse

php.internals

Ryan McCullagh

8 years ago
I can't find this anywhere after a compile of master. `grep -r -n 'zendparse' *`. I see that there are declarations of zendparse, but there is no definition as far as I can see. How is this happening?
-- Ryan McCullagh ryanmccullagh.com | +1 847-791-4066

Kalle Sommer Nielsen

8 years ago
Hi Ryan 2018-02-25 3:42 GMT+01:00 Ryan McCullagh <me@ryanmccullagh.com>:
> I can't find this anywhere after a compile of master. `grep -r -n 'zendparse' *`. I see that there are declarations of zendparse, but there is no definition as far as I can see. How is this happening?
This comes from the Zend/zend_language_parser.y file in its generated form, the yyparse name is set to zendparse (through #define yyparse zendparse)
-- regards, Kalle Sommer Nielsen kalle@php.net

Ryan McCullagh

8 years ago
It seems that the define is backwards though. ‘#define yyparse zendparse’ still depends on a zendparse symbol. There is no function definition for zendparse. All I can see is yyparse in the generated file. What are your thoughts? Sent from my iPhone

Thomas Punt

8 years ago
Hi!
> It seems that the define is backwards though. ‘#define yyparse zendparse’ still depends on a zendparse symbol. There is no function definition for zendparse. All I can see is yyparse in the generated file. What are your thoughts?
Right, yyparse is aliased to zendparse. yyparse is used for the symbol definition name (instead of zendparse) in the generated parser[1], where it will be replaced with zendparse by the preprocessor. Thanks, Tom [1]: https://gist.github.com/tpunt/c22aea1602594d6cfcc94f801d580241#file-zend_language_parser-c-L4489 <https://gist.github.com/tpunt/c22aea1602594d6cfcc94f801d580241#file-zend_language_parser-c-L4489>