PHP-Yacc icon indicating copy to clipboard operation
PHP-Yacc copied to clipboard

Fix php7 grammar and rebuilt parser

Open TiMESPLiNTER opened this issue 7 years ago • 2 comments

PR for issue #8

grammar.y is tmp_grammar.y (php7) from PHP-Parser 3.1.4 kmyacc version: 4.1.4 OS: MacOS

I rebuild the parser based on the correct grammar (tmp_grammar.y with all the fixed PHP syntax stuff). What is weird is that the diff is pretty huge respecting the fact that php-yacc und kmyacc should generate more or less the same output. Maybe I used another kmyacc version to generate the code?

Or has anybody an idea what went wrong?

TiMESPLiNTER avatar Feb 25 '18 07:02 TiMESPLiNTER

Part of this issue here is that not all the debug output was printed. I've committed https://github.com/ircmaxell/PHP-Yacc/commit/7eb75d16ac1b0fda06739adfb525e9a538e5294b to fix that issue. That will probably get rid of large parts of y.diff.

However, I'm not sure where the parser.diff is coming from. Which operating system are you using? I think I've had different results on Windows and on Linux.

nikic avatar Feb 28 '18 12:02 nikic

To get the full debug output, it's also necessary to build kmyacc with -DDEBUG=1.

nikic avatar Feb 28 '18 13:02 nikic