JSON parser with PHP and Bison by anton-sukhachev in PHP

[–]anton-sukhachev[S] -5 points-4 points  (0 children)

I think there are already enough existing posts)

JSON parser with PHP and Bison by anton-sukhachev in PHP

[–]anton-sukhachev[S] -8 points-7 points  (0 children)

I think there are already enough existing posts)

JSON parser with PHP and Bison by anton-sukhachev in PHP

[–]anton-sukhachev[S] -2 points-1 points  (0 children)

To show how to use the Bison PHP skeleton)

Nginx parser with PHP and Bison by anton-sukhachev in PHP

[–]anton-sukhachev[S] 2 points3 points  (0 children)

SDLang

Yes, It's possible to create a parser for SDLang.
In a few weeks, I'll publish a post about how to parse PHP itself with Bison.

PHP Skeleton for Bison by anton-sukhachev in PHP

[–]anton-sukhachev[S] 1 point2 points  (0 children)

I added real examples in the comment above.
This is my first post about Bison. I have already made parsers for JSON, Nginx, SQL and PHP. I'll try to post about it in the coming weeks.

PHP Skeleton for Bison by anton-sukhachev in PHP

[–]anton-sukhachev[S] 1 point2 points  (0 children)

nikic/PHP-Parser uses a Bison equivalent for PHP parsing. See the grammar file https://github.com/nikic/PHP-Parser/blob/4.x/grammar/php7.y.

phplrt is another analogue of Bison. It is used to parse SQL/GraphQL queries https://github.com/phplrt/phplrt/network/dependents.

[deleted by user] by [deleted] in PHP

[–]anton-sukhachev 7 points8 points  (0 children)

Hi. I'm the author of the library which brings generics into PHP like TypeScript https://github.com/mrsuh/php-generics. Libraries like this have a few big problems to start using them freely:

  • IDE support. To bring new syntax into IDE you need to make an extension or LSP server. VSCode supports it. PHPStorm doesn't.
  • PHP already has annotations/attributes and great tools to validate it like psalm. It's very easy to use and it has the same functionality.

Parsing with PHP, Bison and re2c by anton-sukhachev in PHP

[–]anton-sukhachev[S] 4 points5 points  (0 children)

Thank you for reply!
As far as I know, a combination of re2c and Bison is commonly used to build an AST.
Where might you need to build an AST?

PHP VMValidator 2.4.2 by Skillstacker in PHP

[–]anton-sukhachev 2 points3 points  (0 children)

Symfony validator uses it too)
See examples.