Shortly: Lemon is a LALR(1) parser generator, similar to yacc, but is
much simpler. Also it has few neat features, like:
- It is thread-safe and re-entrant
- Tokenizer calls the parser, instead of parser calls tokenizer
(the opposite of yacc/bison)
- Uses no global variables, allows to run multiple parsers
simultaneously
- Auto-generation of token symbol constants (yacc/bison requires a
list)
- No need to count grammar symbols, they can be named (nice names
instead of $1 $2 $3)
- etc..
It is developed as a part of the sqlite project. The generator code is
quite horrible, but it works and I believe it is very solid. Of course
it has few drawbacks, but.. :)
Lemon homepage:
http://www.hwaci.com/sw/lemon
Go port:
http://github.com/nsf/golemon
I don't know whether I will support it or not, but at least if someone
likes lemon (like me), he/she has a decent (I hope so) base for his/her
experiments now.
I've successfully compiled and executed the very beginning of this
tutorial:
http://freshmeat.net/articles/lemon-parser-generator-tutorial
Hopefully, I will have enough enthusiasm to fix some of the obvious
issues (there are some).
Feel free to ask any questions regarding this port via email, here on
the ML or in the IRC (@freenode, my nickname is nsf).
P.S.
Also maybe someone is interested in that too, recently Go support
was added to the Ragel State Machine Compiler (available in trunk):
http://www.complang.org/ragel/
Lemon and Ragel are my favourite tools to write parsers, instead of lex
and yacc.
That's all for today. :)