# uffda

> Parser generator for domain specific languages

Latest version **0.1.1** (published 2020-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install uffda
pnpm add uffda
yarn add uffda
bun add uffda
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-11-30 |
| First published | 2020-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 318.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Justin Chase |
| Maintainers | justinmchase |
| Keywords | uffda, dsl, domain-specific-language, parser, patterns, pattern-matching, meta, meta-programming, ometa |

## Links

- npm: https://www.npmjs.com/package/uffda
- Repository: https://github.com/justinmchase/uffda
- Issues: https://github.com/justinmchase/uffda/issues
- npm.io page: https://npm.io/package/uffda

## Dependencies (6)

- [esm](https://npm.io/package/esm.md) ^3.2.25
- [debug](https://npm.io/package/debug.md) ^4.2.0
- [tsc-watch](https://npm.io/package/tsc-watch.md) ^4.2.9
- [tiny-tfidf](https://npm.io/package/tiny-tfidf.md) ^0.9.1
- [typescript](https://npm.io/package/typescript.md) ^3.9.7
- [even-more-min](https://npm.io/package/even-more-min.md) ^1.0.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2020-11-30

## README

# Uffda

_**NOTE**: work in progress!_

Uffda is a parser generator for domain specific languages.

It is different from many parser generators in that the syntax is expressive enough to support
parsing strings as well as objects, arrays or any other value type. The result of this capability
is that each step of the compiler can be expressed as dsl.

> OMeta’s key insight is the realization that all of the passes in a traditional compiler are essentially pattern matching operations
> 
> ~ Experimenting with Programming Languages, Alessandro Warth 2009

## How to use
```sh
npm i uffda
```

```ts
import { uffda } from "uffda"
import { Digit } from "uffda/parsers/tokenizer"

// This generates a parser which can be used as a 
export const calc = uffda`
  Add = x:Number '+' y:Number -> ${({ x, y }) => x + y}
  Number = i:${Digit} -> ${({ i }) => parseInt(i)}
  Main
    = Add
    | Number
`

// Parses a calculator dsl which procuces mathematical results
const { value } = calc`1+2`
assert(value === 3)

```

## Documentation

_This is a work in progress_

### Resources
This project is based on a previous project I made called Meta# which was a C# implementation of
the ideas written in the OMeta paper by [Alessandro Warth](http://www.tinlizzie.org/~awarth/).

* [Experimenting with Programming Languages](http://www.vpri.org/pdf/tr2008003_experimenting.pdf)
* [ohm-js](https://ohmlang.github.io/)
* [meta#](https://archive.codeplex.com/?p=metasharp)

---
_Source: https://npm.io/package/uffda · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
