1. Wez Furlong
  2. lemon-php

Source

lemon-php /

Filename Size Date modified Message
1.1 KB
add copying and readme information
618 B
remove dist script, remove stale email address
c.y
11.2 KB
add objc.y
143.2 KB
Fixed some bugs.
24.2 KB
import lemon.c 1.40 and lempar.c 1.22 from sqlite.org
21.4 KB
Fixed some bugs.
15.6 KB
add objc.y
(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.