#+TITLE: Identifier Stream Grammar
#+AUTHOR: Tom Gillespie

* Grammar
#+begin_src racket
#lang brag  ; this is actually racket but whatever
; TODO stream stream stream stream ... can go on forever ...
stream-free : conventions-free
            | identifier-free
            | metadata-free
            | data-free
            | other-free
identifier-free : identifier  ; dereference this to get a any number of streams
identifier : checksum-stream  ; hard to resolve
           | identifier-global
           | identifier-local  ; plus expansion rule
           | bytes  ; modulo encoding, but a string none the less
checksum-stream : bytes
metadata-free : stream-bound  ; secondary referents
data-free : stream-bound  ; primary referents
stream-bound : conventions-bound  ; aka local conventions
             | identifier-bound [checksum-next-bound]
             | identifier-bound metadata-bound [checksum-next-bound]
             | identifier-bound metadata-bound data-bound [checksum-next-bound]
             | [identifier-bound] [metadata-bound] [data-bound] [checksum-next-bound]
checksum-next-bound : checksum-stream  ; can be more pricise than next ...
identifier-bound : identifier
metadata-bound : stream-next
data-bound : stream-next
stream-next : stream-bound
            | done

other-free : prov-free
           | likes-at-pidapalooza-free
           | random-bits-in-my-database-free
prov-free : stream-bound  ; etc
#+end_src
