Defines the central Abstract Syntax Tree (AST) used for analysis, transformation, and code generation.
npm install @je-es/ast

The definitive Abstract Syntax Tree (AST).
Serves as the central data structure for parsing, analysis, transformation, and code generation.

- ### Install
``bash`
npm install @je-es/ast
`ts`
import * as AST from "@je-es/ast";
- ### Usage
`rust`
// suppose we want to represent an abstract syntax tree for this statement:
pub let mut x: i32 = 42
`ts
const my_let_stmt = AST.StmtNode.asLet(
// span
{ start: 0, end: 23 },
// Public/Static/Private
{
kind: 'Public',
span: { start: 0, end: 3 },
}
// Comptime/Runtime
{
kind: 'Runtime', // default
// span: undefined,
}
// Mutable/Immutable
{
kind: 'Mutable',
span: { start: 8, end: 11 },
}
// ident
AST.IdentNode.create({ start: 12, end: 13 }, 'x'),
// type
AST.TypeNode.asSigned({ start: 15, end: 18 }, 'i32'),
// init
AST.ExprNode.asInteger({ start: 21, end: 23 }, 42)
);
`
- ### Related
- #### kemet-lang (MVP)
> #### 1. @je-es/lexer
> #### 2. @je-es/parser
> #### 3. @je-es/ast`
> #### 4. @je-es/syntax
> #### 5. @je-es/ast-analyzer
> #### 6. @je-es/codegen
> #### 7. @je-es/project
> #### 8. @je-es/lsp
> #### 9. @je-es/compiler
