2020-12-14 19:00:42 +03:00
|
|
|
{0 Desugared representation }
|
|
|
|
|
2022-01-02 16:53:51 +03:00
|
|
|
This representation is the second in the compilation chain
|
|
|
|
(see {{: index.html#architecture} Architecture}). Its main difference
|
|
|
|
with {{: surface.html} the surface representation} is that the legislative
|
|
|
|
text has been discarded and all the definitions of each variables have been
|
2020-12-14 19:00:42 +03:00
|
|
|
collected in the same place rather than being scattered across the code base.
|
|
|
|
|
|
|
|
The module describing the abstract syntax tree is:
|
|
|
|
|
|
|
|
{!modules: Desugared.Ast}
|
|
|
|
|
|
|
|
{1 Translation to the scope language}
|
|
|
|
|
|
|
|
Before the translation to the {{: scopelang.html} scope language},
|
|
|
|
{!module: Desugared.Dependency} checks that within
|
2022-01-02 16:53:51 +03:00
|
|
|
a scope, there is no computational circular dependency between the variables
|
2020-12-14 19:00:42 +03:00
|
|
|
of the scope. When the dependency graph is a DAG,
|
2023-06-02 18:17:45 +03:00
|
|
|
{!module:Scopelang.From_desugared} performs a topological ordering to
|
2022-01-02 16:53:51 +03:00
|
|
|
produce an ordered list of the scope definitions compatible with the
|
|
|
|
computation order. All the graph computations are done using the
|
2020-12-14 19:00:42 +03:00
|
|
|
{{:http://ocamlgraph.lri.fr/} Ocamlgraph} library.
|
|
|
|
|
|
|
|
The other important piece of work performed by
|
2023-06-02 18:17:45 +03:00
|
|
|
{!module:Scopelang.From_desugared} is the construction of the default trees
|
2022-08-25 13:09:51 +03:00
|
|
|
(see {!Shared_ast.EDefault}) from the list of prioritized rules.
|
2022-01-19 12:54:16 +03:00
|
|
|
|
|
|
|
Related modules:
|
|
|
|
|
2023-06-02 18:17:45 +03:00
|
|
|
{!modules: Desugared.Dependency Scopelang.From_desugared}
|