Files
langkit/doc/extension_points.rst
Pierre-Marie de Rodat ffd099105a Automatically add source files in extensions/src to the generated lib
Change-Id: Idd318258c2168d6886e4dd5838af869349d182fb
TN: P518-014
2016-07-01 17:59:38 +02:00

34 lines
1.3 KiB
ReStructuredText

****************
Extension points
****************
Langkit tries to provide as much functionality as possible as part of the DSL.
Ideally, you could specify every feature you want in your library via the DSL.
However, for various reasons (time, money, scope, etc.), this goal will remain
an ideal that we want to reach, while being aware of the fact that we probably
won't ever reach it.
To provide a pragmatic way for the user to be able to implement every
functionality he needs *as part of the library itself*, we added the extension
points feature.
High level overview
===================
At the top level directory of your language definition, Langkit will search for
an ``extension`` directory, and will search for extensions inside it. It will
use the directory structure and file names to determine the purpose of each
extension file. Moreover, all files in the special ``extension/src`` directory
will be included in the generated library.
Existing extensions points
==========================
* ``extensions/support``: Every file in this folder needs to be a valid ada spec
+ body pair.
* ``extensions/nodes/$ast_node_name/components``: For every subclass of ASTNode
that you created in your project, you can add this file to add components to
the ast node subclass record.