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
- Host: GitHub
- URL: https://github.com/pavanpodila/clause-builder
- Owner: pavanpodila
- Created: 2018-10-13T12:34:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-19T15:19:43.000Z (over 6 years ago)
- Last Synced: 2025-01-31T15:49:53.985Z (4 months ago)
- Topics: mobx, pegjs, react, typescript
- Language: TypeScript
- Homepage: https://clauser.netlify.com/
- Size: 264 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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/)