Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wez/lemon-php
A PHP parser generator, based on the lemon parser generator tool. lemon-php requires a C compiler to build, and this will generate pure-PHP parsers.
https://github.com/wez/lemon-php
Last synced: about 1 month ago
JSON representation
A PHP parser generator, based on the lemon parser generator tool. lemon-php requires a C compiler to build, and this will generate pure-PHP parsers.
- Host: GitHub
- URL: https://github.com/wez/lemon-php
- Owner: wez
- License: other
- Created: 2010-10-23T14:49:30.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-04-12T23:57:47.000Z (almost 13 years ago)
- Last Synced: 2024-12-27T15:52:40.858Z (about 2 months ago)
- Language: C
- Homepage: http://wezfurlong.org/blog/2006/nov/parser-and-lexer-generators-for-php
- Size: 386 KB
- Stars: 73
- Watchers: 5
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
Awesome Lists containing this project
- AwesomeCompiler - lemon-php
README
(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.yThis 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 packagewhile ($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.htmlEnjoy!
--Wez.