Lemon (parser generator)

From Wikipedia, the free encyclopedia
Revision as of 21:37, 18 January 2024 by imported>Cornmazes
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description Template:Refimprove Script error: No such module "Infobox".Template:Template otherScript error: No such module "Check for unknown parameters".Template:Main other Lemon is a parser generator, maintained as part of the SQLite project, that generates a look-ahead LR parser (LALR parser) in the programming language C from an input context-free grammar. The generator is quite simple, implemented in one C source file with another file used as a template for output. Lexical analysis is performed externally.

Lemon is similar to the programs Bison and Yacc, but is incompatible with both. The grammar input format is different, 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 memory leaks.

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

Lemon, together with re2c and a re2c wrapper named 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]

OpenFOAM expression evaluation[5] uses a combination of ragel and a version of lemon that has been minimally modified[6] to ease C++ integration without affecting C integration.[7] The parser grammars are augmented with m4 macros.

Notes

Template:Reflist

References

  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".

External links

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. Script error: No such module "citation/CS1".