shinobu/lemon-php

Parser Generator for PHP

Installs: 185

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 14

Language:C

dev-master 2016-12-18 18:27 UTC

This package is not auto-updated.

Last update: 2024-06-08 18:00:09 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.