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/xmlish-demo/grammar.rkt

20 lines
452 B
Racket

#lang brag
top : @content
content : (tagged-element | /comment | string | sp)*
tagged-element : /"<" /sp? identifier attrs /sp? (short | full)
@short : /"/>"
@full : /">" content /"</" /sp? identifier /sp? /">"
attrs : [attr] (/sp attr)*
attr : identifier /sp? /"=" /sp? /"\"" string /"\""
comment : "<!--" (string | sp)* "-->"
string : char+
identifier : ALPHANUMERIC [@string]
@sp : SP
@char : ALPHANUMERIC | OTHER | AMP | LT | GT | "=" | "\""