Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 authored Nov 24, 2024
1 parent c259b22 commit 2e97616
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type R = Static.Parse<T, 'X Y Z W'> // type R = [['X', 'Y', 'Z']
## Overview
ParseBox is a parsing system designed to embed domain-specific languages (DSLs) within the TypeScript type system. It provides a set of type-level and runtime combinators that directly map to BNF notation, which can be used to parse content either at runtime or statically within the type system.
ParseBox is a parsing system designed to embed domain-specific languages (DSLs) within the TypeScript type system. It provides a set of type-level and runtime combinators that map to BNF notation. The combinators can be used to parse content either at runtime or at design time via TypeScript static inference.
ParseBox is written as a parsing infrastructure for the [TypeBox](https://github.com/sinclairzx81/typebox) and [LinqBox](https://github.com/sinclairzx81/linqbox) projects, enabling these libraries to support advanced runtime parsing for their respective domains.
Expand Down Expand Up @@ -84,7 +84,7 @@ License MIT
## Combinators
ParseBox provides a set of combinators that map to notation expressible in (E)BNF (Backus-Naur Form). These combinators are named Const, Tuple, Union, Array, and Optional, respectively, to describe the types produced by each combinator. These combinators serve as building blocks for constructing parsers.
ParseBox provides a minimal set of combinators that map to structures expressible in BNF (Backus-Naur Form). These combinators serve as building blocks for constructing parsers.
### Const
Expand Down Expand Up @@ -130,7 +130,7 @@ const T = Runtime.Tuple([ // const T = {
// }


const R = Runtime.Parse(P, 'X Y Z W') // const R = [['X', 'Y', 'Z'], ' W']
const R = Runtime.Parse(T, 'X Y Z W') // const R = [['X', 'Y', 'Z'], ' W']
```

### Union
Expand All @@ -155,11 +155,11 @@ const T = Runtime.Union([ // const T = {
// ]
// }

const R1 = Runtime.Parse(P, 'X E') // const R1 = ['X', ' E']
const R1 = Runtime.Parse(T, 'X E') // const R1 = ['X', ' E']

const R2 = Runtime.Parse(P, 'Y E') // const R2 = ['Y', ' E']
const R2 = Runtime.Parse(T, 'Y E') // const R2 = ['Y', ' E']

const R3 = Runtime.Parse(P, 'Z E') // const R3 = ['Z', ' E']
const R3 = Runtime.Parse(T, 'Z E') // const R3 = ['Z', ' E']
```

### Array
Expand Down

0 comments on commit 2e97616

Please sign in to comment.