The Lezer Parser System
The problem of parsing structured text has resisted one-size-fits
all solutions for over 60 years. Lezer isn't such a solution either,
but it is a very decent parser generator, especially well
suited for use in code editors.
Lezer (the Dutch word for reader, pronounced like “laser”) provides
loaded to parse code into a non-abstract syntax tree. This tree can
then be used to do highlighting and basic semantic analysis.
use a parser generator tool to convert it into an efficient
Lezer can quickly re-parse documents that were slightly changed
compared to a previously parsed version by reusing nodes from the
Being designed for the code editor use case, the parser is
equipped with strategies for recovering from syntax errors, and
can produce a tree for any input.
By using the LR parsing algorithm, an efficient tokenizer, and
data structures optimized for locality, the parser can process its
input at a very respectable speed.
The parser generator produces compact parse table files which,
along with the run-time library, are all you need to ship to
The syntax tree representation is designed to be small in
memory, packing groups of smaller nodes together in a
representation using 64 bits per node.
source under an MIT license. It is maintained by
the CodeMirror team.
Lezer is being developed
Contributions are welcome.
Discussing the project, or asking questions, is best done on
Bugs should be reported through
tracker. We aim to be an inclusive, welcoming community. To make
that explicit, we have
a code of
conduct that applies to communication around the project.