GithubHelp home page GithubHelp logo

graken's Introduction

graken

A library and command line tool for flattening and validation of hierarchical and concurrent/parallel graphs (mainly .scxml state charts), written in crystal. This library takes advantage of the graph's ken (graphken - the guard dependencies of parallel states in .scxml) to identify feasible edges and necessary triggers to reach a target state.

Installation

Install crystal-lang

Fedora / Centos

sudo dnf -y install gcc gcc-c++ gmp-devel libbsd-devel \
  libedit-devel libevent-devel libxml2-devel libyaml-devel \
  llvm-devel llvm-static libstdc++-static make \
  openssl-devel pcre-devel redhat-rpm-config \
  fonts-cmu

sudo dnf install snapd
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install crystal --classic

Debian / Ubuntu

sudo apt install gcc pkg-config git tzdata \
  libpcre3-dev libevent-dev libyaml-dev \
  libgmp-dev libssl-dev libxml2-dev libz-dev \
  fonts-cmu

sudo apt install snapd
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install crystal --classic

Install as library

Add the dependency to your shard.yml:

dependencies:
  graken:
    github: ttrau/graken

Run shards install and add require "graken" to your project.

Install CLI

sudo make install

Usage

Usage CLI

graken < ./spec/simple.scxml                     ## pipe graph as .scxml file
graken -i ./spec/simple.scxml                    ## read graph from .scxml file
graken -s /tmp/graken.sock < ./spec/simple.scxml ## keep http service running with unix socket
graken -p 3000 < ./spec/simple.scxml             ## keep http service running behind port
graken -f < ./spec/simple.scxml                  ## flatten
graken -v < ./spec/simple.scxml                  ## flatten + validate
graken -h                                        ## show help

Development

Run

crystal src/cli.cr -v -o -a < spec/testmodel/simple.scxml
crystal src/cli.cr -v -o -a < spec/testmodel/cell.scxml

Test

crystal spec

Release

crystal build src/cli.cr --release

Contributors

graken's People

Contributors

ttrau avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.