For grammar parser, I used to "play" with Bison which have its pros/cons.
Last week, I noticed on SqLite site that the engine is done with another grammar parser: Lemon
Sounds great after reading the thin documentation.
Do you have some feedback about this parser?
Cannot really see pertinent information on Google and Wikipedia (just a few examples, same tutorials) It doesn't seem very popular. (there is no lemon tag in Stack Overflow [ed: there is now :P])
Yes, technically, but not a very strong one! The source of electric energy in this demonstration is the combination of copper and zinc strips in the citric acid of the lemon. The citric acid of the lemon reacts with the zinc and loosens electrons.
The advantages to a lemon battery is that it could be a renewable resource and a power source that does not pollute the environment but instead is biodegradable in origin. We can measure the conductivity of a lemon or any citric fruit with a voltmeter, zinc, and conductive material.
The electrolyte in our lemon battery is lemon juice. Just like regular batteries, it contains acid. Acid attacks the zinc atoms, and some change into positively charged ions (charged atoms that have an unequal number of electrons or protons). An electric current is created between the two metals.
An orange, lemon or lime can act as a battery, and while a single one might not generate enough voltage to illuminate an LED bulb, several wired in series will. Citrus fruits can do this because they contain citric acid, an electrolyte that allows electricity to flow.
Reasons we are using Lemon in our firmware project are:
Surely Lemon is not a silver bullet, it has limited area of application. Among disadvantages:
Weigh the pros and cons before making your choice. I've done mine ;-)
Interesting find! I haven't actually used it, so the commentary is based on reading the documentation.
The redesign so that the lexical analysis is done separately from the parsing immediately seems to have merit. In particular, it has the potential to simplify operations such as handling multiple or nested source files. The Lex-based yywrap()
mechanism is less than ideal. That it avoids all global variables and has careful memory allocation and deallocation control should count in its favour (that it allows the choice of allocator and deallocator greatly helps too - at least for the environments where I work, where memory allocation is always an issue).
The rethinking on how the rules are organized and how the terminals are identified is a good idea.
All in all, it looks like a well thought out redesign of Bison.
It is in the public domain according to the referenced web pages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With