Skip to content

01BTC10/ribosomejs

 
 

Repository files navigation

RIBOSOMEJS Build Status

A simple generic code generation tool.

Forked from here This repository include only the javascript binary, javascript tests and javascript examples. The main goal of this fork is to add a javascript only npm package.

Installation

$ npm install -g ribosomejs

Usage

$ ribosomejs examples/errors.dna

Example

This example uses JavaScript as the control language:

readysteady.js.dna:

.#include <stdio.h>
.
.int main() {
var i;
for (i=3; i>0; i--) {
.    printf("@{i}!\n");
}
.    printf("Go!\n");
.    return 0;
.}

To generate the code do the following:

$ ribosome.js readysteady.js.dna

The script produces the following output (which happens to be a C program):

#include <stdio.h>

int main() {
    printf("3!\n");
    printf("2!\n");
    printf("1!\n");
    printf("Go!\n");
    return 0;
}

Original documentation.

About

Simple code generator

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 88.7%
  • Vim Script 8.8%
  • Shell 1.4%
  • Makefile 1.1%