Lemon Parser Generator

Lemon Parser GeneratorDeveloper(s)| D. Richard Hipp

|

Written in| C
Operating system| Cross-platform
Type| Parser generator
License| Public domain
Website| www.hwaci.com/sw/lemon/

Lemon is a parser generator, maintained as part of the SQLite project, that generates an LALR parser in the C programming language from an input context-free grammar. The generator is quite simple, implemented in a single C source file with another file used as a template for output. Lexical analysis is performed externally.

Lemon is similar to bison and yacc; however it is not compatible with these programs. The grammar input format is different, so as to help prevent common coding errors. Other distinctive features include a reentrant, thread-safe output parser, and the concept of "non-terminal destructors" that try to make it easier to avoid leaking memory.

SQLite uses Lemon with a hand-coded tokenizer to parse SQL strings.

Lemon, in combination with re2c and a re2c wrapper called Perplex, are used[1][2][3] in BRL-CAD as platform-agnostic and easily compilable alternatives to Flex and Bison. This combination is also used with STEPcode.[4]

## Notes

1. ↑ http://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/misc/tools/lemon/
2. ↑ http://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/misc/tools/re2c/
3. ↑ http://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/misc/tools/perplex/
4. ↑ http://stepcode.org/docs/build_process/

## References

* "The LEMON Parser Generator". http://www.hwaci.com/sw/lemon/. Retrieved 2008-12-24.
* "Architecture of SQLite". 2008-11-01. http://www.sqlite.org/arch.html. Retrieved 2008-12-24.

## External links

* The Lemon Parser Generator
* Calculator with Lemon and Lex in C++ Example
* Understanding Lemon generated Parser
* Lemon, bundled with Re2c and Perplex

0.00

(0 votes)

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Lemon_Parser_Generator&oldid=798180"