forked from indeyets/lemon-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
34 lines (22 loc) · 794 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--
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.