Ryan McCullagh
[PHP-DEV] definition of zendparse
February 25, 2018 03:50AM
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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Kalle Sommer Nielsen
Re: [PHP-DEV] definition of zendparse
February 25, 2018 04:10AM
Hi Ryan

2018-02-25 3:42 GMT+01:00 Ryan McCullagh <[email protected]>:
> 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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Ryan McCullagh
Re: [PHP-DEV] definition of zendparse
February 26, 2018 08:30PM
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

> On Feb 24, 2018, at 9:02 PM, Kalle Sommer Nielsen <[email protected]> wrote:
>
> Hi Ryan
>
> 2018-02-25 3:42 GMT+01:00 Ryan McCullagh <[email protected]>:
>> 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


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Thomas Punt
Re: [PHP-DEV] definition of zendparse
February 26, 2018 08:50PM
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>;
Sorry, only registered users may post in this forum.

Click here to login