From b737130c059e8e5566caa7aa3144f910d43999ae Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Sat, 10 Jan 2026 17:33:14 +0100 Subject: More grammar shite. --- docs/c1/1-parse.md | 13 ++---- docs/c1/2-decode.md | 2 +- docs/c1/grammar.abnf.txt | 109 +++++++++++++++++++++++++++++++++++++++++++ docs/c1/grammar.md | 101 ++++++++++++++++++++++++++++++++++++++++ docs/c1/grammar.peg.txt | 75 ++++++++++++++++++++++++++++++ docs/c1/grammar.zbnf.txt | 63 +++++++++++++++++++++++++ spec/syntax.abnf | 96 -------------------------------------- spec/syntax.md | 117 ----------------------------------------------- spec/syntax.peg | 63 ------------------------- spec/syntax.zbnf | 59 ------------------------ 10 files changed, 354 insertions(+), 344 deletions(-) create mode 100644 docs/c1/grammar.abnf.txt create mode 100644 docs/c1/grammar.md create mode 100644 docs/c1/grammar.peg.txt create mode 100644 docs/c1/grammar.zbnf.txt delete mode 100644 spec/syntax.abnf delete mode 100644 spec/syntax.md delete mode 100644 spec/syntax.peg delete mode 100644 spec/syntax.zbnf diff --git a/docs/c1/1-parse.md b/docs/c1/1-parse.md index a23ebbc..e04240b 100644 --- a/docs/c1/1-parse.md +++ b/docs/c1/1-parse.md @@ -1,8 +1,7 @@ # Parser for Code & Data -Zisp s-expressions are defined in terms of an extremely minimal set of data -types; only that which is necessary to build representations of more complex -expressions and data types: +Zisp S-Expressions represent an extremely minimal set of data types; only that +which is necessary to strategically construct more complex code and data: +--------+-----------------+--------+----------+------+ | TYPE | String | Rune | Pair | Nil | @@ -10,12 +9,8 @@ expressions and data types: | E.G. | foo, |foo bar| | #name | (X & Y) | () | +--------+-----------------+--------+----------+------+ -Note that the ampersand replaces the period in pair notation. This simplifies -the grammar: periods are a regular constituent of strings, while the ampersand -cannot appear in unquoted strings. - The parser can also output non-negative integers, but this is only used for -datum labels; number literals are handled by the *decoder*. +datum labels; number literals are handled by the *decoder* (see next). The parser recognizes various "syntax sugar" and transforms it into uses of the above data types. The most ubiquitous example is of course the list: @@ -110,6 +105,8 @@ Further notes about the syntax sugar table and examples above: Zisp's internal use and standard library; users can use lowercase runes with custom meaning without worrying about clashes. +For an exact specification of the grammar, see [grammar](grammar.html). +