0.12.0 • Published 5 months ago

stepcode v0.12.0

Weekly downloads
-
License
-
Repository
github
Last release
5 months ago

StepCode

StepCode is a pseudo-code language for writing step-by-step instructions. It is designed to be easy to read and write, and to be easily converted to other languages. It is based on the syntax of PSeInt, a pseudo-code language for teaching programming.

About this repository

This repository contains the source code for the StepCode interpreter for NodeJS/Browser. It uses the ANTLR parser generator.

Installation

To install the StepCode interpreter, run the following command:

npm install stepcode

Usage

To use the StepCode interpreter, you must first import the interpreter

import { interpret, EventBus } from 'stepcode';

Create an event bus to receive events from the interpreter:

const eventBus = new EventBus();

eventBus.on('output-request', (message: string) => {
    console.log(message);
});

eventBus.on('input-request', (resolve: (s: string) => void) => {
  console.log(message);
});

Then, you can interpret a StepCode program by calling the interpret function:

const result = interpret({
    code: `Proceso HolaMundo
        Escribir "Hola mundo";
    FinProceso`,
});

The interpret function returns a promise that resolves to the result of the program.

0.12.0

5 months ago

0.11.2

5 months ago

0.11.3

5 months ago

0.11.4

5 months ago

0.11.1

5 months ago

0.11.0

5 months ago

0.10.0

6 months ago

0.9.2

6 months ago

0.9.1

6 months ago

0.9.0

6 months ago

0.8.4

6 months ago

0.8.3

6 months ago

0.8.2

6 months ago

0.8.1

6 months ago

0.8.0

6 months ago

0.7.3

6 months ago

0.7.2

6 months ago

0.7.1

6 months ago

0.7.0

6 months ago

0.6.2

6 months ago

0.6.1

6 months ago

0.6.0

6 months ago

0.5.3

6 months ago

0.5.2

6 months ago

0.5.1

6 months ago

0.5.0

6 months ago

0.4.2

6 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.3.0

6 months ago

0.2.2

6 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago