1.2.3 • Published 2 years ago

zatlin v1.2.3

Weekly downloads
5
License
MIT
Repository
-
Last release
2 years ago

npm.io npm.io npm.io npm.io

Overview

Zatlin is a domain-specific language to generate words of a constructed langauge. This package serves a TypeScript implementation of Zatlin.

Installation

Install via npm.

npm i zatlin

Usage

Call Zatlin.load with a source string to create a Zatlin object, and then call generate to generate a string.

const {Zatlin} = require("zatlin");

let zatlin = Zatlin.load(`% "a" | "b" | "c";`);
let output = zatlin.generate();
console.log(output);

If an identifier name is passed to generate method, the processor generates a string from the specified identifier.

const {Zatlin} = require("zatlin");

let zatlin = Zatlin.load(`
  foo = "a" | "b" ; bar = "x" | "y";
  % "p" | "q" ;
`);
let output = zatlin.generate("bar");
console.log(output);  // outputs “x” or “y”

Documentations

Syntax

Error messages

Note on versioning

First note that the version of this package and that of Zatlin implemented in it are different.

Zatlin 1.0 is the first version of Zatlin, and implemented in the desktop version of ZpDIC. There is also a self-contained Java implementation here.

Zatlin 1.1 and 1.2 are enhanced versions whose syntax is more powerful, and implemented in this package.

1.2.3

2 years ago

1.2.2

3 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago