Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions bnf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ print(ds_output)
# c

# Unparse: Convert from DS format to readable Dsp
ds_input = "a\nb\n----\nc"
ds_input = "a\nb\n----\nc\n"
dsp_output = unparse(ds_input)
print(dsp_output)
# Output: a, b -> c
Expand All @@ -72,7 +72,7 @@ console.log(ds_output);
// c

// Unparse: Convert from DS format to readable Dsp
const ds_input = "a\nb\n----\nc";
const ds_input = "a\nb\n----\nc\n";
const dsp_output = unparse(ds_input);
console.log(dsp_output);
// Output: a, b -> c
Expand Down Expand Up @@ -115,13 +115,13 @@ For structured terms:

| Description | Dsp Format (parse input / unparse output) | Ds Format |
|-------------|-------------------|-------------------|
| Simple rule | `a, b -> c` | `a\nb\n----\nc` |
| Axiom | `a` | `----\na` |
| Function call | `f(a, b) -> c` | `(function f a b)\n----------------\nc` |
| Subscript | `a[i, j] -> b` | `(subscript a i j)\n-----------------\nb` |
| Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc` |
| Unary operator | `~ a -> b` | `(unary ~ a)\n-----------\nb` |
| Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)` |
| Simple rule | `a, b -> c` | `a\nb\n----\nc\n` |
| Axiom | `a` | `----\na\n` |
| Function call | `f(a, b) -> c` | `(function f a b)\n----------------\nc\n` |
| Subscript | `a[i, j] -> b` | `(subscript a i j)\n-----------------\nb\n` |
| Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc\n` |
| Unary operator | `~ a -> b` | `(unary ~ a)\n-----------\nb\n` |
| Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)\n` |

## Building from Source

Expand Down
16 changes: 8 additions & 8 deletions docs/support-packages/bnf.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ print(ds_output)
# c

# Unparse: Convert from DS format to readable Dsp
ds_input = "a\nb\n----\nc"
ds_input = "a\nb\n----\nc\n"
dsp_output = unparse(ds_input)
print(dsp_output)
# Output: a, b -> c
Expand All @@ -63,7 +63,7 @@ console.log(ds_output);
// c

// Unparse: Convert from DS format to readable Dsp
const ds_input = "a\nb\n----\nc";
const ds_input = "a\nb\n----\nc\n";
const dsp_output = unparse(ds_input);
console.log(dsp_output);
// Output: a, b -> c
Expand Down Expand Up @@ -108,13 +108,13 @@ For structured terms:

| Description | Dsp Format | Ds Format |
|-------------|------------|-----------|
| Simple rule | `a, b -> c` | `a\nb\n----\nc` |
| Simple rule | `a, b -> c` | `a\nb\n----\nc\n` |
| Axiom | `a` | `----\na\n` |
| Function call | `f(a, b) -> c` | `(function f a b)\n----------------\nc` |
| Subscript | `a[i, j] -> b` | `(subscript a i j)\n-----------------\nb` |
| Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc` |
| Unary operator | `~ a -> b` | `(unary ~ a)\n-----------\nb` |
| Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)` |
| Function call | `f(a, b) -> c` | `(function f a b)\n----------------\nc\n` |
| Subscript | `a[i, j] -> b` | `(subscript a i j)\n-----------------\nb\n` |
| Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc\n` |
| Unary operator | `~ a -> b` | `(unary ~ a)\n-----------\nb\n` |
| Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)\n` |

## Package Information

Expand Down