diff options
Diffstat (limited to 'doc/0/grammar/zbnf.txt')
| -rw-r--r-- | doc/0/grammar/zbnf.txt | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/doc/0/grammar/zbnf.txt b/doc/0/grammar/zbnf.txt new file mode 100644 index 0000000..c04b813 --- /dev/null +++ b/doc/0/grammar/zbnf.txt @@ -0,0 +1,75 @@ +; Custom notation with PEG semantics + +Stream : Unit ( Blank Unit )* + + +Unit : Blank* [Datum] + +Blank : '\t'...'\r' | SP | Comment + + +Datum : OneDatum ( [JoinChar] OneDatum )* + +JoinChar : '.' | ':' + + +Comment : ';' ( SkipUnit | SkipLine ) + +SkipUnit : '~' Unit + +SkipLine : ( ~LF )* [LF] + + +OneDatum : BareString | CladDatum + + +BareString : SpecBareChar ( BareChar | JoinChar )* + | BareChar+ + +SpecBareChar : '+' | '-' | JoinChar | DIGIT + +BareChar : ALPHA | DIGIT + | '!' | '$' | '%' | '&' | '*' | '+' | '-' | '/' + | '<' | '=' | '>' | '?' | '^' | '_' | '~' + + +CladDatum : PipeStr | QuoteStr | HashExpr | QuoteExpr | List + +PipeStr : '|' ( PipeStrChar | '\' StringEsc )* '|' +QuoteStr : '"' ( QuotStrChar | '\' StringEsc )* '"' +HashExpr : '#' HashExprs +QuoteExpr : "'" Datum | '`' Datum | ',' Datum +List : ParenList | SquareList | BraceList + + +PipeStrChar : ~( '|' | '\' ) +QuotStrChar : ~( '"' | '\' ) + +StringEsc : '\' | '|' | '"' | ( HTAB | SP )* LF ( HTAB | SP )* + | '0' | 'a' | 'b' | 't' | 'n' | 'v' | 'f' | 'r' | 'e' + | 'x' HexByte* ';' + | 'u' UnicodeSV ';' + +HexByte : HEXDIG HEXDIG +UnicodeSV : HEXDIG+ + + +HashExprs : '!' ( SP | HTAB )* HBangLine [ LF ] + | '%' Label ( '%' | '=' Datum ) + | '\' BareString | CladDatum + | Rune [ '\' BareString | CladDatum ] + +HBangLine : HBChars+ ( SP | HTAB )* [ HBChars+ ] +HBChars : ~( SP | HTAB | LF ) +Label : HEXDIG+ +Rune : ALPHA ( ALPHA | DIGIT )* + + +ParenList : '(' Unit* ')' +SquareList : '[' Unit* ']' +BraceList : '{' Unit* '}' + + +;; Local Variables: +;; eval: (flyspell-mode -1) +;; End: |
