shinobu / lemon-php
Parser Generator for PHP
dev-master
2016-12-18 18:27 UTC
This package is not auto-updated.
Last update: 2025-04-26 22:54:07 UTC
README
-- This Fork is made for use on https://github.com/shinobu/PHP-SparqlParser It is based on https://github.com/indeyets/lemon-php Fork from https://github.com/wez/lemon-php/ -- (for licensing and copyright information, see COPYING) This is an adaptation of lemon that optionally emits PHP code to implement a parser for the grammar described in a .y file. Usage: cc -o lemon lemon.c lemon -LPHP my.y This will output my.php, which contains a PHP class that implements your parser. Usage is along the lines of: $P = new ParseParser(); $S = new Yylex(); // you can get one of these using the JLexPHP package while ($t = $S->yylex()) { $P->Parse($t->type, $t); } $P->Parse(0); You can find out more about the lemon syntax from: http://www.hwaci.com/sw/lemon/lemon.html Enjoy! --Wez.