An open API service indexing awesome lists of open source software.

https://github.com/pavanpodila/clause-builder

A clause parser
https://github.com/pavanpodila/clause-builder

mobx pegjs react typescript

Last synced: about 2 months ago
JSON representation

A clause parser

Awesome Lists containing this project

README

        

## Clause Parser

A clause is some text interspersed with `placeholders`. \__placeholders_, which will get
their values when the clause is created.

Tags are specified with the following syntax:

```text
[: { }]
```

The complete grammar can be found in [grammar.pegjs](src/clause/parser/grammar.pegjs)

## Quick Sample

Here's a sample clause with placeholders:

```text
The weather at
[city: city{name = "Bengaluru", country.name = "India"}] is
[temp: city{temperature > 0}]°[unit: temperatureUnit{unit != ""}]
```

## How's it built?

- [x] [PegJS](https://pegjs.org) for parsing
- [x] MobX, React and Styled-Components for the demo

## Demo

View the [demo](https://clauser.netlify.com/)