Re: Lemon parser generator
| From: | Zeev Suraski | Date: | Sat, 17 Jul 1999 23:42:00 +0000 |
| Subject: | Re: Lemon parser generator | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-8667@lists.php.net to get a copy of this message | ||
At 23:27 17/07/99 , Rasmus Lerdorf wrote:
The Lemon program is an LALR(1) parser generator. It takes a context free grammar and converts it into a subroutine that will parse a file using that grammar. Lemon is similar to the much more famous programs "YACC" and "BISON". But lemon is not compatible with either yacc or bison. There are several important differences: Lemon uses a different grammar syntax which is less prone to programming errors. Lemon generates a parser that is faster than Yacc or Bison parsers. The parser generated by Lemon is both re-entrant and thread-safe. Lemon includes the concept of a non-terminal destructor, which makes it much easier to write a parser that does not leak memory. http://www.hwaci.com/sw/lemon/index.html Looks interesting, but from very brief look, I see: ** This file contains all sources (including headers) to the LEMON ** LALR(1) parser generator. The sources have been combined into a ** single file to make it easy to include LEMON as part of another ** program. ** This program is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public ** License as published by the Free Software Foundation; either ** version 2 of the License, or (at your option) any later version. It looks as though you need to include at least a piece of it in your code and this piece is GPL'ed which pretty much rules it out.Why are we looking for bison alternatives? The performance of the parser is now really not an issue. As long as it's not dog slow (and bison isn't, at all), it's good enough. We don't leak any memory either :) Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il