Fork me on GitHub

part of the Shift suite

Shift Code Generator

generates an ECMAScript program from a valid Shift AST


Demo

In this demo, a script is provided, and the formatted code generator output is shown when the pretty button is pressed below. When the minimal button is pressed, a minimal code generator provides the smallest possible output, not including minimizer rewriting.

for( let x ;x> 5;x ++){if (x<3){do { console.log(`${x} < 3`); } while (false)} else { console.log(`${x} >= 3`); }}

Installation

npm install shift-codegen

Usage

import codegen from "shift-codegen";
let programSource = codegen(/* Shift AST */);