ribosomejs
v1.17.9
Published
RIBOSOME [![Build Status](https://travis-ci.org/sustrik/ribosome.svg?branch=master)](https://travis-ci.org/sustrik/ribosome) ========
Downloads
3
Readme
RIBOSOMEJS
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;
}