⚠️ Morgana is still in early stage. ⚠️
# Morgana Morgana is a declarative language that allows users to define the datatypes of the AST of a language together with their syntax rules. ## Why? Most compilers generator tend to overlook the aspect of the generation of the AST, which can be as tedious as writing a parser or a lexer. This formalism aims at providing a single declarative specification that cleanly and concisely allows to represent the nodes of the AST of a language together with their introduction rules, that is, their syntax rules. Once a specification is in place, the user will be able to generate automatically code for the AST, lexer, parser, pretty printer and hopefully also a skeleton for the LSP. Morgana _itself_ is not a CLI or a library, Morgana is the formalism; ideally, various adoption of the format will allow more generators for spurious objectives. Consider the following _Morg_. ``` -- Simple arithmetic expressions ast Expressions node Expression := | Num : u32 | Mul : Expression '*' Expression | Div : Expression '/' Expression | Sum : Expression '+' Expression | Min : Expression '-' Expression ``` Analysing the Morg, a Rust generator (for example) can generate an AST in a form such as ```rust pub enum Expression { Num(u32), Mul(Box