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.
16 lines
521 B
Racket
16 lines
521 B
Racket
#lang brag
|
|
|
|
chip-program : /"CHIP" chipname /"{" in-spec out-spec part-spec /"}"
|
|
@chipname : ID
|
|
in-spec : pin-spec
|
|
out-spec : pin-spec
|
|
@pin-spec : (/"IN" | /"OUT") pin [/"," pin]* /";"
|
|
/pin : ID [/"[" NUMBER /"]"]
|
|
@part-spec : /"PARTS:" part+
|
|
part : partname /"(" wire-assign [/"," wire-assign]* /")" /";"
|
|
@partname : ID
|
|
/wire-assign : pin-range /"=" pin-val
|
|
/pin-range : ID [/"[" bus-range /"]"]
|
|
@bus-range : number [/"." /"." number]
|
|
@pin-val : pin-range | BINARY-NUMBER | TRUE | FALSE
|
|
@number : BINARY-NUMBER | NUMBER |