You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beautiful-racket/beautiful-racket-demo/hdl-demo/grammar.rkt

16 lines
521 B
Racket

#lang brag
9 years ago
chip-program : /"CHIP" chipname /"{" in-spec out-spec part-spec /"}"
9 years ago
@chipname : ID
in-spec : pin-spec
out-spec : pin-spec
@pin-spec : (/"IN" | /"OUT") pin [/"," pin]* /";"
/pin : ID [/"[" NUMBER /"]"]
9 years ago
@part-spec : /"PARTS:" part+
9 years ago
part : partname /"(" wire-assign [/"," wire-assign]* /")" /";"
9 years ago
@partname : ID
9 years ago
/wire-assign : pin-range /"=" pin-val
/pin-range : ID [/"[" bus-range /"]"]
@bus-range : number [/"." /"." number]
7 years ago
@pin-val : pin-range | BINARY-NUMBER | TRUE | FALSE
@number : BINARY-NUMBER | NUMBER