The definitive Abstract Syntax Tree (AST).
Serves as the central data structure for parsing, analysis, transformation, and code generation.
-
npm install @je-es/ast
import * as AST from "@je-es/ast";
-
// suppose we want to represent an abstract syntax tree for this statement: pub let mut x: i32 = 42
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) );
-
-
1. @je-es/lexer
3.
@je-es/ast8. @je-es/lsp
-

