2023-10-17 00:01:23 +00:00
|
|
|
{:.postcard-grammar.textsyntax}
|
2023-10-16 22:31:10 +00:00
|
|
|
| *Document* | := | *Value* **ws** |
|
2023-11-01 14:30:23 +00:00
|
|
|
| *Value* | := | **ws** (*Record* | *Collection* | *Embedded* | *Annotated* | *Atom*) |
|
2023-10-16 22:31:10 +00:00
|
|
|
| *Collection* | := | *Sequence* | *Dictionary* | *Set* |
|
|
|
|
|
2023-10-17 00:01:23 +00:00
|
|
|
{:.postcard-grammar.textsyntax}
|
2023-10-16 22:31:10 +00:00
|
|
|
| *Record* | := | `<`*Value*<sup>+</sup> **ws**`>` |
|
2023-11-01 13:13:36 +00:00
|
|
|
| *Sequence* | := | `[`(**commas** *Value*)<sup>⋆</sup> **commas**`]` |
|
|
|
|
| *Set* | := | `#{`(**commas** *Value*)<sup>⋆</sup> **commas**`}` |
|
|
|
|
| *Dictionary* | := | `{` (**commas** *Value* **ws**`:`*Value*)<sup>⋆</sup> **commas**`}` |
|
2023-11-01 14:30:23 +00:00
|
|
|
| **commas** | := | (**ws** `,`)<sup>⋆</sup> **ws** |
|
2023-10-16 22:31:10 +00:00
|
|
|
|
2023-10-17 00:01:23 +00:00
|
|
|
{:.postcard-grammar.textsyntax}
|
2024-02-05 21:38:49 +00:00
|
|
|
| *Embedded* | := | `#:`*Value* |
|
2023-11-01 14:30:23 +00:00
|
|
|
| *Annotated* | := | *Annotation* *Value* |
|
2024-03-07 13:14:24 +00:00
|
|
|
| *Annotation* | := | `@`*Value* |`#` ((**space** | **tab** | `!`) *linecomment*) (**cr** | **lf**) |
|
2023-11-01 14:30:23 +00:00
|
|
|
|
|
|
|
{:.postcard-grammar.textsyntax}
|
|
|
|
| *Atom* | := | *Boolean* | *ByteString* | *String* | *QuotedSymbol* | *Symbol* | *Number* |
|
2023-10-16 22:31:10 +00:00
|
|
|
| *Boolean* | := | `#t`|`#f` |
|
2023-10-17 00:24:14 +00:00
|
|
|
| *ByteString* | := | `#"`*binchar*<sup>⋆</sup> `"`|`#x"` (**ws** *hex* *hex*)<sup>⋆</sup> **ws**`"`|`#[` (**ws** *base64char*)<sup>⋆</sup> **ws**`]` |
|
2023-10-16 22:49:56 +00:00
|
|
|
| *String* | := | `"` (« any unicode scalar value except `\` or `"` » | *escaped* |`\"`)<sup>⋆</sup> `"` |
|
|
|
|
| *QuotedSymbol* | := | `|` (« any unicode scalar value except `\` or `|` » | *escaped* |`\|`)<sup>⋆</sup> `|` |
|
2023-10-16 22:31:10 +00:00
|
|
|
| *Symbol* | := | (`A`..`Z`|`a`..`z`|`0`..`9`| *sympunct* | *symuchar*)<sup>+</sup> |
|
2024-01-27 10:34:51 +00:00
|
|
|
| *Number* | := | *Double* | *SignedInteger* |
|
2023-10-16 22:31:10 +00:00
|
|
|
| *Double* | := | *flt* |`#xd"` (**ws** *hex* *hex*)<sup>8</sup> **ws**`"` |
|
|
|
|
| *SignedInteger* | := | *int* |
|
|
|
|
|
2023-10-17 00:01:23 +00:00
|
|
|
{:.postcard-grammar.textsyntax}
|
2023-10-16 22:49:56 +00:00
|
|
|
| *escaped* | := | `\\`|`\/`|`\b`|`\f`|`\n`|`\r`|`\t`|`\u`*hex* *hex* *hex* *hex* |
|
2023-10-17 00:18:52 +00:00
|
|
|
| *binescaped* | := | `\\`|`\/`|`\b`|`\f`|`\n`|`\r`|`\t`|`\x`*hex* *hex* |
|
2023-10-17 00:21:15 +00:00
|
|
|
| *binchar* | := | « any unicode scalar value ≥32 and ≤126, except `\` or `"` » | *binescaped* |`\"` |
|
2023-10-16 22:31:10 +00:00
|
|
|
| *base64char* | := | `A`..`Z`|`a`..`z`|`0`..`9`|`+`|`/`|`-`|`_`|`=` |
|
|
|
|
| *sympunct* | := | `~`|`!`|`$`|`%`|`^`|`&`|`*`|`?`|`_`|`=`|`+`|`-`|`/`|`.` |
|
2023-10-16 23:00:54 +00:00
|
|
|
| *symuchar* | := | « any scalar value ≥128 whose Unicode category is Lu, Ll, Lt, Lm, Lo, Mn, Mc, Me, Nd, Nl, No, Pc, Pd, Po, Sc, Sm, Sk, So, or Co » |
|
2023-10-16 22:31:10 +00:00
|
|
|
|
2023-10-17 00:01:23 +00:00
|
|
|
{:.postcard-grammar.textsyntax}
|
2023-10-16 22:31:10 +00:00
|
|
|
| *flt* | := | *int* ( *frac* *exp* | *frac* | *exp* ) |
|
|
|
|
| *int* | := | (`-`|`+`) (`0`..`9`)<sup>+</sup> |
|
|
|
|
| *frac* | := | `.` (`0`..`9`)<sup>+</sup> |
|
|
|
|
| *exp* | := | (`e`|`E`) (`-`|`+`) (`0`..`9`)<sup>+</sup> |
|
|
|
|
| *hex* | := | `A`..`F`|`a`..`f`|`0`..`9` |
|
2023-11-01 14:30:23 +00:00
|
|
|
|
|
|
|
{:.postcard-grammar.textsyntax}
|
|
|
|
| **ws** | := | (**space** | **tab** | **cr** | **lf**)<sup>⋆</sup> |
|
|
|
|
| **delimiter** | := | **ws** | `<` | `>` | `[` | `]` | `{` | `}` | `#` | `:` | `"` | `|` | `@` | `;` | `,` |
|
|
|
|
| *linecomment* | := | « any unicode scalar value except **cr** or **lf** »<sup>⋆</sup> |
|