Files
langkit/doc/introduction.rst
Pierre-Marie de Rodat 5cdce44320 Doc: refresh the tutorial
Switch the language spec to Lkt/lkm, the interpreter to Python3 and
recent generated Python APIs, and update explanations to accomodate the
evolution of Langkit in general.
2025-02-14 15:03:35 +01:00

31 lines
1.0 KiB
ReStructuredText

************
Introduction
************
Langkit is a tool whose purpose is to ease the development of libraries to
analyze program source files. It makes it super-easy to create combined
lexers, parsers and semantic analyzers as libraries that have C, Ada and
Python bindings.
Architecture
============
Langkit is a kind of compiler:
* Its users are expected to write a language specification in the Lkt language,
a domain-specific language created for the Langkit project. Lkt sources
define a lexer, a grammar, define nodes/fields for the parse tree and
optionally use a functional language to implement semantic analysis.
* Langkit compiles this specification into an analysis library in Ada with C
and Python bindings.
* The generated library can be shipped to programmers that intend to write
analysis tools such as code editors, code checkers, etc. These will not be
aware of Langkit at all, except for common runtime libraries
(``Langkit_Support`` in Ada, for instance).
.. image:: architecture.svg
:align: center