Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tom-sherman/coffeebird
A DSL that compiles to RBLang.
https://github.com/tom-sherman/coffeebird
automation decision-making dsl inference
Last synced: 14 days ago
JSON representation
A DSL that compiles to RBLang.
- Host: GitHub
- URL: https://github.com/tom-sherman/coffeebird
- Owner: tom-sherman
- Created: 2019-01-13T22:53:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-30T09:10:30.000Z (almost 5 years ago)
- Last Synced: 2024-11-28T14:20:14.361Z (26 days ago)
- Topics: automation, decision-making, dsl, inference
- Language: JavaScript
- Homepage:
- Size: 443 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Coffeebird
[![Build Status](https://travis-ci.org/tom-sherman/coffeebird.svg?branch=master)](https://travis-ci.org/tom-sherman/coffeebird)
A DSL that compiles to RBLang.
RBLang is Rainbird's XML based language which is used to define concepts, relationships, and rules to solve complex decision making problems. Coffeebird replicates all of the features of RBLang without the visual noise of XML.
## Syntax
Full syntax documentation can be found [here](syntax.md).
```
concept Person (type: string)
concept Country (type: string)
concept Language (type: string)rel Person - speaks - Language
rel Person - lives in - Country
rel Country - national language - LanguageLanguage("English")
Language("French")
Language("German")
Country("England")
Country("France")"England" - national language - "English" (cf: 100)
"France" - national language - "French"// This is a comment
speaks (cf: 75, minimumRuleCertainty: 60) {
%S - lives in - %COUNTRY;
%COUNTRY - national language - %O;
}
```## CLI
You can install `coffeebird` globally to invoke the transpiler from the command line.
### Install it globally from NPM
```
npm i coffeebird -g
```### Usage
```
coffeebird [input]transpile a file to RBLang
Commands:
coffeebird transpile [input] transpile a file to RBLang [default]Positionals:
input The file to transpile.Options:
--help Show help [boolean]
--version Show version number [boolean]
--output, -o
```## API
You can use Coffeebird programmatically by installing it via NPM and requiring it.
```
npm i coffeebird
```The Coffeebird module exports two functions `parse`, and `transpile`.
```javascript
const { parse, transpile } = require('coffeebird')
```### `transpile(input)`
Take an `input` string and output the transpiled RBLang.
### `parse(input)`
Take an `input` Coffeebird string and outputs an AST.
## Development
Ensure you have Node and `npm` installed.
```
# Clone the repository
git clone https://github.com/tom-sherman/coffeebird# Move into the cloned directory
cd coffeebird# Install dependencies
npm i# Run tests
npm t
```