Skip to content

khelle/redscript-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RedScript JISON Compiler

Redscript Compatible

Description

RedScript was created to provide a first class functional experience in the browser. This repository contains a compiler for it written in JISON, which is essentially a clone of the parser generator Bison (thus Yacc,) but in JavaScript.

Compiling

jison redscript.jison

Usage

As Command

node redscript.js input.rds > output.js

As Module

var parser = require("./redscript").parser;

function exec (input) {
    return parser.parse(input);
}

// input is String variable with RedScript code, output is translated code to JavaScript
var output = exec(input);

As Website Widget

<script src="./redscript.js"></script>
<script>
parser.parse(input);
</script>

Bibliography

License

This repository is open-sourced software licensed under the MIT license.