ircmaxell / PHP-Yacc

A PHP port of kmyacc
Other
152 stars 14 forks source link

Running example code #10

Open KoulSlou opened 5 years ago

KoulSlou commented 5 years ago

If I want to see how code in examples is working, what Lexer class should I use?

I tried to run 00-basic-usage example with Lexer from nikic/php-parser, but I keep getting this error:

Fatal error: Uncaught RangeException: The lexer returned an invalid token (id=317, value=1) in /development/PHP-Yacc/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php:204
unkind commented 4 years ago

I think this package is too bugged (examples, at least, they are broken). If you want to rebuild exactly PhpParser, better clone https://github.com/nikic/PHP-Parser/tree/master/grammar, that one should work fine (rebuildParsers.php).