All Projects → nodejs → Llparse

nodejs / Llparse

Licence: other
Generating parsers in LLVM IR

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Llparse

xstate
State machines and statecharts for the modern web.
Stars: ✭ 21,286 (+4770.94%)
Mutual labels:  finite-state-machine
simple-state-machine
A simple Java state machine for Spring Boot projects
Stars: ✭ 25 (-94.28%)
Mutual labels:  finite-state-machine
actus
A monorepo for a self learning command palette driven by a final state machine implemented in XState.
Stars: ✭ 43 (-90.16%)
Mutual labels:  finite-state-machine
use-state-machine
Use Finite State Machines with React Hooks
Stars: ✭ 28 (-93.59%)
Mutual labels:  finite-state-machine
kaliningraph
🕸️ Graphs, finite fields and discrete dynamical systems in Kotlin
Stars: ✭ 62 (-85.81%)
Mutual labels:  finite-state-machine
statemachine-go
🚦 Declarative Finite-State Machines in Go
Stars: ✭ 47 (-89.24%)
Mutual labels:  finite-state-machine
smacha
SMACHA is a meta-scripting, templating, and code generation engine for rapid prototyping of ROS SMACH state machines.
Stars: ✭ 15 (-96.57%)
Mutual labels:  finite-state-machine
Statecharts.github.io
There is no state but what we make. Feel free to pitch in.
Stars: ✭ 265 (-39.36%)
Mutual labels:  finite-state-machine
AALpy
An Active Automata Learning Library Written in Python
Stars: ✭ 60 (-86.27%)
Mutual labels:  finite-state-machine
trembita
Model complex data transformation pipelines easily
Stars: ✭ 44 (-89.93%)
Mutual labels:  finite-state-machine
godpaper
🐵 An AI chess-board-game framework(by many programming languages) implementations.
Stars: ✭ 40 (-90.85%)
Mutual labels:  finite-state-machine
fsm
Finite State Machine for Go inspired by Akka FSM
Stars: ✭ 59 (-86.5%)
Mutual labels:  finite-state-machine
udar
UDAR Does Accented Russian: A finite-state morphological analyzer of Russian that handles stressed wordforms.
Stars: ✭ 15 (-96.57%)
Mutual labels:  finite-state-machine
as fsm
A finite state machine implementation for elixir
Stars: ✭ 14 (-96.8%)
Mutual labels:  finite-state-machine
daachorse
🐎 A fast implementation of the Aho-Corasick algorithm using the compact double-array data structure.
Stars: ✭ 75 (-82.84%)
Mutual labels:  finite-state-machine
finite-state-machine
Lightweight, decorator-based Python implementation of a Finite State Machine
Stars: ✭ 93 (-78.72%)
Mutual labels:  finite-state-machine
UnityHFSM
A simple yet powerful class based hierarchical finite state machine for Unity3D
Stars: ✭ 243 (-44.39%)
Mutual labels:  finite-state-machine
Aho Corasick
A fast implementation of Aho-Corasick in Rust.
Stars: ✭ 424 (-2.97%)
Mutual labels:  finite-state-machine
use-tiny-state-machine
A tiny (~700 bytes) react hook to help you write finite state machines
Stars: ✭ 37 (-91.53%)
Mutual labels:  finite-state-machine
SimpleStateMachineLibrary
📚 A simple library for realization state machines in C# code
Stars: ✭ 30 (-93.14%)
Mutual labels:  finite-state-machine

llparse

Build Status NPM version

An API for compiling an incremental parser into a C output.

Usage

import { LLParse } from 'llparse';

const p = new LLParse('http_parser');

const method = p.node('method');
const beforeUrl = p.node('before_url');
const urlSpan = p.span(p.code.span('on_url'));
const url = p.node('url');
const http = p.node('http');

// Add custom uint8_t property to the state
p.property('i8', 'method');

// Store method inside a custom property
const onMethod = p.invoke(p.code.store('method'), beforeUrl);

// Invoke custom C function
const complete = p.invoke(p.code.match('on_complete'), {
  // Restart
  0: method
}, p.error(4, '`on_complete` error'));

method
  .select({
    'HEAD': 0, 'GET': 1, 'POST': 2, 'PUT': 3,
    'DELETE': 4, 'OPTIONS': 5, 'CONNECT': 6,
    'TRACE': 7, 'PATCH': 8
  }, onMethod)
  .otherwise(p.error(5, 'Expected method'));

beforeUrl
  .match(' ', beforeUrl)
  .otherwise(urlSpan.start(url));

url
  .peek(' ', urlSpan.end(http))
  .skipTo(url);

http
  .match(' HTTP/1.1\r\n\r\n', complete)
  .otherwise(p.error(6, 'Expected HTTP/1.1 and two newlines'));

const artifacts = p.build(method);
console.log('----- C -----');
console.log(artifacts.c);  // string
console.log('----- C END -----');
console.log('----- HEADER -----');
console.log(artifacts.header);
console.log('----- HEADER END -----');

LICENSE

This software is licensed under the MIT License.

Copyright Fedor Indutny, 2020.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].